v0.14.0
Classes | Public Member Functions | Public Attributes | List of all members
BoneRemodeling::Remodeling::CommonData Struct Reference

#include <users_modules/bone_remodelling/src/Remodeling.hpp>

Collaboration diagram for BoneRemodeling::Remodeling::CommonData:
[legend]

Classes

struct  DataContainers
 

Public Member Functions

MoFEMErrorCode getParameters ()
 
double getCFromDensity (const double &rho)
 
double getCFromDensityDiff (const double &rho)
 
 CommonData ()
 

Public Attributes

Mat A
 
Vec F
 
Vec D
 
int oRder
 
BitRefLevel bitLevel
 
DMType dm_name
 dm (problem) name More...
 
DM dm
 Discretization manager. More...
 
TS ts
 Time solver. More...
 
boost::shared_ptr< FefeLhs
 FE to make left hand side. More...
 
boost::shared_ptr< FefeRhs
 FE to make right hand side. More...
 
boost::shared_ptr< FePrePostProcessRhspreProcRhs
 
boost::shared_ptr< FePrePostProcessLhspreProcLhs
 
boost::ptr_map< string, NeummanForcesSurfaceneumannForces
 Forces on surface. More...
 
boost::ptr_map< string, NodalForcenodalForces
 Nodal forces. More...
 
boost::ptr_map< string, EdgeForceedgeForces
 Forces on edges. More...
 
boost::shared_ptr< NonlinearElasticElementelasticPtr
 
boost::shared_ptr< ElasticMaterialselasticMaterialsPtr
 
double lambda
 Lame parameter. More...
 
double mu
 Lame parameter. More...
 
double c
 density evolution (growth) velocity [d/m^2] More...
 
double m
 algorithmic exponent [-] More...
 
double n
 porosity exponent [-] More...
 
double rHo_ref
 reference density More...
 
double rHo_max
 max density More...
 
double rHo_min
 min density More...
 
int b
 b exponent for bell function More...
 
double pSi_ref
 reference free energy More...
 
double R0
 mass conduction coefficient More...
 
double cUrrent_psi
 current free energy for evaluating equilibrium state More...
 
double cUrrent_mass
 current free energy for evaluating equilibrium state More...
 
PetscBool with_adol_c
 
PetscBool is_atom_testing
 for atom tests More...
 
PetscBool less_post_proc
 reduce file size More...
 
bool nOremodellingBlock
 
Range tEts_all
 
Range tEts_block
 
FTensor::Tensor2_symmetric< adouble, 3 > aC
 right Cauchy-Green deformation tensor More...
 
adouble aPsi
 
const int tAg
 
const int kEep
 
DataContainers data
 

Detailed Description

Data structure for storing material parameters and evaluated values at integration points.

Parameters
oRderorder of approximation
lambdaLame parameter

\[ \lambda=\frac{E}{2(1+v)} \]

muLame parameter

\[ \mu=\frac{E\cdot\nu}{(1-2\nu)(1+\nu)} \]

cdensity evolution (growth) velocity [d/m^2]

\[ k_{p}^{\ast} \]

in Ellen Kuhl's paper
malgorithmic exponent [-]
nporosity exponent [-]
rHo_refreference density
pSi_refreference free energy
R0mass conduction coefficient
Examples
bone_adaptation.cpp.

Definition at line 117 of file Remodeling.hpp.

Constructor & Destructor Documentation

◆ CommonData()

BoneRemodeling::Remodeling::CommonData::CommonData ( )
inline
Examples
Remodeling.hpp.

Definition at line 181 of file Remodeling.hpp.

181 : tAg(1), kEep(0) {}

Member Function Documentation

◆ getCFromDensity()

double BoneRemodeling::Remodeling::CommonData::getCFromDensity ( const double rho)
inline
Examples
Remodeling.hpp.

Definition at line 218 of file Remodeling.cpp.

