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