24#ifndef __REMODELING_HPP__
25#define __REMODELING_HPP__
58 case CTX_TSSETIFUNCTION: {
59 snes_ctx = CTX_SNESSETFUNCTION;
85 case CTX_TSSETIJACOBIAN: {
86 snes_ctx = CTX_SNESSETJACOBIAN;
135 boost::ptr_map<string, NeummanForcesSurface>
184 boost::shared_ptr<MatrixDouble>
186 boost::shared_ptr<VectorDouble>
271template <
class B1,
class B2,
class T>
278 const double mu = common_data.
mu;
283 CHKERR determinantTensor3by3(C, det);
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;
304template <
class B1,
class T>
311 trace_on(common_data.
tAg, common_data.
kEep);
312 common_data.
aC(
I,
J) <<= dC(
I,
J);
313 CHKERR freeEnergy<adouble, adouble, FTensor::Tensor2_symmetric<adouble, 3>>(
314 common_data, common_data.
aC, common_data.
aPsi);
316 common_data.
aPsi >>= psi_val;
340 DataForcesAndSourcesCore::EntData &data);
365 DataForcesAndSourcesCore::EntData &data);
382 std::vector<EntityHandle> &map_gauss_pts,
386 DataForcesAndSourcesCore::EntData &data);
412 DataForcesAndSourcesCore::EntData &data);
424 DataForcesAndSourcesCore::EntData &data);
444 DataForcesAndSourcesCore::EntData &data);
462 DataForcesAndSourcesCore::EntData &data);
483 DataForcesAndSourcesCore::EntData &row_data,
484 DataForcesAndSourcesCore::EntData &col_data);
502 DataForcesAndSourcesCore::EntData &row_data,
503 DataForcesAndSourcesCore::EntData &col_data);
525 DataForcesAndSourcesCore::EntData &row_data,
526 DataForcesAndSourcesCore::EntData &col_data);
546 DataForcesAndSourcesCore::EntData &row_data,
547 DataForcesAndSourcesCore::EntData &col_data);
587 Vec energy_vec, Vec mass_vec)
593 DataForcesAndSourcesCore::EntData &row_data);
ForcesAndSourcesCore::UserDataOperator UserDataOperator
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
MoFEMErrorCode recordFreeEnergy_dC(Remodeling::CommonData &common_data, T &dC, B1 &psi)
MoFEMErrorCode freeEnergy(Remodeling::CommonData &common_data, T &C, B1 &psi)
implementation of Data Operators for Forces and Sources
constexpr IntegrationType I
constexpr auto field_name
Remodeling::CommonData & commonData
MoFEMErrorCode postProcess()
MoFEMErrorCode operator()()
MoFEMErrorCode preProcess()
MoFEM::Interface & mField
PetscBool equilibrium_flg
PostProcVolumeOnRefinedMesh postProcElastic
PostProcVolumeOnRefinedMesh postProc
Off diagonal block of tangent matrix .
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Remodeling::CommonData & commonData
Diagonal block of tangent matrix .
MatrixDouble transLocK_rho_rho
Remodeling::CommonData & commonData
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
MatrixDouble locK_rho_rho
Assemble residual for conservation of mass (density)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
VectorDouble nF
Vector of the right hand side (internal forces)
Remodeling::CommonData & commonData
Off diagonal block of tangent matrix .
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
MatrixDouble transLocK_P_F
FTensor::Tensor2< double, 3, 3 > diffDiff
Remodeling::CommonData & commonData
Off diagonal block of tangent matrix /f[ K_{u \rho}=\intop_{V} \left[\frac{n}{\rho_{0}}\right] \left...
Remodeling::CommonData & commonData
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Assemble residual for conservation of momentum (stresses)
Remodeling::CommonData & commonData
VectorDouble nF
Vector of the right hand side (internal forces)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Evaluate physical equations at integration points.
Remodeling::CommonData & commonData
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Remodeling::CommonData & commonData
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Remodeling::CommonData & commonData
Evaluate density derivative with respect to time in case of Backward Euler Method.
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Remodeling::CommonData & commonData
MoFEMErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSourcesCore::EntData &row_data)
OpMassAndEnergyCalculation(const string &field_name, Remodeling::CommonData &common_data, Vec energy_vec, Vec mass_vec)
Remodeling::CommonData & commonData
Used to post proc stresses, energy, source term.
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Remodeling::CommonData & commonData
moab::Interface & postProcMesh
std::vector< EntityHandle > & mapGaussPts
VectorDouble vecDetF
determinant of F
VectorDouble vecPsi
Elastic energy density.
VectorDouble vecR
Mass sorce.
boost::shared_ptr< MatrixDouble > gradDispPtr
Ptr to gradient of displacements matrix container.
boost::shared_ptr< VectorDouble > rhoPtr
Ptr to density matrix container.
MatrixDouble matPushedMaterialTangent
MatrixDouble matP
1st Piola stress
MatrixDouble matS
2nd Piola stress
boost::shared_ptr< MatrixDouble > gradRhoPtr
Gradient of density field.
MatrixDouble matMaterialTangent
MatrixDouble matInvF
inverse of deformation gradient
VectorDouble vecRhoDt
Time derivative of density.
MatrixDouble matGradientOfDeformation
Gradient of deformation.
boost::shared_ptr< FePrePostProcessRhs > preProcRhs
double getCFromDensity(const double &rho)
double pSi_ref
reference free energy
boost::shared_ptr< Fe > feLhs
FE to make left hand side.
double n
porosity exponent [-]
FTensor::Tensor2_symmetric< adouble, 3 > aC
right Cauchy-Green deformation tensor
int b
b exponent for bell function
double getCFromDensityDiff(const double &rho)
double m
algorithmic exponent [-]
DMType dm_name
dm (problem) name
boost::shared_ptr< Fe > feRhs
FE to make right hand side.
PetscBool is_atom_testing
for atom tests
double c
density evolution (growth) velocity [d/m^2]
boost::ptr_map< string, NeummanForcesSurface > neumannForces
Forces on surface.
MoFEMErrorCode getParameters()
boost::ptr_map< string, EdgeForce > edgeForces
Forces on edges.
double rHo_max
max density
PetscBool less_post_proc
reduce file size
DM dm
Discretization manager.
boost::shared_ptr< ElasticMaterials > elasticMaterialsPtr
boost::shared_ptr< FePrePostProcessLhs > preProcLhs
boost::ptr_map< string, NodalForce > nodalForces
Nodal forces.
double rHo_min
min density
double rHo_ref
reference density
double lambda
Lame parameter.
double R0
mass conduction coefficient
double cUrrent_psi
current free energy for evaluating equilibrium state
boost::shared_ptr< NonlinearElasticElement > elasticPtr
double cUrrent_mass
current free energy for evaluating equilibrium state
int getRule(int order)
Set integrate rule.
Fe(MoFEM::Interface &m_field)
Not used at this stage. Could be used to do some calculations, before assembly of local elements.
MoFEMErrorCode postProcess()
MoFEMErrorCode preProcess()
Not used at this stage. Could be used to do some calculations, before assembly of local elements.
MoFEMErrorCode postProcess()
MoFEMErrorCode preProcess()
Implementation of bone remodeling finite element.
MoFEMErrorCode addElementsTestingDensity()
(Testing only) Set finite element to run mass transport problem only
MoFEM::Interface & mField
MoFEMErrorCode addElements()
Set and add finite elements.
MoFEMErrorCode solveDM()
Solve problem set up in DM.
MoFEMErrorCode buildDM()
Set problem and DM.
MoFEMErrorCode getParameters()
Get parameters form line command or config file.
MoFEMErrorCode addElementsTestingElasticty()
(Testing only) Set finite element to run elastic problem only
Remodeling(MoFEM::Interface &m_field, CommonData &common_data)
MoFEMErrorCode addFields()
Set and add entities to approximation fields.
MoFEMErrorCode addMomentumFluxes()
Finite elements to calculate tractions.
Deprecated interface functions.
@ OPROW
operator doWork function is executed on FE rows
Volume finite element base.
VolumeElementForcesAndSourcesCore(Interface &m_field, const EntityType type=MBTET)