218  {
219  double mid_rho = 0.5 * (rHo_max + rHo_min);
220  double var_h = (rho - mid_rho) / (rHo_max - mid_rho);
221 
222  return 1 / (1 + (b != 0) * pow(var_h, 2 * b));
223 }

◆ getCFromDensityDiff()

double BoneRemodeling::Remodeling::CommonData::getCFromDensityDiff ( const double rho)
inline
Examples
Remodeling.hpp.

Definition at line 225 of file Remodeling.cpp.

225  {
226  double mid_rho = 0.5 * (rHo_max + rHo_min);
227  double var_h = (rho - mid_rho) / (rHo_max - mid_rho);
228  return (b != 0) * (-2) * b * pow(var_h, 2 * b - 1) /
229  ((rHo_max - mid_rho) * pow(pow(var_h, 2 * b) + 1, 2));
230 }

◆ getParameters()

MoFEMErrorCode BoneRemodeling::Remodeling::CommonData::getParameters ( )
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 62 of file Remodeling.cpp.

62  {
63 
64  PetscBool flg_config = PETSC_FALSE;
65  is_atom_testing = PETSC_FALSE;
66  with_adol_c = PETSC_FALSE;
67  char my_config_file_name[255];
68  double young_modulus = 5.0e+9; // Set here some typical value for bone 5 GPa
69  double poisson_ratio = 0.3; // Set here some typical value for bone
70  c = 4.0e-5; // Set here some typical value for bone. days/ m2 // this
71  // parameters governs how fast we can achieve equilibrium
72  m = 3.25; // Set some parameter typical for bone
73  n = 2.25; // Set Some parameter typical for bone
74  rHo_ref = 1000; // Set Some parameter typical for bone. kg/m3
75  pSi_ref = 2.75e4; // Set Some parameter typical for bone. energy / volume unit
76  // J/m3 = Pa
77  rHo_max = rHo_ref + 0.5 * rHo_ref;
78  rHo_min = rHo_ref - 0.5 * rHo_ref;
79  b = 0;
80  R0 = 0.0; // Set Some parameter typical for bone.
81  cUrrent_psi = 0.0;
82  cUrrent_mass = 0.0;
83  nOremodellingBlock = false;
84  less_post_proc = PETSC_FALSE;
85 
87  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Bone remodeling parameters",
88  "none");
89 
90  // config file
91  CHKERR PetscOptionsString("-my_config", "configuration file name", "",
92  "my_config.in", my_config_file_name, 255,
93  &flg_config);
94 
95  if (flg_config) {
96  CHKERR PetscPrintf(PETSC_COMM_WORLD, "Config file: %s loaded.\n",
97  my_config_file_name);
98  try {
99  ifstream ini_file(my_config_file_name);
100  if (!ini_file.is_open()) {
101  SETERRQ(PETSC_COMM_SELF, 1, "*** -my_config does not exist ***");
102  }
103  po::variables_map vm;
104  po::options_description config_file_options;
105  // std::cout << my_config_file_name << std::endl;
106 
107  config_file_options.add_options()(
108  "young_modulus", po::value<double>(&young_modulus)->default_value(1));
109  config_file_options.add_options()(
110  "poisson_ratio", po::value<double>(&poisson_ratio)->default_value(1));
111  config_file_options.add_options()(
112  "c", po::value<double>(&c)->default_value(1));
113  config_file_options.add_options()(
114  "m", po::value<double>(&m)->default_value(1));
115  config_file_options.add_options()(
116  "n", po::value<double>(&n)->default_value(1));
117  config_file_options.add_options()(
118  "rHo_ref", po::value<double>(&rHo_ref)->default_value(1));
119  config_file_options.add_options()(
120  "pSi_ref", po::value<double>(&pSi_ref)->default_value(1));
121  config_file_options.add_options()(
122  "R0", po::value<double>(&R0)->default_value(1));
123 
124  po::parsed_options parsed =
125  parse_config_file(ini_file, config_file_options, true);
126  store(parsed, vm);
127  po::notify(vm);
128 
129  } catch (const std::exception &ex) {
130  std::ostringstream ss;
131  ss << ex.what() << std::endl;
132  SETERRQ(PETSC_COMM_SELF, MOFEM_STD_EXCEPTION_THROW, ss.str().c_str());
133  }
134  }
135 
136  CHKERR PetscOptionsScalar("-young_modulus", "get young modulus", "",
137  young_modulus, &young_modulus, PETSC_NULL);
138 
139  CHKERR PetscOptionsScalar("-poisson_ratio", "get poisson_ratio", "",
140  poisson_ratio, &poisson_ratio, PETSC_NULL);
141 
142  CHKERR PetscOptionsScalar("-c", "density evolution (growth) velocity [d/m^2]",
143  "", c, &c, PETSC_NULL);
144 
145  CHKERR PetscOptionsScalar("-m", "algorithmic exponent", "", m, &m,
146  PETSC_NULL);
147 
148  CHKERR PetscOptionsScalar("-n", "porosity exponent", "", n, &n, PETSC_NULL);
149 
150  CHKERR PetscOptionsInt("-b", "bell function exponent", "", b, &b, PETSC_NULL);
151 
152  CHKERR PetscOptionsScalar("-rho_ref", "reference bone density", "", rHo_ref,
153  &rHo_ref, PETSC_NULL);
154 
155  CHKERR PetscOptionsScalar("-rho_max", "reference bone density", "", rHo_max,
156  &rHo_max, PETSC_NULL);
157  CHKERR PetscOptionsScalar("-rho_min", "reference bone density", "", rHo_min,
158  &rHo_min, PETSC_NULL);
159 
160  CHKERR PetscOptionsScalar("-psi_ref", "reference energy density", "", pSi_ref,
161  &pSi_ref, PETSC_NULL);
162 
163  CHKERR PetscOptionsScalar("-r0", "mass source", "", R0, &R0, PETSC_NULL);
164 
165  CHKERR PetscOptionsBool("-my_is_atom_test",
166  "is used with testing, exit with error when diverged",
167  "", is_atom_testing, &is_atom_testing, PETSC_NULL);
168 
169  CHKERR PetscOptionsBool("-less_post_proc",
170  "is used to reduce output file size", "",
171  less_post_proc, &less_post_proc, PETSC_NULL);
172 
173  CHKERR PetscOptionsBool(
174  "-with_adolc",
175  "calculate the material tangent with automatic differentiation", "",
176  with_adol_c, &with_adol_c, PETSC_NULL);
177 
180 
181  CHKERR PetscPrintf(PETSC_COMM_WORLD,
182  "Young's modulus E[Pa]: %4.3g\n",
183  young_modulus);
184  CHKERR PetscPrintf(PETSC_COMM_WORLD,
185  "Poisson ratio nu[-] %4.3g\n",
186  poisson_ratio);
187  CHKERR PetscPrintf(PETSC_COMM_WORLD,
188  "Lame coefficient lambda[Pa]: %4.3g\n", lambda);
189  CHKERR PetscPrintf(PETSC_COMM_WORLD,
190  "Lame coefficient mu[Pa]: %4.3g\n", mu);
191  CHKERR PetscPrintf(PETSC_COMM_WORLD,
192  "Density growth velocity [d/m2] %4.3g\n", c);
193  CHKERR PetscPrintf(PETSC_COMM_WORLD,
194  "Algorithmic exponent m[-]: %4.3g\n", m);
195  CHKERR PetscPrintf(PETSC_COMM_WORLD,
196  "Porosity exponent n[-]: %4.3g\n", n);
197  CHKERR PetscPrintf(PETSC_COMM_WORLD,
198  "Reference density rHo_ref[kg/m3]: %4.3g\n", rHo_ref);
199  CHKERR PetscPrintf(PETSC_COMM_WORLD,
200  "Reference energy pSi_ref[Pa]: %4.3g\n", pSi_ref);
201  CHKERR PetscPrintf(PETSC_COMM_WORLD,
202  "Mass conduction R0[kg/m3s]: %4.3g\n", R0);
203  CHKERR PetscPrintf(PETSC_COMM_WORLD,
204  "Bell function coefficent b[-]: %4.3g\n", b);
205  if (b != 0) {
206  CHKERR PetscPrintf(PETSC_COMM_WORLD,
207  "Max density rHo_max[kg/m3]: %4.3g\n", rHo_max);
208  CHKERR PetscPrintf(PETSC_COMM_WORLD,
209  "Min density rHo_min[kg/m3]: %4.3g\n", rHo_min);
210  }
211 
212  ierr = PetscOptionsEnd();
213  CHKERRQ(ierr);
214 
216 }

