v0.15.0
Loading...
Searching...
No Matches
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
 
DM dm
 Discretization manager.
 
TS ts
 Time solver.
 
boost::shared_ptr< FefeLhs
 FE to make left hand side.
 
boost::shared_ptr< FefeRhs
 FE to make right hand side.
 
boost::shared_ptr< FePrePostProcessRhspreProcRhs
 
boost::shared_ptr< FePrePostProcessLhspreProcLhs
 
boost::ptr_map< string, NeummanForcesSurfaceneumannForces
 Forces on surface.
 
boost::ptr_map< string, NodalForcenodalForces
 Nodal forces.
 
boost::ptr_map< string, EdgeForceedgeForces
 Forces on edges.
 
boost::shared_ptr< NonlinearElasticElementelasticPtr
 
boost::shared_ptr< ElasticMaterialselasticMaterialsPtr
 
double lambda
 Lame parameter.
 
double mu
 Lame parameter.
 
double c
 density evolution (growth) velocity [d/m^2]
 
double m
 algorithmic exponent [-]
 
double n
 porosity exponent [-]
 
double rHo_ref
 reference density
 
double rHo_max
 max density
 
double rHo_min
 min density
 
int b
 b exponent for bell function
 
double pSi_ref
 reference free energy
 
double R0
 mass conduction coefficient
 
double cUrrent_psi
 current free energy for evaluating equilibrium state
 
double cUrrent_mass
 current free energy for evaluating equilibrium state
 
PetscBool with_adol_c
 
PetscBool is_atom_testing
 for atom tests
 
PetscBool less_post_proc
 reduce file size
 
bool nOremodellingBlock
 
Range tEts_all
 
Range tEts_block
 
FTensor::Tensor2_symmetric< adouble, 3 > aC
 right Cauchy-Green deformation tensor
 
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
mofem/users_modules/bone_remodelling/bone_adaptation.cpp.

Definition at line 117 of file Remodeling.hpp.

Constructor & Destructor Documentation

◆ CommonData()

BoneRemodeling::Remodeling::CommonData::CommonData ( )
inline

Member Function Documentation

◆ getCFromDensity()

double BoneRemodeling::Remodeling::CommonData::getCFromDensity ( const double rho)
inline
Examples
mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 217 of file Remodeling.cpp.

217 {
218 double mid_rho = 0.5 * (rHo_max + rHo_min);
219 double var_h = (rho - mid_rho) / (rHo_max - mid_rho);
220
221 return 1 / (1 + (b != 0) * pow(var_h, 2 * b));
222}
double rho
Definition plastic.cpp:144
int b
b exponent for bell function

◆ getCFromDensityDiff()

double BoneRemodeling::Remodeling::CommonData::getCFromDensityDiff ( const double rho)
inline
Examples
mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 224 of file Remodeling.cpp.

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

◆ getParameters()

MoFEMErrorCode BoneRemodeling::Remodeling::CommonData::getParameters ( )
Examples
mofem/users_modules/bone_remodelling/bone_adaptation.cpp, mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

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 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",
184 CHKERR PetscPrintf(PETSC_COMM_WORLD,
185 "Poisson ratio nu[-] %4.3g\n",
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 PetscOptionsEnd();
213
215}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_STD_EXCEPTION_THROW
Definition definitions.h:39
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MU(E, NU)
Definition fem_tools.h:23
#define LAMBDA(E, NU)
Definition fem_tools.h:22
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:126
double young_modulus
Young modulus.
Definition plastic.cpp:125
double pSi_ref
reference free energy
double n
porosity exponent [-]
double m
algorithmic exponent [-]
PetscBool is_atom_testing
for atom tests
double c
density evolution (growth) velocity [d/m^2]
PetscBool less_post_proc
reduce file size
double R0
mass conduction coefficient
double cUrrent_psi
current free energy for evaluating equilibrium state
double cUrrent_mass
current free energy for evaluating equilibrium state

Member Data Documentation

◆ A

