v0.16.3
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElasticTieMeshExample Struct Reference

ElasticExample extension providing reusable TIE mesh behaviour. More...

#include "tutorials/vec-11_elastic_tie_mesh/src/ElasticTie.hpp"

Inheritance diagram for ElasticTieMeshExample:
[legend]
Collaboration diagram for ElasticTieMeshExample:
[legend]

Public Member Functions

 ElasticExample (MoFEM::Interface &m_field)
 
- Public Member Functions inherited from ElasticExample
 ElasticExample (MoFEM::Interface &m_field)
 
virtual ~ElasticExample ()=default
 
MoFEMErrorCode runProblem ()
 [Run problem]
 

Protected Member Functions

MoFEMErrorCode readMesh () override
 [Run problem]
 
MoFEMErrorCode setupProblem () override
 [Read mesh]
 
MoFEMErrorCode setUpSolver (SmartPetscObj< KSP > solver) override
 [Push operators to pipeline]
 
MoFEMErrorCode kspSetUpAndSolve (SmartPetscObj< KSP > solver) override
 
MoFEMErrorCode checkResults () override
 [Postprocess results]
 
- Protected Member Functions inherited from ElasticExample
virtual MoFEMErrorCode boundaryCondition ()
 [Set up problem]
 
virtual MoFEMErrorCode assembleSystem ()
 
virtual MoFEMErrorCode solveSystem ()
 [Solve]
 
virtual MoFEMErrorCode outputResults ()
 [Solve]
 
virtual MoFEMErrorCode addDomainMaterialOps (Pipeline &lhs_pipeline, Pipeline &rhs_pipeline)
 Add constitutive operators to the domain assembly pipelines.
 

Protected Attributes

boost::shared_ptr< ElasticTie::CommonData > tieData = nullptr
 
Range physicalBoundaryFaces
 
- Protected Attributes inherited from ElasticExample
MoFEM::Interface & mField
 
boost::shared_ptr< MatrixDouble > vectorFieldPtr = nullptr
 

Additional Inherited Members

- Protected Types inherited from ElasticExample
using Pipeline = boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator >
 

Detailed Description

ElasticExample extension providing reusable TIE mesh behaviour.

Examples
mofem/tutorials/vec-11_elastic_tie_mesh/elastic_tie_mesh.cpp.

Definition at line 1254 of file ElasticTie.hpp.

Member Function Documentation

◆ checkResults()

MoFEMErrorCode ElasticTieMeshExample::checkResults ( )
inlineoverrideprotectedvirtual

[Postprocess results]

[Check]

Reimplemented from ElasticExample.

Reimplemented in ElasticTieMeshTutorial.

Definition at line 1355 of file ElasticTie.hpp.

1355 {
1358}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()

◆ ElasticExample()

ElasticExample::ElasticExample ( MoFEM::Interface &  m_field)
inline

Definition at line 20 of file ElasticExample.hpp.

20: mField(m_field) {}
MoFEM::Interface & mField

◆ kspSetUpAndSolve()

MoFEMErrorCode ElasticTieMeshExample::kspSetUpAndSolve ( SmartPetscObj< KSP >  solver)
inlineoverrideprotectedvirtual

Reimplemented from ElasticExample.

Definition at line 1348 of file ElasticTie.hpp.

1348 {
1353}
#define CHKERR
Inline error check.
MoFEMErrorCode logTieDisplacementNorms(MoFEM::Interface &mField, const boost::shared_ptr< CommonData > &tie_data, const std::string &field_name)
virtual MoFEMErrorCode kspSetUpAndSolve(SmartPetscObj< KSP > solver)
boost::shared_ptr< ElasticTie::CommonData > tieData

◆ readMesh()

MoFEMErrorCode ElasticTieMeshExample::readMesh ( )
inlineoverrideprotectedvirtual

[Run problem]

[Read mesh]

Reimplemented from ElasticExample.

Definition at line 1269 of file ElasticTie.hpp.

1269 {
1271 CHKERR ElasticTie::loadTieMesh<SPACE_DIM>(mField, physicalBoundaryFaces);
1273}

◆ setupProblem()

MoFEMErrorCode ElasticTieMeshExample::setupProblem ( )
inlineoverrideprotectedvirtual

[Read mesh]

[Set up problem]

