OGS
IntegrationGaussLegendrePyramid.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "BaseLib/Error.h"
16
17namespace NumLib
18{
23{
24public:
30 explicit IntegrationGaussLegendrePyramid(unsigned const order = 2)
31 : _order(order)
32 {
33 this->setIntegrationOrder(order);
34 }
35
37 void setIntegrationOrder(unsigned const order)
38 {
39 _order = order;
41 }
42
44 unsigned getIntegrationOrder() const { return _order; }
46 unsigned getNumberOfPoints() const { return _n_sampl_pt; }
53 MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
54 {
56 }
57
65 static MathLib::WeightedPoint getWeightedPoint(unsigned const order,
66 unsigned const igp)
67 {
68 // For the case of order = 4, it
69 // causes `assertion `rank == num_nodes' failed`
70 // in the SVD decomposition in the least square extrapolation.
71 // Therefore for the case of order = 4, the rule of order 3 is used.
72 switch (order)
73 {
74 case 1:
75 return getWeightedPoint<MathLib::GaussLegendrePyramid<1>>(igp);
76 case 2:
77 return getWeightedPoint<MathLib::GaussLegendrePyramid<2>>(igp);
78 case 3:
79 return getWeightedPoint<MathLib::GaussLegendrePyramid<3>>(igp);
80 case 4:
81 return getWeightedPoint<MathLib::GaussLegendrePyramid<3>>(igp);
82 }
83 OGS_FATAL("Integration order {:d} not implemented for pyramids.",
84 order);
85 }
86
87 template <typename Method>
88 static MathLib::WeightedPoint getWeightedPoint(unsigned const igp)
89 {
90 return MathLib::WeightedPoint(Method::X[igp], Method::W[igp]);
91 }
92
99 static unsigned getNumberOfPoints(unsigned const order)
100 {
101 // For the case of order = 4, it
102 // causes `assertion `rank == num_nodes' failed`
103 // in the SVD decomposition in the least square extrapolation.
104 // Therefore for the case of order = 4, the rule of order 3 is used.
105 switch (order)
106 {
107 case 1:
109 case 2:
111 case 3:
113 case 4:
115 }
116 OGS_FATAL("Integration order {:d} not implemented for pyramids.",
117 order);
118 }
119
120private:
121 unsigned _order;
122 unsigned _n_sampl_pt{0};
123};
124
125} // namespace NumLib
#define OGS_FATAL(...)
Definition Error.h:26
Gauss-Legendre quadrature rule for pyramid.
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.