www.mooseframework.org
Functions
Efa Namespace Reference

Functions

template<typename T >
bool deleteFromMap (std::map< unsigned int, T *> &theMap, T *elemToDelete, bool delete_elem=true)
 
template<typename T >
unsigned int getNewID (std::map< unsigned int, T *> &theMap)
 
template<class T >
unsigned int numCommonElems (std::set< T > &v1, std::set< T > &v2)
 
template<class T >
unsigned int numCommonElems (std::set< T > &v1, std::vector< T > &v2)
 
template<class T >
std::vector< T > getCommonElems (std::set< T > &v1, std::set< T > &v2)
 
double linearQuadShape2D (unsigned int node_id, std::vector< double > &xi_2d)
 
double linearTriShape2D (unsigned int node_id, std::vector< double > &xi_2d)
 
double linearHexShape3D (unsigned int node_id, std::vector< double > &xi_3d)
 
double linearTetShape3D (unsigned int node_id, std::vector< double > &xi_3d)
 

Function Documentation

◆ deleteFromMap()

template<typename T >
bool Efa::deleteFromMap ( std::map< unsigned int, T *> &  theMap,
T *  elemToDelete,
bool  delete_elem = true 
)

Definition at line 22 of file EFAFuncs.h.

Referenced by EFAElement2D::addNodeCut(), ElementFragmentAlgorithm::clearAncestry(), ElementFragmentAlgorithm::clearPotentialIsolatedNodes(), EFAElement2D::connectNeighbors(), EFAElement3D::connectNeighbors(), EFAElement::mergeNodes(), EFAFragment2D::removeInvalidEmbeddedNodes(), and EFAFragment3D::removeInvalidEmbeddedNodes().

23 {
24  bool didIt = false;
25  typename std::map<unsigned int, T *>::iterator i = theMap.find(elemToDelete->id());
26  if (i != theMap.end())
27  {
28  if (delete_elem)
29  delete i->second;
30  theMap.erase(i);
31  didIt = true;
32  }
33  return didIt;
34 }

◆ getCommonElems()

template<class T >
std::vector<T> Efa::getCommonElems ( std::set< T > &  v1,
std::set< T > &  v2 
)

Definition at line 69 of file EFAFuncs.h.

Referenced by EFAFragment3D::combine_two_faces(), EFAFragment::getCommonNodes(), EFAElement2D::getCommonNodes(), and EFAElement3D::getCommonNodes().

70 {
71  std::vector<T> common_elems;
72  std::set_intersection(
73  v1.begin(), v1.end(), v2.begin(), v2.end(), std::inserter(common_elems, common_elems.end()));
74  return common_elems;
75 }

◆ getNewID()

template<typename T >
unsigned int Efa::getNewID ( std::map< unsigned int, T *> &  theMap)

Definition at line 38 of file EFAFuncs.h.

Referenced by ElementFragmentAlgorithm::add2DElements(), EFAElement2D::addEdgeCut(), EFAElement3D::addFaceEdgeCut(), EFAElement2D::addFragmentEdgeCut(), EFAElement2D::branchingSplit(), EFAElement2D::connectNeighbors(), EFAElement3D::connectNeighbors(), EFAElement2D::createChild(), EFAElement3D::createChild(), EFAElement::mergeNodes(), and ElementFragmentAlgorithm::updateTopology().

39 {
40  typename std::map<unsigned int, T *>::reverse_iterator last_elem = theMap.rbegin();
41  unsigned int new_elem_id = 0;
42  if (last_elem != theMap.rend())
43  new_elem_id = last_elem->first + 1;
44  return new_elem_id;
45 }

◆ linearHexShape3D()

double Efa::linearHexShape3D ( unsigned int  node_id,
std::vector< double > &  xi_3d 
)

Definition at line 33 of file EFAFuncs.C.

Referenced by EFAElement3D::getMasterInfo().

34 {
35  double node_xi[8][3] = {{-1.0, -1.0, -1.0},
36  {1.0, -1.0, -1.0},
37  {1.0, 1.0, -1.0},
38  {-1.0, 1.0, -1.0},
39  {-1.0, -1.0, 1.0},
40  {1.0, -1.0, 1.0},
41  {1.0, 1.0, 1.0},
42  {-1.0, 1.0, 1.0}};
43  return 0.125 * (1.0 + node_xi[node_id][0] * xi_3d[0]) * (1.0 + node_xi[node_id][1] * xi_3d[1]) *
44  (1.0 + node_xi[node_id][2] * xi_3d[2]);
45 }

◆ linearQuadShape2D()

double Efa::linearQuadShape2D ( unsigned int  node_id,
std::vector< double > &  xi_2d 
)

Definition at line 16 of file EFAFuncs.C.

Referenced by EFAFace::getMasterInfo(), and EFAElement2D::getMasterInfo().

17 {
18  double node_xi[4][2] = {{-1.0, -1.0}, {1.0, -1.0}, {1.0, 1.0}, {-1.0, 1.0}};
19  return 0.25 * (1.0 + node_xi[node_id][0] * xi_2d[0]) * (1.0 + node_xi[node_id][1] * xi_2d[1]);
20 }

◆ linearTetShape3D()

double Efa::linearTetShape3D ( unsigned int  node_id,
std::vector< double > &  xi_3d 
)

Definition at line 48 of file EFAFuncs.C.

Referenced by EFAElement3D::getMasterInfo().

49 {
50  std::vector<double> vol_xi(4, 0.0);
51  for (unsigned int i = 0; i < 3; ++i)
52  vol_xi[i] = xi_3d[i];
53  vol_xi[3] = 1.0 - xi_3d[0] - xi_3d[1] - xi_3d[2];
54  return vol_xi[node_id];
55 }

◆ linearTriShape2D()

double Efa::linearTriShape2D ( unsigned int  node_id,
std::vector< double > &  xi_2d 
)

Definition at line 23 of file EFAFuncs.C.

Referenced by EFAFace::getMasterInfo(), and EFAElement2D::getMasterInfo().

24 {
25  std::vector<double> area_xi(3, 0.0);
26  area_xi[0] = xi_2d[0];
27  area_xi[1] = xi_2d[1];
28  area_xi[2] = 1.0 - xi_2d[0] - xi_2d[1];
29  return area_xi[node_id];
30 }

◆ numCommonElems() [1/2]

template<class T >
unsigned int Efa::numCommonElems ( std::set< T > &  v1,
std::set< T > &  v2 
)

Definition at line 49 of file EFAFuncs.h.

Referenced by EFAElement2D::setupNeighbors(), EFAElement2D::shouldDuplicateCrackTipSplitElement(), EFAElement3D::shouldDuplicateCrackTipSplitElement(), EFAElement2D::shouldDuplicateForPhantomCorner(), and EFAElement3D::shouldDuplicateForPhantomCorner().

50 {
51  std::vector<T> common_elems;
52  std::set_intersection(
53  v1.begin(), v1.end(), v2.begin(), v2.end(), std::inserter(common_elems, common_elems.end()));
54  return common_elems.size();
55 }

◆ numCommonElems() [2/2]

template<class T >
unsigned int Efa::numCommonElems ( std::set< T > &  v1,
std::vector< T > &  v2 
)

Definition at line 59 of file EFAFuncs.h.

60 {
61  std::vector<T> common_elems;
62  std::set_intersection(
63  v1.begin(), v1.end(), v2.begin(), v2.end(), std::inserter(common_elems, common_elems.end()));
64  return common_elems.size();
65 }