v0.14.0
Remodeling.hpp
Go to the documentation of this file.
1 /** \file Remodeling.hpp
2 * \ingroup bone_remodelling
3 * \example Remodeling.hpp
4 
5 * \brief Implementation of element for bone remodeling
6 
7 */
8 
9 /*
10  * This file is part of MoFEM.
11  * MoFEM is free software: you can redistribute it and/or modify it under
12  * the terms of the GNU Lesser General Public License as published by the
13  * Free Software Foundation, either version 3 of the License, or (at your
14  * option) any later version.
15  *
16  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
17  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
19  * License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>. */
23 
24 #ifndef __REMODELING_HPP__
25 #define __REMODELING_HPP__
26 
27 namespace BoneRemodeling {
28 
29 /**
30  * \brief Implementation of bone remodeling finite element
31  *
32  * Implementation base on paper \cite waffenschmidt2012anisotropic
33  * <http://biomechanics.stanford.edu/paper/IJSS12.pdf>
34  *
35  */
36 struct Remodeling {
37 
38  /**
39  * \brief Volume finite element
40  */
42  Fe(MoFEM::Interface &m_field)
44  /** \brief Set integrate rule
45  */
46  int getRule(int order) { return 2 * (order - 1) + 1; };
47  };
48 
49  /**
50  * \brief Not used at this stage. Could be used to do some calculations,
51  * before assembly of local elements.
52  */
53  struct FePrePostProcessRhs : public FEMethod {
54 
57  switch (ts_ctx) {
58  case CTX_TSSETIFUNCTION: {
59  snes_ctx = CTX_SNESSETFUNCTION;
60  snes_f = ts_F;
61  break;
62  }
63  default:
64  break;
65  }
67  }
68 
72  }
73  };
74 
75  /**
76  * \brief Not used at this stage. Could be used to do some calculations,
77  * before assembly of local elements.
78  */
79  struct FePrePostProcessLhs : public FEMethod {
80 
82  //
84  switch (ts_ctx) {
85  case CTX_TSSETIJACOBIAN: {
86  snes_ctx = CTX_SNESSETJACOBIAN;
87  snes_B = ts_B;
88  break;
89  }
90  default:
91  break;
92  }
94  }
95 
99  }
100  };
101 
102  /**
103  * Data structure for storing material parameters and evaluated values at
104  * integration points.
105  *
106  * @param oRder order of approximation
107  * @param lambda Lame parameter \f[ \lambda=\frac{E}{2(1+v)} \f]
108  * @param mu Lame parameter \f[ \mu=\frac{E\cdot\nu}{(1-2\nu)(1+\nu)} \f]
109  * @param c density evolution (growth) velocity [d/m^2] \f[ k_{p}^{\ast} \f]
110  * in Ellen Kuhl's paper
111  * @param m algorithmic exponent [-]
112  * @param n porosity exponent [-]
113  * @param rHo_ref reference density
114  * @param pSi_ref reference free energy
115  * @param R0 mass conduction coefficient
116  */
117  struct CommonData {
118 
119  Mat A;
120  Vec F, D;
121  // Approximation
122  int oRder;
124 
125  // DM
126  DMType dm_name; ///< dm (problem) name
127  DM dm; ///< Discretization manager
128  TS ts; ///< Time solver
129 
130  boost::shared_ptr<Fe> feLhs; ///< FE to make left hand side
131  boost::shared_ptr<Fe> feRhs; ///< FE to make right hand side
132  boost::shared_ptr<FePrePostProcessRhs> preProcRhs;
133  boost::shared_ptr<FePrePostProcessLhs> preProcLhs;
134 
135  boost::ptr_map<string, NeummanForcesSurface>
136  neumannForces; ///< Forces on surface
137  boost::ptr_map<string, NodalForce> nodalForces; ///< Nodal forces
138  boost::ptr_map<string, EdgeForce> edgeForces; ///< Forces on edges
139 
140  boost::shared_ptr<NonlinearElasticElement> elasticPtr;
141  boost::shared_ptr<ElasticMaterials> elasticMaterialsPtr;
142 
143  // Material parameters
144  double lambda; ///< Lame parameter
145  double mu; ///< Lame parameter
146  double c; ///< density evolution (growth) velocity [d/m^2]
147  double m; ///< algorithmic exponent [-]
148  double n; ///< porosity exponent [-]
149 
150  double rHo_ref; ///< reference density
151  double rHo_max; ///< max density
152  double rHo_min; ///< min density
153  int b; ///< b exponent for bell function
154  double pSi_ref; ///< reference free energy
155  double R0; ///< mass conduction coefficient
156 
157  double
158  cUrrent_psi; ///< current free energy for evaluating equilibrium state
159  double
160  cUrrent_mass; ///< current free energy for evaluating equilibrium state
161  PetscBool with_adol_c;
162  PetscBool is_atom_testing; ///< for atom tests
163  PetscBool less_post_proc; ///< reduce file size
165  Range tEts_all; // all blockset
166  Range tEts_block; // blockset with no remodelling
167 
169  inline double getCFromDensity(const double &rho);
170  inline double getCFromDensityDiff(const double &rho);
171  // aDouble values
173  aC; ///< right Cauchy-Green deformation tensor \f[ C=F^{T}\cdot F \f]
174  adouble aPsi; ///< Elastic energy
175  ///< \f[\psi_{0}=\frac{\mu}{2}\left(\textrm{tr}(\mathbf{C})-3\right)-\mu\ln(J)+\frac{\lambda}{2}\ln^{2}(\ln
176  ///< J)^{2} \f]
177 
178  const int tAg;
179  const int kEep;
180 
181  CommonData() : tAg(1), kEep(0) {}
182 
183  struct DataContainers {
184  boost::shared_ptr<MatrixDouble>
185  gradDispPtr; ///< Ptr to gradient of displacements matrix container
186  boost::shared_ptr<VectorDouble>
187  rhoPtr; ///< Ptr to density matrix container
188  boost::shared_ptr<MatrixDouble> gradRhoPtr; ///< Gradient of density field
189  VectorDouble vecPsi; ///< Elastic energy density
190  MatrixDouble matS; ///< 2nd Piola stress
191  MatrixDouble matP; ///< 1st Piola stress
192  VectorDouble vecR; ///< Mass sorce
193  MatrixDouble matMaterialTangent; ///< Tangent matrix (derivative for F and
194  ///< 1st Piola stress)
196  matPushedMaterialTangent; ///< Pushed tangent matrix (derivative for F
197  ///< and 1st Piola stress)
198  MatrixDouble matGradientOfDeformation; ///< Gradient of deformation
199  MatrixDouble matInvF; ///< inverse of deformation gradient
200  VectorDouble vecDetF; ///< determinant of F
201  VectorDouble vecRhoDt; ///< Time derivative of density
202  };
204  };
205 
208 
209  Remodeling(MoFEM::Interface &m_field, CommonData &common_data)
210  : mField(m_field), commonData(common_data) {}
211 
212  /**
213  * \brief Get parameters form line command or config file
214 
215  * Read command line and config file to setup material and model parameters.
216 
217  * @return Error code
218  */
220 
221  /**
222  * \brief Set and add entities to approximation fields
223  * @return Error code
224  */
226 
227  /**
228  * \brief Set and add finite elements
229  * @return Error code
230  */
232 
233  /**
234  * \brief (Testing only) Set finite element to run mass transport problem only
235  * @return Error code
236  */
238 
239  /**
240  * \brief (Testing only) Set finite element to run elastic problem only
241  * @return Error code
242  */
244 
245  /**
246  * \brief Finite elements to calculate tractions
247  * @return Error code
248  */
250 
251  /**
252  * \brief Set problem and DM
253  * @return Error code
254  */
256 
257  /**
258  * \brief Solve problem set up in DM
259  * @return Error code
260  */
262 };
263 
264 /**
265 * Calculate free energy
266 *
267 \f[\psi_{0}=\frac{\mu}{2}\left(\textrm{tr}(\mathbf{C})-3\right)-\mu\ln(J)+\frac{\lambda}{2}\ln^{2}(\ln
268 J) \f]
269 *
270 */
271 template <class B1, class B2, class T>
273  B1 &psi) {
274 
278  const double mu = common_data.mu;
279  const double lambda = common_data.lambda;
280 
281  // Compressible Neo-Hookean
282  B2 det;
284  det = sqrt(det);
285  B2 traceC;
286  traceC = C(I, I);
287  B2 log_det = log(det);
288  psi = 0.5 * mu * (traceC - 3.0) - mu * log_det +
289  0.5 * lambda * log_det * log_det;
290 
291  // St. Venant–Kirchhoff Material
292  // T E;
293  // E(I,J) = C(I,J);
294  // E(0,0) -= 1;
295  // E(1,1) -= 1;
296  // E(2,2) -= 1;
297  // E(I,J) *= 0.5;
298  // B2 traceE = E(I,I);
299  // psi = 0.5*lambda*traceE*traceE+mu*E(I,J)*E(I,J);
300 
302 }
303 
304 template <class B1, class T>
306  T &dC, B1 &psi) {
307 
311  trace_on(common_data.tAg, common_data.kEep);
312  common_data.aC(I, J) <<= dC(I, J); // Set independent variables
313  CHKERR freeEnergy<adouble, adouble, FTensor::Tensor2_symmetric<adouble, 3>>(
314  common_data, common_data.aC, common_data.aPsi);
315  double psi_val;
316  common_data.aPsi >>= psi_val; // Set dependent variables
317  psi = psi_val;
318  trace_off();
320 }
321 /**
322  * \brief Evaluate density derivative with respect to time
323  in case of Backward Euler Method
324  \f[
325  \frac{\partial \rho}{\partial t} = \frac{\rho_{n+1} - \rho_{n}}{\Delta t}
326  \f]
327  The density within a finite element is approximated directly as
328  \f[
329  \rho = N r
330  \f]
331  */
334 
336 
338 
339  MoFEMErrorCode doWork(int side, EntityType type,
341 };
342 
343 /**
344  * \brief Evaluate physical equations at integration points.
345 
346  \f[
347  F_{ij}=u_{i,j}+\delta_{ij} \\
348  C_{ij}=F_{k,i}F_{k,j} \\
349  P_{ij}=F_{i,k}S_{k,j} \\
350  \psi_{0}=\frac{\mu}{2}\left[\textrm{tr}(C)-3\right]-\mu\ln(\sqrt{\det
351  C})+\frac{\lambda}{2}\ln^{2}(\sqrt{\det C}) \\
352  R=c\left[\left[\frac{\rho}{\rho_0}\right]^{-m}\Psi-\Psi_0\right] \\
353  \f]
354 
355  */
358 
361 
363 
364  MoFEMErrorCode doWork(int side, EntityType type,
366 };
367 
368 /**
369  * \brief Used to post proc stresses, energy, source term.
370  *
371  * calculation of principal stresses. for e.g.
372  *
373  */
376 
379  std::vector<EntityHandle> &mapGaussPts;
380 
381  OpPostProcStress(moab::Interface &post_proc_mesh,
382  std::vector<EntityHandle> &map_gauss_pts,
383  Remodeling::CommonData &common_data);
384 
385  MoFEMErrorCode doWork(int side, EntityType type,
387 };
388 
389 /**
390  * Evaluate tangent material matrix
391 
392  \f[
393  C_{IJ} = F_{iI}F_{iJ}\\
394  P_{iI} = F_{iI}S_{IJ}(\mathbf{C})\\
395  \delta \Psi = \delta v_{iI}P_{iI} = \delta v_{iJ} F_{iI}S_{IJ}\\
396  D_{iJkL} \delta u_{k,L} = S_{IJ}F_{iI,kL} \delta u_{k,L} +
397  F_{iI}S_{IJ,KL}F_{kL}\delta u_{k,L}\\
398  D_{iJkL} \delta u_{k,L} = S_{IJ}\delta_{ik}\delta_{IL} \delta u_{k,L} +
399  F_{iI}S_{IJ,KL}F_{kL}\delta u_{k,L}\\
400  D_{iJkL} \delta u_{k,L} = \left( S_{IJ}\delta_{ik}\delta_{IL} +
401  F_{iI}S_{IJ,KL}F_{kL} \right)\delta u_{k,L}\\ \f]
402 
403  */
406 
408 
410 
411  MoFEMErrorCode doWork(int side, EntityType type,
413 };
414 
417 
420 
422 
423  MoFEMErrorCode doWork(int side, EntityType type,
425 };
426 // TODO correct equations in documentation
427 /**
428  * \brief Assemble residual for conservation of momentum (stresses)
429  *
430  \f[
431  R^{\phi}=\intop_{V}\left[\frac{\rho_{0}}{\rho_{0}^{\ast}}\right]^{n}
432  \mathbf{P}_{ij}\nabla N_{j}\,dV
433  \f]
434  */
437 
439  VectorDouble nF; ///< Vector of the right hand side (internal forces)
440 
442 
443  MoFEMErrorCode doWork(int side, EntityType type,
445 };
446 
447 /**
448  * \brief Assemble residual for conservation of mass (density)
449  \f[
450  R^{\rho}=\intop_{V}N\frac{\partial\rho}{\partial t}-N\mathbf{R}-R_{0}\nabla
451  N\nabla\rho\,dV \f]
452  */
455 
457  VectorDouble nF; ///< Vector of the right hand side (internal forces)
458 
460 
461  MoFEMErrorCode doWork(int side, EntityType type,
463 };
464 
465 /**
466  * \brief Diagonal block of tangent matrix \f$K_{\rho\rho}\f$
467  \f[
468  K^{\rho \rho}=\intop_{V} \Delta t N_i N_j - R_0 \nabla N_i \nabla N_j -c
469  \frac{n-m}{\rho_0}\left[\frac{\rho_{0}}{\rho_{0}^{\ast}}\right]^{n-m} \psi_0
470  N_i N_j \,dV \f]
471  */
474 
478 
480 
481  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
482  EntityType col_type,
485 };
486 
487 /**
488  * \brief Off diagonal block of tangent matrix \f$K_{\rho u}\f$
489  \f[
490  K_{\rho u}=-\intop_{V} c \left[\frac{\rho_{0}}{\rho_{0}^{\ast}}\right]^{n-m}
491  \nabla N_j P_{ij} N_i \,dV \f]
492  */
495 
498 
500  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
501  EntityType col_type,
504 };
505 
506 /**
507  * \brief Off diagonal block of tangent matrix \f$K_{u u}\f$
508  \f[
509  K_{u u}=\left[\frac{\rho_{0}}{\rho_{0}^{\ast}}\right]^{n} \nabla N_j
510  D_{ijkl}\nabla N_l S_{jl} \f]
511  */
512 template <bool ADOLC>
515 
520 
522 
523  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
524  EntityType col_type,
527 };
528 
529 /**
530  * \brief Off diagonal block of tangent matrix \f$K_{u \rho}\f$
531 /f[
532  K_{u \rho}=\intop_{V} \left[\frac{n}{\rho_{0}}\right]
533 \left[\frac{\rho_{0}}{\rho_{0}^{\ast}}\right]^{n} \nabla N_j P_{ij} N_i \,dV
534  /f]
535  */
538 
541 
543 
544  MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
545  EntityType col_type,
548 };
549 
550 /**
551  * Element used to post-process results at each time step
552  */
553 struct MonitorPostProc : public FEMethod {
554 
559  // DensityMapFe densityMaps;
560  PetscBool mass_postproc;
561  PetscBool equilibrium_flg;
562  double rate;
563  bool iNit;
564  int pRT;
565 
567  Remodeling::CommonData &common_data);
568 
572 };
573 
574 /**
575  * Operator used to calculate potential energy at each time step, for
576  * postprocessing
577  */
580 
584 
586  Remodeling::CommonData &common_data,
587  Vec energy_vec, Vec mass_vec)
588  : MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator(
590  energVec(energy_vec), massVec(mass_vec), commonData(common_data) {}
591 
592  MoFEMErrorCode doWork(int row_side, EntityType row_type,
594 };
595 
596 } // namespace BoneRemodeling
597 
598 #endif //__REMODELING_HPP__
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
BoneRemodeling::OpAssmbleRhoLhs_dRho::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Definition: Remodeling.cpp:969
BoneRemodeling::Remodeling::CommonData::kEep
const int kEep
Definition: Remodeling.hpp:179
BoneRemodeling::OpAssmbleStressRhs::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:820
MoFEM::VolumeElementForcesAndSourcesCore::VolumeElementForcesAndSourcesCore
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)
Definition: VolumeElementForcesAndSourcesCore.cpp:9
BoneRemodeling::OpAssmbleStressLhs_dRho::OpAssmbleStressLhs_dRho
OpAssmbleStressLhs_dRho(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:1307
BoneRemodeling::Remodeling::CommonData::nOremodellingBlock
bool nOremodellingBlock
Definition: Remodeling.hpp:164
BoneRemodeling::Remodeling::buildDM
MoFEMErrorCode buildDM()
Set problem and DM.
Definition: Remodeling.cpp:1832
BoneRemodeling::Remodeling::addFields
MoFEMErrorCode addFields()
Set and add entities to approximation fields.
Definition: Remodeling.cpp:1607
BoneRemodeling::Remodeling::mField
MoFEM::Interface & mField
Definition: Remodeling.hpp:206
BoneRemodeling::Remodeling::CommonData::feRhs
boost::shared_ptr< Fe > feRhs
FE to make right hand side.
Definition: Remodeling.hpp:131
BoneRemodeling::OpGetRhoTimeDirevative::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:239
BoneRemodeling::Remodeling::CommonData::ts
TS ts
Time solver.
Definition: Remodeling.hpp:128
BoneRemodeling::Remodeling::CommonData::DataContainers::vecDetF
VectorDouble vecDetF
determinant of F
Definition: Remodeling.hpp:200
BoneRemodeling::Remodeling::CommonData::neumannForces
boost::ptr_map< string, NeummanForcesSurface > neumannForces
Forces on surface.
Definition: Remodeling.hpp:136
BoneRemodeling::Remodeling::CommonData::n
double n
porosity exponent [-]
Definition: Remodeling.hpp:148
BoneRemodeling::MonitorPostProc::mass_postproc
PetscBool mass_postproc
Definition: Remodeling.hpp:560
BoneRemodeling::Remodeling::FePrePostProcessRhs::postProcess
MoFEMErrorCode postProcess()
Definition: Remodeling.hpp:69
BoneRemodeling::OpAssmbleRhoRhs::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:889
BoneRemodeling::OpAssmbleStressRhs::nF
VectorDouble nF
Vector of the right hand side (internal forces)
Definition: Remodeling.hpp:439
BoneRemodeling::OpCalculateStressTangent::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:732
BoneRemodeling::Remodeling::CommonData::dm_name
DMType dm_name
dm (problem) name
Definition: Remodeling.hpp:126
BoneRemodeling::OpAssmbleRhoLhs_dF::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:496
rho
double rho
Definition: plastic.cpp:140
BoneRemodeling::MonitorPostProc::operator()
MoFEMErrorCode operator()()
Definition: Remodeling.cpp:1399
BoneRemodeling::OpAssmbleStressLhs_dF::transLocK_P_F
MatrixDouble transLocK_P_F
Definition: Remodeling.hpp:518
BoneRemodeling::Remodeling::CommonData::nodalForces
boost::ptr_map< string, NodalForce > nodalForces
Nodal forces.
Definition: Remodeling.hpp:137
BoneRemodeling::OpAssmbleRhoLhs_dRho
Diagonal block of tangent matrix .
Definition: Remodeling.hpp:472
BoneRemodeling::OpAssmbleRhoLhs_dF::locK_rho_F
MatrixDouble locK_rho_F
Definition: Remodeling.hpp:497
BoneRemodeling::OpMassAndEnergyCalculation::energVec
Vec energVec
Definition: Remodeling.hpp:581
BoneRemodeling::Remodeling::CommonData::CommonData
CommonData()
Definition: Remodeling.hpp:181
BoneRemodeling::Remodeling
Implementation of bone remodeling finite element.
Definition: Remodeling.hpp:36
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
BoneRemodeling::Remodeling::CommonData::rHo_ref
double rHo_ref
reference density
Definition: Remodeling.hpp:150
BoneRemodeling::Remodeling::Fe::Fe
Fe(MoFEM::Interface &m_field)
Definition: Remodeling.hpp:42
BoneRemodeling::OpAssmbleStressLhs_dF
Off diagonal block of tangent matrix .
Definition: Remodeling.hpp:513
BoneRemodeling::OpPostProcStress::postProcMesh
moab::Interface & postProcMesh
Definition: Remodeling.hpp:378
BoneRemodeling::OpAssmbleRhoLhs_dRho::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:475
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::DataContainers::vecR
VectorDouble vecR
Mass sorce.
Definition: Remodeling.hpp:192
BoneRemodeling::freeEnergy
MoFEMErrorCode freeEnergy(Remodeling::CommonData &common_data, T &C, B1 &psi)
Definition: Remodeling.hpp:272
BoneRemodeling::Remodeling::CommonData::DataContainers
Definition: Remodeling.hpp:183
BoneRemodeling::Remodeling::CommonData::aC
FTensor::Tensor2_symmetric< adouble, 3 > aC
right Cauchy-Green deformation tensor
Definition: Remodeling.hpp:173
BoneRemodeling::OpMassAndEnergyCalculation::massVec
Vec massVec
Definition: Remodeling.hpp:582
BoneRemodeling::Remodeling::CommonData::rHo_min
double rHo_min
min density
Definition: Remodeling.hpp:152
J
FTensor::Index< 'J', DIM1 > J
Definition: level_set.cpp:30
BoneRemodeling::OpAssmbleRhoLhs_dRho::OpAssmbleRhoLhs_dRho
OpAssmbleRhoLhs_dRho(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:961
FTensor::Tensor2_symmetric< adouble, 3 >
BoneRemodeling::Remodeling::CommonData::DataContainers::rhoPtr
boost::shared_ptr< VectorDouble > rhoPtr
Ptr to density matrix container.
Definition: Remodeling.hpp:187
BoneRemodeling::OpCalculateStressTangent::OpCalculateStressTangent
OpCalculateStressTangent(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:717
ts_ctx
MoFEM::TsCtx * ts_ctx
Definition: level_set.cpp:1932
BoneRemodeling::MonitorPostProc::preProcess
MoFEMErrorCode preProcess()
Definition: Remodeling.cpp:1394
BoneRemodeling::Remodeling::CommonData::lambda
double lambda
Lame parameter.
Definition: Remodeling.hpp:144
FTensor::Tensor2< double, 3, 3 >
BoneRemodeling::OpCalculateStressTangentWithAdolc::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:396
order
constexpr int order
Definition: dg_projection.cpp:18
BoneRemodeling::OpGetRhoTimeDirevative::OpGetRhoTimeDirevative
OpGetRhoTimeDirevative(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:232
BoneRemodeling::Remodeling::CommonData::DataContainers::gradDispPtr
boost::shared_ptr< MatrixDouble > gradDispPtr
Ptr to gradient of displacements matrix container.
Definition: Remodeling.hpp:185
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
BoneRemodeling::OpMassAndEnergyCalculation::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:583
BoneRemodeling::OpAssmbleRhoRhs
Assemble residual for conservation of mass (density)
Definition: Remodeling.hpp:453
BoneRemodeling::Remodeling::FePrePostProcessLhs::preProcess
MoFEMErrorCode preProcess()
Definition: Remodeling.hpp:81
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
BoneRemodeling::MonitorPostProc
Definition: Remodeling.hpp:553
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
FEMethod
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
BoneRemodeling::recordFreeEnergy_dC
MoFEMErrorCode recordFreeEnergy_dC(Remodeling::CommonData &common_data, T &dC, B1 &psi)
Definition: Remodeling.hpp:305
BoneRemodeling::Remodeling::CommonData::tEts_block
Range tEts_block
Definition: Remodeling.hpp:166
BoneRemodeling::OpCalculateStress::vecC
VectorDouble vecC
Definition: Remodeling.hpp:360
BoneRemodeling::OpCalculateStressTangent::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:407
BoneRemodeling::MonitorPostProc::MonitorPostProc
MonitorPostProc(MoFEM::Interface &m_field, Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:1387
BoneRemodeling::Remodeling::CommonData::bitLevel
BitRefLevel bitLevel
Definition: Remodeling.hpp:123
BoneRemodeling::Remodeling::getParameters
MoFEMErrorCode getParameters()
Get parameters form line command or config file.
Definition: Remodeling.cpp:1579
BoneRemodeling::OpAssmbleRhoLhs_dRho::transLocK_rho_rho
MatrixDouble transLocK_rho_rho
Definition: Remodeling.hpp:477
BoneRemodeling::OpCalculateStressTangentWithAdolc
Definition: Remodeling.hpp:415
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
BoneRemodeling::OpCalculateStress::OpCalculateStress
OpCalculateStress(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:280
BoneRemodeling::Remodeling::CommonData::mu
double mu
Lame parameter.
Definition: Remodeling.hpp:145
BoneRemodeling::Remodeling::CommonData::D
Vec D
Definition: Remodeling.hpp:120
BoneRemodeling::OpAssmbleRhoLhs_dRho::locK_rho_rho
MatrixDouble locK_rho_rho
Definition: Remodeling.hpp:476
BoneRemodeling::Remodeling::CommonData::is_atom_testing
PetscBool is_atom_testing
for atom tests
Definition: Remodeling.hpp:162
BoneRemodeling::MonitorPostProc::postProcElastic
PostProcVolumeOnRefinedMesh postProcElastic
Definition: Remodeling.hpp:558
BoneRemodeling::Remodeling::CommonData::elasticPtr
boost::shared_ptr< NonlinearElasticElement > elasticPtr
Definition: Remodeling.hpp:140
BoneRemodeling::OpAssmbleRhoRhs::OpAssmbleRhoRhs
OpAssmbleRhoRhs(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:883
BoneRemodeling::OpAssmbleStressLhs_dF::locK_P_F
MatrixDouble locK_P_F
Definition: Remodeling.hpp:517
MoFEM::ForcesAndSourcesCore::UserDataOperator
Definition: ForcesAndSourcesCore.hpp:549
BoneRemodeling::OpCalculateStressTangentWithAdolc::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:418
BoneRemodeling::Remodeling::CommonData::b
int b
b exponent for bell function
Definition: Remodeling.hpp:153
BoneRemodeling::Remodeling::addElementsTestingElasticty
MoFEMErrorCode addElementsTestingElasticty()
(Testing only) Set finite element to run elastic problem only
BoneRemodeling::MonitorPostProc::equilibrium_flg
PetscBool equilibrium_flg
Definition: Remodeling.hpp:561
BoneRemodeling::Remodeling::CommonData::DataContainers::gradRhoPtr
boost::shared_ptr< MatrixDouble > gradRhoPtr
Gradient of density field.
Definition: Remodeling.hpp:188
convert.type
type
Definition: convert.py:64
BoneRemodeling::Remodeling::FePrePostProcessRhs::preProcess
MoFEMErrorCode preProcess()
Definition: Remodeling.hpp:55
BoneRemodeling::OpAssmbleRhoLhs_dF
Off diagonal block of tangent matrix .
Definition: Remodeling.hpp:493
BoneRemodeling::Remodeling::Remodeling
Remodeling(MoFEM::Interface &m_field, CommonData &common_data)
Definition: Remodeling.hpp:209
BoneRemodeling::MonitorPostProc::postProcess
MoFEMErrorCode postProcess()
Definition: Remodeling.cpp:1404
BoneRemodeling::Remodeling::CommonData::edgeForces
boost::ptr_map< string, EdgeForce > edgeForces
Forces on edges.
Definition: Remodeling.hpp:138
BoneRemodeling
Definition: DensityMaps.hpp:27
BoneRemodeling::Remodeling::CommonData::DataContainers::vecPsi
VectorDouble vecPsi
Elastic energy density.
Definition: Remodeling.hpp:189
BoneRemodeling::MonitorPostProc::rate
double rate
Definition: Remodeling.hpp:562
BoneRemodeling::MonitorPostProc::pRT
int pRT
Definition: Remodeling.hpp:564
BoneRemodeling::Remodeling::CommonData::F
Vec F
Definition: Remodeling.hpp:120
BoneRemodeling::Remodeling::Fe
Volume finite element.
Definition: Remodeling.hpp:41
BoneRemodeling::Remodeling::FePrePostProcessRhs
Not used at this stage. Could be used to do some calculations, before assembly of local elements.
Definition: Remodeling.hpp:53
BoneRemodeling::OpAssmbleStressRhs::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:438
BoneRemodeling::Remodeling::addMomentumFluxes
MoFEMErrorCode addMomentumFluxes()
Finite elements to calculate tractions.
Definition: Remodeling.cpp:1792
BoneRemodeling::Remodeling::CommonData::getCFromDensity
double getCFromDensity(const double &rho)
Definition: Remodeling.cpp:218
BoneRemodeling::OpAssmbleStressRhs
Assemble residual for conservation of momentum (stresses)
Definition: Remodeling.hpp:435
BoneRemodeling::Remodeling::commonData
CommonData & commonData
Definition: Remodeling.hpp:207
BoneRemodeling::Remodeling::CommonData::DataContainers::matGradientOfDeformation
MatrixDouble matGradientOfDeformation
Gradient of deformation.
Definition: Remodeling.hpp:198
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
BoneRemodeling::OpCalculateStress::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:294
BoneRemodeling::OpAssmbleStressLhs_dRho::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:539
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
Definition: VolumeElementForcesAndSourcesCore.hpp:108
BoneRemodeling::OpAssmbleStressLhs_dF::diffDiff
FTensor::Tensor2< double, 3, 3 > diffDiff
Definition: Remodeling.hpp:519
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
BoneRemodeling::OpAssmbleStressRhs::OpAssmbleStressRhs
OpAssmbleStressRhs(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:814
BoneRemodeling::OpCalculateStress
Evaluate physical equations at integration points.
Definition: Remodeling.hpp:356
MoFEM::determinantTensor3by3
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:1540
BoneRemodeling::OpCalculateStressTangentWithAdolc::OpCalculateStressTangentWithAdolc
OpCalculateStressTangentWithAdolc(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:382
BoneRemodeling::Remodeling::solveDM
MoFEMErrorCode solveDM()
Solve problem set up in DM.
Definition: Remodeling.cpp:1863
Range
BoneRemodeling::OpMassAndEnergyCalculation::OpMassAndEnergyCalculation
OpMassAndEnergyCalculation(const string &field_name, Remodeling::CommonData &common_data, Vec energy_vec, Vec mass_vec)
Definition: Remodeling.hpp:585
BoneRemodeling::OpGetRhoTimeDirevative
Evaluate density derivative with respect to time in case of Backward Euler Method.
Definition: Remodeling.hpp:332
adouble
BoneRemodeling::Remodeling::CommonData::DataContainers::matPushedMaterialTangent
MatrixDouble matPushedMaterialTangent
Definition: Remodeling.hpp:196
BoneRemodeling::OpAssmbleStressLhs_dRho::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Definition: Remodeling.cpp:1316
BoneRemodeling::OpCalculateStress::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:359
BoneRemodeling::Remodeling::CommonData::pSi_ref
double pSi_ref
reference free energy
Definition: Remodeling.hpp:154
BoneRemodeling::Remodeling::CommonData::feLhs
boost::shared_ptr< Fe > feLhs
FE to make left hand side.
Definition: Remodeling.hpp:130
BoneRemodeling::OpPostProcStress::mapGaussPts
std::vector< EntityHandle > & mapGaussPts
Definition: Remodeling.hpp:379
BoneRemodeling::Remodeling::CommonData::R0
double R0
mass conduction coefficient
Definition: Remodeling.hpp:155
BoneRemodeling::Remodeling::CommonData
Definition: Remodeling.hpp:117
BoneRemodeling::OpAssmbleStressLhs_dRho
Off diagonal block of tangent matrix /f[ K_{u \rho}=\intop_{V} \left[\frac{n}{\rho_{0}}\right] \left...
Definition: Remodeling.hpp:536
PostProcVolumeOnRefinedMesh
Post processing.
Definition: PostProcOnRefMesh.hpp:955
BoneRemodeling::Remodeling::addElements
MoFEMErrorCode addElements()
Set and add finite elements.
Definition: Remodeling.cpp:1694
BoneRemodeling::MonitorPostProc::postProc
PostProcVolumeOnRefinedMesh postProc
Definition: Remodeling.hpp:557
BoneRemodeling::MonitorPostProc::iNit
bool iNit
Definition: Remodeling.hpp:563
BoneRemodeling::MonitorPostProc::mField
MoFEM::Interface & mField
Definition: Remodeling.hpp:555
BoneRemodeling::Remodeling::CommonData::DataContainers::matP
MatrixDouble matP
1st Piola stress
Definition: Remodeling.hpp:191
BoneRemodeling::Remodeling::CommonData::elasticMaterialsPtr
boost::shared_ptr< ElasticMaterials > elasticMaterialsPtr
Definition: Remodeling.hpp:141
BoneRemodeling::Remodeling::CommonData::getCFromDensityDiff
double getCFromDensityDiff(const double &rho)
Definition: Remodeling.cpp:225
BoneRemodeling::Remodeling::Fe::getRule
int getRule(int order)
Set integrate rule.
Definition: Remodeling.hpp:46
BoneRemodeling::Remodeling::CommonData::getParameters
MoFEMErrorCode getParameters()
Definition: Remodeling.cpp:62
BoneRemodeling::Remodeling::CommonData::oRder
int oRder
Definition: Remodeling.hpp:122
BoneRemodeling::Remodeling::CommonData::dm
DM dm
Discretization manager.
Definition: Remodeling.hpp:127
BoneRemodeling::Remodeling::CommonData::tEts_all
Range tEts_all
Definition: Remodeling.hpp:165
mu
double mu
Definition: dynamic_first_order_con_law.cpp:98
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
BoneRemodeling::OpMassAndEnergyCalculation::doWork
MoFEMErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSourcesCore::EntData &row_data)
Definition: Remodeling.cpp:1947
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
BoneRemodeling::OpAssmbleRhoRhs::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:456
BoneRemodeling::Remodeling::CommonData::DataContainers::matInvF
MatrixDouble matInvF
inverse of deformation gradient
Definition: Remodeling.hpp:199
BoneRemodeling::Remodeling::CommonData::m
double m
algorithmic exponent [-]
Definition: Remodeling.hpp:147
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
BoneRemodeling::OpPostProcStress::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:377
BoneRemodeling::OpCalculateStressTangentWithAdolc::vecC
VectorDouble vecC
Definition: Remodeling.hpp:419
BoneRemodeling::OpAssmbleRhoLhs_dF::OpAssmbleRhoLhs_dF
OpAssmbleRhoLhs_dF(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:1066
BoneRemodeling::Remodeling::CommonData::A
Mat A
Definition: Remodeling.hpp:119
BoneRemodeling::Remodeling::CommonData::DataContainers::matS
MatrixDouble matS
2nd Piola stress
Definition: Remodeling.hpp:190
BoneRemodeling::Remodeling::CommonData::tAg
const int tAg
Definition: Remodeling.hpp:178
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
BoneRemodeling::Remodeling::CommonData::DataContainers::vecRhoDt
VectorDouble vecRhoDt
Time derivative of density.
Definition: Remodeling.hpp:201
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
BoneRemodeling::Remodeling::CommonData::DataContainers::matMaterialTangent
MatrixDouble matMaterialTangent
Definition: Remodeling.hpp:193
BoneRemodeling::OpAssmbleStressLhs_dF::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Definition: Remodeling.cpp:1153
BoneRemodeling::OpPostProcStress::doWork
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Definition: Remodeling.cpp:567
BoneRemodeling::Remodeling::CommonData::aPsi
adouble aPsi
Definition: Remodeling.hpp:174
BoneRemodeling::OpAssmbleStressLhs_dF::OpAssmbleStressLhs_dF
OpAssmbleStressLhs_dF(Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:1145
BoneRemodeling::Remodeling::FePrePostProcessLhs
Not used at this stage. Could be used to do some calculations, before assembly of local elements.
Definition: Remodeling.hpp:79
BoneRemodeling::Remodeling::CommonData::c
double c
density evolution (growth) velocity [d/m^2]
Definition: Remodeling.hpp:146
BoneRemodeling::Remodeling::CommonData::data
DataContainers data
Definition: Remodeling.hpp:203
BoneRemodeling::OpAssmbleStressLhs_dF::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:516
BoneRemodeling::Remodeling::addElementsTestingDensity
MoFEMErrorCode addElementsTestingDensity()
(Testing only) Set finite element to run mass transport problem only
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
BoneRemodeling::OpGetRhoTimeDirevative::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:335
BoneRemodeling::OpMassAndEnergyCalculation
Definition: Remodeling.hpp:578
BoneRemodeling::OpAssmbleStressLhs_dRho::locK_P_RHO
MatrixDouble locK_P_RHO
Definition: Remodeling.hpp:540
BoneRemodeling::Remodeling::CommonData::preProcLhs
boost::shared_ptr< FePrePostProcessLhs > preProcLhs
Definition: Remodeling.hpp:133
BoneRemodeling::Remodeling::FePrePostProcessLhs::postProcess
MoFEMErrorCode postProcess()
Definition: Remodeling.hpp:96
BoneRemodeling::OpAssmbleRhoLhs_dF::doWork
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Definition: Remodeling.cpp:1074
BoneRemodeling::OpAssmbleRhoRhs::nF
VectorDouble nF
Vector of the right hand side (internal forces)
Definition: Remodeling.hpp:457
BoneRemodeling::OpPostProcStress::OpPostProcStress
OpPostProcStress(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, Remodeling::CommonData &common_data)
Definition: Remodeling.cpp:550
BoneRemodeling::MonitorPostProc::commonData
Remodeling::CommonData & commonData
Definition: Remodeling.hpp:556
BoneRemodeling::OpPostProcStress
Used to post proc stresses, energy, source term.
Definition: Remodeling.hpp:374
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
BoneRemodeling::Remodeling::CommonData::preProcRhs
boost::shared_ptr< FePrePostProcessRhs > preProcRhs
Definition: Remodeling.hpp:132
MoFEM::ForcesAndSourcesCore::UserDataOperator::OPROW
@ OPROW
operator doWork function is executed on FE rows
Definition: ForcesAndSourcesCore.hpp:567
BoneRemodeling::OpCalculateStressTangent
Definition: Remodeling.hpp:404