v0.13.1
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Example Struct Reference

[Example] More...

Collaboration diagram for Example:
[legend]

Classes

struct  BcTempFun
 
struct  BoundaryOp
 
struct  CommonData
 [Example] More...
 
struct  OpCalcSurfaceAverageTemperature
 
struct  OpError
 
struct  OpError< 1 >
 
struct  OpFirst
 
struct  OpFluxRhs
 
struct  OpRadiationLhs
 
struct  OpRadiationRhs
 
struct  OpRhs
 
struct  OpSecond
 [Operator] More...
 
struct  OpZero
 [Common data] More...
 

Public Member Functions

 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 [Run problem] More...
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 
 Example (MoFEM::Interface &m_field)
 
MoFEMErrorCode runProblem ()
 

Private Types

enum  BoundingBox {
  CENTER_X = 0 , CENTER_Y , MAX_X , MAX_Y ,
  MIN_X , MIN_Y , LAST_BB
}
 

Private Member Functions

MoFEMErrorCode setupProblem ()
 [Run problem] More...
 
MoFEMErrorCode createCommonData ()
 [Set up problem] More...
 
MoFEMErrorCode bC ()
 [Create common data] More...
 
MoFEMErrorCode OPs ()
 [Boundary condition] More...
 
MoFEMErrorCode tsSolve ()
 [Push operators to pipeline] More...
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode bC ()
 
MoFEMErrorCode OPs ()
 
MoFEMErrorCode tsSolve ()
 
MoFEMErrorCode postProcess ()
 [Solve] More...
 
MoFEMErrorCode checkResults ()
 [Postprocess results] More...
 
template<int DIM>
Range getEntsOnMeshSkin ()
 [Check] More...
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode bC ()
 
MoFEMErrorCode OPs ()
 
MoFEMErrorCode tsSolve ()
 
MoFEMErrorCode readMesh ()
 [run problem] More...
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode boundaryCondition ()
 [Set up problem] More...
 
MoFEMErrorCode assembleSystem ()
 [Applying essential BC] More...
 
MoFEMErrorCode solveSystem ()
 [Push operators to pipeline] More...
 
MoFEMErrorCode outputResults ()
 [Solve] More...
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode setUp ()
 [Run all] More...
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode setFieldValues ()
 [Create common data] More...
 
MoFEMErrorCode pushOperators ()
 [Set density distribution] More...
 
MoFEMErrorCode integrateElements ()
 [Push operators to pipeline] More...
 
MoFEMErrorCode postProcess ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode setIntegrationRules ()
 [Set up problem] More...
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode assembleSystemIntensity ()
 [Calculate flux on boundary] More...
 
MoFEMErrorCode assembleSystemFlux ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode calculateFlux (double &calc_flux)
 [Set up problem] More...
 
MoFEMErrorCode outputResults (const int i)
 [Solve] More...
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode setIntegrationRules ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode bC ()
 
MoFEMErrorCode OPs ()
 
MoFEMErrorCode kspSolve ()
 [Push operators to pipeline] More...
 
MoFEMErrorCode postProcess ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode setIntegrationRules ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 
MoFEMErrorCode readMesh ()
 
MoFEMErrorCode setupProblem ()
 
MoFEMErrorCode createCommonData ()
 
MoFEMErrorCode boundaryCondition ()
 
MoFEMErrorCode assembleSystem ()
 
MoFEMErrorCode solveSystem ()
 
MoFEMErrorCode outputResults ()
 
MoFEMErrorCode checkResults ()
 

Static Private Member Functions

static std::pair< int, int > getCoordsInImage (double x, double y)
 
static double rhsSource (const double x, const double y, const double)
 
static double lhsFlux (const double x, const double y, const double)
 
static int integrationRule (int, int, int p_data)
 

Private Attributes

MoFEM::InterfacemField
 
boost::shared_ptr< PlasticOps::CommonDatacommonPlasticDataPtr
 
boost::shared_ptr< HenckyOps::CommonDatacommonHenckyDataPtr
 
boost::shared_ptr< PostProcElepostProcFe
 
boost::shared_ptr< DomainElereactionFe
 
boost::shared_ptr< DomainElefeAxiatorRhs
 
boost::shared_ptr< DomainElefeAxiatorLhs
 
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
 
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
 
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uZScatter
 
boost::shared_ptr< std::vector< unsigned char > > boundaryMarker
 
boost::shared_ptr< std::vector< unsigned char > > reactionMarker
 
std::vector< FTensor::Tensor1< double, 3 > > bodyForces
 
boost::shared_ptr< ContactOps::CommonDatacommonDataPtr
 
boost::shared_ptr< PlasticThermalOps::CommonDatacommonPlasticDataPtr
 
boost::shared_ptr< DomainElefeThermalRhs
 
boost::shared_ptr< DomainElefeThermalLhs
 
std::vector< BcTempFunbcTemperatureFunctions
 
SimplesimpleInterface
 
boost::shared_ptr< CommonDatacommonDataPtr
 
FieldApproximationBase base
 
FieldSpace space
 
boost::shared_ptr< VectorDouble > approxVals
 
boost::shared_ptr< MatrixDouble > approxGradVals
 
Range pinchNodes
 
boost::shared_ptr< MatrixDouble > matGradPtr
 
boost::shared_ptr< MatrixDouble > matStrainPtr
 
boost::shared_ptr< MatrixDouble > matStressPtr
 
boost::shared_ptr< MatrixDouble > matDPtr
 
boost::shared_ptr< MatrixDouble > bodyForceMatPtr
 
SmartPetscObj< Mat > M
 
SmartPetscObj< Mat > K
 
SmartPetscObj< EPS > ePS
 
std::array< SmartPetscObj< Vec >, 6 > rigidBodyMotion
 
boost::shared_ptr< MatrixDouble > matAccelerationPtr
 
boost::shared_ptr< MatrixDouble > matInertiaPtr
 
boost::shared_ptr< MatrixDouble > matTangentPtr
 
boost::shared_ptr< FEMethoddomianLhsFEPtr
 
boost::shared_ptr< FEMethoddomianRhsFEPtr
 

Static Private Attributes

static std::vector< doublerZ
 
static std::vector< MatrixInt > iI
 
static std::array< double, LAST_BBaveMaxMin
 
static int focalIndex
 
static int savitzkyGolayNormalisation
 
static const int * savitzkyGolayWeights
 
static ApproxFieldFunction< FIELD_DIMapproxFunction
 

Detailed Description

[Example]

Examples
contact.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plastic.cpp, plot_base.cpp, shallow_wave.cpp, and thermo_plastic.cpp.

Definition at line 130 of file plastic.cpp.

Member Enumeration Documentation

◆ BoundingBox

enum Example::BoundingBox
private
Enumerator
CENTER_X 
CENTER_Y 
MAX_X 
MAX_Y 
MIN_X 
MIN_Y 
LAST_BB 
Examples
phase.cpp.

Definition at line 112 of file phase.cpp.

112 {
113 CENTER_X = 0,
114 CENTER_Y,
115 MAX_X,
116 MAX_Y,
117 MIN_X,
118 MIN_Y,
119 LAST_BB
120 };
@ MAX_X
Definition: phase.cpp:115
@ MIN_X
Definition: phase.cpp:117
@ MIN_Y
Definition: phase.cpp:118
@ CENTER_X
Definition: phase.cpp:113
@ MAX_Y
Definition: phase.cpp:116
@ CENTER_Y
Definition: phase.cpp:114
@ LAST_BB
Definition: phase.cpp:119

Constructor & Destructor Documentation

◆ Example() [1/15]

Example::Example ( MoFEM::Interface m_field)