Member Data Documentation

◆ A

Mat BoneRemodeling::Remodeling::CommonData::A
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 119 of file Remodeling.hpp.

◆ aC

FTensor::Tensor2_symmetric<adouble, 3> BoneRemodeling::Remodeling::CommonData::aC

right Cauchy-Green deformation tensor

\[ C=F^{T}\cdot F \]

Examples
Remodeling.hpp.

Definition at line 173 of file Remodeling.hpp.

◆ aPsi

adouble BoneRemodeling::Remodeling::CommonData::aPsi

Elastic energy

\[\psi_{0}=\frac{\mu}{2}\left(\textrm{tr}(\mathbf{C})-3\right)-\mu\ln(J)+\frac{\lambda}{2}\ln^{2}(\ln < J)^{2} \]

Examples
Remodeling.hpp.

Definition at line 174 of file Remodeling.hpp.

◆ b

int BoneRemodeling::Remodeling::CommonData::b

b exponent for bell function

Examples
Remodeling.hpp.

Definition at line 153 of file Remodeling.hpp.

◆ bitLevel

BitRefLevel BoneRemodeling::Remodeling::CommonData::bitLevel
Examples
Remodeling.hpp.

Definition at line 123 of file Remodeling.hpp.

◆ c

double BoneRemodeling::Remodeling::CommonData::c