Mat BoneRemodeling::Remodeling::CommonData::A

◆ aC

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

right Cauchy-Green deformation tensor

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

Examples
mofem/users_modules/bone_remodelling/src/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
mofem/users_modules/bone_remodelling/src/Remodeling.hpp.

Definition at line 174 of file Remodeling.hpp.

◆ b

int BoneRemodeling::Remodeling::CommonData::b

◆ bitLevel

BitRefLevel BoneRemodeling::Remodeling::CommonData::bitLevel

◆ c

double BoneRemodeling::Remodeling::CommonData::c

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

Examples
mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 146 of file Remodeling.hpp.

◆ cUrrent_mass

double BoneRemodeling::Remodeling::CommonData::cUrrent_mass

current free energy for evaluating equilibrium state

Examples
mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 160 of file Remodeling.hpp.

◆ cUrrent_psi

double BoneRemodeling::Remodeling::CommonData::cUrrent_psi

current free energy for evaluating equilibrium state

Examples
mofem/users_modules/bone_remodelling/src/Remodeling.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 158 of file Remodeling.hpp.

◆ D

Vec BoneRemodeling::Remodeling::CommonData::D

◆ data

DataContainers BoneRemodeling::Remodeling::CommonData::data

◆ dm

DM BoneRemodeling::Remodeling::CommonData::dm

◆ dm_name

DMType BoneRemodeling::Remodeling::CommonData::dm_name

◆ edgeForces

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

◆ elasticMaterialsPtr

boost::shared_ptr<ElasticMaterials> BoneRemodeling::Remodeling::CommonData::elasticMaterialsPtr

◆ elasticPtr

boost::shared_ptr<NonlinearElasticElement> BoneRemodeling::Remodeling::CommonData::elasticPtr

◆ F

Vec BoneRemodeling::Remodeling::CommonData::F

◆ feLhs

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

◆ feRhs

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

◆ is_atom_testing

PetscBool BoneRemodeling::Remodeling::CommonData::is_atom_testing

◆ kEep

const int BoneRemodeling::Remodeling::CommonData::kEep

◆ lambda

double BoneRemodeling::Remodeling::CommonData::lambda

◆ less_post_proc

PetscBool BoneRemodeling::Remodeling::CommonData::less_post_proc

◆ m

double BoneRemodeling::Remodeling::CommonData::m

◆ mu

double BoneRemodeling::Remodeling::CommonData::mu

◆ n

double BoneRemodeling::Remodeling::CommonData::n

◆ neumannForces

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

◆ nodalForces

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

◆ nOremodellingBlock

bool BoneRemodeling::Remodeling::CommonData::nOremodellingBlock

◆ oRder

int BoneRemodeling::Remodeling::CommonData::oRder

◆ preProcLhs

boost::shared_ptr<FePrePostProcessLhs> BoneRemodeling::Remodeling::CommonData::preProcLhs

◆ preProcRhs

boost::shared_ptr<FePrePostProcessRhs> BoneRemodeling::Remodeling::CommonData::preProcRhs

◆ pSi_ref

double BoneRemodeling::Remodeling::CommonData::pSi_ref

◆ R0

double BoneRemodeling::Remodeling::CommonData::R0

◆ rHo_max

double BoneRemodeling::Remodeling::CommonData::rHo_max

◆ rHo_min

double BoneRemodeling::Remodeling::CommonData::rHo_min

◆ rHo_ref

double BoneRemodeling::Remodeling::CommonData::rHo_ref

◆ tAg

const int BoneRemodeling::Remodeling::CommonData::tAg

◆ tEts_all

Range BoneRemodeling::Remodeling::CommonData::tEts_all

◆ tEts_block

Range BoneRemodeling::Remodeling::CommonData::tEts_block

◆ ts

TS BoneRemodeling::Remodeling::CommonData::ts

◆ with_adol_c

PetscBool BoneRemodeling::Remodeling::CommonData::with_adol_c

The documentation for this struct was generated from the following files: