v0.9.0
Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::EshelbianCore Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianPlasticity.hpp>

Inheritance diagram for EshelbianPlasticity::EshelbianCore:
[legend]
Collaboration diagram for EshelbianPlasticity::EshelbianCore:
[legend]

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 Getting interface of core database. More...
 
 EshelbianCore (MoFEM::Interface &m_field)
 
virtual ~EshelbianCore ()
 
MoFEMErrorCode getOptions ()
 
template<typename BC >
MoFEMErrorCode getBc (boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_set_name, const int nb_attributes)
 
MoFEMErrorCode getSpatialDispBc ()
 
MoFEMErrorCode getSpatialRotationBc ()
 
MoFEMErrorCode getSpatialTractionBc ()
 
MoFEMErrorCode getTractionFreeBc (const EntityHandle meshset, boost::shared_ptr< TractionFreeBc > &bc_ptr, const std::string disp_block_set_name, const std::string rot_block_set_name)
 
MoFEMErrorCode getSpatialTractionFreeBc (const EntityHandle meshset=0)
 
MoFEMErrorCode addFields (const EntityHandle meshset=0)
 
MoFEMErrorCode addVolumeFiniteElement (const EntityHandle meshset=0)
 
MoFEMErrorCode addBoundaryFiniteElement (const EntityHandle meshset=0)
 
MoFEMErrorCode addDMs (const BitRefLevel bit=BitRefLevel().set(0))
 
MoFEMErrorCode addMaterial_HMHHStVenantKirchhoff (const int tape, const double lambda, const double mu, const double sigma_y)
 
MoFEMErrorCode addMaterial_HMHMooneyRivlin (const int tape, const double alpha, const double beta, const double lambda, const double sigma_y)
 
MoFEMErrorCode setBaseVolumeElementOps (const int tag, const bool do_rhs, const bool do_lhs, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe)
 
MoFEMErrorCode setGenericVolumeElementOps (const int tag, const bool add_elastic, const bool add_material, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe_rhs, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe_lhs)
 
MoFEMErrorCode setGenericFaceElementOps (const bool add_elastic, const bool add_material, boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &fe_rhs, boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &fe_lhs)
 
MoFEMErrorCode setElasticElementOps (const int tag)
 
MoFEMErrorCode setElasticElementToTs (DM dm)
 
MoFEMErrorCode setUpTSElastic (TS ts, Mat m, Vec f)
 
MoFEMErrorCode solveElastic (TS ts, Vec x)
 
MoFEMErrorCode postProcessResults (const int tag, const std::string file)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
virtual MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const =0
 
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

Public Attributes

MoFEM::InterfacemField
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 
boost::shared_ptr< PhysicalEquationsphysicalEquations
 
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeRhs
 
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeLhs
 
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcLhs
 
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcRhs
 
boost::shared_ptr< EpFEMethodschurAssembly
 
DM dM
 Coupled problem all fields. More...
 
DM dmElastic
 Elastic problem. More...
 
DM dmElasticSchurStreach
 Sub problem of dmElastic Schur. More...
 
DM dmElasticSchurBubble
 Sub problem of dmElastic Schur. More...
 
DM dmElasticSchurSpatialDisp
 Sub problem of dmElastic Schur. More...
 
DM dmElasticSchurOmega
 Sub problem of dmElastic Schur. More...
 
DM dmMaterial
 Material problem. More...
 
const std::string piolaStress
 
const std::string eshelbyStress
 
const std::string spatialDisp
 
const std::string spatialPosition
 
const std::string materialDisp
 
const std::string streachTensor
 
const std::string rotAxis
 
const std::string materialGradient
 
const std::string tauField
 
const std::string lambdaField
 
const std::string bubbleField
 
const std::string elementVolumeName
 
const std::string naturalBcElement
 
const std::string essentialBcElement
 
int spaceOrder
 
PetscBool ghostFrameOn
 
int spaceGhostOrder
 
int materialOrder
 
double alpha_u
 
double preconditioner_eps
 
boost::shared_ptr< BcDispVecbcSpatialDispVecPtr
 
boost::shared_ptr< BcRotVecbcSpatialRotationVecPtr
 
boost::shared_ptr< TractionBcVecbcSpatialTraction
 
boost::shared_ptr< TractionFreeBcbcSpatialFreeTraction
 

Additional Inherited Members

- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Detailed Description

Examples
ep.cpp.

Definition at line 1251 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ EshelbianCore()

EshelbianPlasticity::EshelbianCore::EshelbianCore ( MoFEM::Interface m_field)

Definition at line 45 of file EshelbianPlasticity.cpp.

46  : mField(m_field), dM(PETSC_NULL), dmElastic(PETSC_NULL),
47  dmElasticSchurStreach(PETSC_NULL), dmElasticSchurBubble(PETSC_NULL),
48  dmElasticSchurSpatialDisp(PETSC_NULL), dmElasticSchurOmega(PETSC_NULL),
49  dmMaterial(PETSC_NULL), piolaStress("P"), eshelbyStress("S"),
50  spatialDisp("w"), spatialPosition("x"), materialDisp("W"),
51  streachTensor("u"), rotAxis("omega"), materialGradient("G"),
52  tauField("TAU"), lambdaField("LAMBDA"), bubbleField("BUBBLE"),
53  elementVolumeName("EP"), naturalBcElement("NATURAL_BC"),
54  essentialBcElement("ESSENTIAL_BC") {
55 
56  ierr = getOptions();
57  CHKERRABORT(PETSC_COMM_WORLD, ierr);
58 }
DM dmElasticSchurOmega
Sub problem of dmElastic Schur.
DM dM
Coupled problem all fields.
DM dmElasticSchurStreach
Sub problem of dmElastic Schur.
DM dmElasticSchurSpatialDisp
Sub problem of dmElastic Schur.
DM dmElasticSchurBubble
Sub problem of dmElastic Schur.

◆ ~EshelbianCore()

EshelbianPlasticity::EshelbianCore::~EshelbianCore ( )
virtual

Definition at line 60 of file EshelbianPlasticity.cpp.

60  {
61  auto destroy_dm = [](DM &dm) {
62  if (dm != PETSC_NULL)
63  return DMDestroy(&dm);
64  else
65  return PetscErrorCode(0);
66  };
68  CHKERR destroy_dm(dmElasticSchurOmega);
69  CHKERR destroy_dm(dmElasticSchurBubble);
70  CHKERR destroy_dm(dmElasticSchurStreach);
71  CHKERR destroy_dm(dmMaterial);
72  CHKERR destroy_dm(dmElastic);
73  CHKERR destroy_dm(dM);
74 }
DM dmElasticSchurOmega
Sub problem of dmElastic Schur.
#define CHKERR
Inline error check.
Definition: definitions.h:596
DM dM
Coupled problem all fields.
DM dmElasticSchurStreach
Sub problem of dmElastic Schur.
DM dmElasticSchurSpatialDisp
Sub problem of dmElastic Schur.
DM dmElasticSchurBubble
Sub problem of dmElastic Schur.

Member Function Documentation

◆ addBoundaryFiniteElement()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addBoundaryFiniteElement ( const EntityHandle  meshset = 0)
Examples
ep.cpp.

Definition at line 289 of file EshelbianPlasticity.cpp.

289  {
291 
292  auto bc_elements_add_to_range = [&](const std::string disp_block_set_name,
293  Range &r) {
296  if (it->getName().compare(0, disp_block_set_name.length(),
297  disp_block_set_name) == 0) {
298  Range faces;
299  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, faces,
300  true);
301  r.merge(faces);
302  }
303  }
305  };
306  Range natural_bc_elements;
307  CHKERR bc_elements_add_to_range("SPATIAL_DISP_BC", natural_bc_elements);
308  CHKERR bc_elements_add_to_range("SPATIAL_ROTATION_BC", natural_bc_elements);
309  Range essentail_bc_elements;
310  CHKERR bc_elements_add_to_range("SPATIAL_TRACTION_BC", essentail_bc_elements);
311 
312  // set finite element fields
313  auto add_field_to_fe = [this](const std::string fe,
314  const std::string field_name) {
320  };
321 
323  CHKERR mField.add_ents_to_finite_element_by_type(natural_bc_elements, MBTRI,
325  CHKERR add_field_to_fe(naturalBcElement, piolaStress);
326  CHKERR add_field_to_fe(naturalBcElement, eshelbyStress);
327  CHKERR add_field_to_fe(naturalBcElement, spatialPosition);
328 
330  CHKERR mField.add_ents_to_finite_element_by_type(essentail_bc_elements, MBTRI,
332  CHKERR add_field_to_fe(essentialBcElement, piolaStress);
333  CHKERR add_field_to_fe(essentialBcElement, eshelbyStress);
334  CHKERR add_field_to_fe(essentialBcElement, spatialPosition);
335  // CHKERR mField.modify_finite_element_add_field_data(essentialBcElement,
336  // piolaStress + "_RT");
337 
338  // build finite elements data structures
342 }
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
#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.
#define CHKERR
Inline error check.
Definition: definitions.h:596
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elementsBuild finite element data structures. Have to be run before problem and adjacenc...

◆ addDMs()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addDMs ( const BitRefLevel  bit = BitRefLevel().set(0))
Examples
ep.cpp.

Definition at line 344 of file EshelbianPlasticity.cpp.

344  {
346 
347  // find adjacencies between finite elements and dofs
349 
350  // Create coupled problem
351  CHKERR DMCreate(mField.get_comm(), &dM);
352  CHKERR DMSetType(dM, "DMMOFEM");
353  CHKERR DMMoFEMCreateMoFEM(dM, &mField, "ESHELBY_PLASTICITY", bit,
354  BitRefLevel().set());
355  CHKERR DMMoFEMSetDestroyProblem(dM, PETSC_TRUE);
356  CHKERR DMMoFEMSetIsPartitioned(dM, PETSC_TRUE);
360  mField.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_TRUE;
361  CHKERR DMSetUp(dM);
362  mField.getInterface<ProblemsManager>()->buildProblemFromFields = PETSC_FALSE;
363 
364  auto remove_dofs_on_essential_spatial_stress_boundary =
365  [&](const std::string prb_name) {
367  for (int d : {0, 1, 2})
369  prb_name, piolaStress, (*bcSpatialFreeTraction)[d], d, d, NOISY,
370  true);
372  };
373  CHKERR remove_dofs_on_essential_spatial_stress_boundary("ESHELBY_PLASTICITY");
374 
375  // Create elastic sub-problem
376  CHKERR DMCreate(mField.get_comm(), &dmElastic);
377  CHKERR DMSetType(dmElastic, "DMMOFEM");
378  CHKERR DMMoFEMCreateSubDM(dmElastic, dM, "ELASTIC_PROBLEM");
385  if (ghostFrameOn)
392  CHKERR DMSetUp(dmElastic);
393 
394  // Create elastic streach-problem
396  CHKERR DMSetType(dmElasticSchurStreach, "DMMOFEM");
398  "ELASTIC_PROBLEM_STREACH_SCHUR");
404  if (ghostFrameOn)
406  spatialPosition.c_str());
412  CHKERR DMSetUp(dmElasticSchurStreach);
413 
414  // Create elastic bubble-problem
416  CHKERR DMSetType(dmElasticSchurBubble, "DMMOFEM");
418  "ELASTIC_PROBLEM_BUBBLE_SCHUR");
423  if (ghostFrameOn)
430  CHKERR DMSetUp(dmElasticSchurBubble);
431 
432  // Create elastic omega-problem
434  CHKERR DMSetType(dmElasticSchurOmega, "DMMOFEM");
436  "ELASTIC_PROBLEM_OMEGA_SCHUR");
440  if (ghostFrameOn)
447  CHKERR DMSetUp(dmElasticSchurOmega);
448 
449  // Create elastic tet_stress-problem
451  CHKERR DMSetType(dmElasticSchurSpatialDisp, "DMMOFEM");
453  "ELASTIC_PROBLEM_SPATIAL_DISP_SCHUR");
456  if (ghostFrameOn)
458  spatialPosition.c_str());
460  elementVolumeName.c_str());
463  essentialBcElement.c_str());
467 
468  {
469  PetscSection section;
470  CHKERR mField.getInterface<ISManager>()->sectionCreate("ELASTIC_PROBLEM",
471  &section);
472  CHKERR DMSetDefaultSection(dmElastic, section);
473  CHKERR DMSetDefaultGlobalSection(dmElastic, section);
474  CHKERR PetscSectionDestroy(&section);
475  }
476 
478 }
Problem manager is used to build and partition problems.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
Section manager is used to create indexes and sectionsFIXME: ISManager is not properly testsed by ato...
Definition: ISManager.hpp:36
PetscErrorCode DMMoFEMSetSquareProblem(DM dm, PetscBool square_problem)
set squared problemIt if true is assumed that matrix has the same indexing on rows and columns....
Definition: DMMMoFEM.cpp:367
PetscErrorCode DMMoFEMAddElement(DM dm, const char fe_name[])
add element to dm
Definition: DMMMoFEM.cpp:414
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
MoFEMErrorCode removeDofsOnEntities(const std::string problem_name, const std::string field_name, const Range ents, const int lo_coeff=0, const int hi_coeff=MAX_DOFS_ON_ENTITY, int verb=VERBOSE, const bool debug=false)
Remove DOFs from problemRemove DOFs from problem which are on entities on the given range and given f...
DM dmElasticSchurOmega
Sub problem of dmElastic Schur.
PetscErrorCode DMMoFEMCreateSubDM(DM subdm, DM dm, const char problem_name[])
Must be called by user to set Sub DM MoFEM data structures.
Definition: DMMMoFEM.cpp:166
PetscErrorCode DMMoFEMAddSubFieldRow(DM dm, const char field_name[], EntityType lo_type=MBVERTEX, EntityType hi_type=MBMAXTYPE)
Definition: DMMMoFEM.cpp:187
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T * > &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTraction
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
Definition: DMMMoFEM.cpp:109
#define CHKERR
Inline error check.
Definition: definitions.h:596
DM dM
Coupled problem all fields.
DM dmElasticSchurStreach
Sub problem of dmElastic Schur.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
DM dmElasticSchurSpatialDisp
Sub problem of dmElastic Schur.
PetscErrorCode DMMoFEMSetDestroyProblem(DM dm, PetscBool destroy_problem)
Definition: DMMMoFEM.cpp:349
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MPI_Comm & get_comm() const =0
DM dmElasticSchurBubble
Sub problem of dmElastic Schur.
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
Definition: DMMMoFEM.cpp:971

