v0.14.0
Public Member Functions | Public Attributes | List of all members
FractureMechanics::CrackPropagation::FaceOrientation Struct Reference

Determine face orientation. More...

#include <users_modules/fracture_mechanics/src/CrackPropagation.hpp>

Inheritance diagram for FractureMechanics::CrackPropagation::FaceOrientation:
[legend]
Collaboration diagram for FractureMechanics::CrackPropagation::FaceOrientation:
[legend]

Public Member Functions

 FaceOrientation (bool crack_front, Range contact_faces, BitRefLevel bit_level)
 
virtual ~FaceOrientation ()
 
MoFEMErrorCode getElementOrientation (MoFEM::Interface &m_field, const EntityHandle face, const BitRefLevel bit)
 
MoFEMErrorCode getElementOrientation (MoFEM::Interface &m_field, const FEMethod *fe_method_ptr)
 
MoFEMErrorCode getElementOrientation (MoFEM::Interface &m_field, const EntityHandle face)
 

Public Attributes

bool useProjectionFromCrackFront
 
Range contactFaces
 
BitRefLevel defaultBitLevel
 
- Public Attributes inherited from SurfaceSlidingConstrains::DriverElementOrientation
int elementOrientation
 

Detailed Description

Determine face orientation.

Definition at line 1003 of file CrackPropagation.hpp.

Constructor & Destructor Documentation

◆ FaceOrientation()

FractureMechanics::CrackPropagation::FaceOrientation::FaceOrientation ( bool  crack_front,
Range  contact_faces,
BitRefLevel  bit_level 
)
inline

Definition at line 1008 of file CrackPropagation.hpp.

1010  : useProjectionFromCrackFront(crack_front), contactFaces(contact_faces),
1011  defaultBitLevel(bit_level) {}

◆ ~FaceOrientation()

virtual FractureMechanics::CrackPropagation::FaceOrientation::~FaceOrientation ( )
inlinevirtual

Definition at line 1012 of file CrackPropagation.hpp.

1012 {}

Member Function Documentation

◆ getElementOrientation() [1/3]

MoFEMErrorCode FractureMechanics::CrackPropagation::FaceOrientation::getElementOrientation ( MoFEM::Interface m_field,
const EntityHandle  face 
)
inlinevirtual

Reimplemented from SurfaceSlidingConstrains::DriverElementOrientation.

Definition at line 1024 of file CrackPropagation.hpp.

1025  {
1029  }

◆ getElementOrientation() [2/3]

MoFEMErrorCode FractureMechanics::CrackPropagation::FaceOrientation::getElementOrientation ( MoFEM::Interface m_field,
const EntityHandle  face,
const BitRefLevel  bit 
)

Definition at line 9737 of file CrackPropagation.cpp.

