v0.14.0
Classes | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
EshelbianPlasticity::HMHNeohookean Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHNeohookean:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHNeohookean:
[legend]

Classes

struct  BlockData
 
struct  OpGetScale
 
struct  OpJacobian
 
struct  OpSpatialPhysical
 
struct  OpSpatialPhysical_du_du
 

Public Member Functions

 HMHNeohookean (MoFEM::Interface &m_field, const double c10, const double K)
 
auto getMaterialParameters (EntityHandle ent)
 
VolUserDataOperatorreturnOpSetScale (boost::shared_ptr< double > scale_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
virtual EshelbianPlasticity::OpJacobian * returnOpJacobian (const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
MoFEMErrorCode getOptions ()
 
MoFEMErrorCode extractBlockData (Sev sev)
 
MoFEMErrorCode extractBlockData (std::vector< const CubitMeshSets * > meshset_vec_ptr, Sev sev)
 
MoFEMErrorCode recordTape (const int tape, DTensor2Ptr *t_h_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)
 
- Public Member Functions inherited from EshelbianPlasticity::PhysicalEquations
 PhysicalEquations ()=delete
 
 PhysicalEquations (const int size_active, const int size_dependent)
 
virtual ~PhysicalEquations ()=default
 
virtual VolUserDataOperatorreturnOpCalculateEnergy (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
 
virtual VolUserDataOperatorreturnOpCalculateStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
 
virtual VolUserDataOperatorreturnOpCalculateVarStretchFromStress (boost::shared_ptr< DataAtIntegrationPts > data_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 ()
 

Static Public Attributes

static constexpr int numberOfActiveVariables = 0
 
static constexpr int numberOfDependentVariables = 0
 

Private Attributes

MoFEM::InterfacemField
 
double c10_default
 
double K_default
 
double alphaGradU
 
std::vector< BlockDatablockData
 
double eqScaling = 1.
 

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 14 of file HMHNeohookean.cpp.

Constructor & Destructor Documentation

◆ HMHNeohookean()

EshelbianPlasticity::HMHNeohookean::HMHNeohookean ( MoFEM::Interface m_field,
const double  c10,
const double  K 
)
inline

Definition at line 19 of file HMHNeohookean.cpp.

21  mField(m_field), c10_default(c10), K_default(K) {
22 
23  CHK_THROW_MESSAGE(getOptions(), "get options failed");
25  "extract block data failed");
26 
27 #ifdef NEOHOOKEAN_SCALING
28  if (blockData.size()) {
29  double ave_K = 0;
30  for (auto b : blockData) {
31  ave_K += b.K;
32  }
33  eqScaling = ave_K / blockData.size();
34  }
35 #endif
36 
37  MOFEM_LOG("EP", Sev::inform) << "Neo-Hookean scaling = " << eqScaling;
38 
41  "Stretch selector is not equal to LOG");
42  } else {
43  if (EshelbianCore::exponentBase != exp(1)) {
45  "Exponent base is not equal to exp(1)");
46  }
47  }
48  }

Member Function Documentation

◆ extractBlockData() [1/2]

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

Definition at line 128 of file HMHNeohookean.cpp.

128  {
129  return extractBlockData(
130 
131  mField.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
132 
133  (boost::format("%s(.*)") % "MAT_NEOHOOKEAN").str()
134 
135  )),
136 
137  sev);
138  }

◆ extractBlockData() [2/2]

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

Definition at line 141 of file HMHNeohookean.cpp.

142  {
144 
145  for (auto m : meshset_vec_ptr) {
146  MOFEM_LOG("EP", sev) << *m;
147  std::vector<double> block_data;
148  CHKERR m->getAttributes(block_data);
149  if (block_data.size() != 2) {
150  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
151  "Expected that block has two attribute");
152  }
153  auto get_block_ents = [&]() {
154  Range ents;
155  CHKERR mField.get_moab().get_entities_by_handle(m->meshset, ents, true);
156  return ents;
157  };
158 
159  double c10 = block_data[0];
160  double K = block_data[1];
161 
162  blockData.push_back({c10, K, get_block_ents()});
163 
164  MOFEM_LOG("EP", sev) << "MatBlock Neo-Hookean c10 = "
165  << blockData.back().c10
166  << " K = " << blockData.back().K << " nb ents. = "
167  << blockData.back().blockEnts.size();
168  }
170  }

◆ getMaterialParameters()

auto EshelbianPlasticity::HMHNeohookean::getMaterialParameters ( EntityHandle  ent)
inline

Definition at line 50 of file HMHNeohookean.cpp.

50  {
51  for (auto &b : blockData) {
52  if (b.blockEnts.find(ent) != b.blockEnts.end()) {
53  return std::make_pair(b.c10, b.K);
54  }
55  }
56  if (blockData.size() != 0)
58  "Block not found for entity handle. If you mat set "
59  "block, set it to all elements");
60  return std::make_pair(c10_default, K_default);
61  }

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::HMHNeohookean::getOptions ( )
inline

Definition at line 103 of file HMHNeohookean.cpp.

