24 auto elem_nodes = std::make_unique<MeshLib::Node*[]>(n_nodes);
25 for (
unsigned i = 0; i < n_nodes; ++i)
29 std::swap(elem_nodes[0], elem_nodes[1]);
33 return std::make_unique<MeshLib::Line>(elem_nodes.release(),
38 return std::make_unique<MeshLib::Tri>(elem_nodes.release(),
43 std::swap(elem_nodes[2], elem_nodes[3]);
44 return std::make_unique<MeshLib::Quad>(elem_nodes.release(),
57 std::vector<MeshLib::Node*> new_nodes(copyNodeVector(mesh.
getNodes()));
58 std::vector<MeshLib::Element*>
const& elems(mesh.
getElements());
59 std::vector<MeshLib::Element*> new_elems;
61 new_elems.reserve(n_elems);
63 for (std::size_t i = 0; i < n_elems; ++i)
69 return std::make_unique<MeshLib::Mesh>(
70 "FlippedElementMesh", new_nodes, new_elems,
std::size_t getID() const
virtual MeshElemType getGeomType() const =0
virtual unsigned getNumberOfNodes() const =0
virtual const Node * getNode(unsigned idx) const =0
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
std::size_t getID() const
Returns the ID of the element.
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Properties & getProperties()
std::size_t getNumberOfElements() const
Get the number of elements.