OGS
IntegrationGaussLegendrePyramid.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 IntegrationGaussLegendrePyramid(unsigned const order = 2)
24 : _order(order)
25 {
26 this->setIntegrationOrder(order);
27 }
28
30 void setIntegrationOrder(unsigned const order)
31 {
32 _order = order;
34 }
35
37 unsigned getIntegrationOrder() const { return _order; }
39 unsigned getNumberOfPoints() const { return _n_sampl_pt; }
46 MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
47 {
49 }
50
58 static MathLib::WeightedPoint getWeightedPoint(unsigned const order,
59 unsigned const igp)
60 {
61 // For the case of order = 4, it
62 // causes `assertion `rank == num_nodes' failed`
63 // in the SVD decomposition in the least square extrapolation.
64 // Therefore for the case of order = 4, the rule of order 3 is used.
65 switch (order)
66 {
67 case 1:
69 case 2:
71 case 3:
73 case 4:
75 }
76 OGS_FATAL("Integration order {:d} not implemented for pyramids.",
77 order);
78 }
79
80 template <typename Method>
81 static MathLib::WeightedPoint getWeightedPoint(unsigned const igp)
82 {
83 return MathLib::WeightedPoint(Method::X[igp], Method::W[igp]);
84 }
85
92 static unsigned getNumberOfPoints(unsigned const order)
93 {
94 // For the case of order = 4, it
95 // causes `assertion `rank == num_nodes' failed`
96 // in the SVD decomposition in the least square extrapolation.
97 // Therefore for the case of order = 4, the rule of order 3 is used.
98 switch (order)
99 {
100 case 1:
102 case 2:
104 case 3:
106 case 4:
108 }
109 OGS_FATAL("Integration order {:d} not implemented for pyramids.",
110 order);
111 }
112
113private:
114 unsigned _order;
115 unsigned _n_sampl_pt{0};
116};
117
118} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:19
MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
static unsigned getNumberOfPoints(unsigned const order)
unsigned getNumberOfPoints() const
return the number of sampling points
unsigned getIntegrationOrder() const
return current integration order.
static MathLib::WeightedPoint getWeightedPoint(unsigned const order, unsigned const igp)
static MathLib::WeightedPoint getWeightedPoint(unsigned const igp)
void setIntegrationOrder(unsigned const order)
Change the integration order.
static MATHLIB_EXPORT const unsigned NPoints