103  {
105  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "neo_hookean_", "", "none");
106 
107  c10_default = 1;
108  CHKERR PetscOptionsScalar("-c10", "C10", "", c10_default, &c10_default,
109  PETSC_NULL);
110  K_default = 1;
111  CHKERR PetscOptionsScalar("-K", "Bulk modulus K", "", K_default, &K_default,
112  PETSC_NULL);
113 
114  alphaGradU = 0;
115  CHKERR PetscOptionsScalar("-viscosity_alpha_grad_u", "viscosity", "",
116  alphaGradU, &alphaGradU, PETSC_NULL);
117 
118  ierr = PetscOptionsEnd();
119  CHKERRG(ierr);
120 
121  MOFEM_LOG_CHANNEL("WORLD");
122  MOFEM_TAG_AND_LOG("WORLD", Sev::inform, "MatBlock Neo-Hookean (default)")
123  << "c10 = " << c10_default << " K = " << K_default
124  << " grad alpha u = " << alphaGradU;
126  }

◆ recordTape()

MoFEMErrorCode EshelbianPlasticity::HMHNeohookean::recordTape ( const int  tape,
DTensor2Ptr t_h_ptr 
)
inlinevirtual

Implements EshelbianPlasticity::PhysicalEquations.

Definition at line 172 of file HMHNeohookean.cpp.

172  {
175  }

◆ returnOpJacobian()

virtual EshelbianPlasticity::OpJacobian* EshelbianPlasticity::HMHNeohookean::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 97 of file HMHNeohookean.cpp.

99  {
100  return (new OpJacobian(tag, eval_rhs, eval_lhs, data_ptr, physics_ptr));
101  }

◆ returnOpSetScale()

VolUserDataOperator* EshelbianPlasticity::HMHNeohookean::returnOpSetScale ( boost::shared_ptr< double scale_ptr,
boost::shared_ptr< PhysicalEquations physics_ptr 
)
inlinevirtual

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 84 of file HMHNeohookean.cpp.

85  {
86 
87  return new OpGetScale(scale_ptr, physics_ptr);
88  };

◆ returnOpSpatialPhysical()

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

Reimplemented from EshelbianPlasticity::PhysicalEquations.

Definition at line 190 of file HMHNeohookean.cpp.

192  {
193  return new OpSpatialPhysical(field_name, data_ptr, alpha_u);
194  }

◆ returnOpSpatialPhysical_du_du()

VolUserDataOperator* EshelbianPlasticity::HMHNeohookean::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 206 of file HMHNeohookean.cpp.

208  {
209  return new OpSpatialPhysical_du_du(row_field, col_field, data_ptr, alpha);
210  }

Member Data Documentation

◆ alphaGradU

double EshelbianPlasticity::HMHNeohookean::alphaGradU
private

Definition at line 217 of file HMHNeohookean.cpp.

◆ blockData

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

Definition at line 223 of file HMHNeohookean.cpp.

◆ c10_default

double EshelbianPlasticity::HMHNeohookean::c10_default
private

Definition at line 215 of file HMHNeohookean.cpp.

◆ eqScaling

double EshelbianPlasticity::HMHNeohookean::eqScaling = 1.
private

Definition at line 225 of file HMHNeohookean.cpp.

◆ K_default

double EshelbianPlasticity::HMHNeohookean::K_default
private

Definition at line 216 of file HMHNeohookean.cpp.

◆ mField

MoFEM::Interface& EshelbianPlasticity::HMHNeohookean::mField
private

Definition at line 213 of file HMHNeohookean.cpp.

◆ numberOfActiveVariables

constexpr int EshelbianPlasticity::HMHNeohookean::numberOfActiveVariables = 0
staticconstexpr

Definition at line 16 of file HMHNeohookean.cpp.

◆ numberOfDependentVariables

constexpr int EshelbianPlasticity::HMHNeohookean::numberOfDependentVariables = 0
staticconstexpr

Definition at line 17 of file HMHNeohookean.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
MoFEM::K
VectorDouble K
Definition: Projection10NodeCoordsOnField.cpp:125
EshelbianPlasticity::HMHNeohookean::mField
MoFEM::Interface & mField
Definition: HMHNeohookean.cpp:213
EshelbianPlasticity::HMHNeohookean::blockData
std::vector< BlockData > blockData
Definition: HMHNeohookean.cpp:223
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
EshelbianPlasticity::HMHNeohookean::numberOfActiveVariables
static constexpr int numberOfActiveVariables
Definition: HMHNeohookean.cpp:16
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
EshelbianPlasticity::HMHNeohookean::c10_default
double c10_default
Definition: HMHNeohookean.cpp:215
EshelbianCore::stretchSelector
static enum StretchSelector stretchSelector
Definition: EshelbianCore.hpp:17
EshelbianPlasticity::HMHNeohookean::alphaGradU
double alphaGradU
Definition: HMHNeohookean.cpp:217
EshelbianPlasticity::HMHNeohookean::eqScaling
double eqScaling
Definition: HMHNeohookean.cpp:225
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
OpJacobian
Definition: EshelbianOperators.hpp:14
EshelbianPlasticity::HMHNeohookean::numberOfDependentVariables
static constexpr int numberOfDependentVariables
Definition: HMHNeohookean.cpp:17
EshelbianCore::exponentBase
static double exponentBase
Definition: EshelbianCore.hpp:31
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
EshelbianPlasticity::HMHNeohookean::K_default
double K_default
Definition: HMHNeohookean.cpp:216
Range
EshelbianPlasticity::HMHNeohookean::getOptions
MoFEMErrorCode getOptions()
Definition: HMHNeohookean.cpp:103
MOFEM_TAG_AND_LOG
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
Definition: LogManager.hpp:362
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
EshelbianPlasticity::HMHNeohookean::extractBlockData
MoFEMErrorCode extractBlockData(Sev sev)
Definition: HMHNeohookean.cpp:128
EshelbianPlasticity::LOG
@ LOG
Definition: EshelbianPlasticity.hpp:46
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
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