OGS
MeshToolsLib::anonymous_namespace{ConvertToLinearMesh.cpp} Namespace Reference

Functions

template<typename T_ELEMENT >
T_ELEMENT * createLinearElement (MeshLib::Element const *e, std::vector< MeshLib::Node * > const &vec_new_nodes, std::vector< std::size_t > const &map)
 

Function Documentation

◆ createLinearElement()

template<typename T_ELEMENT >
T_ELEMENT * MeshToolsLib::anonymous_namespace{ConvertToLinearMesh.cpp}::createLinearElement ( MeshLib::Element const * e,
std::vector< MeshLib::Node * > const & vec_new_nodes,
std::vector< std::size_t > const & map )

Definition at line 31 of file ConvertToLinearMesh.cpp.

34{
35 auto const n_base_nodes = T_ELEMENT::n_base_nodes;
36 auto** nodes = new MeshLib::Node*[n_base_nodes];
37 auto* const* element_nodes = e->getNodes();
38 for (unsigned i = 0; i < n_base_nodes; i++)
39 {
40 auto const n = vec_new_nodes[map[element_nodes[i]->getID()]];
41 nodes[i] = const_cast<MeshLib::Node*>(n);
42 }
43 return new T_ELEMENT(nodes);
44}

References createLinearElement(), and MeshLib::Element::getNodes().

Referenced by createLinearElement().