v0.15.0
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHHencky:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky:
[legend]

Classes

struct  BlockData
 
struct  OpCalculateEnergy
 Calculate energy density for Hencky material model. More...
 
struct  OpCalculateStretchFromStress
 
struct  OpHenckyJacobian
 
struct  OpSpatialPhysical
 
struct  OpSpatialPhysical_du_du
 
struct  OpSpatialPhysicalExternalStrain
 

Public Member Functions

 HMHHencky (MoFEM::Interface &m_field, const double E, const double nu)
 
MoFEMErrorCode recordTape (const int tag, DTensor2Ptr *t_h)
 
virtual UserDataOperatorreturnOpJacobian (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
virtual VolUserDataOperatorreturnOpSpatialPhysical (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
 
virtual VolUserDataOperatorreturnOpSpatialPhysicalExternalStrain (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
 
VolUserDataOperatorreturnOpSpatialPhysical_du_du (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
 
VolUserDataOperatorreturnOpCalculateEnergy (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
 
VolUserDataOperatorreturnOpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
VolUserDataOperatorreturnOpCalculateVarStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode getOptions (boost::shared_ptr< DataAtIntegrationPts > data_ptr)
 
MoFEMErrorCode extractBlockData (Sev sev)
 
MoFEMErrorCode extractBlockData (std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
 
MoFEMErrorCode getMatDPtr (boost::shared_ptr< MatrixDouble > mat_D_ptr, boost::shared_ptr< MatrixDouble > mat_axiator_D_ptr, boost::shared_ptr< MatrixDouble > mat_deviator_D_ptr, double bulk_modulus_K, double shear_modulus_G)
 
MoFEMErrorCode getInvMatDPtr (boost::shared_ptr< MatrixDouble > mat_inv_D_ptr, double bulk_modulus_K, double shear_modulus_G)
 
- Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (const int size_active, const int size_dependent)
 
virtual ~PhysicalEquations ()=default
 
virtual VolUserDataOperatorreturnOpSetScale (boost::shared_ptr< double > scale_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
DTensor2Ptr get_P ()
 
DTensor3Ptr get_P_dh0 ()
 
DTensor3Ptr get_P_dh1 ()
 
DTensor3Ptr get_P_dh2 ()
 
DTensor2Ptr get_h ()
 

Private Attributes

MoFEM::InterfacemField
 
std::vector< BlockDatablockData
 
double E
 
double nu
 
Sev getOptionsSeverityLevels = Sev::inform
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::PhysicalEquations
typedef FTensor::Tensor1< adouble, 3 > ATensor1
 
typedef FTensor::Tensor2< adouble, 3, 3 > ATensor2
 
typedef FTensor::Tensor3< adouble, 3, 3, 3 > ATensor3
 
typedef FTensor::Tensor1< double, 3 > DTensor1
 
typedef FTensor::Tensor2< double, 3, 3 > DTensor2
 
typedef FTensor::Tensor3< double, 3, 3, 3 > DTensor3
 
typedef FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > DTensor0Ptr
 
typedef FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, 3, 3 > DTensor2Ptr
 
typedef FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > DTensor3Ptr
 
- Static Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
template<int S>
static DTensor2Ptr get_VecTensor2 (std::vector< double > &v)
 
template<int S>
static DTensor0Ptr get_VecTensor0 (std::vector< double > &v)
 
template<int S0>
static DTensor3Ptr get_vecTensor3 (std::vector< double > &v, const int nba)
 
- Public Attributes inherited from EshelbianPlasticity::PhysicalEquations
std::vector< doubleactiveVariables
 
std::vector< doubledependentVariablesPiola
 
std::vector< doubledependentVariablesPiolaDirevatives
 

Detailed Description

Definition at line 13 of file HMHHencky.cpp.

Constructor & Destructor Documentation

◆ HMHHencky()

EshelbianPlasticity::HMHHencky::HMHHencky ( MoFEM::Interface m_field,
const double  E,
const double  nu 
)
inline

Member Function Documentation

◆ extractBlockData() [1/2]

MoFEMErrorCode EshelbianPlasticity::HMHHencky::extractBlockData ( Sev  sev)
inline

Definition at line 231 of file HMHHencky.cpp.

231 {
232 return extractBlockData(
233
234 mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
235
236 (boost::format("%s(.*)") % "MAT_ELASTIC").str()
237
238 )),
239
240 sev);
241 }
MoFEMErrorCode extractBlockData(Sev sev)
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ extractBlockData() [2/2]

MoFEMErrorCode EshelbianPlasticity::HMHHencky::extractBlockData ( std::vector< const CubitMeshSets * >  meshset_vec_ptr,
Sev  sev 
)
inline

Definition at line 244 of file HMHHencky.cpp.

245 {
247
248 for (auto m : meshset_vec_ptr) {
249 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
250 std::vector<double> block_data;
251 CHKERR m->getAttributes(block_data);
252 if (block_data.size() < 2) {
253 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
254 "Expected that block has atleast two attributes");
255 }
256 auto get_block_ents = [&]() {
257 Range ents;
258 CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
259 return ents;
260 };
261
262 double young_modulus = block_data[0];
263 double poisson_ratio = block_data[1];
264 double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
265 double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
266
267 MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
268 << "E = " << young_modulus << " nu = " << poisson_ratio;
269
270 blockData.push_back({bulk_modulus_K, shear_modulus_G, get_block_ents()});
271 }
272 MOFEM_LOG_CHANNEL("WORLD");
274 }
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
double bulk_modulus_K
double shear_modulus_G
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
FTensor::Index< 'm', 3 > m
std::vector< BlockData > blockData
virtual moab::Interface & get_moab()=0
double young_modulus
Young modulus.
Definition plastic.cpp:125
double poisson_ratio
Poisson ratio.
Definition plastic.cpp:126

◆ getInvMatDPtr()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::getInvMatDPtr ( boost::shared_ptr< MatrixDouble >  mat_inv_D_ptr,
double  bulk_modulus_K,
double  shear_modulus_G 
)
inline

[Calculate elasticity tensor]

[Calculate elasticity tensor]

Definition at line 310 of file HMHHencky.cpp.

311 {
313 //! [Calculate elasticity tensor]
314 auto set_material_compilance = [&]() {
320 const double A = 1. / (2. * shear_modulus_G);
321 const double B =
322 (1. / (9. * bulk_modulus_K)) - (1. / (6. * shear_modulus_G));
323 auto t_inv_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
324 &*(mat_inv_D_ptr->data().begin()));
325 t_inv_D(i, j, k, l) =
326 A * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) + B * t_kd(i, j) * t_kd(k, l);
327 };
328 //! [Calculate elasticity tensor]
329 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
330 mat_inv_D_ptr->resize(size_symm, size_symm, false);
331 set_material_compilance();
333 }
#define FTENSOR_INDEX(DIM, I)
constexpr int SPACE_DIM
[Define dimension]
Kronecker Delta class symmetric.
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static constexpr auto size_symm
constexpr AssemblyType A
[Define dimension]

◆ getMatDPtr()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::getMatDPtr ( boost::shared_ptr< MatrixDouble >  mat_D_ptr,
boost::shared_ptr< MatrixDouble >  mat_axiator_D_ptr,
boost::shared_ptr< MatrixDouble >  mat_deviator_D_ptr,
double  bulk_modulus_K,
double  shear_modulus_G 
)
inline

[Calculate elasticity tensor]

[Calculate elasticity tensor]

Definition at line 276 of file HMHHencky.cpp.

279 {
281 //! [Calculate elasticity tensor]
282 auto set_material_stiffness = [&]() {
288 auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
289 &*(mat_D_ptr->data().begin()));
290 auto t_axiator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
291 &*mat_axiator_D_ptr->data().begin());
292 auto t_deviator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
293 &*mat_deviator_D_ptr->data().begin());
294 t_axiator_D(i, j, k, l) = (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
295 t_kd(i, j) * t_kd(k, l);
296 t_deviator_D(i, j, k, l) =
297 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
298 t_D(i, j, k, l) = t_axiator_D(i, j, k, l) + t_deviator_D(i, j, k, l);
299 };
300 //! [Calculate elasticity tensor]
301 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
302 mat_D_ptr->resize(size_symm, size_symm, false);
303 mat_axiator_D_ptr->resize(size_symm, size_symm, false);
304 mat_deviator_D_ptr->resize(size_symm, size_symm, false);
305 set_material_stiffness();
307 }

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::getOptions ( boost::shared_ptr< DataAtIntegrationPts data_ptr)
inline