◆ addFields()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addFields ( const EntityHandle  meshset = 0)
Examples
ep.cpp.

Definition at line 109 of file EshelbianPlasticity.cpp.

109  {
111 
112  Range tets;
113  CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET, tets);
114  Range tets_skin_part;
115  Skinner skin(&mField.get_moab());
116  CHKERR skin.find_skin(0, tets, false, tets_skin_part);
117  ParallelComm *pcomm =
118  ParallelComm::get_pcomm(&mField.get_moab(), MYPCOMM_INDEX);
119  Range tets_skin;
120  CHKERR pcomm->filter_pstatus(tets_skin_part,
121  PSTATUS_SHARED | PSTATUS_MULTISHARED,
122  PSTATUS_NOT, -1, &tets_skin);
123 
124  auto subtract_faces_where_displacements_are_applied =
125  [&](const std::string disp_block_set_name) {
128  if (it->getName().compare(0, disp_block_set_name.length(),
129  disp_block_set_name) == 0) {
130  Range faces;
131  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2,
132  faces, true);
133  tets_skin = subtract(tets_skin, faces);
134  }
135  }
137  };
138  CHKERR subtract_faces_where_displacements_are_applied("SPATIAL_DISP_BC");
139  CHKERR subtract_faces_where_displacements_are_applied("SPATIAL_ROTATION_BC");
140  CHKERR subtract_faces_where_displacements_are_applied("SPATIAL_TRACTION_BC");
141 
142  Range faces;
143  CHKERR mField.get_moab().get_adjacencies(tets, 2, true, faces,
144  moab::Interface::UNION);
145  Range faces_not_on_the_skin = subtract(faces, tets_skin);
146 
147  auto add_hdiv_field = [&](const std::string field_name, const int order,
148  const int dim) {
151  MB_TAG_SPARSE, MF_ZERO);
152  CHKERR mField.add_ents_to_field_by_type(meshset, MBTET, field_name);
153  CHKERR mField.set_field_order(meshset, MBTET, field_name, order);
154  CHKERR mField.set_field_order(faces_not_on_the_skin, field_name, order);
155  CHKERR mField.set_field_order(tets_skin, field_name, 0);
157  };
158 
159  auto add_hdiv_rt_field = [&](const std::string field_name, const int order,
160  const int dim) {
163  MB_TAG_DENSE, MF_ZERO);
164  CHKERR mField.add_ents_to_field_by_type(meshset, MBTET, field_name);
165  CHKERR mField.set_field_order(meshset, MBTET, field_name, 0);
166  CHKERR mField.set_field_order(tets_skin, field_name, order);
168  };
169 
170  auto add_l2_field = [this, meshset](const std::string field_name,
171  const int order, const int dim) {
174  MB_TAG_DENSE, MF_ZERO);
175  CHKERR mField.add_ents_to_field_by_type(meshset, MBTET, field_name);
176  CHKERR mField.set_field_order(meshset, MBTET, field_name, order);
178  };
179 
180  auto add_h1_field = [this, meshset](const std::string field_name,
181  const int order, const int dim) {
184  MB_TAG_DENSE, MF_ZERO);
185  CHKERR mField.add_ents_to_field_by_type(meshset, MBTET, field_name);
186  CHKERR mField.set_field_order(meshset, MBVERTEX, field_name, 1);
187  CHKERR mField.set_field_order(meshset, MBEDGE, field_name, order);
188  CHKERR mField.set_field_order(meshset, MBTRI, field_name, order);
189  CHKERR mField.set_field_order(meshset, MBTET, field_name, order);
191  };
192 
193  auto add_bubble_field = [this, meshset](const std::string field_name,
194  const int order, const int dim) {
196  CHKERR mField.add_field(field_name, HDIV, USER_BASE, dim, MB_TAG_DENSE,
197  MF_ZERO);
198  // Modify field
199  auto field_ptr = mField.get_field_structure(field_name);
200  auto field_order_table =
201  const_cast<Field *>(field_ptr)->getFieldOrderTable();
202  auto get_cgg_bubble_order_zero = [](int p) { return 0; };
203  auto get_cgg_bubble_order_tet = [](int p) {
204  return NBVOLUMETET_CCG_BUBBLE(p);
205  };
206  field_order_table[MBVERTEX] = get_cgg_bubble_order_zero;
207  field_order_table[MBEDGE] = get_cgg_bubble_order_zero;
208  field_order_table[MBTRI] = get_cgg_bubble_order_zero;
209  field_order_table[MBTET] = get_cgg_bubble_order_tet;
210  CHKERR mField.add_ents_to_field_by_type(meshset, MBTET, field_name);
211  CHKERR mField.set_field_order(meshset, MBTRI, field_name, order);
212  CHKERR mField.set_field_order(meshset, MBTET, field_name, order);
214  };
215 
216  // spatial fields
217  CHKERR add_hdiv_field(piolaStress, spaceOrder, 3);
218  // CHKERR add_hdiv_rt_field(piolaStress + "_RT", spaceOrder, 3);
219  CHKERR add_bubble_field(bubbleField, spaceOrder, 1);
220  CHKERR add_l2_field(spatialDisp, spaceOrder - 1, 3);
221  CHKERR add_l2_field(rotAxis, spaceOrder - 1, 3);
222  CHKERR add_l2_field(streachTensor, spaceOrder, 6);
223  const bool check_if_field_exist = mField.check_field(spatialPosition);
224  CHKERR add_h1_field(spatialPosition, spaceGhostOrder, 3);
225 
226  // material fields
227  CHKERR add_hdiv_field(eshelbyStress, materialOrder, 3);
228  CHKERR add_l2_field(materialGradient, materialOrder - 1, 9);
229  // CHKERR add_l2_field(materialDisp, materialOrder - 1, 3);
230  // CHKERR add_l2_field(tauField, materialOrder - 1, 1);
231  // CHKERR add_l2_field(lambdaField, materialOrder - 1, 1);
232 
233  // Add history filedes
234  CHKERR add_l2_field(materialGradient + "0", materialOrder - 1, 9);
235 
237 
238  if (!check_if_field_exist) {
240  CHKERR mField.loop_dofs(spatialPosition, ent_method);
241  }
242 
244 }
field with continuous normal traction
Definition: definitions.h:173
user implemented approximation base
Definition: definitions.h:154
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
Projection of edge entities with one mid-node on hierarchical basis.
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:146
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
FieldOrderTable & getFieldOrderTable()
Get the Field Order Table.
#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.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:285
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
#define NBVOLUMETET_CCG_BUBBLE(P)
Bubble function for CGG H div space.
virtual bool check_field(const std::string &name) const =0
check if field is in database
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
continuous field
Definition: definitions.h:171
virtual const Field * get_field_structure(const std::string &name)=0
get field structure
field with C-1 continuity
Definition: definitions.h:174

◆ addMaterial_HMHHStVenantKirchhoff()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addMaterial_HMHHStVenantKirchhoff ( const int  tape,
const double  lambda,
const double  mu,
const double  sigma_y 
)

Definition at line 634 of file EshelbianADOL-C.cpp.

