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

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

Definition at line 21 of file EFAFuncs.h.

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

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

Definition at line 68 of file EFAFuncs.h.

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

69 {
70  std::vector<T> common_elems;
71  std::set_intersection(
72  v1.begin(), v1.end(), v2.begin(), v2.end(), std::inserter(common_elems, common_elems.end()));
73  return common_elems;
74 }
template<typename T >
unsigned int Efa::getNewID ( std::map< unsigned int, T * > &  theMap)

Definition at line 37 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().

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

Definition at line 31 of file EFAFuncs.C.

Referenced by getCommonElems(), and EFAElement3D::getMasterInfo().

32 {
33  double node_xi[8][3] = {{-1.0, -1.0, -1.0},
34  {1.0, -1.0, -1.0},
35  {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  return 0.125 * (1.0 + node_xi[node_id][0] * xi_3d[0]) * (1.0 + node_xi[node_id][1] * xi_3d[1]) *
42  (1.0 + node_xi[node_id][2] * xi_3d[2]);
43 }
double Efa::linearQuadShape2D ( unsigned int  node_id,
std::vector< double > &  xi_2d 
)

Definition at line 14 of file EFAFuncs.C.

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

15 {
16  double node_xi[4][2] = {{-1.0, -1.0}, {1.0, -1.0}, {1.0, 1.0}, {-1.0, 1.0}};
17  return 0.25 * (1.0 + node_xi[node_id][0] * xi_2d[0]) * (1.0 + node_xi[node_id][1] * xi_2d[1]);
18 }
double Efa::linearTetShape3D ( unsigned int  node_id,
std::vector< double > &  xi_3d 
)

Definition at line 46 of file EFAFuncs.C.

Referenced by getCommonElems(), and EFAElement3D::getMasterInfo().

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

Definition at line 21 of file EFAFuncs.C.

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

22 {
23  std::vector<double> area_xi(3, 0.0);
24  area_xi[0] = xi_2d[0];
25  area_xi[1] = xi_2d[1];
26  area_xi[2] = 1.0 - xi_2d[0] - xi_2d[1];
27  return area_xi[node_id];
28 }
template<class T >
unsigned int Efa::numCommonElems ( std::set< T > &  v1,
std::set< T > &  v2 
)

Definition at line 48 of file EFAFuncs.h.

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

49 {
50  std::vector<T> common_elems;
51  std::set_intersection(
52  v1.begin(), v1.end(), v2.begin(), v2.end(), std::inserter(common_elems, common_elems.end()));
53  return common_elems.size();
54 }
template<class T >
unsigned int Efa::numCommonElems ( std::set< T > &  v1,
std::vector< T > &  v2 
)

Definition at line 58 of file EFAFuncs.h.

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