OGS
IntegrationGaussLegendreTet.h
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#pragma once
5
6#include "BaseLib/Error.h"
9
10namespace NumLib
11{
16{
17public:
23 explicit IntegrationGaussLegendreTet(unsigned order = 2) : _order(order)
24 {
25 this->setIntegrationOrder(order);
26 }
27
29 void setIntegrationOrder(unsigned order)
30 {
31 _order = order;
33 }
34
36 unsigned getIntegrationOrder() const { return _order; }
37
39 unsigned getNumberOfPoints() const { return _n_sampl_pt; }
40
47 MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
48 {
50 }
51
59 static MathLib::WeightedPoint getWeightedPoint(unsigned const order, unsigned const igp)
60 {
61 switch (order)
62 {
63 case 1:
65 case 2:
67 case 3:
69 case 4:
71 }
72 OGS_FATAL("Integration order {:d} not implemented for tetrahedrals.",
73 order);
74 }
75
76 template <typename Method>
77 static MathLib::WeightedPoint getWeightedPoint(unsigned const igp)
78 {
79 return MathLib::WeightedPoint(Method::X[igp], Method::W[igp]);
80 }
81
88 static unsigned getNumberOfPoints(unsigned order)
89 {
90 switch (order)
91 {
92 case 1:
94 case 2:
96 case 3:
98 case 4:
100 }
101 OGS_FATAL("Integration order {:d} not implemented for tetrahedrals.",
102 order);
103 }
104
105private:
106 unsigned _order;
107 unsigned _n_sampl_pt{0};
108};
109
110} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:19
void setIntegrationOrder(unsigned order)
Change the integration order.
unsigned getIntegrationOrder() const
return current integration order.
static MathLib::WeightedPoint getWeightedPoint(unsigned const igp)
unsigned getNumberOfPoints() const
return the number of sampling points
MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
static unsigned getNumberOfPoints(unsigned order)
static MathLib::WeightedPoint getWeightedPoint(unsigned const order, unsigned const igp)
static MATHLIB_EXPORT const unsigned NPoints