23 const std::size_t nNodes(nodes.size());
24 std::vector<Node*> new_nodes;
25 new_nodes.reserve(nNodes);
26 for (std::size_t k = 0; k < nNodes; ++k)
28 new_nodes.push_back(
new Node(nodes[k]->data(), new_nodes.size()));
34 std::vector<Element*>
const& elements,
35 std::vector<Node*>
const& new_nodes,
36 std::vector<std::size_t>
const*
const node_id_map)
38 std::vector<Element*> new_elements;
39 new_elements.reserve(elements.size());
40 std::transform(elements.begin(), elements.end(),
41 std::back_inserter(new_elements),
42 [&new_nodes, &node_id_map](
auto const& element)
43 { return copyElement(element, new_nodes, node_id_map); });
51 const std::vector<Node*>& nodes,
52 std::vector<std::size_t>
const*
const id_map)
55 auto** new_nodes =
new Node*[number_of_element_nodes];
58 for (
unsigned i = 0; i < number_of_element_nodes; ++i)
60 new_nodes[i] = nodes[(*id_map)[element->
getNode(i)->
getID()]];
65 for (
unsigned i = 0; i < number_of_element_nodes; ++i)
70 return new E(new_nodes);
74 const std::vector<Node*>& nodes,
75 std::vector<std::size_t>
const*
const id_map)
111 ERR(
"Error: Unknown cell type.");
119 std::vector<Element*> cloned_elements;
120 cloned_elements.reserve(elements.size());
121 std::transform(begin(elements), end(elements),
122 std::back_inserter(cloned_elements),
124 return cloned_elements;