636  {
638  physicalEquations = boost::shared_ptr<HMHStVenantKirchhoff>(
639  new HMHStVenantKirchhoff(lambda, mu, sigma_y));
640  CHKERR physicalEquations->recordTape(tape);
642 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< PhysicalEquations > physicalEquations
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ addMaterial_HMHMooneyRivlin()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addMaterial_HMHMooneyRivlin ( const int  tape,
const double  alpha,
const double  beta,
const double  lambda,
const double  sigma_y 
)
Examples
ep.cpp.

Definition at line 644 of file EshelbianADOL-C.cpp.

646  {
648  physicalEquations = boost::shared_ptr<HMHPMooneyRivlinWriggersEq63>(
649  new HMHPMooneyRivlinWriggersEq63(alpha, beta, lambda, sigma_y));
650  CHKERR physicalEquations->recordTape(tape);
652 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< PhysicalEquations > physicalEquations
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ addVolumeFiniteElement()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::addVolumeFiniteElement ( const EntityHandle  meshset = 0)
Examples
ep.cpp.

Definition at line 247 of file EshelbianPlasticity.cpp.

247  {
249 
250  // set finite element fields
251  auto add_field_to_fe = [this](const std::string fe,
252  const std::string field_name) {
258  };
259 
263 
264  CHKERR add_field_to_fe(elementVolumeName, piolaStress);
265  CHKERR add_field_to_fe(elementVolumeName, bubbleField);
266  CHKERR add_field_to_fe(elementVolumeName, eshelbyStress);
267  CHKERR add_field_to_fe(elementVolumeName, streachTensor);
268  CHKERR add_field_to_fe(elementVolumeName, rotAxis);
269  CHKERR add_field_to_fe(elementVolumeName, spatialDisp);
270  CHKERR add_field_to_fe(elementVolumeName, spatialPosition);
271  CHKERR add_field_to_fe(elementVolumeName, streachTensor);
272  CHKERR add_field_to_fe(elementVolumeName, materialGradient);
273  // CHKERR add_field_to_fe(elementVolumeName, materialDisp);
274  // CHKERR add_field_to_fe(elementVolumeName, tauField);
275  // CHKERR add_field_to_fe(elementVolumeName, lambdaField);
276 
277  // CHKERR mField.modify_finite_element_add_field_data(elementVolumeName,
278  // piolaStress + "_RT");
280  materialGradient + "0");
281 
282  // build finite elements data structures
284 
286 }
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string &name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
#define CHKERR
Inline error check.
Definition: definitions.h:596
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string &name_row)=0
set field row which finite element use
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elementsBuild finite element data structures. Have to be run before problem and adjacenc...

◆ getBc()

template<typename BC >
MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getBc ( boost::shared_ptr< BC > &  bc_vec_ptr,
const std::string  block_set_name,
const int  nb_attributes 
)

Definition at line 1315 of file EshelbianPlasticity.hpp.

1317  {
1320  auto block_name = it->getName();
1321  if (block_name.compare(0, block_set_name.length(), block_set_name) == 0) {
1322  std::vector<double> block_attributes;
1323  CHKERR it->getAttributes(block_attributes);
1324  if (block_attributes.size() != nb_attributes) {
1325  SETERRQ3(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1326  "In block %s expected %d attributes, but given %d",
1327  it->getName().c_str(), nb_attributes,
1328  block_attributes.size());
1329  }
1330  Range faces;
1331  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, faces,
1332  true);
1333  bc_vec_ptr->emplace_back(block_name, block_attributes, faces);
1334  }
1335  }
1337  }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#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.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getOptions()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getOptions ( )

Definition at line 76 of file EshelbianPlasticity.cpp.

76  {
78  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Eshelbian plasticity",
79  "none");
80 
81  spaceOrder = 1;
82  CHKERR PetscOptionsInt("-space_order", "approximation oder for space", "",
83  spaceOrder, &spaceOrder, PETSC_NULL);
84  spaceGhostOrder = 1;
85  CHKERR PetscOptionsInt("-space_ghost_order",
86  "approximation ghost frame oder for space", "",
87  spaceGhostOrder, &spaceGhostOrder, PETSC_NULL);
88  ghostFrameOn = PETSC_TRUE;
89  CHKERR PetscOptionsBool("-space_ghost_frame_on", "On ghost frame", "",
90  ghostFrameOn, &ghostFrameOn, PETSC_NULL);
91  materialOrder = 1;
92  CHKERR PetscOptionsInt("-material_order", "approximation oder for material",
93  "", materialOrder, &materialOrder, PETSC_NULL);
94 
95  alpha_u = 0;
96  CHKERR PetscOptionsScalar("-viscosity_alpha_u", "viscosity", "", alpha_u,
97  &alpha_u, PETSC_NULL);
98 
99  preconditioner_eps = 1e-3;
100  CHKERR PetscOptionsScalar("-preconditioner_eps", "preconditioner_eps", "",
102  PETSC_NULL);
103 
104  ierr = PetscOptionsEnd();
105  CHKERRG(ierr);
107 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:544
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ getSpatialDispBc()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getSpatialDispBc ( )
Examples
ep.cpp.

Definition at line 1339 of file EshelbianPlasticity.hpp.

1339  {
1340  bcSpatialDispVecPtr = boost::make_shared<BcDispVec>();
1341  return getBc(bcSpatialDispVecPtr, "SPATIAL_DISP_BC", 6);
1342  }
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
MoFEMErrorCode getBc(boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_set_name, const int nb_attributes)

◆ getSpatialRotationBc()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getSpatialRotationBc ( )
Examples
ep.cpp.

Definition at line 1344 of file EshelbianPlasticity.hpp.

1344  {
1345  bcSpatialRotationVecPtr = boost::make_shared<BcRotVec>();
1346  return getBc(bcSpatialRotationVecPtr, "SPATIAL_ROTATION_BC", 4);
1347  }
boost::shared_ptr< BcRotVec > bcSpatialRotationVecPtr
MoFEMErrorCode getBc(boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_set_name, const int nb_attributes)

◆ getSpatialTractionBc()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getSpatialTractionBc ( )
Examples
ep.cpp.

Definition at line 1349 of file EshelbianPlasticity.hpp.

1349  {
1350  bcSpatialTraction = boost::make_shared<TractionBcVec>();
1351  return getBc(bcSpatialTraction, "SPATIAL_TRACTION_BC", 6);
1352  }
MoFEMErrorCode getBc(boost::shared_ptr< BC > &bc_vec_ptr, const std::string block_set_name, const int nb_attributes)
boost::shared_ptr< TractionBcVec > bcSpatialTraction

◆ getSpatialTractionFreeBc()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getSpatialTractionFreeBc ( const EntityHandle  meshset = 0)
Examples
ep.cpp.

Definition at line 1359 of file EshelbianPlasticity.hpp.

1359  {
1361  boost::shared_ptr<TractionFreeBc>(new TractionFreeBc());
1362  return getTractionFreeBc(meshset, bcSpatialFreeTraction, "SPATIAL_DISP_BC",
1363  "SPATIAL_ROTATION_BC");
1364  }
std::vector< Range > TractionFreeBc
boost::shared_ptr< TractionFreeBc > bcSpatialFreeTraction
MoFEMErrorCode getTractionFreeBc(const EntityHandle meshset, boost::shared_ptr< TractionFreeBc > &bc_ptr, const std::string disp_block_set_name, const std::string rot_block_set_name)

◆ getTractionFreeBc()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::getTractionFreeBc ( const EntityHandle  meshset,
boost::shared_ptr< TractionFreeBc > &  bc_ptr,
const std::string  disp_block_set_name,
const std::string  rot_block_set_name 
)

Definition at line 511 of file EshelbianPlasticity.cpp.

514  {
516  Range tets;
517  CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET, tets);
518  Range tets_skin_part;
519  Skinner skin(&mField.get_moab());
520  CHKERR skin.find_skin(0, tets, false, tets_skin_part);
521  ParallelComm *pcomm =
522  ParallelComm::get_pcomm(&mField.get_moab(), MYPCOMM_INDEX);
523  Range tets_skin;
524  CHKERR pcomm->filter_pstatus(tets_skin_part,
525  PSTATUS_SHARED | PSTATUS_MULTISHARED,
526  PSTATUS_NOT, -1, &tets_skin);
527 
528  bc_ptr->resize(3);
529  for (int dd = 0; dd != 3; ++dd)
530  (*bc_ptr)[dd] = tets_skin;
531 
533  if (it->getName().compare(0, disp_block_set_name.length(),
534  disp_block_set_name) == 0) {
535  std::vector<double> block_attributes;
536  CHKERR it->getAttributes(block_attributes);
537  if (block_attributes.size() != 6) {
538  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
539  "In block %s six attributes are required for given BC "
540  "blockset (3 values + "
541  "3 flags) != %d",
542  it->getName().c_str(), block_attributes.size());
543  }
544  Range faces;
545  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, faces,
546  true);
547  if (block_attributes[3] != 0)
548  (*bc_ptr)[0] = subtract((*bc_ptr)[0], faces);
549  if (block_attributes[4] != 0)
550  (*bc_ptr)[1] = subtract((*bc_ptr)[1], faces);
551  if (block_attributes[5] != 0)
552  (*bc_ptr)[2] = subtract((*bc_ptr)[2], faces);
553  }
554  if (it->getName().compare(0, rot_block_set_name.length(),
555  rot_block_set_name) == 0) {
556  Range faces;
557  CHKERR it->getMeshsetIdEntitiesByDimension(mField.get_moab(), 2, faces,
558  true);
559  (*bc_ptr)[0] = subtract((*bc_ptr)[0], faces);
560  (*bc_ptr)[1] = subtract((*bc_ptr)[1], faces);
561  (*bc_ptr)[2] = subtract((*bc_ptr)[2], faces);
562  }
563  }
564 
565  // for (int dd = 0; dd != 3; ++dd) {
566  // EntityHandle meshset;
567  // CHKERR mField.get_moab().create_meshset(MESHSET_SET, meshset);
568  // CHKERR mField.get_moab().add_entities(meshset, (*bc_ptr)[dd]);
569  // std::string file_name = disp_block_set_name +
570  // "_traction_free_bc_" + boost::lexical_cast<std::string>(dd) + ".vtk";
571  // CHKERR mField.get_moab().write_file(file_name.c_str(), " VTK ", "",
572  // &meshset, 1);
573  // CHKERR mField.get_moab().delete_entities(&meshset, 1);
574  // }
575 
577 }
virtual moab::Interface & get_moab()=0
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
#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.
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:285
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ postProcessResults()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::postProcessResults ( const int  tag,
const std::string  file 
)

Definition at line 1520 of file EshelbianPlasticity.cpp.

