|
| v0.14.0
|
Implementation of element for bone remodeling
#ifndef __REMODELING_HPP__
#define __REMODELING_HPP__
struct Remodeling {
};
struct FePrePostProcessRhs :
public FEMethod {
case CTX_TSSETIFUNCTION: {
snes_ctx = CTX_SNESSETFUNCTION;
snes_f = ts_F;
break;
}
default:
break;
}
}
}
};
struct FePrePostProcessLhs :
public FEMethod {
case CTX_TSSETIJACOBIAN: {
snes_ctx = CTX_SNESSETJACOBIAN;
snes_B = ts_B;
break;
}
default:
break;
}
}
}
};
boost::shared_ptr<Fe>
feLhs;
boost::shared_ptr<Fe>
feRhs;
boost::shared_ptr<FePrePostProcessRhs>
preProcRhs;
boost::shared_ptr<FePrePostProcessLhs>
preProcLhs;
boost::ptr_map<string, NeummanForcesSurface>
boost::shared_ptr<NonlinearElasticElement>
elasticPtr;
double
double
struct DataContainers {
boost::shared_ptr<MatrixDouble>
boost::shared_ptr<VectorDouble>
};
};
};
template <class B1, class B2, class T>
B1 &psi) {
const double mu = common_data.mu;
const double lambda = common_data.lambda;
B2 det;
det = sqrt(det);
B2 traceC;
B2 log_det = log(det);
psi = 0.5 *
mu * (traceC - 3.0) -
mu * log_det +
0.5 *
lambda * log_det * log_det;
}
template <class B1, class T>
T &dC, B1 &psi) {
trace_on(common_data.tAg, common_data.kEep);
common_data.aC(
I,
J) <<= dC(
I,
J);
CHKERR freeEnergy<adouble, adouble, FTensor::Tensor2_symmetric<adouble, 3>>(
common_data, common_data.aC, common_data.aPsi);
double psi_val;
common_data.aPsi >>= psi_val;
psi = psi_val;
trace_off();
}
struct OpGetRhoTimeDirevative
};
};
std::vector<EntityHandle> &map_gauss_pts,
Remodeling::CommonData &common_data);
};
struct OpCalculateStressTangent
};
struct OpCalculateStressTangentWithAdolc
};
struct OpAssmbleStressRhs
};
struct OpAssmbleRhoRhs
};
struct OpAssmbleRhoLhs_dRho
EntityType col_type,
};
struct OpAssmbleRhoLhs_dF
EntityType col_type,
};
template <bool ADOLC>
struct OpAssmbleStressLhs_dF
EntityType col_type,
};
struct OpAssmbleStressLhs_dRho
EntityType col_type,
};
Remodeling::CommonData &common_data);
};
struct OpMassAndEnergyCalculation
Remodeling::CommonData &common_data,
};
}
#endif //__REMODELING_HPP__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
OpAssmbleStressLhs_dRho(Remodeling::CommonData &common_data)
MoFEMErrorCode buildDM()
Set problem and DM.
MoFEMErrorCode addFields()
Set and add entities to approximation fields.
MoFEM::Interface & mField
boost::shared_ptr< Fe > feRhs
FE to make right hand side.
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
VectorDouble vecDetF
determinant of F
boost::ptr_map< string, NeummanForcesSurface > neumannForces
Forces on surface.
double n
porosity exponent [-]
MoFEMErrorCode postProcess()
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
VectorDouble nF
Vector of the right hand side (internal forces)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
DMType dm_name
dm (problem) name
Remodeling::CommonData & commonData
MoFEMErrorCode operator()()
MatrixDouble transLocK_P_F
boost::ptr_map< string, NodalForce > nodalForces
Nodal forces.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
double rHo_ref
reference density
Fe(MoFEM::Interface &m_field)
moab::Interface & postProcMesh
Remodeling::CommonData & commonData
double cUrrent_psi
current free energy for evaluating equilibrium state
double cUrrent_mass
current free energy for evaluating equilibrium state
double rHo_max
max density
VectorDouble vecR
Mass sorce.
MoFEMErrorCode freeEnergy(Remodeling::CommonData &common_data, T &C, B1 &psi)
FTensor::Tensor2_symmetric< adouble, 3 > aC
right Cauchy-Green deformation tensor
double rHo_min
min density
FTensor::Index< 'J', DIM1 > J
OpAssmbleRhoLhs_dRho(Remodeling::CommonData &common_data)
boost::shared_ptr< VectorDouble > rhoPtr
Ptr to density matrix container.
OpCalculateStressTangent(Remodeling::CommonData &common_data)
MoFEMErrorCode preProcess()
double lambda
Lame parameter.
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
OpGetRhoTimeDirevative(Remodeling::CommonData &common_data)
boost::shared_ptr< MatrixDouble > gradDispPtr
Ptr to gradient of displacements matrix container.
Deprecated interface functions.
Remodeling::CommonData & commonData
MoFEMErrorCode preProcess()
constexpr IntegrationType I
DeprecatedCoreInterface Interface
PetscBool less_post_proc
reduce file size
#define CHKERR
Inline error check.
MoFEMErrorCode recordFreeEnergy_dC(Remodeling::CommonData &common_data, T &dC, B1 &psi)
Remodeling::CommonData & commonData
MonitorPostProc(MoFEM::Interface &m_field, Remodeling::CommonData &common_data)
MoFEMErrorCode getParameters()
Get parameters form line command or config file.
MatrixDouble transLocK_rho_rho
OpCalculateStress(Remodeling::CommonData &common_data)
MatrixDouble locK_rho_rho
PetscBool is_atom_testing
for atom tests
PostProcVolumeOnRefinedMesh postProcElastic
boost::shared_ptr< NonlinearElasticElement > elasticPtr
OpAssmbleRhoRhs(Remodeling::CommonData &common_data)
Remodeling::CommonData & commonData
int b
b exponent for bell function
MoFEMErrorCode addElementsTestingElasticty()
(Testing only) Set finite element to run elastic problem only
PetscBool equilibrium_flg
boost::shared_ptr< MatrixDouble > gradRhoPtr
Gradient of density field.
MoFEMErrorCode preProcess()
Remodeling(MoFEM::Interface &m_field, CommonData &common_data)
MoFEMErrorCode postProcess()
boost::ptr_map< string, EdgeForce > edgeForces
Forces on edges.
friend class UserDataOperator
VectorDouble vecPsi
Elastic energy density.
Remodeling::CommonData & commonData
MoFEMErrorCode addMomentumFluxes()
Finite elements to calculate tractions.
double getCFromDensity(const double &rho)
MatrixDouble matGradientOfDeformation
Gradient of deformation.
Volume finite element base.
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
Remodeling::CommonData & commonData
FTensor::Tensor2< double, 3, 3 > diffDiff
EntitiesFieldData::EntData EntData
constexpr auto field_name
OpAssmbleStressRhs(Remodeling::CommonData &common_data)
static auto determinantTensor3by3(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
OpCalculateStressTangentWithAdolc(Remodeling::CommonData &common_data)
MoFEMErrorCode solveDM()
Solve problem set up in DM.
OpMassAndEnergyCalculation(const string &field_name, Remodeling::CommonData &common_data, Vec energy_vec, Vec mass_vec)
MatrixDouble matPushedMaterialTangent
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
double pSi_ref
reference free energy
boost::shared_ptr< Fe > feLhs
FE to make left hand side.
std::vector< EntityHandle > & mapGaussPts
double R0
mass conduction coefficient
MoFEMErrorCode addElements()
Set and add finite elements.
PostProcVolumeOnRefinedMesh postProc
MoFEM::Interface & mField
MatrixDouble matP
1st Piola stress
boost::shared_ptr< ElasticMaterials > elasticMaterialsPtr
double getCFromDensityDiff(const double &rho)
int getRule(int order)
Set integrate rule.
MoFEMErrorCode getParameters()
DM dm
Discretization manager.
MoFEMErrorCode doWork(int row_side, EntityType row_type, DataForcesAndSourcesCore::EntData &row_data)
const FTensor::Tensor2< T, Dim, Dim > Vec
Remodeling::CommonData & commonData
MatrixDouble matInvF
inverse of deformation gradient
double m
algorithmic exponent [-]
UBlasVector< double > VectorDouble
Remodeling::CommonData & commonData
OpAssmbleRhoLhs_dF(Remodeling::CommonData &common_data)
MatrixDouble matS
2nd Piola stress
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
VectorDouble vecRhoDt
Time derivative of density.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
MatrixDouble matMaterialTangent
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
MoFEMErrorCode doWork(int side, EntityType type, DataForcesAndSourcesCore::EntData &data)
OpAssmbleStressLhs_dF(Remodeling::CommonData &common_data)
double c
density evolution (growth) velocity [d/m^2]
Remodeling::CommonData & commonData
MoFEMErrorCode addElementsTestingDensity()
(Testing only) Set finite element to run mass transport problem only
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Remodeling::CommonData & commonData
boost::shared_ptr< FePrePostProcessLhs > preProcLhs
MoFEMErrorCode postProcess()
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
VectorDouble nF
Vector of the right hand side (internal forces)
OpPostProcStress(moab::Interface &post_proc_mesh, std::vector< EntityHandle > &map_gauss_pts, Remodeling::CommonData &common_data)
Remodeling::CommonData & commonData
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
boost::shared_ptr< FePrePostProcessRhs > preProcRhs
@ OPROW
operator doWork function is executed on FE rows