OGS
ReferenceElement.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <vector>
14
16
17namespace NumLib
18{
19template <typename MeshElementType>
21{
22 static std::vector<MeshLib::Node> createReferenceElementNodes()
23 {
24 constexpr auto natural_node_coordss =
26
27 return {natural_node_coordss.begin(), natural_node_coordss.end()};
28 }
29
30 static MeshElementType createElement(
31 std::vector<MeshLib::Node> const& nodes)
32 {
33 constexpr unsigned num_nodes = MeshElementType::n_all_nodes;
34
35 std::array<MeshLib::Node*, num_nodes> node_ptrs{};
36
37 for (std::size_t i = 0; i < num_nodes; ++i)
38 {
39 node_ptrs[i] = const_cast<MeshLib::Node*>(&(nodes[i]));
40 }
41
42 return MeshElementType(node_ptrs);
43 }
44
45 std::vector<MeshLib::Node> const nodes = createReferenceElementNodes();
46
47public:
48 MeshElementType const element = createElement(nodes);
49};
50} // namespace NumLib
static MeshElementType createElement(std::vector< MeshLib::Node > const &nodes)
static std::vector< MeshLib::Node > createReferenceElementNodes()
std::vector< MeshLib::Node > const nodes
MeshElementType const element