OGS
ReferenceElement.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include <vector>
14
15
#include "
NumLib/Fem/CoordinatesMapping/NaturalNodeCoordinates.h
"
16
17
namespace
NumLib
18
{
19
template
<
typename
MeshElementType>
20
class
ReferenceElement
21
{
22
static
std::vector<MeshLib::Node>
createReferenceElementNodes
()
23
{
24
constexpr
auto
natural_node_coordss =
25
NumLib::NaturalCoordinates<MeshElementType>::coordinates
;
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
47
public
:
48
MeshElementType
const
element
=
createElement
(
nodes
);
49
};
50
}
// namespace NumLib
NaturalNodeCoordinates.h
MeshLib::Node
Definition
Node.h:39
NumLib::ReferenceElement
Definition
ReferenceElement.h:21
NumLib::ReferenceElement::createElement
static MeshElementType createElement(std::vector< MeshLib::Node > const &nodes)
Definition
ReferenceElement.h:30
NumLib::ReferenceElement::createReferenceElementNodes
static std::vector< MeshLib::Node > createReferenceElementNodes()
Definition
ReferenceElement.h:22
NumLib::ReferenceElement::nodes
std::vector< MeshLib::Node > const nodes
Definition
ReferenceElement.h:45
NumLib::ReferenceElement::element
MeshElementType const element
Definition
ReferenceElement.h:48
NumLib
Definition
ProjectData.h:46
NumLib::NaturalCoordinates
Definition
NaturalNodeCoordinates.h:20
NumLib
Fem
ReferenceElement.h
Generated by
1.12.0