density evolution (growth) velocity [d/m^2]

Examples
Remodeling.hpp.

Definition at line 146 of file Remodeling.hpp.

◆ cUrrent_mass

double BoneRemodeling::Remodeling::CommonData::cUrrent_mass

current free energy for evaluating equilibrium state

Examples
Remodeling.hpp.

Definition at line 160 of file Remodeling.hpp.

◆ cUrrent_psi

double BoneRemodeling::Remodeling::CommonData::cUrrent_psi

current free energy for evaluating equilibrium state

Examples
Remodeling.hpp.

Definition at line 158 of file Remodeling.hpp.

◆ D

Vec BoneRemodeling::Remodeling::CommonData::D
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 120 of file Remodeling.hpp.

◆ data

DataContainers BoneRemodeling::Remodeling::CommonData::data
Examples
Remodeling.hpp.

Definition at line 203 of file Remodeling.hpp.

◆ dm

DM BoneRemodeling::Remodeling::CommonData::dm

Discretization manager.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 127 of file Remodeling.hpp.

◆ dm_name

DMType BoneRemodeling::Remodeling::CommonData::dm_name

dm (problem) name

Examples
Remodeling.hpp.

Definition at line 126 of file Remodeling.hpp.

◆ edgeForces

boost::ptr_map<string, EdgeForce> BoneRemodeling::Remodeling::CommonData::edgeForces

Forces on edges.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 138 of file Remodeling.hpp.

◆ elasticMaterialsPtr

boost::shared_ptr<ElasticMaterials> BoneRemodeling::Remodeling::CommonData::elasticMaterialsPtr
Examples
Remodeling.hpp.

Definition at line 141 of file Remodeling.hpp.

◆ elasticPtr

boost::shared_ptr<NonlinearElasticElement> BoneRemodeling::Remodeling::CommonData::elasticPtr
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 140 of file Remodeling.hpp.

◆ F

Vec BoneRemodeling::Remodeling::CommonData::F
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 120 of file Remodeling.hpp.

◆ feLhs

