OGS
MeshLib::details Namespace Reference

Functions

template<unsigned N>
bool isEdge (unsigned const (&edge_nodes)[N], unsigned idx1, unsigned idx2)
 
bool isEdge (unsigned const (&)[1], unsigned, unsigned)
 
std::vector< MeshLib::Element * > excludeElementCopy (std::vector< MeshLib::Element * > const &vec_src_eles, std::vector< std::size_t > const &vec_removed)
 

Function Documentation

◆ excludeElementCopy()

std::vector< MeshLib::Element * > MeshLib::details::excludeElementCopy ( std::vector< MeshLib::Element * > const &  vec_src_eles,
std::vector< std::size_t > const &  vec_removed 
)

Definition at line 23 of file RemoveMeshComponents.cpp.

26{
27 std::vector<MeshLib::Element*> vec_dest_eles(vec_src_eles.size() -
28 vec_removed.size());
29
30 unsigned cnt(0);
31 for (std::size_t i = 0; i < vec_removed[0]; ++i)
32 {
33 vec_dest_eles[cnt++] = vec_src_eles[i];
34 }
35 for (std::size_t i = 1; i < vec_removed.size(); ++i)
36 {
37 for (std::size_t j = vec_removed[i - 1] + 1; j < vec_removed[i]; ++j)
38 {
39 vec_dest_eles[cnt++] = vec_src_eles[j];
40 }
41 }
42 for (std::size_t i = vec_removed.back() + 1; i < vec_src_eles.size(); ++i)
43 {
44 vec_dest_eles[cnt++] = vec_src_eles[i];
45 }
46
47 return vec_dest_eles;
48}

Referenced by MeshLib::removeElements().

◆ isEdge() [1/2]

bool MeshLib::details::isEdge ( unsigned   const(&)[1],
unsigned  ,
unsigned   
)
inline

Definition at line 79 of file TemplateElement-impl.h.

80{
81 return false;
82}

◆ isEdge() [2/2]

template<unsigned N>
bool MeshLib::details::isEdge ( unsigned const (&)  edge_nodes[N],
unsigned  idx1,
unsigned  idx2 
)

Definition at line 64 of file TemplateElement-impl.h.

65{
66 if (edge_nodes[0] == idx1 && edge_nodes[1] == idx2)
67 {
68 return true;
69 }
70 if (edge_nodes[1] == idx1 && edge_nodes[0] == idx2)
71 {
72 return true;
73 }
74
75 return false;
76}

Referenced by MeshLib::TemplateElement< ELEMENT_RULE >::isEdge().