1521  {
1523 
1524  if (!dataAtPts) {
1525  dataAtPts =
1526  boost::shared_ptr<DataAtIntegrationPts>(new DataAtIntegrationPts());
1527  dataAtPts->approxPAtPts = boost::make_shared<MatrixDouble>();
1528  dataAtPts->approxSigmaAtPts = boost::make_shared<MatrixDouble>();
1529  dataAtPts->divSigmaAtPts = boost::make_shared<MatrixDouble>();
1530  dataAtPts->wAtPts = boost::make_shared<MatrixDouble>();
1531  dataAtPts->xAtPts = boost::make_shared<MatrixDouble>();
1532  dataAtPts->xGradAtPts = boost::make_shared<MatrixDouble>();
1533  dataAtPts->xDetAtPts = boost::make_shared<VectorDouble>();
1534  dataAtPts->xInvGradAtPts = boost::make_shared<MatrixDouble>();
1535  dataAtPts->rotAxisAtPts = boost::make_shared<MatrixDouble>();
1536  dataAtPts->streachTensorAtPts = boost::make_shared<MatrixDouble>();
1537  dataAtPts->rotMatAtPts = boost::make_shared<MatrixDouble>();
1538  dataAtPts->diffRotMatAtPts = boost::make_shared<MatrixDouble>();
1539  dataAtPts->hAtPts = boost::make_shared<MatrixDouble>();
1540  dataAtPts->hDeltaAtPts = boost::make_shared<MatrixDouble>();
1541  dataAtPts->GAtPts = boost::make_shared<MatrixDouble>();
1542  dataAtPts->G0AtPts = boost::make_shared<MatrixDouble>();
1543  dataAtPts->hDeltaDetAtPts = boost::make_shared<VectorDouble>();
1544  }
1545 
1547  post_proc.getUserPolynomialBase() =
1548  boost::shared_ptr<BaseFunction>(new CGGUserPolynomialBase());
1549 
1550  CHKERR post_proc.generateReferenceElementMesh();
1551  post_proc.getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
1552  piolaStress, dataAtPts->approxPAtPts));
1553  // post_proc.getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
1554  // piolaStress + "_RT", dataAtPts->approxPAtPts, MBMAXTYPE));
1555  post_proc.getOpPtrVector().push_back(new OpCalculateHTensorTensorField<3, 3>(
1556  bubbleField, dataAtPts->approxPAtPts, MBMAXTYPE));
1557  post_proc.getOpPtrVector().push_back(
1559  streachTensor, dataAtPts->streachTensorAtPts, MBTET));
1560  post_proc.getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1561  rotAxis, dataAtPts->rotAxisAtPts, MBTET));
1562  post_proc.getOpPtrVector().push_back(new OpCalculateTensor2FieldValues<3, 3>(
1563  materialGradient, dataAtPts->GAtPts, MBTET));
1564  post_proc.getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1565  spatialDisp, dataAtPts->wAtPts, MBTET));
1566  post_proc.getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1567  spatialPosition, dataAtPts->xAtPts, MBVERTEX));
1568  post_proc.getOpPtrVector().push_back(new OpCalculateVectorFieldGradient<3, 3>(
1569  spatialPosition, dataAtPts->xGradAtPts));
1570 
1571  // evaluate derived quantities
1572  post_proc.getOpPtrVector().push_back(
1573  new OpCalculateRotationAndSpatialGradient(rotAxis, dataAtPts));
1574 
1575  // evaluate integration points
1576  post_proc.getOpPtrVector().push_back(physicalEquations->returnOpJacobian(
1577  spatialDisp, tag, true, false, dataAtPts, physicalEquations));
1578  post_proc.getOpPtrVector().push_back(new OpPostProcDataStructure(
1579  post_proc.postProcMesh, post_proc.mapGaussPts, spatialDisp, dataAtPts));
1580 
1581  CHKERR DMoFEMLoopFiniteElements(dM, elementVolumeName.c_str(), &post_proc);
1582  CHKERR post_proc.writeFile(file.c_str());
1584 }
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
Get values at integration pts for tensor filed rank 1, i.e. vector field.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method)
Executes FEMethod for finite elements in DM.
Definition: DMMMoFEM.cpp:496
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Post processing.
boost::shared_ptr< PhysicalEquations > physicalEquations
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
#define CHKERR
Inline error check.
Definition: definitions.h:596
DM dM
Coupled problem all fields.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
Get values at integration pts for tensor filed rank 2, i.e. matrix field.

◆ query_interface()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const

Getting interface of core database.

Parameters
uuidunique ID of interface
ifacereturned pointer to interface
Returns
error code

Definition at line 19 of file EshelbianPlasticity.cpp.

20  {
22  *iface = NULL;
24  *iface = const_cast<EshelbianCore *>(this);
26  }
27  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
29 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
static const MOFEMuuid IDD_MOFEMEshelbianCrackInterface

◆ setBaseVolumeElementOps()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setBaseVolumeElementOps ( const int  tag,
const bool  do_rhs,
const bool  do_lhs,
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &  fe 
)

Definition at line 697 of file EshelbianPlasticity.cpp.

699  {
701  fe = boost::make_shared<EpElement<VolumeElementForcesAndSourcesCore>>(mField);
702 
703  fe->getUserPolynomialBase() =
704  boost::shared_ptr<BaseFunction>(new CGGUserPolynomialBase());
705 
706  // set integration rule
707  fe->getRuleHook = VolRule();
708 
709  if (!dataAtPts) {
710  dataAtPts =
711  boost::shared_ptr<DataAtIntegrationPts>(new DataAtIntegrationPts());
712  dataAtPts->approxPAtPts = boost::make_shared<MatrixDouble>();
713  dataAtPts->divPAtPts = boost::make_shared<MatrixDouble>();
714  dataAtPts->approxSigmaAtPts = boost::make_shared<MatrixDouble>();
715  dataAtPts->divSigmaAtPts = boost::make_shared<MatrixDouble>();
716  dataAtPts->wAtPts = boost::make_shared<MatrixDouble>();
717  dataAtPts->xAtPts = boost::make_shared<MatrixDouble>();
718  dataAtPts->xGradAtPts = boost::make_shared<MatrixDouble>();
719  dataAtPts->xDotGradAtPts = boost::make_shared<MatrixDouble>();
720  dataAtPts->xDetAtPts = boost::make_shared<VectorDouble>();
721  dataAtPts->xInvGradAtPts = boost::make_shared<MatrixDouble>();
722  dataAtPts->rotAxisAtPts = boost::make_shared<MatrixDouble>();
723  dataAtPts->rotDotAxisAtPts = boost::make_shared<MatrixDouble>();
724  dataAtPts->streachTensorAtPts = boost::make_shared<MatrixDouble>();
725  dataAtPts->streachDotTensorAtPts = boost::make_shared<MatrixDouble>();
726  dataAtPts->rotMatAtPts = boost::make_shared<MatrixDouble>();
727  dataAtPts->diffRotMatAtPts = boost::make_shared<MatrixDouble>();
728  dataAtPts->hAtPts = boost::make_shared<MatrixDouble>();
729  dataAtPts->hDeltaAtPts = boost::make_shared<MatrixDouble>();
730  dataAtPts->GAtPts = boost::make_shared<MatrixDouble>();
731  dataAtPts->G0AtPts = boost::make_shared<MatrixDouble>();
732  dataAtPts->wwMatPtr = boost::make_shared<MatrixDouble>();
733  dataAtPts->ooMatPtr = boost::make_shared<MatrixDouble>();
734  }
735 
736  // calculate fields values
737  fe->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
738  piolaStress, dataAtPts->approxPAtPts));
739  // fe->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
740  // piolaStress + "_RT", dataAtPts->approxPAtPts, MBMAXTYPE));
741  fe->getOpPtrVector().push_back(new OpCalculateHTensorTensorField<3, 3>(
742  bubbleField, dataAtPts->approxPAtPts, MBMAXTYPE));
743  fe->getOpPtrVector().push_back(new OpCalculateHVecTensorDivergence<3, 3>(
744  piolaStress, dataAtPts->divPAtPts));
745  // fe->getOpPtrVector().push_back(new OpCalculateHVecTensorDivergence<3, 3>(
746  // piolaStress + "_RT", dataAtPts->divPAtPts, MBMAXTYPE));
747  fe->getOpPtrVector().push_back(new OpCalculateHVecTensorField<3, 3>(
748  eshelbyStress, dataAtPts->approxSigmaAtPts));
749  fe->getOpPtrVector().push_back(new OpCalculateHVecTensorDivergence<3, 3>(
750  eshelbyStress, dataAtPts->divSigmaAtPts));
751  fe->getOpPtrVector().push_back(new OpCalculateTensor2SymmetricFieldValues<3>(
752  streachTensor, dataAtPts->streachTensorAtPts, MBTET));
753  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
754  rotAxis, dataAtPts->rotAxisAtPts, MBTET));
755  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldValuesDot<3>(
756  rotAxis, dataAtPts->rotDotAxisAtPts, MBTET));
757  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
758  spatialPosition, dataAtPts->xAtPts, MBVERTEX));
759  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldGradient<3, 3>(
760  spatialPosition, dataAtPts->xGradAtPts));
761  fe->getOpPtrVector().push_back(new OpCalculateTensor2FieldValues<3, 3>(
762  materialGradient, dataAtPts->GAtPts, MBTET));
763  fe->getOpPtrVector().push_back(new OpCalculateTensor2FieldValues<3, 3>(
764  materialGradient + "0", dataAtPts->G0AtPts, MBTET));
765  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
766  spatialDisp, dataAtPts->wAtPts, MBTET));
767 
768  // velocities
769  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldGradientDot<3, 3>(
770  spatialPosition, dataAtPts->xDotGradAtPts));
771  fe->getOpPtrVector().push_back(new OpCalculateVectorFieldValuesDot<3>(
772  rotAxis, dataAtPts->rotDotAxisAtPts, MBTET));
773  fe->getOpPtrVector().push_back(
775  streachTensor, dataAtPts->streachDotTensorAtPts, MBTET));
776 
777  // calculate other derived quantities
778  fe->getOpPtrVector().push_back(
779  new OpCalculateRotationAndSpatialGradient(rotAxis, dataAtPts));
780 
781  // evaluate integration points
782  fe->getOpPtrVector().push_back(physicalEquations->returnOpJacobian(
783  spatialDisp, tag, do_rhs, do_lhs, dataAtPts, physicalEquations));
784 
786 }
Get field gradients time derivative at integration pts for scalar filed rank 0, i....
Set integration rule.
Get time direvatives of values at integration pts for tensor filed rank 1, i.e. vector field mofem_fo...
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
Get values at integration pts for tensor filed rank 1, i.e. vector field.
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
boost::shared_ptr< PhysicalEquations > physicalEquations
Calculate divergence of tonsorial field using vectorial base.
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
Get values at integration pts for tensor filed rank 2, i.e. matrix field.

◆ setElasticElementOps()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setElasticElementOps ( const int  tag)
Examples
ep.cpp.

Definition at line 916 of file EshelbianPlasticity.cpp.

916  {
919  elasticFeLhs);
922 }
MoFEMErrorCode setGenericFaceElementOps(const bool add_elastic, const bool add_material, boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &fe_rhs, boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &fe_lhs)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
MoFEMErrorCode setGenericVolumeElementOps(const int tag, const bool add_elastic, const bool add_material, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe_rhs, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe_lhs)
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcRhs
#define CHKERR
Inline error check.
Definition: definitions.h:596
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeLhs
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcLhs
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeRhs

◆ setElasticElementToTs()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setElasticElementToTs ( DM  dm)
Examples
ep.cpp.

Definition at line 924 of file EshelbianPlasticity.cpp.