boost::shared_ptr<Fe> BoneRemodeling::Remodeling::CommonData::feLhs

FE to make left hand side.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 130 of file Remodeling.hpp.

◆ feRhs

boost::shared_ptr<Fe> BoneRemodeling::Remodeling::CommonData::feRhs

FE to make right hand side.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 131 of file Remodeling.hpp.

◆ is_atom_testing

PetscBool BoneRemodeling::Remodeling::CommonData::is_atom_testing

for atom tests

Examples
Remodeling.hpp.

Definition at line 162 of file Remodeling.hpp.

◆ kEep

const int BoneRemodeling::Remodeling::CommonData::kEep
Examples
Remodeling.hpp.

Definition at line 179 of file Remodeling.hpp.

◆ lambda

double BoneRemodeling::Remodeling::CommonData::lambda

Lame parameter.

Examples
Remodeling.hpp.

Definition at line 144 of file Remodeling.hpp.

◆ less_post_proc

PetscBool BoneRemodeling::Remodeling::CommonData::less_post_proc

reduce file size

Examples
Remodeling.hpp.

Definition at line 163 of file Remodeling.hpp.

◆ m

double BoneRemodeling::Remodeling::CommonData::m

algorithmic exponent [-]

Examples
Remodeling.hpp.

Definition at line 147 of file Remodeling.hpp.

◆ mu

double BoneRemodeling::Remodeling::CommonData::mu

Lame parameter.

Examples
Remodeling.hpp.

Definition at line 145 of file Remodeling.hpp.

◆ n

double BoneRemodeling::Remodeling::CommonData::n

porosity exponent [-]

Examples
Remodeling.hpp.

Definition at line 148 of file Remodeling.hpp.

◆ neumannForces

boost::ptr_map<string, NeummanForcesSurface> BoneRemodeling::Remodeling::CommonData::neumannForces

Forces on surface.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 136 of file Remodeling.hpp.

◆ nodalForces

boost::ptr_map<string, NodalForce> BoneRemodeling::Remodeling::CommonData::nodalForces

Nodal forces.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 137 of file Remodeling.hpp.

◆ nOremodellingBlock

bool BoneRemodeling::Remodeling::CommonData::nOremodellingBlock
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 164 of file Remodeling.hpp.

◆ oRder

int BoneRemodeling::Remodeling::CommonData::oRder
Examples
Remodeling.hpp.

Definition at line 122 of file Remodeling.hpp.

◆ preProcLhs

boost::shared_ptr<FePrePostProcessLhs> BoneRemodeling::Remodeling::CommonData::preProcLhs
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 133 of file Remodeling.hpp.

◆ preProcRhs

boost::shared_ptr<FePrePostProcessRhs> BoneRemodeling::Remodeling::CommonData::preProcRhs
Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 132 of file Remodeling.hpp.

◆ pSi_ref

double BoneRemodeling::Remodeling::CommonData::pSi_ref

reference free energy

Examples
Remodeling.hpp.

Definition at line 154 of file Remodeling.hpp.

◆ R0

double BoneRemodeling::Remodeling::CommonData::R0

mass conduction coefficient

Examples
Remodeling.hpp.

Definition at line 155 of file Remodeling.hpp.

◆ rHo_max

double BoneRemodeling::Remodeling::CommonData::rHo_max

max density

Examples
Remodeling.hpp.

Definition at line 151 of file Remodeling.hpp.

◆ rHo_min

double BoneRemodeling::Remodeling::CommonData::rHo_min

min density

Examples
Remodeling.hpp.

Definition at line 152 of file Remodeling.hpp.

◆ rHo_ref

double BoneRemodeling::Remodeling::CommonData::rHo_ref

reference density

Examples
Remodeling.hpp.

Definition at line 150 of file Remodeling.hpp.

◆ tAg

const int BoneRemodeling::Remodeling::CommonData::tAg
Examples
Remodeling.hpp.

Definition at line 178 of file Remodeling.hpp.

◆ tEts_all

