OGS
TetRule10.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "TetRule10.h"
5
6#include <array>
7
8#include "BaseLib/Logging.h"
9#include "MeshLib/Node.h"
10#include "Tri.h"
11
12namespace MeshLib
13{
14const Element* TetRule10::getFace(const Element* e, unsigned i)
15{
16 if (i < n_faces)
17 {
18 std::array<Node*, 6> nodes{};
19 for (unsigned j = 0; j < 6; j++)
20 {
21 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
22 }
23 return new Tri6(nodes, e->getID());
24 }
25 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
26 return nullptr;
27}
28
29} // end namespace MeshLib
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
virtual const Node * getNode(unsigned idx) const =0
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:80
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
Definition TetRule10.cpp:14
static constexpr const unsigned face_nodes[4][6]
Constant: Local node index table for faces.
Definition TetRule10.h:44
static const unsigned n_faces
Constant: The number of faces.
Definition TetRule.h:23
TemplateElement< MeshLib::TriRule6 > Tri6
Definition Tri.h:16