Overhaul to the user-defined parameters done: All logical switches, parameters and vertex buffer handles are now defined in a single header file (the default location is acc/mhd_solver/stencil_defines.h). This header is used when preprocessing the DSL sources and is linked to the include/ directory when calling scripts/compile_acc.sh. astaroth.h is now used for configuring internal stuff only and should not be modified by users
This commit is contained in:
@@ -69,21 +69,17 @@ extern "C" {
|
||||
|
||||
// clang-format off
|
||||
#ifndef USER_PROVIDED_DEFINES
|
||||
#include "acc/mhd_solver/stencil_defines.h" // TODO: this should be in a standard location
|
||||
#include "stencil_defines.h"
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
#define AC_THERMAL_CONDUCTIVITY (AcReal(0.001)) // TODO: make an actual config parameter
|
||||
|
||||
/*
|
||||
* =============================================================================
|
||||
* Identifiers used to construct the parameter lists for AcMeshInfo
|
||||
* (IntParamType and RealParamType)
|
||||
* (user definable)
|
||||
* Built-in parameters
|
||||
* =============================================================================
|
||||
*/
|
||||
// clang-format off
|
||||
#define AC_FOR_INT_PARAM_TYPES(FUNC)\
|
||||
#define AC_FOR_BUILTIN_INT_PARAM_TYPES(FUNC)\
|
||||
/* cparams */\
|
||||
FUNC(AC_nx), \
|
||||
FUNC(AC_ny), \
|
||||
@@ -97,141 +93,10 @@ extern "C" {
|
||||
FUNC(AC_nx_max), \
|
||||
FUNC(AC_ny_max), \
|
||||
FUNC(AC_nz_max), \
|
||||
/* Other */\
|
||||
FUNC(AC_max_steps), \
|
||||
FUNC(AC_save_steps), \
|
||||
FUNC(AC_bin_steps), \
|
||||
FUNC(AC_bc_type), \
|
||||
/* Additional */\
|
||||
FUNC(AC_mxy),\
|
||||
FUNC(AC_nxy),\
|
||||
FUNC(AC_nxyz)
|
||||
#define AC_FOR_REAL_PARAM_TYPES(FUNC)\
|
||||
/* cparams */\
|
||||
FUNC(AC_dsx), \
|
||||
FUNC(AC_dsy), \
|
||||
FUNC(AC_dsz), \
|
||||
FUNC(AC_dsmin), \
|
||||
/* physical grid*/\
|
||||
FUNC(AC_xlen), \
|
||||
FUNC(AC_ylen), \
|
||||
FUNC(AC_zlen), \
|
||||
FUNC(AC_xorig), \
|
||||
FUNC(AC_yorig), \
|
||||
FUNC(AC_zorig), \
|
||||
/*Physical units*/\
|
||||
FUNC(AC_unit_density),\
|
||||
FUNC(AC_unit_velocity),\
|
||||
FUNC(AC_unit_length),\
|
||||
/* properties of gravitating star*/\
|
||||
FUNC(AC_star_pos_x),\
|
||||
FUNC(AC_star_pos_y),\
|
||||
FUNC(AC_star_pos_z),\
|
||||
FUNC(AC_M_star),\
|
||||
/* Run params */\
|
||||
FUNC(AC_cdt), \
|
||||
FUNC(AC_cdtv), \
|
||||
FUNC(AC_cdts), \
|
||||
FUNC(AC_nu_visc), \
|
||||
FUNC(AC_cs_sound), \
|
||||
FUNC(AC_eta), \
|
||||
FUNC(AC_mu0), \
|
||||
FUNC(AC_cp_sound), \
|
||||
FUNC(AC_gamma), \
|
||||
FUNC(AC_cv_sound), \
|
||||
FUNC(AC_lnT0), \
|
||||
FUNC(AC_lnrho0), \
|
||||
FUNC(AC_zeta), \
|
||||
FUNC(AC_trans),\
|
||||
/* Other */\
|
||||
FUNC(AC_bin_save_t), \
|
||||
/* Initial condition params */\
|
||||
FUNC(AC_ampl_lnrho), \
|
||||
FUNC(AC_ampl_uu), \
|
||||
FUNC(AC_angl_uu), \
|
||||
FUNC(AC_lnrho_edge),\
|
||||
FUNC(AC_lnrho_out),\
|
||||
/* Forcing parameters. User configured. */\
|
||||
FUNC(AC_forcing_magnitude),\
|
||||
FUNC(AC_relhel), \
|
||||
FUNC(AC_kmin), \
|
||||
FUNC(AC_kmax), \
|
||||
/* Forcing parameters. Set by the generator. */\
|
||||
FUNC(AC_forcing_phase),\
|
||||
FUNC(AC_k_forcex),\
|
||||
FUNC(AC_k_forcey),\
|
||||
FUNC(AC_k_forcez),\
|
||||
FUNC(AC_kaver),\
|
||||
FUNC(AC_ff_hel_rex),\
|
||||
FUNC(AC_ff_hel_rey),\
|
||||
FUNC(AC_ff_hel_rez),\
|
||||
FUNC(AC_ff_hel_imx),\
|
||||
FUNC(AC_ff_hel_imy),\
|
||||
FUNC(AC_ff_hel_imz),\
|
||||
/* Additional helper params */\
|
||||
/* (deduced from other params do not set these directly!) */\
|
||||
FUNC(AC_G_CONST),\
|
||||
FUNC(AC_GM_star),\
|
||||
FUNC(AC_sq2GM_star),\
|
||||
FUNC(AC_cs2_sound), \
|
||||
FUNC(AC_inv_dsx), \
|
||||
FUNC(AC_inv_dsy), \
|
||||
FUNC(AC_inv_dsz)
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
* =============================================================================
|
||||
* Identifiers for VertexBufferHandle
|
||||
* (i.e. the arrays used to construct AcMesh)
|
||||
* (user definable)
|
||||
* =============================================================================
|
||||
*/
|
||||
// clang-format off
|
||||
#if LDENSITY
|
||||
#define AC_FOR_DENSITY_VTXBUF_HANDLES(FUNC) \
|
||||
FUNC(VTXBUF_LNRHO),
|
||||
#else
|
||||
#define AC_FOR_DENSITY_VTXBUF_HANDLES(FUNC)
|
||||
#endif
|
||||
|
||||
#if LHYDRO
|
||||
#define AC_FOR_HYDRO_VTXBUF_HANDLES(FUNC) \
|
||||
FUNC(VTXBUF_UUX), \
|
||||
FUNC(VTXBUF_UUY), \
|
||||
FUNC(VTXBUF_UUZ),
|
||||
#else
|
||||
#define AC_FOR_HYDRO_VTXBUF_HANDLES(FUNC)
|
||||
#endif
|
||||
|
||||
#if LMAGNETIC
|
||||
#define AC_FOR_MAGNETIC_VTXBUF_HANDLES(FUNC) \
|
||||
FUNC(VTXBUF_AX), \
|
||||
FUNC(VTXBUF_AY), \
|
||||
FUNC(VTXBUF_AZ),
|
||||
#else
|
||||
#define AC_FOR_MAGNETIC_VTXBUF_HANDLES(FUNC)
|
||||
#endif
|
||||
|
||||
#if LENTROPY
|
||||
#define AC_FOR_ENTROPY_VTXBUF_HANDLES(FUNC) \
|
||||
FUNC(VTXBUF_ENTROPY),
|
||||
#else
|
||||
#define AC_FOR_ENTROPY_VTXBUF_HANDLES(FUNC)
|
||||
#endif
|
||||
|
||||
//MR: Temperature must not have an additional variable slot, but should sit on the
|
||||
// same as entropy.
|
||||
#if LTEMPERATURE
|
||||
#define AC_FOR_TEMPERATURE_VTXBUF_HANDLES(FUNC)\
|
||||
FUNC(VTXBUF_TEMPERATURE),
|
||||
#else
|
||||
#define AC_FOR_TEMPERATURE_VTXBUF_HANDLES(FUNC)
|
||||
#endif
|
||||
|
||||
#define AC_FOR_VTXBUF_HANDLES(FUNC) AC_FOR_HYDRO_VTXBUF_HANDLES(FUNC) \
|
||||
AC_FOR_DENSITY_VTXBUF_HANDLES(FUNC) \
|
||||
AC_FOR_ENTROPY_VTXBUF_HANDLES(FUNC) \
|
||||
AC_FOR_MAGNETIC_VTXBUF_HANDLES(FUNC) \
|
||||
FUNC(AC_nxyz),
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
@@ -286,7 +151,12 @@ typedef enum { RTYPE_MAX, RTYPE_MIN, RTYPE_RMS, RTYPE_RMS_EXP, NUM_REDUCTION_TYP
|
||||
* Definitions for the enums and structs for AcMeshInfo (DO NOT TOUCH)
|
||||
* =============================================================================
|
||||
*/
|
||||
typedef enum { AC_FOR_INT_PARAM_TYPES(AC_GEN_ID), NUM_INT_PARAM_TYPES } AcIntParam;
|
||||
|
||||
typedef enum {
|
||||
AC_FOR_BUILTIN_INT_PARAM_TYPES(AC_GEN_ID) //
|
||||
AC_FOR_USER_INT_PARAM_TYPES(AC_GEN_ID), //
|
||||
NUM_INT_PARAM_TYPES
|
||||
} AcIntParam;
|
||||
|
||||
typedef enum { AC_FOR_REAL_PARAM_TYPES(AC_GEN_ID), NUM_REAL_PARAM_TYPES } AcRealParam;
|
||||
// typedef enum { AC_FOR_VEC_PARAM_TYPES(AC_GEN_ID), NUM_VEC_PARAM_TYPES } AcVecParam;
|
||||
|
Reference in New Issue
Block a user