Definition at line 211 of file HMHHencky.cpp.

211 {
213 PetscOptionsBegin(PETSC_COMM_WORLD, "hencky_", "", "none");
214
215 CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
216 PETSC_NULLPTR);
217 CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
218 PETSC_NULLPTR);
219
220 PetscOptionsEnd();
221
223 << "Hencky: E = " << E << " nu = " << nu;
224 getOptionsSeverityLevels = Sev::verbose;
225
226 CHKERRG(ierr);
227
229 }
static PetscErrorCode ierr
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define MOFEM_LOG(channel, severity)
Log.

◆ recordTape()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::recordTape ( const int  tag,
DTensor2Ptr t_h 
)
inlinevirtual

Implements EshelbianPlasticity::PhysicalEquations.

Definition at line 18 of file HMHHencky.cpp.

18{ return 0; }

◆ returnOpCalculateEnergy()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateEnergy ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< double total_energy_ptr 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 173 of file HMHHencky.cpp.

174 {
175 return new OpCalculateEnergy(data_ptr, total_energy_ptr);
176 }

◆ returnOpCalculateStretchFromStress()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 194 of file HMHHencky.cpp.

196 {
197 return new OpCalculateStretchFromStress(
198 data_ptr, data_ptr->getLogStretchTensorAtPts(),
199 data_ptr->getApproxPAtPts(),
200 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
201 }

◆ returnOpCalculateVarStretchFromStress()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpCalculateVarStretchFromStress ( boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 203 of file HMHHencky.cpp.

205 {
206 return new OpCalculateStretchFromStress(
207 data_ptr, data_ptr->getVarLogStreachPts(), data_ptr->getVarPiolaPts(),
208 boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
209 }

◆ returnOpJacobian()

virtual UserDataOperator * EshelbianPlasticity::HMHHencky::returnOpJacobian ( const int  tag,
const bool  eval_rhs,
const bool  eval_lhs,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 71 of file HMHHencky.cpp.

73 {
74 return (new OpHenckyJacobian(
75 data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr)));
76 }

◆ returnOpSpatialPhysical()

virtual VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 96 of file HMHHencky.cpp.

98 {
99 return new OpSpatialPhysical(field_name, data_ptr, alpha_u);
100 }
constexpr auto field_name

◆ returnOpSpatialPhysical_du_du()

VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysical_du_du ( std::string  row_field,
std::string  col_field,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 142 of file HMHHencky.cpp.

144 {
145 return new OpSpatialPhysical_du_du(row_field, col_field, data_ptr, alpha);
146 }

◆ returnOpSpatialPhysicalExternalStrain()

virtual VolUserDataOperator * EshelbianPlasticity::HMHHencky::returnOpSpatialPhysicalExternalStrain ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< ExternalStrainVec external_strain_vec_ptr,
std::map< std::string, boost::shared_ptr< ScalingMethod > >  smv 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 116 of file HMHHencky.cpp.

121 {
122 return new OpSpatialPhysicalExternalStrain(
123 field_name, data_ptr, external_strain_vec_ptr, smv);
124 }

Member Data Documentation

◆ blockData

std::vector<BlockData> EshelbianPlasticity::HMHHencky::blockData
private

Definition at line 343 of file HMHHencky.cpp.

◆ E

double EshelbianPlasticity::HMHHencky::E
private

Definition at line 345 of file HMHHencky.cpp.

◆ getOptionsSeverityLevels

Sev EshelbianPlasticity::HMHHencky::getOptionsSeverityLevels = Sev::inform
private

Definition at line 350 of file HMHHencky.cpp.

◆ mField

MoFEM::Interface& EshelbianPlasticity::HMHHencky::mField
private

Definition at line 336 of file HMHHencky.cpp.

◆ nu

double EshelbianPlasticity::HMHHencky::nu
private

Definition at line 346 of file HMHHencky.cpp.


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