924  {
926  boost::shared_ptr<FEMethod> null;
927  boost::shared_ptr<EpElement<FeTractionBc>> spatial_traction_bc(
928  new EpElement<FeTractionBc>(mField, piolaStress/* + "_RT"*/,
930 
931  CHKERR DMMoFEMTSSetIFunction(dm, DM_NO_ELEMENT, null, spatial_traction_bc,
932  null);
936  spatial_traction_bc);
937 
938  schurAssembly = boost::make_shared<EpFEMethod>();
944 }
#define DM_NO_ELEMENT
Definition: DMMoFEM.hpp:22
boost::shared_ptr< EpFEMethod > schurAssembly
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
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:761
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcRhs
#define CHKERR
Inline error check.
Definition: definitions.h:596
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeLhs
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore > > elasticBcLhs
boost::shared_ptr< TractionBcVec > bcSpatialTraction
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:708
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore > > elasticFeRhs

◆ setGenericFaceElementOps()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setGenericFaceElementOps ( const bool  add_elastic,
const bool  add_material,
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &  fe_rhs,
boost::shared_ptr< EpElement< FaceElementForcesAndSourcesCore >> &  fe_lhs 
)

Definition at line 879 of file EshelbianPlasticity.cpp.

882  {
884 
885  fe_rhs =
886  boost::make_shared<EpElement<FaceElementForcesAndSourcesCore>>(mField);
887  fe_lhs =
888  boost::make_shared<EpElement<FaceElementForcesAndSourcesCore>>(mField);
889 
890  // set integration rule
891  fe_rhs->getRuleHook = FaceRule();
892  fe_lhs->getRuleHook = FaceRule();
893 
894  if (!dataAtPts->xAtPts)
895  dataAtPts->xAtPts = boost::make_shared<MatrixDouble>();
896 
897  if (add_elastic) {
898  fe_rhs->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
899  spatialPosition, dataAtPts->xAtPts, MBVERTEX));
900  fe_rhs->getOpPtrVector().push_back(
901  new OpDispBc(piolaStress, dataAtPts, bcSpatialDispVecPtr));
902  fe_rhs->getOpPtrVector().push_back(
903  new OpRotationBc(piolaStress, dataAtPts, bcSpatialRotationVecPtr));
904 
905  fe_lhs->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
906  spatialPosition, dataAtPts->xAtPts, MBVERTEX));
907  fe_lhs->getOpPtrVector().push_back(new OpDispBc_dx(
909  fe_lhs->getOpPtrVector().push_back(new OpRotationBc_dx(
911  }
912 
914 }
boost::shared_ptr< BcRotVec > bcSpatialRotationVecPtr
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
Get values at integration pts for tensor filed rank 1, i.e. vector field.
boost::shared_ptr< BcDispVec > bcSpatialDispVecPtr
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
Set integration rule to boundary elements.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ setGenericVolumeElementOps()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setGenericVolumeElementOps ( const int  tag,
const bool  add_elastic,
const bool  add_material,
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &  fe_rhs,
boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &  fe_lhs 
)

Definition at line 788 of file EshelbianPlasticity.cpp.

791  {
793 
794  // Right hand side
795  CHKERR setBaseVolumeElementOps(tag, true, false, fe_rhs);
796 
797  // elastic
798  if (add_elastic) {
799  fe_rhs->getOpPtrVector().push_back(
800  new OpSpatialEquilibrium(spatialDisp, dataAtPts));
801  fe_rhs->getOpPtrVector().push_back(
802  new OpSpatialRotation(rotAxis, dataAtPts));
803  fe_rhs->getOpPtrVector().push_back(
804  new OpSpatialPhysical(streachTensor, dataAtPts, alpha_u));
805  fe_rhs->getOpPtrVector().push_back(
806  new OpSpatialConsistencyP(piolaStress, dataAtPts));
807  fe_rhs->getOpPtrVector().push_back(
808  new OpSpatialConsistencyBubble(bubbleField, dataAtPts));
809  fe_rhs->getOpPtrVector().push_back(
810  new OpSpatialConsistencyDivTerm(piolaStress, dataAtPts));
811  fe_rhs->getOpPtrVector().push_back(
812  new OpSpatialPrj(spatialPosition, dataAtPts));
813  }
814 
815  // Left hand side
816  CHKERR setBaseVolumeElementOps(tag, true, true, fe_lhs);
817 
818  // elastic
819  if (add_elastic) {
820 
821  // Schur
822  fe_lhs->getOpPtrVector().push_back(
823  new OpSpatialSchurBegin(spatialDisp, dataAtPts));
824 
825  fe_lhs->getOpPtrVector().push_back(new OpSpatialPhysical_du_du(
827  fe_lhs->getOpPtrVector().push_back(new OpSpatialPhysical_du_dBubble(
829 
830  fe_lhs->getOpPtrVector().push_back(new OpSpatialEquilibrium_dw_dP(
832  fe_lhs->getOpPtrVector().push_back(
833  new OpSpatialConsistency_dP_domega(piolaStress, rotAxis, dataAtPts));
834  fe_lhs->getOpPtrVector().push_back(new OpSpatialConsistency_dBubble_domega(
835  bubbleField, rotAxis, dataAtPts, false));
836  fe_lhs->getOpPtrVector().push_back(new OpSpatialConsistency_dP_dx(
838  fe_lhs->getOpPtrVector().push_back(new OpSpatialConsistency_dBubble_dx(
840 
841  fe_lhs->getOpPtrVector().push_back(new OpSpatialPhysical_du_dP(
843  fe_lhs->getOpPtrVector().push_back(new OpSpatialPhysical_du_domega(
844  streachTensor, rotAxis, dataAtPts, false));
845  fe_lhs->getOpPtrVector().push_back(new OpSpatialPhysical_du_dx(
847 
848  fe_lhs->getOpPtrVector().push_back(new OpSpatialRotation_domega_dP(
849  rotAxis, piolaStress, dataAtPts, false));
850  fe_lhs->getOpPtrVector().push_back(new OpSpatialRotation_domega_dBubble(
851  rotAxis, bubbleField, dataAtPts, false));
852  fe_lhs->getOpPtrVector().push_back(
853  new OpSpatialRotation_domega_domega(rotAxis, rotAxis, dataAtPts));
854  fe_lhs->getOpPtrVector().push_back(
855  new OpSpatialRotation_domega_du(rotAxis, streachTensor, dataAtPts));
856  fe_lhs->getOpPtrVector().push_back(new OpSpatialRotation_domega_dx(
857  rotAxis, spatialPosition, dataAtPts, false));
858 
859  fe_lhs->getOpPtrVector().push_back(
860  new OpSpatialPrj_dx_dx(spatialPosition, spatialPosition, dataAtPts));
861  fe_lhs->getOpPtrVector().push_back(
862  new OpSpatialPrj_dx_dw(spatialPosition, spatialDisp, dataAtPts));
863 
864  // Schur
865  fe_lhs->getOpPtrVector().push_back(
866  new OpSpatialPreconditionMass(rotAxis, dataAtPts->ooMatPtr));
867  fe_lhs->getOpPtrVector().push_back(
868  new OpSpatialPreconditionMass(spatialDisp, dataAtPts->wwMatPtr));
869  fe_lhs->getOpPtrVector().push_back(
870  new OpSpatialSchurEnd(spatialDisp, dataAtPts, preconditioner_eps));
871 
872  if (add_material) {
873  }
874  }
875 
877 }
MoFEMErrorCode setBaseVolumeElementOps(const int tag, const bool do_rhs, const bool do_lhs, boost::shared_ptr< EpElement< VolumeElementForcesAndSourcesCore >> &fe)
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
#define CHKERR
Inline error check.
Definition: definitions.h:596
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

◆ setUpTSElastic()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::setUpTSElastic ( TS  ts,
Mat  m,
Vec  f 
)
Examples
ep.cpp.

Definition at line 946 of file EshelbianPlasticity.cpp.

946  {
948  boost::shared_ptr<TsCtx> ts_ctx;
950  CHKERR TSSetIFunction(ts, f, PETSC_NULL, PETSC_NULL);
951  CHKERR TSSetIJacobian(ts, m, m, PETSC_NULL, PETSC_NULL);
952  CHKERR TSMonitorSet(ts, TsMonitorSet, ts_ctx.get(), PETSC_NULL);
953 
954  auto add_schur_streach_op = [this](auto &list, Mat S, AO aoS) {
956  for (auto &fe : list)
957  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.second))
958  fe_cast->addStreachSchurMatrix(S, aoS);
959  else
960  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
962  };
963 
964  auto add_schur_streach_pre = [this](auto &list, Mat S, AO aoS) {
966  for (auto &fe : list)
967  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.getSharedPtr().get()))
968  fe_cast->addStreachSchurMatrix(S, aoS);
969  else
970  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
972  };
973 
974  auto add_schur_bubble_op = [this](auto &list, Mat S, AO aoS) {
976  for (auto &fe : list)
977  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.second))
978  fe_cast->addBubbleSchurMatrix(S, aoS);
979  else
980  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
982  };
983 
984  auto add_schur_bubble_pre = [this](auto &list, Mat S, AO aoS) {
986  for (auto &fe : list)
987  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.getSharedPtr().get()))
988  fe_cast->addBubbleSchurMatrix(S, aoS);
989  else
990  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
992  };
993 
994  auto add_schur_spatial_disp_op = [this](auto &list, Mat S, AO aoS) {
996  for (auto &fe : list)
997  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.second))
998  fe_cast->addSpatialDispStressSchurMatrix(S, aoS);
999  else
1000  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
1002  };
1003 
1004  auto add_schur_spatial_disp_pre = [this](auto &list, Mat S, AO aoS) {
1006  for (auto &fe : list)
1007  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.getSharedPtr().get()))
1008  fe_cast->addSpatialDispStressSchurMatrix(S, aoS);
1009  else
1010  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
1012  };
1013 
1014  auto add_schur_omega_op = [this](auto &list, Mat S, AO aoS) {
1016  for (auto &fe : list)
1017  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.second))
1018  fe_cast->addOmegaSchurMatrix(S, aoS);
1019  else
1020  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
1022  };
1023 
1024  auto add_schur_omega_pre = [this](auto &list, Mat S, AO ao) {
1026  for (auto &fe : list)
1027  if (auto fe_cast = dynamic_cast<EpElementBase *>(fe.getSharedPtr().get()))
1028  fe_cast->addOmegaSchurMatrix(S, ao);
1029  else
1030  SETERRQ(mField.get_comm(), MOFEM_DATA_INCONSISTENCY, "No EpElement");
1032  };
1033 
1034  const MoFEM::Problem *schur_streach_prb_ptr;
1035  CHKERR DMMoFEMGetProblemPtr(dmElasticSchurStreach, &schur_streach_prb_ptr);
1036  if (auto sub_data = schur_streach_prb_ptr->subProblemData) {
1037  Mat Suu;
1038  CHKERR DMCreateMatrix(dmElasticSchurStreach, &Suu);
1039  AO aoSuu;
1040  CHKERR sub_data->getRowMap(&aoSuu);
1041 
1042  CHKERR add_schur_streach_op(ts_ctx->loops_to_do_IJacobian, Suu, aoSuu);
1043  CHKERR add_schur_streach_pre(ts_ctx->preProcess_IJacobian, Suu, aoSuu);
1044  CHKERR add_schur_streach_pre(ts_ctx->postProcess_IJacobian, Suu, aoSuu);
1045 
1046  CHKERR MatDestroy(&Suu);
1047  CHKERR AODestroy(&aoSuu);
1048 
1049  const MoFEM::Problem *schur_bubble_prb_ptr;
1050  CHKERR DMMoFEMGetProblemPtr(dmElasticSchurBubble, &schur_bubble_prb_ptr);
1051  if (auto bubble_data = schur_bubble_prb_ptr->subProblemData) {
1052  Mat SBubble;
1053  CHKERR DMCreateMatrix(dmElasticSchurBubble, &SBubble);
1054  AO aoSBubble;
1055  CHKERR bubble_data->getRowMap(&aoSBubble);
1056 
1057  CHKERR add_schur_bubble_op(ts_ctx->loops_to_do_IJacobian, SBubble,
1058  aoSBubble);
1059  CHKERR add_schur_bubble_pre(ts_ctx->preProcess_IJacobian, SBubble,
1060  aoSBubble);
1061  CHKERR add_schur_bubble_pre(ts_ctx->postProcess_IJacobian, SBubble,
1062  aoSBubble);
1063 
1064  CHKERR MatDestroy(&SBubble);
1065  CHKERR AODestroy(&aoSBubble);
1066 
1067  const MoFEM::Problem *schur_omega_prb_ptr;
1068  CHKERR DMMoFEMGetProblemPtr(dmElasticSchurOmega, &schur_omega_prb_ptr);
1069  if (auto tet_stress_data = schur_omega_prb_ptr->subProblemData) {
1070  Mat SOmega;
1071  CHKERR DMCreateMatrix(dmElasticSchurOmega, &SOmega);
1072  AO aoSOmega;
1073  CHKERR tet_stress_data->getRowMap(&aoSOmega);
1074 
1075  CHKERR add_schur_omega_op(ts_ctx->loops_to_do_IJacobian, SOmega,
1076  aoSOmega);
1077  CHKERR add_schur_omega_pre(ts_ctx->preProcess_IJacobian, SOmega,
1078  aoSOmega);
1079  CHKERR add_schur_omega_pre(ts_ctx->postProcess_IJacobian, SOmega,
1080  aoSOmega);
1081 
1082  const MoFEM::Problem *schur_spatial_disp_prb_ptr;
1084  &schur_spatial_disp_prb_ptr);
1085  if (auto spatial_disp_data =
1086  schur_spatial_disp_prb_ptr->subProblemData) {
1087 
1088  Mat Sw;
1089  CHKERR DMCreateMatrix(dmElasticSchurSpatialDisp, &Sw);
1090  AO aoSw;
1091  CHKERR spatial_disp_data->getRowMap(&aoSw);
1092 
1093  CHKERR add_schur_spatial_disp_op(ts_ctx->loops_to_do_IJacobian, Sw,
1094  aoSw);
1095  CHKERR add_schur_spatial_disp_pre(ts_ctx->preProcess_IJacobian, Sw,
1096  aoSw);
1097  CHKERR add_schur_spatial_disp_pre(ts_ctx->postProcess_IJacobian, Sw,
1098  aoSw);
1099 
1100  CHKERR MatDestroy(&Sw);
1101  CHKERR AODestroy(&aoSw);
1102  } else
1104  "Problem does not have sub-problem data");
1105 
1106  CHKERR MatDestroy(&SOmega);
1107  CHKERR AODestroy(&aoSOmega);
1108 
1109  } else
1111  "Problem does not have sub-problem data");
1112 
1113  } else
1115  "Problem does not have sub-problem data");
1116 
1117  } else
1119  "Problem does not have sub-problem data");
1120 
1121  struct Monitor : public FEMethod {
1122 
1123  using Ele = ForcesAndSourcesCore;
1124  using VolEle = VolumeElementForcesAndSourcesCore;
1126  using SetPtsData = FieldEvaluatorInterface::SetPtsData;
1127 
1128  EshelbianCore &eP;
1129  boost::shared_ptr<SetPtsData> dataFieldEval;
1130  boost::shared_ptr<VolEle> volPostProcEle;
1131  boost::shared_ptr<double> gEnergy;
1132 
1133  Monitor(EshelbianCore &ep)
1134  : eP(ep),
1135  dataFieldEval(ep.mField.getInterface<FieldEvaluatorInterface>()
1136  ->getData<VolEle>()),
1137  volPostProcEle(new VolEle(ep.mField)), gEnergy(new double) {
1138  ierr = ep.mField.getInterface<FieldEvaluatorInterface>()->buildTree3D(
1139  dataFieldEval, "EP");
1140  CHKERRABORT(PETSC_COMM_WORLD, ierr);
1141 
1142  auto no_rule = [](int, int, int) { return -1; };
1143 
1144  auto set_element_for_field_eval = [&]() {
1145  boost::shared_ptr<Ele> vol_ele(dataFieldEval->feMethodPtr.lock());
1146  vol_ele->getRuleHook = no_rule;
1147  vol_ele->getUserPolynomialBase() =
1148  boost::shared_ptr<BaseFunction>(new CGGUserPolynomialBase());
1149  vol_ele->getOpPtrVector().push_back(
1150  new OpCalculateHVecTensorField<3, 3>(eP.piolaStress,
1151  eP.dataAtPts->approxPAtPts));
1152  // vol_ele->getOpPtrVector().push_back(
1153  // new OpCalculateHVecTensorField<3, 3>(
1154  // eP.piolaStress + "_RT", eP.dataAtPts->approxPAtPts, MBMAXTYPE));
1155  vol_ele->getOpPtrVector().push_back(
1157  eP.bubbleField, eP.dataAtPts->approxPAtPts, MBMAXTYPE));
1158  vol_ele->getOpPtrVector().push_back(
1160  eP.streachTensor, eP.dataAtPts->streachTensorAtPts, MBTET));
1161  vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1162  eP.rotAxis, eP.dataAtPts->rotAxisAtPts, MBTET));
1163  vol_ele->getOpPtrVector().push_back(
1165  eP.materialGradient, eP.dataAtPts->GAtPts, MBTET));
1166  vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1167  eP.spatialDisp, eP.dataAtPts->wAtPts, MBTET));
1168  vol_ele->getOpPtrVector().push_back(new OpCalculateVectorFieldValues<3>(
1169  eP.spatialPosition, eP.dataAtPts->xAtPts, MBVERTEX));
1170  vol_ele->getOpPtrVector().push_back(
1171  new OpCalculateVectorFieldGradient<3, 3>(eP.spatialPosition,
1172  eP.dataAtPts->xGradAtPts));
1173  vol_ele->getOpPtrVector().push_back(
1174  new OpCalculateRotationAndSpatialGradient(eP.rotAxis,
1175  eP.dataAtPts));
1176  };
1177 
1178 
1179  auto set_element_for_post_process = [&]() {
1180  volPostProcEle->getRuleHook = VolRule();
1181  volPostProcEle->getUserPolynomialBase() =
1182  boost::shared_ptr<BaseFunction>(new CGGUserPolynomialBase());
1183  volPostProcEle->getOpPtrVector().push_back(
1184  new OpCalculateHVecTensorField<3, 3>(eP.piolaStress,
1185  eP.dataAtPts->approxPAtPts));
1186  // volPostProcEle->getOpPtrVector().push_back(
1187  // new OpCalculateHVecTensorField<3, 3>(
1188  // eP.piolaStress + "_RT", eP.dataAtPts->approxPAtPts, MBMAXTYPE));
1189  volPostProcEle->getOpPtrVector().push_back(
1191  eP.bubbleField, eP.dataAtPts->approxPAtPts, MBMAXTYPE));
1192  volPostProcEle->getOpPtrVector().push_back(
1194  eP.streachTensor, eP.dataAtPts->streachTensorAtPts, MBTET));
1195  volPostProcEle->getOpPtrVector().push_back(
1197  eP.rotAxis, eP.dataAtPts->rotAxisAtPts, MBTET));
1198  volPostProcEle->getOpPtrVector().push_back(
1200  eP.materialGradient, eP.dataAtPts->GAtPts, MBTET));
1201  volPostProcEle->getOpPtrVector().push_back(
1202  new OpCalculateVectorFieldValues<3>(eP.spatialDisp,
1203  eP.dataAtPts->wAtPts, MBTET));
1204  volPostProcEle->getOpPtrVector().push_back(
1206  eP.spatialPosition, eP.dataAtPts->xAtPts, MBVERTEX));
1207  volPostProcEle->getOpPtrVector().push_back(
1208  new OpCalculateVectorFieldGradient<3, 3>(eP.spatialPosition,
1209  eP.dataAtPts->xGradAtPts));
1210  volPostProcEle->getOpPtrVector().push_back(
1211  new OpCalculateRotationAndSpatialGradient(eP.rotAxis,
1212  eP.dataAtPts));
1213  volPostProcEle->getOpPtrVector().push_back(
1214  new OpCalculateStrainEnergy(eP.spatialDisp, eP.dataAtPts, gEnergy));
1215  };
1216 
1217  set_element_for_field_eval();
1218  set_element_for_post_process();
1219  }
1220 
1221  MoFEMErrorCode preProcess() { return 0; }
1222 
1223  MoFEMErrorCode operator()() { return 0; }
1224 
1225  MoFEMErrorCode postProcess() {
1227 
1228  CHKERR eP.postProcessResults(
1229  1, "out_sol_elastic_" + boost::lexical_cast<std::string>(ts_step) +
1230  ".h5m");
1231 
1232  // Loop boundary elements with traction boundary conditions
1233  *gEnergy = 0;
1234  CHKERR eP.mField.loop_finite_elements(problemPtr->getName(), "EP",
1235  *volPostProcEle,nullptr);
1236 
1237  double body_energy;
1238  MPI_Allreduce(gEnergy.get(), &body_energy, 1, MPI_DOUBLE, MPI_SUM,
1239  eP.mField.get_comm());
1240  CHKERR PetscPrintf(eP.mField.get_comm(),
1241  "Step %d time %3.4g strain energy %3.6e\n", ts_step,
1242  ts_t, body_energy);
1243 
1244  auto post_proc_at_points = [&](std::array<double, 3> point,
1245  std::string str) {
1247 
1248  dataFieldEval->setEvalPoints(point.data(), point.size() / 3);
1249 
1250  struct OpPrint : public VolOp {
1251 
1252  EshelbianCore &eP;
1253  std::array<double, 3> point;
1254  std::string str;
1255 
1256  OpPrint(EshelbianCore &ep, std::array<double, 3> &point,
1257  std::string &str)
1258  : VolOp(ep.spatialDisp, VolOp::OPROW), eP(ep), point(point),
1259  str(str) {}
1260 
1261  MoFEMErrorCode doWork(int side, EntityType type,
1264  if (type == MBTET) {
1265  if (getGaussPts().size2()) {
1266 
1267  auto t_h = getFTensor2FromMat<3, 3>(*(eP.dataAtPts->hAtPts));
1268  auto t_approx_P =
1269  getFTensor2FromMat<3, 3>(*(eP.dataAtPts->approxPAtPts));
1270 
1274  const double jac = dEterminant(t_h);
1276  t_cauchy(i, j) = (1. / jac) * (t_approx_P(i, k) * t_h(j, k));
1277 
1278  auto add = [&]() {
1279  std::ostringstream s;
1280  s << str << " elem " << getFEEntityHandle() << " ";
1281  return s.str();
1282  };
1283 
1284  std::ostringstream print;
1285  print << add() << "comm rank " << eP.mField.get_comm_rank()
1286  << std::endl;
1287  print << add() << "point " << getVectorAdaptor(point.data(), 3)
1288  << std::endl;
1289  print << add() << "coords at gauss pts " << getCoordsAtGaussPts()
1290  << std::endl;
1291  print << add() << "w " << (*eP.dataAtPts->wAtPts) << std::endl;
1292  print << add() << "Piola " << (*eP.dataAtPts->approxPAtPts)
1293  << std::endl;
1294  print << add() << "Cauchy " << t_cauchy << std::endl;
1295  print << std::endl;
1296  CHKERR PetscSynchronizedPrintf(eP.mField.get_comm(), "%s",
1297  print.str().c_str());
1298 
1299  }
1300  }
1302  }
1303  };
1304 
1305  if (auto fe_ptr = dataFieldEval->feMethodPtr.lock()) {
1306 
1307  fe_ptr->getOpPtrVector().push_back(new OpPrint(eP, point, str));
1308  CHKERR eP.mField.getInterface<FieldEvaluatorInterface>()
1309  ->evalFEAtThePoint3D(point.data(), 1e-12, problemPtr->getName(),
1310  "EP", dataFieldEval,
1311  eP.mField.get_comm_rank(),
1312  eP.mField.get_comm_rank(), MF_EXIST, QUIET);
1313  fe_ptr->getOpPtrVector().pop_back();
1314  }
1315 
1317  };
1318 
1319  // Points for Cook beam
1320  std::array<double, 3> pointA = {48., 60., 5.};
1321  CHKERR post_proc_at_points(pointA, "Point A");
1322  PetscSynchronizedFlush(eP.mField.get_comm(), PETSC_STDOUT);
1323 
1324  std::array<double, 3> pointB = {48. / 2., 44. + (60. - 44.) / 2., 0.};
1325  CHKERR post_proc_at_points(pointB, "Point B");
1326  PetscSynchronizedFlush(eP.mField.get_comm(), PETSC_STDOUT);
1327 
1328  std::array<double, 3> pointC = {48. / 2., (44. - 0.) / 2., 0.};
1329  CHKERR post_proc_at_points(pointC, "Point C");
1330  PetscSynchronizedFlush(eP.mField.get_comm(), PETSC_STDOUT);
1331 
1333  }
1334  };
1335 
1336  boost::shared_ptr<FEMethod> monitor_ptr(new Monitor(*this));
1337  ts_ctx->get_loops_to_do_Monitor().push_back(
1339 
1340  CHKERR TSAppendOptionsPrefix(ts, "elastic_");
1341  CHKERR TSSetFromOptions(ts);
1343 }
Set integration rule.
structure for User Loop Methods on finite elementsIt can be used to calculate stiffness matrices,...
VolumeElementForcesAndSourcesCoreSwitch< 0 > VolumeElementForcesAndSourcesCore
Volume finite element default.
boost::shared_ptr< SubProblemData > subProblemData
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
IFACE getInterface() const
Get interface pointer to pointer of interface.
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
Definition: TsCtx.cpp:190
keeps basic data about problemThis is low level structure with information about problem,...
Get values at integration pts for tensor filed rank 1, i.e. vector field.
DM dmElasticSchurOmega
Sub problem of dmElastic Schur.
EshelbianCore(MoFEM::Interface &m_field)
Field evaluator interface.
static double dEterminant(T &t)
Calculate the determinant of a 3x3 matrix or a tensor of rank 2.
Definition: Templates.hpp:385
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:43
Calculate tenor field using vectorial base, i.e. Hdiv/Hcurl.
#define CHKERR
Inline error check.
Definition: definitions.h:596
ForcesAndSourcesCore::UserDataOperator UserDataOperator
DM dmElasticSchurStreach
Sub problem of dmElastic Schur.
PetscErrorCode DMMoFEMGetTsCtx(DM dm, MoFEM::TsCtx **ts_ctx)
get MoFEM::TsCtx data structure
Definition: DMMMoFEM.cpp:990
DM dmElasticSchurSpatialDisp
Sub problem of dmElastic Schur.
Data on single entity (This is passed as argument to DataOperator::doWork)
structure to get information form mofem into DataForcesAndSourcesCore
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMMoFEM.cpp:337
virtual MPI_Comm & get_comm() const =0
DM dmElasticSchurBubble
Sub problem of dmElastic Schur.
Get values at integration pts for tensor filed rank 2, i.e. matrix field.