◆ Example() [2/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 150 of file contact.cpp.

150: mField(m_field) {}

◆ Example() [3/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 211 of file thermo_plastic.cpp.

211: mField(m_field) {}

◆ Example() [4/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 47 of file helmholtz.cpp.

47: mField(m_field) {}

◆ Example() [5/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 39 of file integration.cpp.

39: mField(m_field) {}

◆ Example() [6/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 65 of file plot_base.cpp.

65: mField(m_field) {}

◆ Example() [7/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 95 of file phase.cpp.

95: mField(m_field) {}

◆ Example() [8/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 69 of file approximaton.cpp.

69: mField(m_field) {}

◆ Example() [9/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 57 of file radiation.cpp.

57: mField(m_field) {}

◆ Example() [10/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 58 of file heat_method.cpp.

58: mField(m_field) {}

◆ Example() [11/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 73 of file elastic.cpp.

73: mField(m_field) {}

◆ Example() [12/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 70 of file eigen_elastic.cpp.

70: mField(m_field) {}

◆ Example() [13/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 76 of file nonlinear_elastic.cpp.

76: mField(m_field) {}

◆ Example() [14/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 78 of file nonlinear_dynamic_elastic.cpp.

78: mField(m_field) {}

◆ Example() [15/15]

Example::Example ( MoFEM::Interface m_field)

Definition at line 354 of file shallow_wave.cpp.

354: mField(m_field) {}

Member Function Documentation

◆ assembleSystem() [1/9]

MoFEMErrorCode Example::assembleSystem ( )
private

[Applying essential BC]

[Boundary condition]

[Push operators to pipeline]

Examples
eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 162 of file helmholtz.cpp.

162 {
165
166 double k = 90;
167 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-k", &k, PETSC_NULL);
168
169 auto beta = [](const double, const double, const double) { return -1; };
170 auto k2 = [k](const double, const double, const double) { return pow(k, 2); };
171 auto kp = [k](const double, const double, const double) { return k; };
172 auto km = [k](const double, const double, const double) { return -k; };
173 auto integration_rule = [](int, int, int p_data) { return 2 * p_data; };
174
175 auto set_domain = [&]() {
177 auto det_ptr = boost::make_shared<VectorDouble>();
178 auto jac_ptr = boost::make_shared<MatrixDouble>();
179 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
180 pipeline_mng->getOpDomainLhsPipeline().push_back(
181 new OpCalculateHOJac<2>(jac_ptr));
182 pipeline_mng->getOpDomainLhsPipeline().push_back(
183 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
184 pipeline_mng->getOpDomainLhsPipeline().push_back(
185 new OpSetHOInvJacToScalarBases<2>(H1, inv_jac_ptr));
186 pipeline_mng->getOpDomainLhsPipeline().push_back(
187 new OpSetHOWeights(det_ptr));
188
189 pipeline_mng->getOpDomainLhsPipeline().push_back(
190 new OpSetBc("P_REAL", true, boundaryMarker));
191
192 pipeline_mng->getOpDomainLhsPipeline().push_back(
193 new OpDomainGradGrad("P_REAL", "P_REAL", beta));
194 pipeline_mng->getOpDomainLhsPipeline().push_back(
195 new OpDomainGradGrad("P_IMAG", "P_IMAG", beta));
196
197 pipeline_mng->getOpDomainLhsPipeline().push_back(
198 new OpDomainMass("P_REAL", "P_REAL", k2));
199 pipeline_mng->getOpDomainLhsPipeline().push_back(
200 new OpDomainMass("P_IMAG", "P_IMAG", k2));
201
202 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpUnSetBc("P_REAL"));
203
206 };
207
208 auto set_boundary = [&]() {
210 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
211 new OpSetBc("P_REAL", true, boundaryMarker));
212 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
213 new OpBoundaryMass("P_IMAG", "P_REAL", kp));
214 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
215 new OpBoundaryMass("P_REAL", "P_IMAG", km));
216 pipeline_mng->getOpBoundaryLhsPipeline().push_back(new OpUnSetBc("P_REAL"));
217
218 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
219 new OpSetBc("P_REAL", false, boundaryMarker));
220 pipeline_mng->getOpBoundaryLhsPipeline().push_back(
221 new OpBoundaryMass("P_REAL", "P_REAL", beta));
222 pipeline_mng->getOpBoundaryLhsPipeline().push_back(new OpUnSetBc("P_REAL"));
223
224 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
225 new OpSetBc("P_REAL", false, boundaryMarker));
226 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
227 new OpBoundarySource("P_REAL", beta));
228 pipeline_mng->getOpBoundaryRhsPipeline().push_back(new OpUnSetBc("P_REAL"));
229
233 };
234
235 CHKERR set_domain();
236 CHKERR set_boundary();
237
239}
@ H1
continuous field
Definition: definitions.h:98
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
constexpr double beta
auto integration_rule
boost::ptr_vector< UserDataOperator > & getOpDomainLhsPipeline()
Get the Op Domain Lhs Pipeline object.
boost::ptr_vector< UserDataOperator > & getOpBoundaryLhsPipeline()
Get the Op Boundary Lhs Pipeline object.
boost::ptr_vector< UserDataOperator > & getOpBoundaryRhsPipeline()
Get the Op Boundary Rhs Pipeline object.
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpDomainMass
Definition: helmholtz.cpp:39
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, 2 > OpDomainGradGrad
Definition: helmholtz.cpp:37
FormsIntegrators< EdgeEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpBoundaryMass
Definition: helmholtz.cpp:41
FormsIntegrators< EdgeEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpBoundarySource
Definition: helmholtz.cpp:43
FTensor::Index< 'k', 3 > k
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
boost::shared_ptr< std::vector< unsigned char > > boundaryMarker
Definition: plastic.cpp:156
Set indices on entities on finite element.
Set inverse jacobian to base functions.
PipelineManager interface.
MoFEMErrorCode setBoundaryLhsIntegrationRule(RuleHookFun rule)
MoFEMErrorCode setBoundaryRhsIntegrationRule(RuleHookFun rule)
MoFEMErrorCode setDomainLhsIntegrationRule(RuleHookFun rule)
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

◆ assembleSystem() [2/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [3/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [4/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [5/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [6/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [7/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [8/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystem() [9/9]

MoFEMErrorCode Example::assembleSystem ( )
private

◆ assembleSystemFlux()

MoFEMErrorCode Example::assembleSystemFlux ( )
private
Examples
phase.cpp.

◆ assembleSystemIntensity()

MoFEMErrorCode Example::assembleSystemIntensity ( )
private

[Calculate flux on boundary]

[Push operators to pipeline]

Examples
phase.cpp.

Definition at line 447 of file phase.cpp.

447 {
449
450 auto *pipeline_mng = mField.getInterface<PipelineManager>();
451
452 pipeline_mng->getDomainLhsFE().reset();
453 pipeline_mng->getDomainRhsFE().reset();
454 pipeline_mng->getBoundaryRhsFE().reset();
455
456 auto rule_vol = [](int, int, int order) { return 2 * (order + 1); };
457 pipeline_mng->setDomainLhsIntegrationRule(rule_vol);
458 pipeline_mng->setDomainRhsIntegrationRule(rule_vol);
459
460 auto det_ptr = boost::make_shared<VectorDouble>();
461 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
462 auto jac_ptr = boost::make_shared<MatrixDouble>();
463 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpSetHOWeightsOnFace());
464 pipeline_mng->getOpDomainLhsPipeline().push_back(
465 new OpCalculateHOJacForFace(jac_ptr));
466 pipeline_mng->getOpDomainLhsPipeline().push_back(
467 new OpInvertMatrix<2>(jac_ptr, det_ptr, inv_jac_ptr));
468 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpMakeHdivFromHcurl());
469 pipeline_mng->getOpDomainLhsPipeline().push_back(
471 pipeline_mng->getOpDomainLhsPipeline().push_back(
472 new OpSetInvJacHcurlFace(inv_jac_ptr));
473 pipeline_mng->getOpDomainLhsPipeline().push_back(new OpSetHOWeightsOnFace());
474
475 pipeline_mng->getOpDomainLhsPipeline().push_back(
476 new OpHdivHdiv("S", "S", lhsFlux));
477 auto unity = []() { return 1; };
478 pipeline_mng->getOpDomainLhsPipeline().push_back(
479 new OpHdivU("S", "PHI", unity, true));
480
481 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpSetHOWeightsOnFace());
482 pipeline_mng->getOpDomainRhsPipeline().push_back(
483 new OpDomainSource("PHI", rhsSource));
484
486}
OpSetInvJacHcurlFaceImpl< 2 > OpSetInvJacHcurlFace
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
OpSetContravariantPiolaTransformOnFace2DImpl< 2 > OpSetContravariantPiolaTransformOnFace2D
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< 2 > OpHdivU
Definition: phase.cpp:85
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, 3 > OpHdivHdiv
Definition: phase.cpp:83
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, 1 > OpDomainSource
Definition: phase.cpp:87
static double rhsSource(const double x, const double y, const double)
Definition: phase.cpp:164
static double lhsFlux(const double x, const double y, const double)
Definition: phase.cpp:179
Make Hdiv space from Hcurl space in 2d.
Modify integration weights on face to take in account higher-order geometry.
boost::shared_ptr< FEMethod > & getDomainLhsFE()

◆ bC() [1/4]

MoFEMErrorCode Example::bC ( )
private

[Create common data]

[Boundary condition]

Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 319 of file plastic.cpp.

319 {
321
323 auto bc_mng = mField.getInterface<BcManager>();
324 auto prb_mng = mField.getInterface<ProblemsManager>();
325
326 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_X",
327 "U", 0, 0);
328 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Y",
329 "U", 1, 1);
330 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(), "REMOVE_Z",
331 "U", 2, 2);
332 CHKERR bc_mng->removeBlockDOFsOnEntities(simple->getProblemName(),
333 "REMOVE_ALL", "U", 0, 3);
334
335 CHKERR bc_mng->pushMarkDOFsOnEntities(simple->getProblemName(), "FIX_X", "U",
336 0, 0);
337 CHKERR bc_mng->pushMarkDOFsOnEntities(simple->getProblemName(), "FIX_Y", "U",
338 1, 1);
339 CHKERR bc_mng->pushMarkDOFsOnEntities(simple->getProblemName(), "FIX_Z", "U",
340 2, 2);
341 CHKERR bc_mng->pushMarkDOFsOnEntities(simple->getProblemName(), "FIX_ALL",
342 "U", 0, 3);
343
344 auto &bc_map = bc_mng->getBcMapByBlockName();
345 boundaryMarker = bc_mng->getMergedBlocksMarker(vector<string>{"FIX_"});
346
347 CHKERR bc_mng->pushMarkDOFsOnEntities(simple->getProblemName(), "REACTION",
348 "U", 0, 3);
349
350 for (auto bc : bc_map)
351 MOFEM_LOG("EXAMPLE", Sev::verbose) << "Marker " << bc.first;
352
353 // OK. We have problem with GMesh, it adding empty characters at the end of
354 // block. So first block is search by regexp. popMarkDOFsOnEntities should
355 // work with regexp.
356 std::string reaction_block_set;
357 for (auto bc : bc_map) {
358 if (bc_mng->checkBlock(bc, "REACTION")) {
359 reaction_block_set = bc.first;
360 break;
361 }
362 }
363
364 if (auto bc = bc_mng->popMarkDOFsOnEntities(reaction_block_set)) {
365 reactionMarker = bc->getBcMarkersPtr();
366
367 // Only take reaction from nodes
368 Range nodes;
369 CHKERR mField.get_moab().get_entities_by_type(0, MBVERTEX, nodes, true);
370 CHKERR prb_mng->markDofs(simple->getProblemName(), ROW,
371 ProblemsManager::MarkOP::AND, nodes,
373
374 } else {
375 MOFEM_LOG("EXAMPLE", Sev::warning) << "REACTION blockset does not exist";
376 }
377
378 if (!reactionMarker) {
379 MOFEM_LOG("EXAMPLE", Sev::warning) << "REACTION blockset does not exist";
380 }
381
383}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
@ ROW
Definition: definitions.h:136
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:311
boost::shared_ptr< std::vector< unsigned char > > reactionMarker
Definition: plastic.cpp:157
Simple interface for fast problem set-up.
Definition: BcManager.hpp:27
virtual moab::Interface & get_moab()=0
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
Definition: Simple.hpp:35

◆ bC() [2/4]

MoFEMErrorCode Example::bC ( )
private

◆ bC() [3/4]

MoFEMErrorCode Example::bC ( )
private

◆ bC() [4/4]

MoFEMErrorCode Example::bC ( )
private

◆ boundaryCondition() [1/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

[Set up problem]

[Create common data]

[Applying essential BC]

[Boundary condition]

Examples
eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 114 of file helmholtz.cpp.

114 {
116
117 auto get_ents_on_mesh_skin = [&]() {
118 Range boundary_entities;
120 std::string entity_name = it->getName();
121 if (entity_name.compare(0, 2, "BC") == 0) {
122 CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 1,
123 boundary_entities, true);
124 }
125 }
126 // Add vertices to boundary entities
127 Range boundary_vertices;
128 CHKERR mField.get_moab().get_connectivity(boundary_entities,
129 boundary_vertices, true);
130 boundary_entities.merge(boundary_vertices);
131
132 return boundary_entities;
133 };
134
135 auto mark_boundary_dofs = [&](Range &&skin_edges) {
136 auto problem_manager = mField.getInterface<ProblemsManager>();
137 auto marker_ptr = boost::make_shared<std::vector<unsigned char>>();
138 problem_manager->markDofs(simpleInterface->getProblemName(), ROW,
139 skin_edges, *marker_ptr);
140 return marker_ptr;
141 };
142
143 auto remove_dofs_from_problem = [&](Range &&skin_edges) {
145 auto problem_manager = mField.getInterface<ProblemsManager>();
146 CHKERR problem_manager->removeDofsOnEntities(
147 simpleInterface->getProblemName(), "P_IMAG", skin_edges, 0, 1);
149 };
150
151 // Get global local vector of marked DOFs. Is global, since is set for all
152 // DOFs on processor. Is local since only DOFs on processor are in the
153 // vector. To access DOFs use local indices.
154 boundaryMarker = mark_boundary_dofs(get_ents_on_mesh_skin());
155 CHKERR remove_dofs_from_problem(get_ents_on_mesh_skin());
156
158}
@ BLOCKSET
Definition: definitions.h:161
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
Simple * simpleInterface
Definition: helmholtz.cpp:53
MoFEMErrorCode markDofs(const std::string problem_name, RowColData rc, const enum MarkOP op, const Range ents, std::vector< unsigned char > &marker) const
Create vector with marked indices.
const std::string getProblemName() const
Get the Problem Name.
Definition: Simple.hpp:342

◆ boundaryCondition() [2/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [3/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [4/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [5/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [6/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [7/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [8/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ boundaryCondition() [9/9]

MoFEMErrorCode Example::boundaryCondition ( )
private

◆ calculateFlux()

MoFEMErrorCode Example::calculateFlux ( double calc_flux)
private

[Set up problem]

[Calculate flux on boundary]

Examples
phase.cpp.

Definition at line 416 of file phase.cpp.

416 {
418 auto pipeline_mng = mField.getInterface<PipelineManager>();
419
420 pipeline_mng->getDomainLhsFE().reset();
421 pipeline_mng->getDomainRhsFE().reset();
422 pipeline_mng->getBoundaryRhsFE().reset();
423
424 auto rule_vol = [](int, int, int order) { return 2 * (order + 1); };
425 pipeline_mng->setBoundaryRhsIntegrationRule(rule_vol);
426
427 auto flux_ptr = boost::make_shared<MatrixDouble>();
428 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
430 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
431 new OpCalculateHVecVectorField<3>("S", flux_ptr));
432 pipeline_mng->getOpBoundaryRhsPipeline().push_back(
433 new BoundaryOp(flux_ptr, calc_flux));
434
435 calc_flux = 0;
436 CHKERR pipeline_mng->loopFiniteElements();
437 double global_flux_assembeld = 0;
438 MPI_Allreduce(&calc_flux, &global_flux_assembeld, 1, MPI_DOUBLE, MPI_SUM,
439 mField.get_comm());
440 calc_flux = global_flux_assembeld;
441
443}
virtual MPI_Comm & get_comm() const =0
Get vector field for H-div approximation.

◆ checkResults() [1/12]

MoFEMErrorCode Example::checkResults ( )
private

[Postprocess results]

[Print results]

[Check]

[Check results]

[Test example]

Examples
contact.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 693 of file contact.cpp.

693{ return 0; }

◆ checkResults() [2/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [3/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [4/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [5/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [6/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [7/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [8/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [9/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [10/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [11/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ checkResults() [12/12]

MoFEMErrorCode Example::checkResults ( )
private

◆ createCommonData() [1/13]

MoFEMErrorCode Example::createCommonData ( )
private

[Set up problem]

[Set integration rule]

[Create common data]

Examples
contact.cpp, eigen_elastic.cpp, heat_method.cpp, nonlinear_elastic.cpp, plastic.cpp, plot_base.cpp, shallow_wave.cpp, and thermo_plastic.cpp.

Definition at line 195 of file plastic.cpp.

195 {
197
198 auto get_command_line_parameters = [&]() {
200 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-scale", &scale, PETSC_NULL);
201 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-rho", &rho, PETSC_NULL);
202 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-young_modulus",
203 &young_modulus, PETSC_NULL);
204 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-poisson_ratio",
205 &poisson_ratio, PETSC_NULL);
206 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-hardening", &H, PETSC_NULL);
207 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-hardening_viscous", &visH,
208 PETSC_NULL);
209 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-yield_stress", &sigmaY,
210 PETSC_NULL);
211 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-cn", &cn, PETSC_NULL);
212 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-Qinf", &Qinf, PETSC_NULL);
213 CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-b_iso", &b_iso, PETSC_NULL);
214
215 CHKERR PetscOptionsGetBool(PETSC_NULL, "", "-large_strains",
216 &is_large_strains, PETSC_NULL);
217
218 MOFEM_LOG("EXAMPLE", Sev::inform) << "Young modulus " << young_modulus;
219 MOFEM_LOG("EXAMPLE", Sev::inform) << "Poisson ratio " << poisson_ratio;
220 MOFEM_LOG("EXAMPLE", Sev::inform) << "Yield stress " << sigmaY;
221 MOFEM_LOG("EXAMPLE", Sev::inform) << "Hardening " << H;
222 MOFEM_LOG("EXAMPLE", Sev::inform) << "Viscous hardening " << visH;
223 MOFEM_LOG("EXAMPLE", Sev::inform) << "Saturation yield stress " << Qinf;
224 MOFEM_LOG("EXAMPLE", Sev::inform) << "Saturation exponent " << b_iso;
225 MOFEM_LOG("EXAMPLE", Sev::inform) << "cn " << cn;
226
227 PetscBool is_scale = PETSC_TRUE;
228 CHKERR PetscOptionsGetBool(PETSC_NULL, "", "-is_scale", &is_scale,
229 PETSC_NULL);
230 if (is_scale) {
233 rho *= scale;
234 sigmaY *= scale;
235 H *= scale;
236 Qinf *= scale;
237 visH *= scale;
238
239 MOFEM_LOG("EXAMPLE", Sev::inform)
240 << "Scaled Young modulus " << young_modulus;
241 MOFEM_LOG("EXAMPLE", Sev::inform)
242 << "Scaled Poisson ratio " << poisson_ratio;
243 MOFEM_LOG("EXAMPLE", Sev::inform) << "Scaled Yield stress " << sigmaY;
244 MOFEM_LOG("EXAMPLE", Sev::inform) << "Scaled Hardening " << H;
245 MOFEM_LOG("EXAMPLE", Sev::inform) << "Scaled Viscous hardening " << visH;
246 MOFEM_LOG("EXAMPLE", Sev::inform)
247 << "Scaled Saturation yield stress " << Qinf;
248 }
249
251 };
252
253 auto set_matrial_stiffness = [&]() {
260 const double bulk_modulus_K = young_modulus / (3 * (1 - 2 * poisson_ratio));
261 const double shear_modulus_G = young_modulus / (2 * (1 + poisson_ratio));
262
263 // Plane stress or when 1, plane strain or 3d
264 const double A = (SPACE_DIM == 2)
265 ? 2 * shear_modulus_G /
266 (bulk_modulus_K + (4. / 3.) * shear_modulus_G)
267 : 1;
268
269 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
270 *commonPlasticDataPtr->mDPtr);
271 auto t_D_axiator = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
272 *commonPlasticDataPtr->mDPtr_Axiator);
273 auto t_D_deviator = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(
274 *commonPlasticDataPtr->mDPtr_Deviator);
275
276 constexpr double third = boost::math::constants::third<double>();
277 t_D_axiator(i, j, k, l) = A *
278 (bulk_modulus_K - (2. / 3.) * shear_modulus_G) *
279 t_kd(i, j) * t_kd(k, l);
280 t_D_deviator(i, j, k, l) =
281 2 * shear_modulus_G * ((t_kd(i, k) ^ t_kd(j, l)) / 4.);
282 t_D(i, j, k, l) = t_D_axiator(i, j, k, l) + t_D_deviator(i, j, k, l);
283
285 };
286
287 commonPlasticDataPtr = boost::make_shared<PlasticOps::CommonData>();
288 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
289 commonPlasticDataPtr->mDPtr = boost::make_shared<MatrixDouble>();
290 commonPlasticDataPtr->mDPtr->resize(size_symm * size_symm, 1);
291 commonPlasticDataPtr->mDPtr_Axiator = boost::make_shared<MatrixDouble>();
292 commonPlasticDataPtr->mDPtr_Axiator->resize(size_symm * size_symm, 1);
293 commonPlasticDataPtr->mDPtr_Deviator = boost::make_shared<MatrixDouble>();
294 commonPlasticDataPtr->mDPtr_Deviator->resize(size_symm * size_symm, 1);
295
296 commonPlasticDataPtr->mGradPtr = boost::make_shared<MatrixDouble>();
297 commonPlasticDataPtr->mStrainPtr = boost::make_shared<MatrixDouble>();
298 commonPlasticDataPtr->mStressPtr = boost::make_shared<MatrixDouble>();
299
300 CHKERR get_command_line_parameters();
301 CHKERR set_matrial_stiffness();
302
303 if (is_large_strains) {
304 commonHenckyDataPtr = boost::make_shared<HenckyOps::CommonData>();
305 commonHenckyDataPtr->matGradPtr = commonPlasticDataPtr->mGradPtr;
307 commonHenckyDataPtr->matLogCPlastic =
308 commonPlasticDataPtr->getPlasticStrainPtr();
309 commonPlasticDataPtr->mStrainPtr = commonHenckyDataPtr->getMatLogC();
310 commonPlasticDataPtr->mStressPtr =
311 commonHenckyDataPtr->getMatHenckyStress();
312 }
313
315}
constexpr double third
Kronecker Delta class symmetric.
constexpr double shear_modulus_G
Definition: elastic.cpp:66
constexpr double bulk_modulus_K
Definition: elastic.cpp:65
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
double A
double young_modulus
Definition: plastic.cpp:105
double Qinf
Definition: plastic.cpp:112
double rho
Definition: plastic.cpp:107
constexpr int SPACE_DIM
Definition: plastic.cpp:51
double visH
Definition: plastic.cpp:110
double poisson_ratio
Definition: plastic.cpp:106
double scale
Definition: plastic.cpp:103
double H
Definition: plastic.cpp:109
double b_iso
Definition: plastic.cpp:113
PetscBool is_large_strains
Definition: plastic.cpp:101
double sigmaY
Definition: plastic.cpp:108
double cn
Definition: plastic.cpp:111
boost::shared_ptr< PlasticOps::CommonData > commonPlasticDataPtr
Definition: plastic.cpp:145
boost::shared_ptr< HenckyOps::CommonData > commonHenckyDataPtr
Definition: plastic.cpp:146

◆ createCommonData() [2/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [3/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [4/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [5/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [6/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [7/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [8/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [9/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [10/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [11/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [12/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ createCommonData() [13/13]

MoFEMErrorCode Example::createCommonData ( )
private

◆ getCoordsInImage()

std::pair< int, int > Example::getCoordsInImage ( double  x,
double  y 
)
staticprivate
Examples
phase.cpp.

Definition at line 145 of file phase.cpp.

145 {
146
147 auto &m = iI[focalIndex];
148 x -= aveMaxMin[MIN_X];
149 y -= aveMaxMin[MIN_Y];
150 x *= (m.size1() - 1) / (aveMaxMin[MAX_X] - aveMaxMin[MIN_X]);
151 y *= (m.size2() - 1) / (aveMaxMin[MAX_Y] - aveMaxMin[MIN_Y]);
152 const auto p = std::make_pair<int, int>(std::round(x), std::round(y));
153
154#ifndef NDEBUG
155 if (p.first < 0 && p.first >= m.size1())
156 THROW_MESSAGE("Wrong index");
157 if (p.second < 0 && p.second >= m.size2())
158 THROW_MESSAGE("Wrong index");
159#endif
160
161 return p;
162}
static Index< 'p', 3 > p
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
FTensor::Index< 'm', 3 > m
static std::array< double, LAST_BB > aveMaxMin
Definition: phase.cpp:124
static int focalIndex
Definition: phase.cpp:126
static std::vector< MatrixInt > iI
Definition: phase.cpp:123

◆ getEntsOnMeshSkin()

template<int DIM>
Range Example::getEntsOnMeshSkin
private

[Check]

Examples
contact.cpp.

Definition at line 696 of file contact.cpp.

696 {
697 Range body_ents;
698 CHKERR mField.get_moab().get_entities_by_dimension(0, DIM, body_ents);
699 Skinner skin(&mField.get_moab());
700 Range skin_ents;
701 CHKERR skin.find_skin(0, body_ents, false, skin_ents);
702
703 return skin_ents;
704};

◆ integrateElements()

MoFEMErrorCode Example::integrateElements ( )
private

[Push operators to pipeline]

[Integrate]

Definition at line 232 of file integration.cpp.

232 {
234 // Zero global vector
235 CHKERR VecZeroEntries(commonDataPtr->petscVec);
236
237 // Integrate elements by executing operators in the pipeline
239 CHKERR pipeline_mng->loopFiniteElements();
240
241 // Assemble MPI vector
242 CHKERR VecAssemblyBegin(commonDataPtr->petscVec);
243 CHKERR VecAssemblyEnd(commonDataPtr->petscVec);
245}
MoFEMErrorCode loopFiniteElements(SmartPetscObj< DM > dm=nullptr)
Iterate finite elements.
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
Definition: contact.cpp:165

◆ integrationRule()

static int Example::integrationRule ( int  ,
int  ,
int  p_data 
)
staticprivate

Definition at line 64 of file radiation.cpp.

64{ return 2 * p_data; };

◆ kspSolve()

MoFEMErrorCode Example::kspSolve ( )
private

[Push operators to pipeline]

[Solve]

Definition at line 245 of file radiation.cpp.

245 {
249 auto ts = pipeline_mng->createTSIM();
250
251 double ftime = 1;
252 CHKERR TSSetDuration(ts, PETSC_DEFAULT, ftime);
253 CHKERR TSSetFromOptions(ts);
254 CHKERR TSSetExactFinalTime(ts, TS_EXACTFINALTIME_MATCHSTEP);
255
256 auto T = smartCreateDMVector(simple->getDM());
257 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), T, INSERT_VALUES,
258 SCATTER_FORWARD);
259
260 CHKERR TSSolve(ts, T);
261 CHKERR TSGetTime(ts, &ftime);
262
263 PetscInt steps, snesfails, rejects, nonlinits, linits;
264 CHKERR TSGetTimeStepNumber(ts, &steps);
265 CHKERR TSGetSNESFailures(ts, &snesfails);
266 CHKERR TSGetStepRejections(ts, &rejects);
267 CHKERR TSGetSNESIterations(ts, &nonlinits);
268 CHKERR TSGetKSPIterations(ts, &linits);
269 MOFEM_LOG_C("EXAMPLE", Sev::inform,
270 "steps %d (%d rejected, %d SNES fails), ftime %g, nonlinits "
271 "%d, linits %d",
272 steps, rejects, snesfails, ftime, nonlinits, linits);
273
275}
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:314
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMMoFEM.cpp:482
auto smartCreateDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:977
SmartPetscObj< TS > createTSIM(SmartPetscObj< DM > dm=nullptr)
Create TS (time) implicit solver.
const double T

◆ lhsFlux()

double Example::lhsFlux ( const double  x,
const double  y,
const double   
)
staticprivate
Examples
phase.cpp.

Definition at line 179 of file phase.cpp.

179 {
180 const auto idx = getCoordsInImage(x, y);
181 const auto &m = iI[focalIndex];
182 return 1. / m(idx.first, idx.second);
183}
static std::pair< int, int > getCoordsInImage(double x, double y)
Definition: phase.cpp:145

◆ OPs() [1/4]

MoFEMErrorCode Example::OPs ( )
private

[Boundary condition]

[Push operators to pipeline]

Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 387 of file plastic.cpp.

387 {
389 auto pipeline_mng = mField.getInterface<PipelineManager>();
391 auto bc_mng = mField.getInterface<BcManager>();
392
393 feAxiatorLhs = boost::make_shared<DomainEle>(mField);
394 feAxiatorRhs = boost::make_shared<DomainEle>(mField);
395 auto integration_rule_axiator = [](int, int, int approx_order) {
396 return 2 * (approx_order - 1);
397 };
398 feAxiatorLhs->getRuleHook = integration_rule_axiator;
399 feAxiatorRhs->getRuleHook = integration_rule_axiator;
400
401 auto integration_rule_deviator = [](int o_row, int o_col, int approx_order) {
402 return 2 * (approx_order - 1);
403 };
404 auto integration_rule_bc = [](int, int, int approx_order) {
405 return 2 * approx_order;
406 };
407
408 auto add_domain_base_ops = [&](auto &pipeline) {
410
411 auto det_ptr = boost::make_shared<VectorDouble>();
412 auto jac_ptr = boost::make_shared<MatrixDouble>();
413 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
414 pipeline.push_back(new OpCalculateHOJac<SPACE_DIM>(jac_ptr));
415 pipeline.push_back(
416 new OpInvertMatrix<SPACE_DIM>(jac_ptr, det_ptr, inv_jac_ptr));
417 pipeline.push_back(
418 new OpSetHOInvJacToScalarBases<SPACE_DIM>(H1, inv_jac_ptr));
419 pipeline.push_back(new OpSetHOWeights(det_ptr));
420
421 pipeline.push_back(new OpCalculateScalarFieldValuesDot(
422 "TAU", commonPlasticDataPtr->getPlasticTauDotPtr()));
424 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
426 "EP", commonPlasticDataPtr->getPlasticStrainDotPtr()));
428 "U", commonPlasticDataPtr->mGradPtr));
429 pipeline.push_back(new OpCalculateScalarFieldValues(
430 "TAU", commonPlasticDataPtr->getPlasticTauPtr()));
431
433 };
434
435 auto add_domain_stress_ops = [&](auto &pipeline, auto m_D_ptr) {
437
438 if (is_large_strains) {
439
440 if (commonPlasticDataPtr->mGradPtr != commonHenckyDataPtr->matGradPtr)
441 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
442 "Wrong pointer for grad");
443
444 pipeline.push_back(
446 pipeline.push_back(
448 pipeline.push_back(
450 pipeline.push_back(new OpCalculateHenckyPlasticStress<SPACE_DIM>(
451 "U", commonHenckyDataPtr, m_D_ptr));
452 pipeline.push_back(
454
455 } else {
456 pipeline.push_back(
458 commonPlasticDataPtr->mStrainPtr));
459 pipeline.push_back(
460 new OpPlasticStress("U", commonPlasticDataPtr, m_D_ptr, 1));
461 }
462
463 if (m_D_ptr != commonPlasticDataPtr->mDPtr_Axiator)
464 pipeline.push_back(
466
468 };
469
470 auto add_domain_ops_lhs_mechanical = [&](auto &pipeline, auto m_D_ptr) {
472 pipeline.push_back(new OpSetBc("U", true, boundaryMarker));
473
474 if (is_large_strains) {
475 pipeline.push_back(
477 pipeline.push_back(
478 new OpKPiola("U", "U", commonHenckyDataPtr->getMatTangent()));
480 "U", "EP", commonPlasticDataPtr, commonHenckyDataPtr, m_D_ptr));
481 } else {
482 pipeline.push_back(new OpKCauchy("U", "U", m_D_ptr));
483 pipeline.push_back(new OpCalculatePlasticInternalForceLhs_dEP(
484 "U", "EP", commonPlasticDataPtr, m_D_ptr));
485 }
486
487 pipeline.push_back(new OpUnSetBc("U"));
489 };
490
491 auto add_domain_ops_rhs_mechanical = [&](auto &pipeline) {
493 pipeline.push_back(new OpSetBc("U", true, boundaryMarker));
494
496 const std::string block_name = "BODY_FORCE";
497 if (it->getName().compare(0, block_name.size(), block_name) == 0) {
498 std::vector<double> attr;
499 CHKERR it->getAttributes(attr);
500 if (attr.size() == 3) {
501 bodyForces.push_back(
502 FTensor::Tensor1<double, 3>{attr[0], attr[1], attr[2]});
503 } else {
504 SETERRQ1(PETSC_COMM_SELF, MOFEM_INVALID_DATA,
505 "Should be three atributes in BODYFORCE blockset, but is %d",
506 attr.size());
507 }
508 }
509 }
510
511 auto get_body_force = [this](const double, const double, const double) {
512 auto *pipeline_mng = mField.getInterface<PipelineManager>();
515 t_source(i) = 0;
516 auto fe_domain_rhs = pipeline_mng->getDomainRhsFE();
517 const auto time = fe_domain_rhs->ts_t;
518 // hardcoded gravity load
519 for (auto &t_b : bodyForces)
520 t_source(i) += (scale * t_b(i)) * time;
521 return t_source;
522 };
523
524 pipeline.push_back(new OpBodyForce("U", get_body_force));
525
526 // Calculate internal forece
527 if (is_large_strains) {
528 pipeline.push_back(new OpInternalForcePiola(
529 "U", commonHenckyDataPtr->getMatFirstPiolaStress()));
530 } else {
531 pipeline.push_back(
532 new OpInternalForceCauchy("U", commonPlasticDataPtr->mStressPtr));
533 }
534
535 pipeline.push_back(new OpUnSetBc("U"));
537 };
538
539 auto add_domain_ops_lhs_constrain = [&](auto &pipeline, auto m_D_ptr) {
541 pipeline.push_back(new OpSetBc("U", true, boundaryMarker));
542
543 if (is_large_strains) {
544 pipeline.push_back(
546 pipeline.push_back(new OpCalculateContrainsLhs_LogStrain_dU(
547 "TAU", "U", commonPlasticDataPtr, commonHenckyDataPtr, m_D_ptr));
548 pipeline.push_back(new OpCalculatePlasticFlowLhs_LogStrain_dU(
549 "EP", "U", commonPlasticDataPtr, commonHenckyDataPtr, m_D_ptr));
550 } else {
551 pipeline.push_back(new OpCalculatePlasticFlowLhs_dU(
552 "EP", "U", commonPlasticDataPtr, m_D_ptr));
553 pipeline.push_back(new OpCalculateContrainsLhs_dU(
554 "TAU", "U", commonPlasticDataPtr, m_D_ptr));
555 }
556
557 pipeline.push_back(new OpCalculatePlasticFlowLhs_dEP(
558 "EP", "EP", commonPlasticDataPtr, m_D_ptr));
559 pipeline.push_back(
561 pipeline.push_back(new OpCalculateContrainsLhs_dEP(
562 "TAU", "EP", commonPlasticDataPtr, m_D_ptr));
563 pipeline.push_back(
565
566 pipeline.push_back(new OpUnSetBc("U"));
568 };
569
570 auto add_domain_ops_rhs_constrain = [&](auto &pipeline) {
572 pipeline.push_back(new OpSetBc("U", true, boundaryMarker));
573
574 pipeline.push_back(
576 pipeline.push_back(
578
580 };
581
582 auto add_boundary_ops_lhs_mechanical = [&](auto &pipeline) {
584 auto &bc_map = mField.getInterface<BcManager>()->getBcMapByBlockName();
585 for (auto bc : bc_map) {
586 if (bc_mng->checkBlock(bc, "FIX_")){
587 pipeline.push_back(
588 new OpSetBc("U", false, bc.second->getBcMarkersPtr()));
589 pipeline.push_back(new OpBoundaryMass(
590 "U", "U", [](double, double, double) { return 1.; },
591 bc.second->getBcEntsPtr()));
592 pipeline.push_back(new OpUnSetBc("U"));
593 }
594 }
596 };
597
598 auto add_boundary_ops_rhs_mechanical = [&](auto &pipeline) {
600
601 auto get_time = [&](double, double, double) {
602 auto *pipeline_mng = mField.getInterface<PipelineManager>();
603 auto &fe_domain_rhs = pipeline_mng->getBoundaryRhsFE();
604 return fe_domain_rhs->ts_t;
605 };
606
607 auto get_time_scaled = [&](double, double, double) {
608 auto *pipeline_mng = mField.getInterface<PipelineManager>();
609 auto &fe_domain_rhs = pipeline_mng->getBoundaryRhsFE();
610 return fe_domain_rhs->ts_t * scale;
611 };
612
613 auto get_minus_time = [&](double, double, double) {
614 auto *pipeline_mng = mField.getInterface<PipelineManager>();
615 auto &fe_domain_rhs = pipeline_mng->getBoundaryRhsFE();
616 return -fe_domain_rhs->ts_t;
617 };
618
619 auto time_scaled = [&](double, double, double) {
620 auto *pipeline_mng = mField.getInterface<PipelineManager>();
621 auto &fe_domain_rhs = pipeline_mng->getBoundaryRhsFE();
622 return -fe_domain_rhs->ts_t;
623 };
624
625 pipeline.push_back(new OpSetBc("U", true, boundaryMarker));
626
628 if (it->getName().compare(0, 5, "FORCE") == 0) {
629 Range force_edges;
630 std::vector<double> attr_vec;
631 CHKERR it->getMeshsetIdEntitiesByDimension(
632 mField.get_moab(), SPACE_DIM - 1, force_edges, true);
633 it->getAttributes(attr_vec);
634 if (attr_vec.size() < SPACE_DIM)
635 SETERRQ(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
636 "Wrong size of boundary attributes vector. Set right block "
637 "size attributes.");
638 auto force_vec_ptr = boost::make_shared<MatrixDouble>(SPACE_DIM, 1);
639 std::copy(&attr_vec[0], &attr_vec[SPACE_DIM],
640 force_vec_ptr->data().begin());
641 pipeline.push_back(
642 new OpBoundaryVec("U", force_vec_ptr, get_time_scaled,
643 boost::make_shared<Range>(force_edges)));
644 }
645 }
646
647 pipeline.push_back(new OpUnSetBc("U"));
648
649 auto u_mat_ptr = boost::make_shared<MatrixDouble>();
650 pipeline.push_back(
651 new OpCalculateVectorFieldValues<SPACE_DIM>("U", u_mat_ptr));
652
653 for (auto &bc : mField.getInterface<BcManager>()->getBcMapByBlockName()) {
654 if (bc_mng->checkBlock(bc, "FIX_")) {
655 pipeline.push_back(
656 new OpSetBc("U", false, bc.second->getBcMarkersPtr()));
657 auto attr_vec = boost::make_shared<MatrixDouble>(SPACE_DIM, 1);
658 attr_vec->clear();
659 if (bc.second->bcAttributes.size() < SPACE_DIM)
660 SETERRQ1(PETSC_COMM_WORLD, MOFEM_DATA_INCONSISTENCY,
661 "Wrong size of boundary attributes vector. Set right block "
662 "size attributes. Size of attributes %d",
663 bc.second->bcAttributes.size());
664 std::copy(&bc.second->bcAttributes[0],
665 &bc.second->bcAttributes[SPACE_DIM],
666 attr_vec->data().begin());
667
668 pipeline.push_back(new OpBoundaryVec("U", attr_vec, time_scaled,
669 bc.second->getBcEntsPtr()));
670 pipeline.push_back(new OpBoundaryInternal(
671 "U", u_mat_ptr, [](double, double, double) { return 1.; },
672 bc.second->getBcEntsPtr()));
673
674 pipeline.push_back(new OpUnSetBc("U"));
675 }
676 }
677
679 };
680
681 // Axiator
682 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainLhsPipeline());
683 CHKERR add_domain_stress_ops(pipeline_mng->getOpDomainLhsPipeline(),
684 commonPlasticDataPtr->mDPtr_Deviator);
685 CHKERR add_domain_ops_lhs_mechanical(pipeline_mng->getOpDomainLhsPipeline(),
686 commonPlasticDataPtr->mDPtr_Deviator);
687 CHKERR add_domain_ops_lhs_constrain(pipeline_mng->getOpDomainLhsPipeline(),
688 commonPlasticDataPtr->mDPtr_Deviator);
689 CHKERR add_boundary_ops_lhs_mechanical(
690 pipeline_mng->getOpBoundaryLhsPipeline());
691
692 CHKERR add_domain_base_ops(feAxiatorLhs->getOpPtrVector());
693 CHKERR add_domain_stress_ops(feAxiatorLhs->getOpPtrVector(),
694 commonPlasticDataPtr->mDPtr_Axiator);
695 CHKERR add_domain_ops_lhs_mechanical(feAxiatorLhs->getOpPtrVector(),
696 commonPlasticDataPtr->mDPtr_Axiator);
697
698 CHKERR add_domain_base_ops(pipeline_mng->getOpDomainRhsPipeline());
699 CHKERR add_domain_stress_ops(pipeline_mng->getOpDomainRhsPipeline(),
700 commonPlasticDataPtr->mDPtr_Deviator);
701 CHKERR add_domain_ops_rhs_mechanical(pipeline_mng->getOpDomainRhsPipeline());
702 CHKERR add_domain_ops_rhs_constrain(pipeline_mng->getOpDomainRhsPipeline());
703 CHKERR add_boundary_ops_rhs_mechanical(
704 pipeline_mng->getOpBoundaryRhsPipeline());
705
706 CHKERR add_domain_base_ops(feAxiatorRhs->getOpPtrVector());
707 CHKERR add_domain_stress_ops(feAxiatorRhs->getOpPtrVector(),
708 commonPlasticDataPtr->mDPtr_Axiator);
709 CHKERR add_domain_ops_rhs_mechanical(feAxiatorRhs->getOpPtrVector());
710
711 CHKERR pipeline_mng->setDomainRhsIntegrationRule(integration_rule_deviator);
712 CHKERR pipeline_mng->setDomainLhsIntegrationRule(integration_rule_deviator);
713
714 CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(integration_rule_bc);
715 CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(integration_rule_bc);
716
717 auto create_reaction_pipeline = [&](auto &pipeline) {
719
720 if (reactionMarker) {
721
722 auto det_ptr = boost::make_shared<VectorDouble>();
723 auto jac_ptr = boost::make_shared<MatrixDouble>();
724 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
725 pipeline.push_back(new OpCalculateHOJac<SPACE_DIM>(jac_ptr));
726 pipeline.push_back(
727 new OpInvertMatrix<SPACE_DIM>(jac_ptr, det_ptr, inv_jac_ptr));
728 pipeline.push_back(
729 new OpSetHOInvJacToScalarBases<SPACE_DIM>(H1, inv_jac_ptr));
730 pipeline.push_back(new OpSetHOWeights(det_ptr));
731
732 pipeline.push_back(
734 "U", commonPlasticDataPtr->mGradPtr));
736 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
737
738 if (is_large_strains) {
739
740 if (commonPlasticDataPtr->mGradPtr != commonHenckyDataPtr->matGradPtr)
741 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
742 "Wrong pointer for grad");
743
744 pipeline.push_back(
746 pipeline.push_back(
748 pipeline.push_back(
750 pipeline.push_back(new OpCalculateHenckyPlasticStress<SPACE_DIM>(
752 pipeline.push_back(
754
755 } else {
756 pipeline.push_back(new OpSymmetrizeTensor<SPACE_DIM>(
757 "U", commonPlasticDataPtr->mGradPtr,
758 commonPlasticDataPtr->mStrainPtr));
759 pipeline.push_back(new OpPlasticStress(
761 }
762
763 pipeline.push_back(new OpSetBc("U", false, reactionMarker));
764 // Calculate internal forece
765 if (is_large_strains) {
766 pipeline.push_back(new OpInternalForcePiola(
767 "U", commonHenckyDataPtr->getMatFirstPiolaStress()));
768 } else {
769 pipeline.push_back(
770 new OpInternalForceCauchy("U", commonPlasticDataPtr->mStressPtr));
771 }
772 pipeline.push_back(new OpUnSetBc("U"));
773 }
774
776 };
777
778 reactionFe = boost::make_shared<DomainEle>(mField);
779 reactionFe->getRuleHook = integration_rule_deviator;
780
781 CHKERR create_reaction_pipeline(reactionFe->getOpPtrVector());
782
784}
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:44
@ MOFEM_INVALID_DATA
Definition: definitions.h:49
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForcePiola
Definition: plastic.cpp:88
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 > OpKPiola
[Only used for dynamics]
Definition: plastic.cpp:86
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForceCauchy
Definition: plastic.cpp:74
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 0 > OpBoundaryVec
Definition: plastic.cpp:95
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 > OpKCauchy
[Body force]
Definition: plastic.cpp:72
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 1, SPACE_DIM, 1 > OpBoundaryInternal
Definition: plastic.cpp:97
FormsIntegrators< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, SPACE_DIM > OpBoundaryMass
[Only used with Hencky/nonlinear material]
Definition: plastic.cpp:93
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< 1, SPACE_DIM > OpBodyForce
[Body force]
Definition: plastic.cpp:67
static constexpr int approx_order
boost::shared_ptr< DomainEle > feAxiatorRhs
Definition: plastic.cpp:149
boost::shared_ptr< DomainEle > reactionFe
Definition: plastic.cpp:148
boost::shared_ptr< DomainEle > feAxiatorLhs
Definition: plastic.cpp:150
std::vector< FTensor::Tensor1< double, 3 > > bodyForces
Definition: plastic.cpp:159
BcMapByBlockName & getBcMapByBlockName()
Get the bc map.
Definition: BcManager.hpp:129
Get value at integration points for scalar field.
Calculate symmetric tensor field rates ant integratio pts.
Calculate symmetric tensor field values at integration pts.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Set inverse jacobian to base functions.
boost::shared_ptr< FEMethod > & getBoundaryRhsFE()

◆ OPs() [2/4]

MoFEMErrorCode Example::OPs ( )
private

◆ OPs() [3/4]

MoFEMErrorCode Example::OPs ( )
private

◆ OPs() [4/4]

MoFEMErrorCode Example::OPs ( )
private

◆ outputResults() [1/10]

MoFEMErrorCode Example::outputResults ( )
private

[Solve]

[Postprocess results]

Examples
eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 263 of file helmholtz.cpp.

263 {
266 pipeline_mng->getDomainLhsFE().reset();
267 pipeline_mng->getDomainRhsFE().reset();
268 pipeline_mng->getBoundaryLhsFE().reset();
269 pipeline_mng->getBoundaryRhsFE().reset();
270 auto post_proc_fe = boost::make_shared<PostProcFaceOnRefinedMesh>(mField);
271 post_proc_fe->generateReferenceElementMesh();
272 post_proc_fe->addFieldValuesPostProc("P_REAL");
273 post_proc_fe->addFieldValuesPostProc("P_IMAG");
274 pipeline_mng->getDomainRhsFE() = post_proc_fe;
275 CHKERR pipeline_mng->loopFiniteElements();
276 CHKERR post_proc_fe->writeFile("out_helmholtz.h5m");
278}
boost::shared_ptr< FEMethod > & getDomainRhsFE()
boost::shared_ptr< FEMethod > & getBoundaryLhsFE()

◆ outputResults() [2/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [3/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [4/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [5/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [6/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [7/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [8/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [9/10]

MoFEMErrorCode Example::outputResults ( )
private

◆ outputResults() [10/10]

MoFEMErrorCode Example::outputResults ( const int  i)
private

[Solve]

[Postprocess results]

Definition at line 518 of file phase.cpp.

518 {
521 pipeline_mng->getDomainLhsFE().reset();
522 pipeline_mng->getDomainRhsFE().reset();
523 pipeline_mng->getBoundaryRhsFE().reset();
524 auto post_proc_fe = boost::make_shared<PostProcFaceOnRefinedMesh>(mField);
525 post_proc_fe->generateReferenceElementMesh();
526
527 auto jac_ptr = boost::make_shared<MatrixDouble>();
528 post_proc_fe->getOpPtrVector().push_back(
529 new OpCalculateHOJacForFace(jac_ptr));
530 post_proc_fe->getOpPtrVector().push_back(new OpMakeHdivFromHcurl());
531 post_proc_fe->getOpPtrVector().push_back(
533
534 post_proc_fe->addFieldValuesPostProc("S");
535 post_proc_fe->addFieldValuesPostProc("PHI");
536 pipeline_mng->getDomainRhsFE() = post_proc_fe;
537 CHKERR pipeline_mng->loopFiniteElements();
538 CHKERR post_proc_fe->writeFile("out_" + boost::lexical_cast<std::string>(i) +
539 ".h5m");
541}

◆ postProcess() [1/3]

MoFEMErrorCode Example::postProcess ( )
private

[Solve]

[Integrate]

[Postprocess results]

[Print results]

Examples
contact.cpp.

Definition at line 689 of file contact.cpp.

689{ return 0; }

◆ postProcess() [2/3]

MoFEMErrorCode Example::postProcess ( )
private

◆ postProcess() [3/3]

MoFEMErrorCode Example::postProcess ( )
private

◆ pushOperators()

MoFEMErrorCode Example::pushOperators ( )
private

[Set density distribution]

[Push operators to pipeline]

Definition at line 202 of file integration.cpp.

202 {
205
206 // Push an operator which calculates values of density at integration points
207 pipeline_mng->getOpDomainRhsPipeline().push_back(
209 "rho", commonDataPtr->getRhoAtIntegrationPtsPtr()));
210
211 // Push an operator to pipeline to calculate zero moment of inertia (mass)
212 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpZero(commonDataPtr));
213
214 // Push an operator to the pipeline to calculate first moment of inertaia
215 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpFirst(commonDataPtr));
216
217 // Push an operator to the pipeline to calculate second moment of inertaia
218 pipeline_mng->getOpDomainRhsPipeline().push_back(new OpSecond(commonDataPtr));
219
220 // Set integration rule. Integration rule is equal to the polynomial order of
221 // the density field plus 2, since under the integral of the second moment of
222 // inertia term x*x is present
223 auto integration_rule = [](int, int, int p_data) { return p_data + 2; };
224
225 // Add integration rule to the element
228}
boost::ptr_vector< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)

◆ readMesh() [1/10]

MoFEMErrorCode Example::readMesh ( )
private

[run problem]

[Run problem]

[Run programme]

[Read mesh]

Examples
eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 81 of file helmholtz.cpp.

81 {
83
87
89}
MoFEMErrorCode getOptions()
get options
Definition: Simple.cpp:294
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name)
Load mesh file.
Definition: Simple.cpp:308

◆ readMesh() [2/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [3/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [4/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [5/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [6/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [7/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [8/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [9/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ readMesh() [10/10]

MoFEMErrorCode Example::readMesh ( )
private

◆ rhsSource()

double Example::rhsSource ( const double  x,
const double  y,
const double   
)
staticprivate
Examples
phase.cpp.

Definition at line 164 of file phase.cpp.

164 {
165 const auto idx = getCoordsInImage(x, y);
166
167 double v = 0;
168 for (auto w = 0; w != window_savitzky_golay; ++w) {
169 const auto i = focalIndex - (window_savitzky_golay - 1) / 2 + w;
170 const auto &intensity = iI[i];
171 v += intensity(idx.first, idx.second) * savitzkyGolayWeights[w];
172 }
173 v = static_cast<double>(v) / savitzkyGolayNormalisation;
174
175 const auto dz = rZ[focalIndex + 1] - rZ[focalIndex - 1];
176 return -k * v / dz;
177}
double v
phase velocity of light in medium (cm/ns)
double w(const double g, const double t)
static int window_savitzky_golay
Definition: phase.cpp:91
static double k
Definition: phase.cpp:89
static int savitzkyGolayNormalisation
Definition: phase.cpp:127
static std::vector< double > rZ
Definition: phase.cpp:122
static const int * savitzkyGolayWeights
Definition: phase.cpp:128

◆ runProblem() [1/15]

MoFEMErrorCode Example::runProblem ( )

[Run problem]

[Create common data]

[Run programme]

[Operator]

[run problem]

[Run all]

[Run problem]

Examples
contact.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plastic.cpp, plot_base.cpp, shallow_wave.cpp, and thermo_plastic.cpp.

Definition at line 163 of file plastic.cpp.

163 {
167 CHKERR bC();
168 CHKERR OPs();
169 CHKERR tsSolve();
171}
MoFEMErrorCode tsSolve()
[Push operators to pipeline]
Definition: plastic.cpp:788
MoFEMErrorCode createCommonData()
[Set up problem]
Definition: plastic.cpp:195
MoFEMErrorCode OPs()
[Boundary condition]
Definition: plastic.cpp:387
MoFEMErrorCode setupProblem()
[Run problem]
Definition: plastic.cpp:175
MoFEMErrorCode bC()
[Create common data]
Definition: plastic.cpp:319

◆ runProblem() [2/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [3/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [4/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [5/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [6/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [7/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [8/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [9/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [10/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [11/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [12/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [13/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [14/15]

MoFEMErrorCode Example::runProblem ( )

◆ runProblem() [15/15]

MoFEMErrorCode Example::runProblem ( )

◆ setFieldValues()

MoFEMErrorCode Example::setFieldValues ( )
private

[Create common data]

[Set density distribution]

Definition at line 186 of file integration.cpp.

186 {
188 auto set_density = [&](VectorAdaptor &&field_data, double *xcoord,
189 double *ycoord, double *zcoord) {
191 field_data[0] = 1;
193 };
194 FieldBlas *field_blas;
195 CHKERR mField.getInterface(field_blas);
196 CHKERR field_blas->setVertexDofs(set_density, "rho");
198}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:126
Basic algebra on fields.
Definition: FieldBlas.hpp:31
MoFEMErrorCode setVertexDofs(VertexCoordsFunction lambda, const std::string field_name, Range *verts=nullptr)
Set DOFs on vertices using user function.
Definition: FieldBlas.cpp:333

◆ setIntegrationRules() [1/3]

MoFEMErrorCode Example::setIntegrationRules ( )
private

[Set up problem]

[Set integration rule]

Examples
heat_method.cpp, and plot_base.cpp.

Definition at line 219 of file plot_base.cpp.

219 {
222}

◆ setIntegrationRules() [2/3]

MoFEMErrorCode Example::setIntegrationRules ( )
private

◆ setIntegrationRules() [3/3]

MoFEMErrorCode Example::setIntegrationRules ( )
private

◆ setUp()

MoFEMErrorCode Example::setUp ( )
private

[Run all]

[Set up problem]

Definition at line 151 of file integration.cpp.

151 {
154 CHKERR simple->getOptions();
155 CHKERR simple->loadFile();
156 // Add field
157 CHKERR simple->addDomainField("rho", H1, AINSWORTH_LEGENDRE_BASE, 1);
158 constexpr int order = 1;
159 CHKERR simple->setFieldOrder("rho", order);
160 CHKERR simple->setUp();
162}
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:73

◆ setupProblem() [1/14]

MoFEMErrorCode Example::setupProblem ( )
private

[Run problem]

[Read mesh]

[Set up problem]

Examples
contact.cpp, eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plastic.cpp, plot_base.cpp, shallow_wave.cpp, and thermo_plastic.cpp.

Definition at line 175 of file plastic.cpp.

175 {
178 // Add field
180 constexpr auto size_symm = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
181 CHKERR simple->addDomainField("U", H1, base, SPACE_DIM);
182 CHKERR simple->addDomainField("TAU", L2, base, 1);
183 CHKERR simple->addDomainField("EP", L2, base, size_symm);
184 CHKERR simple->addBoundaryField("U", H1, base, SPACE_DIM);
185 CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
186 CHKERR simple->setFieldOrder("U", order);
187 CHKERR simple->setFieldOrder("TAU", order - 1);
188 CHKERR simple->setFieldOrder("EP", order - 1);
189 CHKERR simple->setUp();
191}
FieldApproximationBase
approximation base
Definition: definitions.h:71
@ L2
field with C-1 continuity
Definition: definitions.h:101
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
int order
Definition: plastic.cpp:114
FieldApproximationBase base
Definition: plot_base.cpp:83

◆ setupProblem() [2/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [3/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [4/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [5/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [6/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [7/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [8/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [9/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [10/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [11/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [12/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [13/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ setupProblem() [14/14]

MoFEMErrorCode Example::setupProblem ( )
private

◆ solveSystem() [1/10]

MoFEMErrorCode Example::solveSystem ( )
private

[Push operators to pipeline]

[Solve]

Examples
eigen_elastic.cpp, heat_method.cpp, helmholtz.cpp, nonlinear_elastic.cpp, phase.cpp, plot_base.cpp, and shallow_wave.cpp.

Definition at line 243 of file helmholtz.cpp.

243 {
246 auto solver = pipeline_mng->createKSP();
247 CHKERR KSPSetFromOptions(solver);
248 CHKERR KSPSetUp(solver);
249
250 auto dm = simpleInterface->getDM();
251 auto D = smartCreateDMVector(dm);
252 auto F = smartVectorDuplicate(D);
253
254 CHKERR KSPSolve(solver, F, D);
255 CHKERR VecGhostUpdateBegin(D, INSERT_VALUES, SCATTER_FORWARD);
256 CHKERR VecGhostUpdateEnd(D, INSERT_VALUES, SCATTER_FORWARD);
257 CHKERR DMoFEMMeshToLocalVector(dm, D, INSERT_VALUES, SCATTER_REVERSE);
259}
SmartPetscObj< KSP > createKSP(SmartPetscObj< DM > dm=nullptr)
Create KSP (linear) solver.
SmartPetscObj< Vec > smartVectorDuplicate(SmartPetscObj< Vec > &vec)
Create duplicate vector of smart vector.
const double D
diffusivity
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition: Simple.cpp:810

◆ solveSystem() [2/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [3/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [4/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [5/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [6/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [7/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [8/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [9/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ solveSystem() [10/10]

MoFEMErrorCode Example::solveSystem ( )
private

◆ tsSolve() [1/3]

MoFEMErrorCode Example::tsSolve ( )
private

[Push operators to pipeline]

[Solve]

Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 788 of file plastic.cpp.

788 {
790
793 ISManager *is_manager = mField.getInterface<ISManager>();
794
795 auto snes_ctx_ptr = smartGetDMSnesCtx(simple->getDM());
796
797 auto set_section_monitor = [&](auto solver) {
799 SNES snes;
800 CHKERR TSGetSNES(solver, &snes);
801 CHKERR SNESMonitorSet(snes,
802 (MoFEMErrorCode(*)(SNES, PetscInt, PetscReal,
804 (void *)(snes_ctx_ptr.get()), nullptr);
806 };
807
808 auto create_post_process_element = [&]() {
810 postProcFe = boost::make_shared<PostProcEle>(mField);
811 postProcFe->generateReferenceElementMesh();
812
813 auto det_ptr = boost::make_shared<VectorDouble>();
814 auto jac_ptr = boost::make_shared<MatrixDouble>();
815 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
816 postProcFe->getOpPtrVector().push_back(
817 new OpCalculateHOJac<SPACE_DIM>(jac_ptr));
818 postProcFe->getOpPtrVector().push_back(
819 new OpInvertMatrix<SPACE_DIM>(jac_ptr, det_ptr, inv_jac_ptr));
820 postProcFe->getOpPtrVector().push_back(
821 new OpSetHOInvJacToScalarBases<SPACE_DIM>(H1, inv_jac_ptr));
822
823 postProcFe->getOpPtrVector().push_back(
825 "U", commonPlasticDataPtr->mGradPtr));
826 postProcFe->getOpPtrVector().push_back(new OpCalculateScalarFieldValues(
827 "TAU", commonPlasticDataPtr->getPlasticTauPtr()));
828 postProcFe->getOpPtrVector().push_back(
830 "EP", commonPlasticDataPtr->getPlasticStrainPtr()));
831
832 if (is_large_strains) {
833
834 if (commonPlasticDataPtr->mGradPtr != commonHenckyDataPtr->matGradPtr)
835 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
836 "Wrong pointer for grad");
837
838 postProcFe->getOpPtrVector().push_back(
840 postProcFe->getOpPtrVector().push_back(
842 postProcFe->getOpPtrVector().push_back(
844 postProcFe->getOpPtrVector().push_back(
847 postProcFe->getOpPtrVector().push_back(
849 postProcFe->getOpPtrVector().push_back(new OpPostProcHencky<SPACE_DIM>(
850 "U", postProcFe->postProcMesh, postProcFe->mapGaussPts,
852
853 } else {
854 postProcFe->getOpPtrVector().push_back(
856 commonPlasticDataPtr->mStrainPtr));
857 postProcFe->getOpPtrVector().push_back(new OpPlasticStress(
859 postProcFe->getOpPtrVector().push_back(
861 "U", postProcFe->postProcMesh, postProcFe->mapGaussPts,
862 commonPlasticDataPtr->mStrainPtr,
863 commonPlasticDataPtr->mStressPtr));
864 }
865
866 postProcFe->getOpPtrVector().push_back(
868 postProcFe->getOpPtrVector().push_back(
869 new OpPostProcPlastic("U", postProcFe->postProcMesh,
870 postProcFe->mapGaussPts, commonPlasticDataPtr));
871 postProcFe->addFieldValuesPostProc("U");
873 };
874
875 auto scatter_create = [&](auto D, auto coeff) {
877 CHKERR is_manager->isCreateProblemFieldAndRank(simple->getProblemName(),
878 ROW, "U", coeff, coeff, is);
879 int loc_size;
880 CHKERR ISGetLocalSize(is, &loc_size);
881 Vec v;
882 CHKERR VecCreateMPI(mField.get_comm(), loc_size, PETSC_DETERMINE, &v);
883 VecScatter scatter;
884 CHKERR VecScatterCreate(D, is, v, PETSC_NULL, &scatter);
885 return std::make_tuple(SmartPetscObj<Vec>(v),
887 };
888
889 auto set_time_monitor = [&](auto dm, auto solver) {
891 boost::shared_ptr<Monitor> monitor_ptr(new Monitor(
893 boost::shared_ptr<ForcesAndSourcesCore> null;
894 CHKERR DMMoFEMTSSetMonitor(dm, solver, simple->getDomainFEName(),
895 monitor_ptr, null, null);
897 };
898
899 auto set_fieldsplit_preconditioner = [&](auto solver) {
901
902 SNES snes;
903 CHKERR TSGetSNES(solver, &snes);
904 KSP ksp;
905 CHKERR SNESGetKSP(snes, &ksp);
906 PC pc;
907 CHKERR KSPGetPC(ksp, &pc);
908 PetscBool is_pcfs = PETSC_FALSE;
909 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
910
911 // Setup fieldsplit (block) solver - optional: yes/no
912 if (is_pcfs == PETSC_TRUE) {
913
914 auto bc_mng = mField.getInterface<BcManager>();
915 auto name_prb = simple->getProblemName();
916 auto is_all_bc = bc_mng->getBlockIS(name_prb, "FIX_X", "U", 0, 0);
917 is_all_bc = bc_mng->getBlockIS(name_prb, "FIX_Y", "U", 1, 1, is_all_bc);
918 is_all_bc = bc_mng->getBlockIS(name_prb, "FIX_Z", "U", 2, 2, is_all_bc);
919 is_all_bc = bc_mng->getBlockIS(name_prb, "FIX_ALL", "U", 0, 2, is_all_bc);
920
921 int is_all_bc_size;
922 CHKERR ISGetSize(is_all_bc, &is_all_bc_size);
923 MOFEM_LOG("EXAMPLE", Sev::inform)
924 << "Field split block size " << is_all_bc_size;
925
926 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL,
927 is_all_bc); // boundary block
928 }
929
931 };
932
933 auto dm = simple->getDM();
934 auto D = smartCreateDMVector(dm);
935
936 boost::shared_ptr<FEMethod> null;
937 CHKERR DMMoFEMTSSetIJacobian(dm, simple->getDomainFEName(), feAxiatorLhs,
938 null, null);
939 CHKERR DMMoFEMTSSetIFunction(dm, simple->getDomainFEName(), feAxiatorRhs,
940 null, null);
941
942 CHKERR create_post_process_element();
943 uXScatter = scatter_create(D, 0);
944 uYScatter = scatter_create(D, 1);
945 if (SPACE_DIM == 3)
946 uZScatter = scatter_create(D, 2);
947
948 auto solver = pipeline_mng->createTSIM();
949
950 CHKERR TSSetSolution(solver, D);
951 CHKERR set_section_monitor(solver);
952 CHKERR set_time_monitor(dm, solver);
953 CHKERR TSSetSolution(solver, D);
954 CHKERR TSSetFromOptions(solver);
955 CHKERR set_fieldsplit_preconditioner(solver);
956 CHKERR TSSetUp(solver);
957 CHKERR TSSolve(solver, NULL);
958
959 CHKERR VecGhostUpdateBegin(D, INSERT_VALUES, SCATTER_FORWARD);
960 CHKERR VecGhostUpdateEnd(D, INSERT_VALUES, SCATTER_FORWARD);
961 CHKERR DMoFEMMeshToLocalVector(dm, D, INSERT_VALUES, SCATTER_REVERSE);
962
964}
PetscErrorCode DMMoFEMTSSetIFunction(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set TS implicit function evaluation function
Definition: DMMMoFEM.cpp:759
PetscErrorCode DMMoFEMTSSetIJacobian(DM dm, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
set TS Jacobian evaluation function
Definition: DMMMoFEM.cpp:812
const FTensor::Tensor2< T, Dim, Dim > Vec
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
Definition: DMMMoFEM.cpp:1015
MoFEMErrorCode MoFEMSNESMonitorFields(SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *snes_ctx)
Sens monitor printing residual field by field.
Definition: SnesCtx.cpp:236
auto smartGetDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition: DMMoFEM.hpp:999
boost::shared_ptr< PostProcEle > postProcFe
Definition: plastic.cpp:147
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uYScatter
Definition: plastic.cpp:153
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uZScatter
Definition: plastic.cpp:154
std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > uXScatter
Definition: plastic.cpp:152
Definition: HenckyOps.hpp:512
Section manager is used to create indexes and sections.
Definition: ISManager.hpp:33
Definition: PlasticOps.hpp:279
[Class definition]

◆ tsSolve() [2/3]

MoFEMErrorCode Example::tsSolve ( )
private

◆ tsSolve() [3/3]

MoFEMErrorCode Example::tsSolve ( )
private

Member Data Documentation

◆ approxFunction

ApproxFieldFunction< FIELD_DIM > Example::approxFunction
staticprivate
Initial value:

Definition at line 77 of file approximaton.cpp.

◆ approxGradVals

boost::shared_ptr<MatrixDouble> Example::approxGradVals
private

Definition at line 75 of file radiation.cpp.

◆ approxVals

boost::shared_ptr<VectorDouble> Example::approxVals
private

Definition at line 74 of file radiation.cpp.

◆ aveMaxMin

std::array< double, Example::BoundingBox::LAST_BB > Example::aveMaxMin
staticprivate
Examples
phase.cpp.

Definition at line 124 of file phase.cpp.

◆ base

FieldApproximationBase Example::base
private
Examples
contact.cpp, plastic.cpp, plot_base.cpp, and thermo_plastic.cpp.

Definition at line 83 of file plot_base.cpp.

◆ bcTemperatureFunctions

std::vector<BcTempFun> Example::bcTemperatureFunctions
private
Examples
thermo_plastic.cpp.

Definition at line 252 of file thermo_plastic.cpp.

◆ bodyForceMatPtr

boost::shared_ptr<MatrixDouble> Example::bodyForceMatPtr
private

Definition at line 93 of file elastic.cpp.

◆ bodyForces

std::vector< FTensor::Tensor1< double, 3 > > Example::bodyForces
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 159 of file plastic.cpp.

◆ boundaryMarker

boost::shared_ptr< std::vector< unsigned char > > Example::boundaryMarker
private
Examples
contact.cpp, helmholtz.cpp, phase.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 156 of file plastic.cpp.

◆ commonDataPtr [1/2]

boost::shared_ptr< CommonData > Example::commonDataPtr
private
Examples
contact.cpp.

Definition at line 165 of file contact.cpp.

◆ commonDataPtr [2/2]

boost::shared_ptr<CommonData> Example::commonDataPtr
private

Definition at line 56 of file integration.cpp.

◆ commonHenckyDataPtr

boost::shared_ptr< HenckyOps::CommonData > Example::commonHenckyDataPtr
private
Examples
nonlinear_elastic.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 146 of file plastic.cpp.

◆ commonPlasticDataPtr [1/2]

boost::shared_ptr<PlasticOps::CommonData> Example::commonPlasticDataPtr
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 145 of file plastic.cpp.

◆ commonPlasticDataPtr [2/2]

boost::shared_ptr<PlasticThermalOps::CommonData> Example::commonPlasticDataPtr
private

Definition at line 224 of file thermo_plastic.cpp.

◆ domianLhsFEPtr

boost::shared_ptr<FEMethod> Example::domianLhsFEPtr
private
Examples
shallow_wave.cpp.

Definition at line 370 of file shallow_wave.cpp.

◆ domianRhsFEPtr

boost::shared_ptr<FEMethod> Example::domianRhsFEPtr
private
Examples
shallow_wave.cpp.

Definition at line 371 of file shallow_wave.cpp.

◆ ePS

SmartPetscObj<EPS> Example::ePS
private
Examples
eigen_elastic.cpp.

Definition at line 90 of file eigen_elastic.cpp.

◆ feAxiatorLhs

boost::shared_ptr< DomainEle > Example::feAxiatorLhs
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 150 of file plastic.cpp.

◆ feAxiatorRhs

boost::shared_ptr< DomainEle > Example::feAxiatorRhs
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 149 of file plastic.cpp.

◆ feThermalLhs

boost::shared_ptr<DomainEle> Example::feThermalLhs
private
Examples
thermo_plastic.cpp.

Definition at line 231 of file thermo_plastic.cpp.

◆ feThermalRhs

boost::shared_ptr<DomainEle> Example::feThermalRhs
private
Examples
thermo_plastic.cpp.

Definition at line 230 of file thermo_plastic.cpp.

◆ focalIndex

int Example::focalIndex
staticprivate
Examples
phase.cpp.

Definition at line 126 of file phase.cpp.

◆ iI

std::vector< MatrixInt > Example::iI
staticprivate
Examples
phase.cpp.

Definition at line 123 of file phase.cpp.

◆ K

SmartPetscObj<Mat> Example::K
private
Examples
eigen_elastic.cpp.

Definition at line 89 of file eigen_elastic.cpp.

◆ M

SmartPetscObj<Mat> Example::M
private
Examples
eigen_elastic.cpp.

Definition at line 88 of file eigen_elastic.cpp.

◆ matAccelerationPtr

boost::shared_ptr<MatrixDouble> Example::matAccelerationPtr
private

Definition at line 97 of file nonlinear_dynamic_elastic.cpp.

◆ matDPtr

boost::shared_ptr< MatrixDouble > Example::matDPtr
private
Examples
eigen_elastic.cpp, and nonlinear_elastic.cpp.

Definition at line 92 of file elastic.cpp.

◆ matGradPtr

boost::shared_ptr< MatrixDouble > Example::matGradPtr
private
Examples
nonlinear_elastic.cpp.

Definition at line 89 of file elastic.cpp.

◆ matInertiaPtr

boost::shared_ptr<MatrixDouble> Example::matInertiaPtr
private

Definition at line 98 of file nonlinear_dynamic_elastic.cpp.

◆ matStrainPtr

boost::shared_ptr< MatrixDouble > Example::matStrainPtr
private
Examples
nonlinear_elastic.cpp.

Definition at line 90 of file elastic.cpp.

◆ matStressPtr

boost::shared_ptr< MatrixDouble > Example::matStressPtr
private
Examples
nonlinear_elastic.cpp.

Definition at line 91 of file elastic.cpp.

◆ matTangentPtr

boost::shared_ptr<MatrixDouble> Example::matTangentPtr
private

Definition at line 101 of file nonlinear_dynamic_elastic.cpp.

◆ mField

MoFEM::Interface & Example::mField
private

◆ pinchNodes

Range Example::pinchNodes
private
Examples
heat_method.cpp.

Definition at line 66 of file heat_method.cpp.

◆ postProcFe

boost::shared_ptr< PostProcEle > Example::postProcFe
private
Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 147 of file plastic.cpp.

◆ reactionFe

boost::shared_ptr< DomainEle > Example::reactionFe
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 148 of file plastic.cpp.

◆ reactionMarker

boost::shared_ptr< std::vector< unsigned char > > Example::reactionMarker
private
Examples
plastic.cpp, and thermo_plastic.cpp.

Definition at line 157 of file plastic.cpp.

◆ rigidBodyMotion

std::array<SmartPetscObj<Vec>, 6> Example::rigidBodyMotion
private
Examples
eigen_elastic.cpp.

Definition at line 92 of file eigen_elastic.cpp.

◆ rZ

std::vector< double > Example::rZ
staticprivate
Examples
phase.cpp.

Definition at line 122 of file phase.cpp.

◆ savitzkyGolayNormalisation

int Example::savitzkyGolayNormalisation
staticprivate
Examples
phase.cpp.

Definition at line 127 of file phase.cpp.

◆ savitzkyGolayWeights

const int * Example::savitzkyGolayWeights
staticprivate
Examples
phase.cpp.

Definition at line 128 of file phase.cpp.

◆ simpleInterface

Simple * Example::simpleInterface
private
Examples
heat_method.cpp, helmholtz.cpp, phase.cpp, and plot_base.cpp.

Definition at line 53 of file helmholtz.cpp.

◆ space

FieldSpace Example::space
private
Examples
plot_base.cpp.

Definition at line 84 of file plot_base.cpp.

◆ uXScatter

std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > Example::uXScatter
private
Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 152 of file plastic.cpp.

◆ uYScatter

std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > Example::uYScatter
private
Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 153 of file plastic.cpp.

◆ uZScatter

std::tuple< SmartPetscObj< Vec >, SmartPetscObj< VecScatter > > Example::uZScatter
private
Examples
contact.cpp, plastic.cpp, and thermo_plastic.cpp.

Definition at line 154 of file plastic.cpp.


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