9738  {
9740  elementOrientation = +1;
9741  Range adj_side_elems;
9742  CHKERR m_field.getInterface<BitRefManager>()->getAdjacencies(
9743  bit, &face, 1, 3, adj_side_elems, moab::Interface::INTERSECT, QUIET);
9744  adj_side_elems = adj_side_elems.subset_by_type(MBTET);
9745  if (adj_side_elems.empty()) {
9746  Range adj_tets_on_surface;
9747  BitRefLevel bit_tet_on_surface;
9748  bit_tet_on_surface.set(BITREFLEVEL_SIZE - 2);
9749  CHKERR m_field.getInterface<BitRefManager>()->getAdjacencies(
9750  bit_tet_on_surface, &face, 1, 3, adj_tets_on_surface,
9751  moab::Interface::INTERSECT, 0);
9752  adj_side_elems.insert(*adj_tets_on_surface.begin());
9753  }
9754  if (adj_side_elems.size() != 1) {
9755  adj_side_elems.clear();
9756  CHKERR m_field.getInterface<BitRefManager>()->getAdjacencies(
9757  bit, &face, 1, 3, adj_side_elems, moab::Interface::INTERSECT,
9758  VERY_NOISY);
9759  Range::iterator it = adj_side_elems.begin();
9760  for (; it != adj_side_elems.end(); it++) {
9761  Range nodes;
9762  CHKERR m_field.get_moab().get_connectivity(&*it, 1, nodes, true);
9763  PetscPrintf(PETSC_COMM_WORLD, "Connectivity %lu %lu %lu %lu\n", nodes[0],
9764  nodes[1], nodes[2], nodes[3]);
9765  }
9766  int rank;
9767  MPI_Comm_rank(m_field.get_comm(), &rank);
9768  if (rank == 0) {
9769  EntityHandle out_meshset;
9770  CHKERR m_field.get_moab().create_meshset(MESHSET_SET, out_meshset);
9771  CHKERR m_field.get_moab().add_entities(out_meshset, adj_side_elems);
9772  CHKERR m_field.get_moab().add_entities(out_meshset, &face, 1);
9773  CHKERR m_field.get_moab().write_file("debug_error.vtk", "VTK", "",
9774  &out_meshset, 1);
9775  CHKERR m_field.get_moab().delete_entities(&out_meshset, 1);
9776  }
9777  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
9778  "Expect 1 tet but is %u", adj_side_elems.size());
9779  }
9780  EntityHandle side_elem = adj_side_elems[0];
9781  if (side_elem != 0) {
9782  int side_number, sense, offset;
9783  CHKERR m_field.get_moab().side_number(side_elem, face, side_number, sense,
9784  offset);
9785  if (sense == -1) {
9786  elementOrientation = -1;
9787  }
9788  }
9789  if (useProjectionFromCrackFront || contactFaces.contains(Range(face, face))) {
9790  Tag th_interface_side;
9791  CHKERR m_field.get_moab().tag_get_handle("INTERFACE_SIDE",
9792  th_interface_side);
9793  int side;
9794  CHKERR m_field.get_moab().tag_get_data(th_interface_side, &face, 1, &side);
9795  if (side == 1) {
9796  elementOrientation = -1;
9797  }
9798  }
9800 }

◆ getElementOrientation() [3/3]

MoFEMErrorCode FractureMechanics::CrackPropagation::FaceOrientation::getElementOrientation ( MoFEM::Interface m_field,
const FEMethod fe_method_ptr 
)
inlinevirtual

Reimplemented from SurfaceSlidingConstrains::DriverElementOrientation.

Definition at line 1016 of file CrackPropagation.hpp.

1017  {
1019  EntityHandle face = fe_method_ptr->numeredEntFiniteElementPtr->getEnt();
1020  BitRefLevel bit = fe_method_ptr->problemPtr->getBitRefLevel();
1021  CHKERR getElementOrientation(m_field, face, bit);
1023  }

Member Data Documentation

◆ contactFaces

Range FractureMechanics::CrackPropagation::FaceOrientation::contactFaces

Definition at line 1006 of file CrackPropagation.hpp.

◆ defaultBitLevel

BitRefLevel FractureMechanics::CrackPropagation::FaceOrientation::defaultBitLevel

Definition at line 1007 of file CrackPropagation.hpp.

◆ useProjectionFromCrackFront

bool FractureMechanics::CrackPropagation::FaceOrientation::useProjectionFromCrackFront

Definition at line 1005 of file CrackPropagation.hpp.


The documentation for this struct was generated from the following files:
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
EntityHandle
FractureMechanics::CrackPropagation::FaceOrientation::defaultBitLevel
BitRefLevel defaultBitLevel
Definition: CrackPropagation.hpp:1007
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
VERY_NOISY
@ VERY_NOISY
Definition: definitions.h:225
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
FractureMechanics::CrackPropagation::FaceOrientation::useProjectionFromCrackFront
bool useProjectionFromCrackFront
Definition: CrackPropagation.hpp:1005
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
Range
FractureMechanics::CrackPropagation::FaceOrientation::contactFaces
Range contactFaces
Definition: CrackPropagation.hpp:1006
BITREFLEVEL_SIZE
#define BITREFLEVEL_SIZE
max number of refinements
Definition: definitions.h:232
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
FractureMechanics::CrackPropagation::FaceOrientation::getElementOrientation
MoFEMErrorCode getElementOrientation(MoFEM::Interface &m_field, const EntityHandle face, const BitRefLevel bit)
Definition: CrackPropagation.cpp:9737
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
QUIET
@ QUIET
Definition: definitions.h:221
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
SurfaceSlidingConstrains::DriverElementOrientation::elementOrientation
int elementOrientation
Definition: SurfaceSlidingConstrains.hpp:336