◆ solveElastic()

MoFEMErrorCode EshelbianPlasticity::EshelbianCore::solveElastic ( TS  ts,
Vec  x 
)
Examples
ep.cpp.

Definition at line 1345 of file EshelbianPlasticity.cpp.

1345  {
1347 
1348  CHKERR TSSetDM(ts, dmElastic);
1349 
1350  SNES snes;
1351  CHKERR TSGetSNES(ts, &snes);
1352 
1353  PetscViewerAndFormat *vf;
1354  CHKERR PetscViewerAndFormatCreate(PETSC_VIEWER_STDOUT_WORLD,
1355  PETSC_VIEWER_DEFAULT, &vf);
1356  CHKERR SNESMonitorSet(
1357  snes,
1358  (MoFEMErrorCode(*)(SNES, PetscInt, PetscReal, void *))SNESMonitorFields,
1359  vf, (MoFEMErrorCode(*)(void **))PetscViewerAndFormatDestroy);
1360 
1361  PetscSection section;
1362  CHKERR DMGetDefaultSection(dmElastic, &section);
1363  int num_fields;
1364  CHKERR PetscSectionGetNumFields(section, &num_fields);
1365  for (int ff = 0; ff != num_fields; ff++) {
1366  const char *field_name;
1367  CHKERR PetscSectionGetFieldName(section, ff, &field_name);
1368  CHKERR PetscPrintf(PETSC_COMM_WORLD, "Field %d name %s\n", ff, field_name);
1369  }
1370 
1371  CHKERR DMoFEMMeshToLocalVector(dmElastic, x, INSERT_VALUES, SCATTER_FORWARD);
1372 
1373  // Adding field split solver
1374 
1375  KSP ksp;
1376  CHKERR SNESGetKSP(snes, &ksp);
1377  PC pc;
1378  CHKERR KSPGetPC(ksp, &pc);
1379  PetscBool is_uu_field_split;
1380  PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_uu_field_split);
1381  if (is_uu_field_split) {
1382 
1383  const MoFEM::Problem *schur_uu_ptr;
1385  if (auto uu_data = schur_uu_ptr->subProblemData) {
1386 
1387  const MoFEM::Problem *prb_ptr;
1389  map<std::string, IS> is_map;
1390  for (int ff = 0; ff != num_fields; ff++) {
1391  const char *field_name;
1392  CHKERR PetscSectionGetFieldName(section, ff, &field_name);
1393  CHKERR mField.getInterface<ISManager>()->isCreateProblemFieldAndRank(
1394  prb_ptr->getName(), ROW, field_name, 0, MAX_DOFS_ON_ENTITY,
1395  &is_map[field_name]);
1396  }
1397  // CHKERR mField.getInterface<ISManager>()
1398  // ->isCreateProblemFieldAndEntityType(
1399  // prb_ptr->getName(), ROW, piolaStress, MBTET, MBTET, 0,
1400  // MAX_DOFS_ON_ENTITY, &is_map["T_STRESS_ON_TETS"]);
1401  // CHKERR mField.getInterface<ISManager>()
1402  // ->isCreateProblemFieldAndEntityType(
1403  // prb_ptr->getName(), ROW, piolaStress, MBTRI, MBTRI, 0,
1404  // MAX_DOFS_ON_ENTITY, &is_map["T_STRESS_ON_TRIS"]);
1405 
1406  CHKERR uu_data->getRowIs(&is_map["E_IS_SUU"]);
1407 
1408  CHKERR PCFieldSplitSetIS(pc, NULL, is_map[streachTensor]);
1409  CHKERR PCFieldSplitSetIS(pc, NULL, is_map["E_IS_SUU"]);
1410 
1411  CHKERR PCFieldSplitSetSchurPre(pc, PC_FIELDSPLIT_SCHUR_PRE_USER,
1412  schurAssembly->Suu);
1413 
1414  CHKERR PCSetUp(pc);
1415  PetscInt n;
1416  KSP *uu_ksp;
1417  CHKERR PCFieldSplitGetSubKSP(pc, &n, &uu_ksp);
1418  PC bubble_pc;
1419  CHKERR KSPGetPC(uu_ksp[1], &bubble_pc);
1420  PetscBool is_bubble_field_split;
1421  PetscObjectTypeCompare((PetscObject)bubble_pc, PCFIELDSPLIT,
1422  &is_bubble_field_split);
1423  if (is_bubble_field_split) {
1424 
1425  const MoFEM::Problem *schur_bubble_ptr;
1426  CHKERR DMMoFEMGetProblemPtr(dmElasticSchurBubble, &schur_bubble_ptr);
1427  if (auto bubble_data = schur_bubble_ptr->subProblemData) {
1428 
1429  CHKERR bubble_data->getRowIs(&is_map["E_IS_BUBBLE"]);
1430 
1431  AO uu_ao;
1432  CHKERR uu_data->getRowMap(&uu_ao);
1433 
1434  CHKERR AOApplicationToPetscIS(uu_ao, is_map[bubbleField]);
1435  CHKERR PCFieldSplitSetIS(bubble_pc, NULL, is_map[bubbleField]);
1436  CHKERR PCFieldSplitSetIS(bubble_pc, NULL, is_map["E_IS_BUBBLE"]);
1437  CHKERR PCFieldSplitSetSchurPre(
1438  bubble_pc, PC_FIELDSPLIT_SCHUR_PRE_USER, schurAssembly->SBubble);
1439 
1440  CHKERR PCSetUp(bubble_pc);
1441  PetscInt bubble_n;
1442  KSP *bubble_ksp;
1443  CHKERR PCFieldSplitGetSubKSP(bubble_pc, &bubble_n, &bubble_ksp);
1444  PC omega_pc;
1445  CHKERR KSPGetPC(bubble_ksp[1], &omega_pc);
1446  PetscBool is_omega_field_split;
1447  PetscObjectTypeCompare((PetscObject)omega_pc, PCFIELDSPLIT,
1448  &is_omega_field_split);
1449 
1450  if (is_omega_field_split) {
1451 
1452  const MoFEM::Problem *schur_omega_ptr;
1453  CHKERR DMMoFEMGetProblemPtr(dmElasticSchurOmega, &schur_omega_ptr);
1454  if (auto omega_data = schur_omega_ptr->subProblemData) {
1455 
1456  AO bubble_ao;
1457  CHKERR bubble_data->getRowMap(&bubble_ao);
1458 
1459  CHKERR AOApplicationToPetscIS(uu_ao, is_map[rotAxis]);
1460  CHKERR AOApplicationToPetscIS(bubble_ao, is_map[rotAxis]);
1461  CHKERR omega_data->getRowIs(&is_map["E_IS_OMEGA"]);
1462 
1463  CHKERR PCFieldSplitSetIS(omega_pc, NULL, is_map[rotAxis]);
1464  CHKERR PCFieldSplitSetIS(omega_pc, NULL, is_map["E_IS_OMEGA"]);
1465  CHKERR PCFieldSplitSetSchurPre(omega_pc,
1466  PC_FIELDSPLIT_SCHUR_PRE_USER,
1467  schurAssembly->SOmega);
1468 
1469  CHKERR PCSetUp(omega_pc);
1470  PetscInt omega_n;
1471  KSP *omega_ksp;
1472  CHKERR PCFieldSplitGetSubKSP(omega_pc, &omega_n, &omega_ksp);
1473  PC w_pc;
1474  CHKERR KSPGetPC(omega_ksp[1], &w_pc);
1475  PetscBool is_w_field_split;
1476  PetscObjectTypeCompare((PetscObject)w_pc, PCFIELDSPLIT,
1477  &is_w_field_split);
1478  if (is_w_field_split) {
1479 
1480  const MoFEM::Problem *schur_w_ptr;
1482  &schur_w_ptr);
1483  if (auto w_data = schur_w_ptr->subProblemData) {
1484 
1485  AO omega_ao;
1486  CHKERR omega_data->getRowMap(&omega_ao);
1487 
1488  CHKERR AOApplicationToPetscIS(uu_ao, is_map[spatialDisp]);
1489  CHKERR AOApplicationToPetscIS(bubble_ao, is_map[spatialDisp]);
1490  CHKERR AOApplicationToPetscIS(omega_ao, is_map[spatialDisp]);
1491  CHKERR w_data->getRowIs(&is_map["E_IS_W"]);
1492 
1493  CHKERR PCFieldSplitSetIS(w_pc, NULL, is_map[spatialDisp]);
1494  CHKERR PCFieldSplitSetIS(w_pc, NULL, is_map["E_IS_W"]);
1495  CHKERR PCFieldSplitSetSchurPre(
1496  w_pc, PC_FIELDSPLIT_SCHUR_PRE_USER, schurAssembly->Sw);
1497 
1498  CHKERR AODestroy(&omega_ao);
1499  }
1500  }
1501 
1502  CHKERR PetscFree(omega_ksp);
1503  }
1504  }
1505  CHKERR PetscFree(bubble_ksp);
1506  CHKERR AODestroy(&uu_ao);
1507  }
1508  }
1509  CHKERR PetscFree(uu_ksp);
1510 
1511  for (auto &m : is_map)
1512  CHKERR ISDestroy(&m.second);
1513  }
1514  }
1515 
1516  CHKERR TSSolve(ts, x);
1518 }
boost::shared_ptr< EpFEMethod > schurAssembly
Section manager is used to create indexes and sectionsFIXME: ISManager is not properly testsed by ato...
Definition: ISManager.hpp:36
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:434
boost::shared_ptr< SubProblemData > subProblemData
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
keeps basic data about problemThis is low level structure with information about problem,...
DM dmElasticSchurOmega
Sub problem of dmElastic Schur.
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:66
#define CHKERR
Inline error check.
Definition: definitions.h:596
DM dmElasticSchurStreach
Sub problem of dmElastic Schur.
DM dmElasticSchurSpatialDisp
Sub problem of dmElastic Schur.
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:298
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
Definition: DMMMoFEM.cpp:337
std::string getName() const
DM dmElasticSchurBubble
Sub problem of dmElastic Schur.

