38 #include "build_info.h" 42 #include "openCARP_p.h" 43 #include "openCARP_d.h" 46 #include "IGBheader.h" 56 #define DATAOUT_NONE 0 57 #define DATAOUT_SURF 1 61 namespace user_globals {
65 extern std::map<mesh_t, sf_mesh>
mesh_reg;
69 extern std::map<physic_t, Basic_physic*>
physics_reg;
133 #define SOLV_METH(A,B) (B & A##_FLAG) 134 #define MONODOMAIN_FLAG 1 135 #define ITERATE_FLAG 2 136 #define CN_PARAB_FLAG 4 137 #define PURKINJE_FLAG 8 138 #define O2dT_PARAB_FLAG 16 139 #define PSEUDO_BIDM_FLAG 32 144 #define PSEUDO_BIDM 2 148 #define RECOVER_PHIE 1 149 #define OPTICAL_MAP 2 150 #define ACTIVATING_FUNCTION 4 151 #define AXIAL_CURRENTS 8 153 #define CURRENT_DENSITIES 32 157 #define EXP_OUTPUT_FEM 1 158 #define EXP_LAPLACE 2 159 #define EXP_SETUP_MESH 3 160 #define EXP_POSTPROCESS 4 203 bool setup_IO(
int argc,
char **argv);
295 void register_output_async(
sf_vec* inp_data,
310 void register_output_sync(
sf_vec* inp_data,
316 bool elem_data =
false);
329 void register_output(
sf_vec* inp_data,
335 bool elem_data =
false);
351 void close_files_and_cleanup();
void register_physics()
Register physics to the physics registry.
bool elem_flag
igb header we use for output
std::map< physic_t, Basic_physic * > physics_reg
the physics
IO_t
The different output (directory) types.
void output_parameter_file(const char *fname, int argc, char **argv)
void set_io_dirs(char *sim_ID, char *pp_ID, IO_t init)
const SF::vector< mesh_int_t > * restr_idx
when using asyncIO, here we store the different IDs associated to the vectors we output ...
tagreg_t
tag regions types. must be in line with carp.prm
std::map< mesh_t, sf_mesh > mesh_reg
Registry for the different meshes used in a multi-physics simulation.
void simulate()
Main simulate loop.
void post_process()
do postprocessing
timer_manager * tm_manager
a manager for the various physics timers
std::map< SF::mixed_tuple< mesh_t, int >, sf_vec * > buffmap
map data spec -> PETSc vector buffer
SF::vector< mesh_int_t > restr_petsc_idx
pointer to index vector with nodal indices we restrict to.
double last
last output wallclock time
void setup_petsc_err_log()
set up error logs for PETSc, so that it doesnt print errors to stderr.
void initialize_physics()
Initialize all physics in the registry.
void savequit()
save state and quit simulator
IGBheader igb
pointer to index vector used for restricting output.
mesh_t
The enum identifying the different meshes we might want to load.
physic_t
Identifier for the different physics we want to set up.
void check_and_convert_params()
Here we want to put all parameter checks, conversions and modifications that have been littered throu...
char * get_file_dir(const char *file)
Timers and timer manager.
for display execution progress and statistical data of electrical solve
bool setup_IO(int argc, char **argv)
bool using_legacy_stimuli
flag storing whether legacy stimuli are used
FILE * petsc_error_fd
file descriptor for petsc error output
double start
output start wallclock time
std::map< SF::quadruple< int >, SF::index_mapping< int > > map_reg
Registriy for the inter domain mappings.
void parse_mesh_types()
Parse the phys_type CLI parameters and set up (empty) SF::meshdata meshes.
void parse_params_cpy(int argc, char **argv)
Initialize input parameters on a copy of the real command line parameters.
double curr
current output wallclock time
void destroy_physics()
Destroy all physics in the registry.
const SF::vector< mesh_int_t > * restr_idx
pointer to data registered for output
std::map< SF::mixed_tuple< mesh_t, int >, sf_vec * > buffmap_elem
void basic_timer_setup()
Here we set up the timers that we always want to have, independent of physics.
int plot_protocols(const char *fname)
plot simulation protocols (I/O timers, stimuli, boundary conditions, etc)
void setup_meshes()
Read in the reference mesh and use its data to populate all meshes registered in the mesh registry...
void show_build_info()
show the build info, exit if -buildinfo was provided. This code runs before MPI_Init().
SF::abstract_vector< SF_int, SF_real > sf_vec
void register_data(sf_vec *dat, datavec_t d)
Register a data vector in the global registry.
Basic_physic * get_physics(physic_t p, bool error_if_missing)
Convinience function to get a physics.
SF::mixed_tuple< mesh_t, int > spec
flag whether the data is elements-wise
MPI_Comm IO_Intercomm
Communicator between IO and compute worlds.
Index mapping class. This is a bijective mapping.
unsigned int classify_soln_methods()
void update_cwd()
save the current working directory to curdir so that we can switch back to it if needed.
short get_mesh_dim(mesh_t id)
get (lowest) dimension of the mesh used in the experiment
SF::vector< async_io_item > async_IOs
std::map< datavec_t, sf_vec * > datavec_reg
important solution vectors from different physics
std::map< int, std::string > units
datavec_t
Enum used to adress the different data vectors stored in the data registry.
SF::vector< sync_io_item > sync_IOs
sf_vec * get_data(datavec_t d)
Retrieve a petsc data vector from the data registry.
int IO_id
pointer to data registered for output
SF::scatter_registry scatter_reg
Registry for the different scatter objects.
The scatterer registry class.