v0.14.0
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
 

Public Member Functions

 HMHHencky (MoFEM::Interface &m_field, const double E, const double nu)
 
MoFEMErrorCode recordTape (const int tag, DTensor2Ptr *t_h)
 
virtual OpJacobianreturnOpJacobian (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)
 
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)
 
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)
 
- Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (const int size_active, const int size_dependent)
 
virtual ~PhysicalEquations ()=default
 
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
 

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 12 of file Hencky.cpp.

Constructor & Destructor Documentation

◆ HMHHencky()

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

Definition at line 14 of file Hencky.cpp.

15  : PhysicalEquations(0, 0), mField(m_field), E(E), nu(nu) {}

Member Function Documentation

◆ extractBlockData() [1/2]

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

Definition at line 189 of file Hencky.cpp.

189  {
190  return extractBlockData(
191 
192  mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
193 
194  (boost::format("%s(.*)") % "MAT_ELASTIC").str()
195 
196  )),
197 
198  sev);
199  }

◆ extractBlockData() [2/2]

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

Definition at line 202 of file Hencky.cpp.

203  {
205 
206  for (auto m : meshset_vec_ptr) {
207  MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock") << *m;
208  std::vector<double> block_data;
209  CHKERR m->getAttributes(block_data);
210  if (block_data.size() != 2) {
211  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
212  "Expected that block has two attribute");
213  }
214  auto get_block_ents = [&]() {
215  Range ents;
216  CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
217  return ents;
218  };
219 
220  double young_modulus = block_data[0];
221  double poisson_ratio = block_data[1];
222  double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
223  double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
224 
225  MOFEM_TAG_AND_LOG("WORLD", sev, "MatBlock")
226  << "E = " << young_modulus << " nu = " << poisson_ratio;
227 
228  blockData.push_back({bulk_modulus_K, shear_modulus_G, get_block_ents()});
229  }
230  MOFEM_LOG_CHANNEL("WORLD");
232  }

◆ 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 234 of file Hencky.cpp.

237  {
239  //! [Calculate elasticity tensor]
240  auto set_material_stiffness = [&]() {
246  double A = (SPACE_DIM == 2)
247  ? 2 * shear_modulus_G /
248  (bulk_modulus_K + (4. / 3.) * shear_modulus_G)
249  : 1;
250 
251  auto t_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
252  &*(mat_D_ptr->data().begin()));
253  auto t_axiator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
254  &*mat_axiator_D_ptr->data().begin());
255  auto t_deviator_D = getFTensor4DdgFromPtr<SPACE_DIM, SPACE_DIM, 0>(
256  &*mat_deviator_D_ptr->data().begin());
257  t_axiator_D(i, j, k, l) = A *
258  (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
259  t_kd(i, j) * t_kd(k, l);
260  t_deviator_D(i, j, k, l) =
261  2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
262  t_D(i, j, k, l) = t_axiator_D(i, j, k, l) + t_deviator_D(i, j, k, l);
263  };
264  //! [Calculate elasticity tensor]
265  constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
266  mat_D_ptr->resize(size_symm, size_symm, false);
267  mat_axiator_D_ptr->resize(size_symm, size_symm, false);
268  mat_deviator_D_ptr->resize(size_symm, size_symm, false);
269  set_material_stiffness();
271  }

◆ getOptions()

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

Definition at line 174 of file Hencky.cpp.

174  {
176  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "hencky_", "", "none");
177 
178  CHKERR PetscOptionsScalar("-young_modulus", "Young modulus", "", E, &E,
179  PETSC_NULL);
180  CHKERR PetscOptionsScalar("-poisson_ratio", "poisson ratio", "", nu, &nu,
181  PETSC_NULL);
182 
183  ierr = PetscOptionsEnd();
184  CHKERRG(ierr);
185 
187  }

◆ recordTape()

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

Implements EshelbianPlasticity::PhysicalEquations.

Definition at line 17 of file Hencky.cpp.

17 { 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 150 of file Hencky.cpp.

151  {
152  return new OpCalculateEnergy(data_ptr, total_energy_ptr);
153  }

◆ 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 167 of file Hencky.cpp.

169  {
170  return new OpCalculateStretchFromStress(
171  data_ptr, boost::dynamic_pointer_cast<HMHHencky>(physics_ptr));
172  }

◆ returnOpJacobian()

virtual OpJacobian* 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

Implements EshelbianPlasticity::PhysicalEquations.

Definition at line 72 of file Hencky.cpp.

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

◆ 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 97 of file Hencky.cpp.

99  {
100  return new OpSpatialPhysical(field_name, data_ptr, alpha_u);
101  }

◆ 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 119 of file Hencky.cpp.

121  {
122  return new OpSpatialPhysical_du_du(row_field, col_field, data_ptr, alpha);
123  }

Member Data Documentation

◆ blockData

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

Definition at line 281 of file Hencky.cpp.

◆ E

double EshelbianPlasticity::HMHHencky::E
private

Definition at line 283 of file Hencky.cpp.

◆ mField

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

Definition at line 274 of file Hencky.cpp.

◆ nu

double EshelbianPlasticity::HMHHencky::nu
private

Definition at line 284 of file Hencky.cpp.


The documentation for this struct was generated from the following file:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:39
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
young_modulus
double young_modulus
Young modulus.
Definition: plastic.cpp:121
E
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
bulk_modulus_K
double bulk_modulus_K
Definition: dynamic_first_order_con_law.cpp:96
EshelbianPlasticity::HMHHencky::blockData
std::vector< BlockData > blockData
Definition: Hencky.cpp:281
EshelbianPlasticity::HMHHencky::nu
double nu
Definition: Hencky.cpp:284
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
OpCalculateEnergy
Definition: HookeElement.hpp:164
poisson_ratio
double poisson_ratio
Poisson ratio.
Definition: plastic.cpp:122
EshelbianPlasticity::HMHHencky::E
double E
Definition: Hencky.cpp:283
EshelbianPlasticity::HMHHencky::mField
MoFEM::Interface & mField
Definition: Hencky.cpp:274
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
EshelbianPlasticity::HMHHencky::extractBlockData
MoFEMErrorCode extractBlockData(Sev sev)
Definition: Hencky.cpp:189
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', SPACE_DIM >
Range
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
shear_modulus_G
double shear_modulus_G
Definition: dynamic_first_order_con_law.cpp:97
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
EshelbianPlasticity::PhysicalEquations::PhysicalEquations
PhysicalEquations()=delete
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21