Member Data Documentation

◆ alpha_u

double EshelbianPlasticity::EshelbianCore::alpha_u

Definition at line 1304 of file EshelbianPlasticity.hpp.

◆ bcSpatialDispVecPtr

boost::shared_ptr<BcDispVec> EshelbianPlasticity::EshelbianCore::bcSpatialDispVecPtr

Definition at line 1309 of file EshelbianPlasticity.hpp.

◆ bcSpatialFreeTraction

boost::shared_ptr<TractionFreeBc> EshelbianPlasticity::EshelbianCore::bcSpatialFreeTraction

Definition at line 1312 of file EshelbianPlasticity.hpp.

◆ bcSpatialRotationVecPtr

boost::shared_ptr<BcRotVec> EshelbianPlasticity::EshelbianCore::bcSpatialRotationVecPtr

Definition at line 1310 of file EshelbianPlasticity.hpp.

◆ bcSpatialTraction

boost::shared_ptr<TractionBcVec> EshelbianPlasticity::EshelbianCore::bcSpatialTraction

Definition at line 1311 of file EshelbianPlasticity.hpp.

◆ bubbleField

const std::string EshelbianPlasticity::EshelbianCore::bubbleField

Definition at line 1291 of file EshelbianPlasticity.hpp.

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::EshelbianCore::dataAtPts