Reimplemented from ElasticExample.

Definition at line 1275 of file ElasticTie.hpp.

1275 {
1277 auto simple = mField.getInterface<Simple>();
1278
1279 enum bases { AINSWORTH, DEMKOWICZ, LASBASETOPT };
1280 const char *list_bases[LASBASETOPT] = {"ainsworth", "demkowicz"};
1281 PetscInt choice_base_value = AINSWORTH;
1282 CHKERR PetscOptionsGetEList(PETSC_NULLPTR, PETSC_NULLPTR, "-base", list_bases,
1283 LASBASETOPT, &choice_base_value, PETSC_NULLPTR);
1284
1286 switch (choice_base_value) {
1287 case AINSWORTH:
1289 break;
1290 case DEMKOWICZ:
1291 base = DEMKOWICZ_JACOBI_BASE;
1292 break;
1293 default:
1294 base = LASTBASE;
1295 break;
1296 }
1297
1298 int order = 3;
1299 CHKERR PetscOptionsGetInt(PETSC_NULLPTR, "", "-order", &order,
1300 PETSC_NULLPTR);
1301
1302 if (SPACE_DIM == 3) {
1303 Range domain_ents;
1304 CHKERR mField.get_moab().get_entities_by_handle(simple->getMeshset(),
1305 domain_ents, true);
1306 auto tet_hex_ents = ElasticTie::getPhysicalVolumeEntities(domain_ents);
1307
1308 if (!tet_hex_ents.empty()) {
1309 EntityHandle domain_meshset;
1311 mField.get_moab(), tet_hex_ents, SPACE_DIM, domain_meshset);
1312 simple->getMeshset() = domain_meshset;
1313
1314 Range boundary_faces;
1315 if (mField.get_comm_size() > 1) {
1316 Skinner skin(&mField.get_moab());
1317 Range local_skin;
1318 CHKERR skin.find_skin(0, tet_hex_ents, false, local_skin);
1319 boundary_faces = intersect(physicalBoundaryFaces, local_skin);
1320 } else if (!physicalBoundaryFaces.empty()) {
1321 boundary_faces = physicalBoundaryFaces;
1322 } else {
1323 Skinner skin(&mField.get_moab());
1324 CHKERR skin.find_skin(0, tet_hex_ents, false, boundary_faces);
1325 }
1326 EntityHandle boundary_meshset;
1328 SPACE_DIM - 1, boundary_meshset);
1329 simple->getBoundaryMeshSet() = boundary_meshset;
1330 }
1331 }
1332
1335 order);
1336
1338}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
constexpr int SPACE_DIM
FieldApproximationBase
approximation base
Definition definitions.h:58
@ LASTBASE
Definition definitions.h:69
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition definitions.h:60
@ DEMKOWICZ_JACOBI_BASE
Definition definitions.h:66
constexpr int order
Range getPhysicalVolumeEntities(const Range &ents)
MoFEMErrorCode initializeTieConstraints(MoFEM::Interface &mField, boost::shared_ptr< CommonData > &tie_data, const std::string &field_name, FieldApproximationBase base, int order)
MoFEMErrorCode makeClosureMeshset(moab::Interface &moab, const Range &ents, const int max_dim, EntityHandle &meshset)
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
virtual MoFEMErrorCode setupProblem()
[Read mesh]
virtual int get_comm_size() const =0
virtual moab::Interface & get_moab()=0
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.

◆ setUpSolver()

MoFEMErrorCode ElasticTieMeshExample::setUpSolver ( SmartPetscObj< KSP >  solver)
inlineoverrideprotectedvirtual

[Push operators to pipeline]

Reimplemented from ElasticExample.

Definition at line 1341 of file ElasticTie.hpp.

1341 {
1345}
MoFEMErrorCode setupTieSolver(MoFEM::Interface &mField, boost::shared_ptr< CommonData > tie_data, SmartPetscObj< KSP > solver)

Member Data Documentation

◆ physicalBoundaryFaces

Range ElasticTieMeshExample::physicalBoundaryFaces
protected

Definition at line 1260 of file ElasticTie.hpp.

◆ tieData

boost::shared_ptr<ElasticTie::CommonData> ElasticTieMeshExample::tieData = nullptr
protected

Definition at line 1259 of file ElasticTie.hpp.


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