diff --git a/include/astaroth_defines.h b/include/astaroth_defines.h index 96ab3fd..58525ba 100644 --- a/include/astaroth_defines.h +++ b/include/astaroth_defines.h @@ -217,6 +217,9 @@ acVertexBufferIdx(const int i, const int j, const int k, const AcMeshInfo info) k * info.int_params[AC_mx] * info.int_params[AC_my]; } +/** Prints all parameters inside AcMeshInfo */ +void acPrintMeshInfo(const AcMeshInfo config); + /* static inline int acGetParam(const AcMeshInfo info, const AcIntParam param) diff --git a/src/core/astaroth.cu b/src/core/astaroth.cu index ea4ecaa..11956f7 100644 --- a/src/core/astaroth.cu +++ b/src/core/astaroth.cu @@ -36,6 +36,21 @@ const char* vtxbuf_names[] = {AC_FOR_VTXBUF_HANDLES(AC_GEN_STR)}; static const int num_nodes = 1; static Node nodes[num_nodes]; +void +acPrintMeshInfo(const AcMeshInfo config) +{ + for (int i = 0; i < NUM_INT_PARAMS; ++i) + printf("[%s]: %d\n", intparam_names[i], config.int_params[i]); + for (int i = 0; i < NUM_INT3_PARAMS; ++i) + printf("[%s]: (%d, %d, %d)\n", int3param_names[i], config.int3_params[i].x, + config.int3_params[i].y, config.int3_params[i].z); + for (int i = 0; i < NUM_REAL_PARAMS; ++i) + printf("[%s]: %g\n", realparam_names[i], double(config.real_params[i])); + for (int i = 0; i < NUM_REAL3_PARAMS; ++i) + printf("[%s]: (%g, %g, %g)\n", real3param_names[i], double(config.real3_params[i].x), + double(config.real3_params[i].y), double(config.real3_params[i].z)); +} + AcResult acInit(const AcMeshInfo mesh_info) { diff --git a/src/standalone/config_loader.cc b/src/standalone/config_loader.cc index eeb223e..36fb83a 100644 --- a/src/standalone/config_loader.cc +++ b/src/standalone/config_loader.cc @@ -34,15 +34,6 @@ #include "src/core/errchk.h" #include "src/core/math_utils.h" -static inline void -print(const AcMeshInfo& config) -{ - for (int i = 0; i < NUM_INT_PARAMS; ++i) - printf("[%s]: %d\n", intparam_names[i], config.int_params[i]); - for (int i = 0; i < NUM_REAL_PARAMS; ++i) - printf("[%s]: %g\n", realparam_names[i], double(config.real_params[i])); -} - /** \brief Find the index of the keyword in names \return Index in range 0...n if the keyword is in names. -1 if the keyword was @@ -155,7 +146,7 @@ update_config(AcMeshInfo* config) #if VERBOSE_PRINTING // Defined in astaroth.h printf("###############################################################\n"); printf("Config dimensions recalculated:\n"); - print(*config); + acPrintMeshInfo(*config); printf("###############################################################\n"); #endif }