Definition at line 1264 of file EshelbianPlasticity.hpp.

◆ dM

DM EshelbianPlasticity::EshelbianCore::dM

Coupled problem all fields.

Definition at line 1273 of file EshelbianPlasticity.hpp.

◆ dmElastic

DM EshelbianPlasticity::EshelbianCore::dmElastic

Elastic problem.

Examples
ep.cpp.

Definition at line 1274 of file EshelbianPlasticity.hpp.

◆ dmElasticSchurBubble

DM EshelbianPlasticity::EshelbianCore::dmElasticSchurBubble

Sub problem of dmElastic Schur.

Definition at line 1276 of file EshelbianPlasticity.hpp.

◆ dmElasticSchurOmega

DM EshelbianPlasticity::EshelbianCore::dmElasticSchurOmega

Sub problem of dmElastic Schur.

Definition at line 1278 of file EshelbianPlasticity.hpp.

◆ dmElasticSchurSpatialDisp

DM EshelbianPlasticity::EshelbianCore::dmElasticSchurSpatialDisp

Sub problem of dmElastic Schur.

Definition at line 1277 of file EshelbianPlasticity.hpp.

◆ dmElasticSchurStreach

DM EshelbianPlasticity::EshelbianCore::dmElasticSchurStreach

Sub problem of dmElastic Schur.

Definition at line 1275 of file EshelbianPlasticity.hpp.

◆ dmMaterial

DM EshelbianPlasticity::EshelbianCore::dmMaterial

Material problem.

Definition at line 1279 of file EshelbianPlasticity.hpp.

◆ elasticBcLhs

boost::shared_ptr<EpElement<FaceElementForcesAndSourcesCore> > EshelbianPlasticity::EshelbianCore::elasticBcLhs

Definition at line 1269 of file EshelbianPlasticity.hpp.

◆ elasticBcRhs

boost::shared_ptr<EpElement<FaceElementForcesAndSourcesCore> > EshelbianPlasticity::EshelbianCore::elasticBcRhs

Definition at line 1270 of file EshelbianPlasticity.hpp.

◆ elasticFeLhs

boost::shared_ptr<EpElement<VolumeElementForcesAndSourcesCore> > EshelbianPlasticity::EshelbianCore::elasticFeLhs

Definition at line 1268 of file EshelbianPlasticity.hpp.

◆ elasticFeRhs

boost::shared_ptr<EpElement<VolumeElementForcesAndSourcesCore> > EshelbianPlasticity::EshelbianCore::elasticFeRhs

Definition at line 1267 of file EshelbianPlasticity.hpp.

◆ elementVolumeName

const std::string EshelbianPlasticity::EshelbianCore::elementVolumeName

Definition at line 1293 of file EshelbianPlasticity.hpp.

◆ eshelbyStress

const std::string EshelbianPlasticity::EshelbianCore::eshelbyStress

Definition at line 1282 of file EshelbianPlasticity.hpp.

◆ essentialBcElement

const std::string EshelbianPlasticity::EshelbianCore::essentialBcElement

Definition at line 1295 of file EshelbianPlasticity.hpp.

◆ ghostFrameOn

PetscBool EshelbianPlasticity::EshelbianCore::ghostFrameOn

Definition at line 1301 of file EshelbianPlasticity.hpp.

◆ lambdaField

const std::string EshelbianPlasticity::EshelbianCore::lambdaField

Definition at line 1290 of file EshelbianPlasticity.hpp.

◆ materialDisp

const std::string EshelbianPlasticity::EshelbianCore::materialDisp

Definition at line 1285 of file EshelbianPlasticity.hpp.

◆ materialGradient

const std::string EshelbianPlasticity::EshelbianCore::materialGradient

Definition at line 1288 of file EshelbianPlasticity.hpp.

◆ materialOrder

int EshelbianPlasticity::EshelbianCore::materialOrder

Definition at line 1303 of file EshelbianPlasticity.hpp.

◆ mField

MoFEM::Interface& EshelbianPlasticity::EshelbianCore::mField

Definition at line 1262 of file EshelbianPlasticity.hpp.

◆ naturalBcElement

const std::string EshelbianPlasticity::EshelbianCore::naturalBcElement

Definition at line 1294 of file EshelbianPlasticity.hpp.

◆ physicalEquations

boost::shared_ptr<PhysicalEquations> EshelbianPlasticity::EshelbianCore::physicalEquations

Definition at line 1265 of file EshelbianPlasticity.hpp.

◆ piolaStress

const std::string EshelbianPlasticity::EshelbianCore::piolaStress

Definition at line 1281 of file EshelbianPlasticity.hpp.

◆ preconditioner_eps

double EshelbianPlasticity::EshelbianCore::preconditioner_eps

Definition at line 1305 of file EshelbianPlasticity.hpp.

◆ rotAxis

const std::string EshelbianPlasticity::EshelbianCore::rotAxis

Definition at line 1287 of file EshelbianPlasticity.hpp.

◆ schurAssembly

boost::shared_ptr<EpFEMethod> EshelbianPlasticity::EshelbianCore::schurAssembly

Definition at line 1271 of file EshelbianPlasticity.hpp.

◆ spaceGhostOrder

int EshelbianPlasticity::EshelbianCore::spaceGhostOrder

Definition at line 1302 of file EshelbianPlasticity.hpp.

◆ spaceOrder

int EshelbianPlasticity::EshelbianCore::spaceOrder

Definition at line 1300 of file EshelbianPlasticity.hpp.

◆ spatialDisp

const std::string EshelbianPlasticity::EshelbianCore::spatialDisp

Definition at line 1283 of file EshelbianPlasticity.hpp.

◆ spatialPosition

const std::string EshelbianPlasticity::EshelbianCore::spatialPosition

Definition at line 1284 of file EshelbianPlasticity.hpp.

◆ streachTensor

const std::string EshelbianPlasticity::EshelbianCore::streachTensor

Definition at line 1286 of file EshelbianPlasticity.hpp.

◆ tauField

const std::string EshelbianPlasticity::EshelbianCore::tauField

Definition at line 1289 of file EshelbianPlasticity.hpp.


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