Range BoneRemodeling::Remodeling::CommonData::tEts_all
Examples
Remodeling.hpp.

Definition at line 165 of file Remodeling.hpp.

◆ tEts_block

Range BoneRemodeling::Remodeling::CommonData::tEts_block
Examples
Remodeling.hpp.

Definition at line 166 of file Remodeling.hpp.

◆ ts

TS BoneRemodeling::Remodeling::CommonData::ts

Time solver.

Examples
bone_adaptation.cpp, and Remodeling.hpp.

Definition at line 128 of file Remodeling.hpp.

◆ with_adol_c

PetscBool BoneRemodeling::Remodeling::CommonData::with_adol_c
Examples
Remodeling.hpp.

Definition at line 161 of file Remodeling.hpp.


The documentation for this struct was generated from the following files:
BoneRemodeling::Remodeling::CommonData::kEep
const int kEep
Definition: Remodeling.hpp:179
BoneRemodeling::Remodeling::CommonData::nOremodellingBlock
bool nOremodellingBlock
Definition: Remodeling.hpp:164
MOFEM_STD_EXCEPTION_THROW
@ MOFEM_STD_EXCEPTION_THROW
Definition: definitions.h:39
BoneRemodeling::Remodeling::CommonData::n
double n
porosity exponent [-]
Definition: Remodeling.hpp:148
young_modulus
double young_modulus
Young modulus.
Definition: plastic.cpp:121
rho
double rho
Definition: plastic.cpp:140
BoneRemodeling::Remodeling::CommonData::rHo_ref
double rHo_ref
reference density
Definition: Remodeling.hpp:150
LAMBDA
#define LAMBDA(E, NU)
Definition: fem_tools.h:22
BoneRemodeling::Remodeling::CommonData::cUrrent_psi
double cUrrent_psi
current free energy for evaluating equilibrium state
Definition: Remodeling.hpp:158
BoneRemodeling::Remodeling::CommonData::cUrrent_mass
double cUrrent_mass
current free energy for evaluating equilibrium state
Definition: Remodeling.hpp:160
BoneRemodeling::Remodeling::CommonData::rHo_max
double rHo_max
max density
Definition: Remodeling.hpp:151
BoneRemodeling::Remodeling::CommonData::rHo_min
double rHo_min
min density
Definition: Remodeling.hpp:152
BoneRemodeling::Remodeling::CommonData::lambda
double lambda
Lame parameter.
Definition: Remodeling.hpp:144
BoneRemodeling::Remodeling::CommonData::less_post_proc
PetscBool less_post_proc
reduce file size
Definition: Remodeling.hpp:163
BoneRemodeling::Remodeling::CommonData::with_adol_c
PetscBool with_adol_c
Definition: Remodeling.hpp:161
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
BoneRemodeling::Remodeling::CommonData::mu
double mu
Lame parameter.
Definition: Remodeling.hpp:145
BoneRemodeling::Remodeling::CommonData::is_atom_testing
PetscBool is_atom_testing
for atom tests
Definition: Remodeling.hpp:162
BoneRemodeling::Remodeling::CommonData::b
int b
b exponent for bell function
Definition: Remodeling.hpp:153
poisson_ratio
double poisson_ratio
Poisson ratio.
Definition: plastic.cpp:122
BoneRemodeling::Remodeling::CommonData::pSi_ref
double pSi_ref
reference free energy
Definition: Remodeling.hpp:154
BoneRemodeling::Remodeling::CommonData::R0
double R0
mass conduction coefficient
Definition: Remodeling.hpp:155
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
BoneRemodeling::Remodeling::CommonData::m
double m
algorithmic exponent [-]
Definition: Remodeling.hpp:147
BoneRemodeling::Remodeling::CommonData::tAg
const int tAg
Definition: Remodeling.hpp:178
BoneRemodeling::Remodeling::CommonData::c
double c
density evolution (growth) velocity [d/m^2]
Definition: Remodeling.hpp:146
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MU
#define MU(E, NU)
Definition: fem_tools.h:23