openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
fem_types.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // openCARP is an open cardiac electrophysiology simulator.
3 //
4 // Copyright (C) 2020 openCARP project
5 //
6 // This program is licensed under the openCARP Academic Public License (APL)
7 // v1.0: You can use and redistribute it and/or modify it in non-commercial
8 // academic environments under the terms of APL as published by the openCARP
9 // project v1.0, or (at your option) any later version. Commercial use requires
10 // a commercial license (info@opencarp.org).
11 //
12 // This program is distributed without any warranty; see the openCARP APL for
13 // more details.
14 //
15 // You should have received a copy of the openCARP APL along with this program
16 // and can find it online: http://www.opencarp.org/license
17 // ----------------------------------------------------------------------------
18 
28 #ifndef _FEM_TYPES_H
29 #define _FEM_TYPES_H
30 
31 #include <map>
32 #include "basics.h"
33 #include "SF_vector.h"
34 //#include "constitutive_model.h"
35 //#include "constitutive_model_library.h"
36 
37 namespace opencarp {
38 
43 
45 enum cond_t {
47 };
48 
50 enum mechMat_t {
52 };
53 
54 
55 // typedef CondTensModifier bidmT;
56 
61 struct physMaterial {
63  double fluct;
64 };
65 
66 
69 {
70  double InVal[3];
71  double ExVal[3];
72  double BathVal[3];
74  int *augment;
75  int nAug;
76 };
77 
78 
81 {
82  double InVal[3];
83  double ExVal[3];
84  double BathVal[3];
85  double clearance;
86  double basal_conc;
87 };
88 
91 {
93  std::map<std::string, mechMat_t> mMat_map = {
94  {"Hooke", mechMat_t::HOOKE},
95  {"NeoHooke", mechMat_t::NEOHOOKE},
96  {"MooneyRivlin", mechMat_t::MOONEYRIVLIN},
97  {"Guccione", mechMat_t::GUCCIONE},
98  {"Usyk", mechMat_t::USYK}
99  }; //necessary to map command line arguments to material type
100  inline void set_constitutive_model(std::string model_name)
101  {
102  mat_t = mMat_map[model_name];
103  switch (mat_t) {
104  case NEOHOOKE:
105  log_msg(0, 0, 0, "Neo-Hooke chosen.");
106  break;
107  case HOOKE:
108  log_msg(0, 0, 0, "Hooke not yet implemented.");
109  break;
110  case MOONEYRIVLIN:
111  log_msg(0, 0, 0, "Mooney-Rivlin not yet implemented.");
112  break;
113  case GUCCIONE:
114  log_msg(0, 0, 0, "Guccione chosen.");
115  break;
116  case USYK:
117  log_msg(0, 0, 0, "Usyk not yet implemented");
118  default:
119  log_msg(0,0,0, "Choose an existing material model pls.");
120  break;
121  }
122  }
123 };
124 
127 {
128  int mode;
129  double Dil[3];
130  double Dem[3];
131  double muAil;
132  double muAem;
133 };
134 
135 // TODO: Write destructor for Regions
136 
138 struct RegionSpecs {
139  char *regname;
140  int regID;
141  int nsubregs;
142  int *subregtags;
144  void *customize;
145 };
146 
147 
149 // struct rndFluct {
150 // long rseed; //!< random seed
151 // double var; //!<
152 // };
153 
155 struct MaterialType {
156  // rndFluct rfluct; //!< random material variations
157  // double *fluct = NULL; //!< random fluctuation vector
158 
162 };
163 
164 } // namespace opencarp
165 
166 #endif
The vector class and related algorithms.
Basic utility structs and functions, mostly IO related.
cond_t
description of electrical tissue properties
Definition: fem_types.h:45
@ extra_cond
Definition: fem_types.h:46
@ sum_cond
Definition: fem_types.h:46
@ intra_cond
Definition: fem_types.h:46
@ para_cond
Definition: fem_types.h:46
void log_msg(FILE_SPEC out, int level, unsigned char flag, const char *fmt,...)
Definition: basics.cc:72
mechMat_t
mechanical material models to choose from
Definition: fem_types.h:50
@ NEOHOOKE
Definition: fem_types.h:51
@ MOONEYRIVLIN
Definition: fem_types.h:51
@ GUCCIONE
Definition: fem_types.h:51
physMat_t
identifier for physical material properties
Definition: fem_types.h:42
@ MechMat
Definition: fem_types.h:42
@ ElecMat
Definition: fem_types.h:42
@ PhysMat
Definition: fem_types.h:42
@ OpticsMat
Definition: fem_types.h:42
@ DiffuseMat
Definition: fem_types.h:42
description of materal properties in a mesh
Definition: fem_types.h:155
SF::vector< RegionSpecs > regions
array with region params
Definition: fem_types.h:160
SF::vector< double > el_scale
optionally provided per-element params scale
Definition: fem_types.h:161
SF::vector< int > regionIDs
elemental region IDs (multiple tags are grouped in one region)
Definition: fem_types.h:159
region based variations of arbitrary material parameters
Definition: fem_types.h:138
physMaterial * material
material parameter description
Definition: fem_types.h:143
int nsubregs
#subregions forming this region
Definition: fem_types.h:141
void * customize
any data for further customization
Definition: fem_types.h:144
int * subregtags
FEM tags forming this region.
Definition: fem_types.h:142
char * regname
name of region
Definition: fem_types.h:139
int regID
region ID
Definition: fem_types.h:140
double clearance
clearance rate (mol/s)
Definition: fem_types.h:85
double BathVal[3]
bath diffusion eigenvalues
Definition: fem_types.h:84
double basal_conc
basal concentration
Definition: fem_types.h:86
double InVal[3]
intracellular diffusion eigenvalues
Definition: fem_types.h:82
double ExVal[3]
extracellular diffusion eigenvalues
Definition: fem_types.h:83
double ExVal[3]
extracellular conductivity eigenvalues
Definition: fem_types.h:71
cond_t g
rule to build conductivity tensor
Definition: fem_types.h:73
double InVal[3]
intracellular conductivity eigenvalues
Definition: fem_types.h:70
int nAug
number of augmented elements
Definition: fem_types.h:75
double BathVal[3]
bath conductivity eigenvalues
Definition: fem_types.h:72
int * augment
augmented element list
Definition: fem_types.h:74
std::map< std::string, mechMat_t > mMat_map
Definition: fem_types.h:93
void set_constitutive_model(std::string model_name)
Definition: fem_types.h:100
mechMat_t mat_t
choose material model
Definition: fem_types.h:92
int mode
0=illumination, 1=emmission
Definition: fem_types.h:128
double muAil
absorption coefficient illumination
Definition: fem_types.h:131
double muAem
absorption coefficient emmission
Definition: fem_types.h:132
double Dem[3]
diffusion coefficient emmission
Definition: fem_types.h:130
double Dil[3]
diffusion coefficient illumination
Definition: fem_types.h:129
physMat_t material_type
ID of physics material.
Definition: fem_types.h:62
double fluct
random fluctuation around standard value
Definition: fem_types.h:63