OGS
IntegrationGaussLegendrePrism.cpp
Go to the documentation of this file.
1
12
#include "
IntegrationGaussLegendrePrism.h
"
13
14
#include <cassert>
15
16
#include "
BaseLib/Error.h
"
17
18
namespace
19
{
20
template
<
int
OrderGaussLegendreTri,
int
OrderGaussLegendre>
21
constexpr
unsigned
getNumberOfPointsConcrete
()
22
{
23
return
MathLib::GaussLegendreTri<OrderGaussLegendreTri>::NPoints
*
24
OrderGaussLegendre;
25
}
26
27
template
<
int
OrderGaussLegendreTri,
int
OrderGaussLegendre>
28
MathLib::WeightedPoint
getWeightedPointConcrete
(
unsigned
const
igp)
29
{
30
using
GL =
MathLib::GaussLegendre<OrderGaussLegendre>
;
31
using
GLT =
MathLib::GaussLegendreTri<OrderGaussLegendreTri>
;
32
33
assert(igp < (
getNumberOfPointsConcrete
<OrderGaussLegendreTri,
34
OrderGaussLegendre>()));
35
36
const
unsigned
gp_r = igp % GLT::NPoints;
37
const
unsigned
gp_t = igp / GLT::NPoints;
38
39
std::array<double, 3> rst{GLT::X[gp_r][0], GLT::X[gp_r][1], GL::X[gp_t]};
40
41
double
const
weight = GLT::W[gp_r] * 0.5 * GL::W[gp_t];
42
43
return
MathLib::WeightedPoint
(rst, weight);
44
}
45
}
// namespace
46
47
namespace
NumLib
48
{
49
void
IntegrationGaussLegendrePrism::setIntegrationOrder
(
unsigned
const
order)
50
{
51
_order
= order;
52
_n_sampl_pt
=
getNumberOfPoints
(
_order
);
53
}
54
55
MathLib::WeightedPoint
IntegrationGaussLegendrePrism::getWeightedPoint
(
56
unsigned
const
order,
unsigned
const
igp)
57
{
58
// Note: These cases must correspod strictly to the logic in
59
// getNumberOfPoints()!
60
switch
(order)
61
{
62
case
1:
63
return
getWeightedPointConcrete<1, 1>(igp);
64
case
2:
65
return
getWeightedPointConcrete<2, 2>(igp);
66
case
3:
67
// The combination <4, 3> has been chosen to allow extrapolation
68
// from the set of integration points on Prism13 elements for the
69
// third integration order. <3, 3> would not be sufficient.
70
return
getWeightedPointConcrete<4, 3>(igp);
71
case
4:
72
return
getWeightedPointConcrete<4, 4>(igp);
73
default
:
74
OGS_FATAL
(
75
"Integration order {} not supported for integration on prisms."
,
76
order);
77
}
78
}
79
80
unsigned
IntegrationGaussLegendrePrism::getNumberOfPoints
(
unsigned
const
order)
81
{
82
// Note: These cases must correspod strictly to the logic in
83
// getWeightedPoint()!
84
switch
(order)
85
{
86
case
1:
87
return
getNumberOfPointsConcrete<1, 1>();
88
case
2:
89
return
getNumberOfPointsConcrete<2, 2>();
90
case
3:
91
// The combination <4, 3> has been chosen to allow extrapolation
92
// from the set of integration points on Prism13 elements for the
93
// third integration order. <3, 3> would not be sufficient.
94
return
getNumberOfPointsConcrete<4, 3>();
95
case
4:
96
return
getNumberOfPointsConcrete<4, 4>();
97
default
:
98
OGS_FATAL
(
99
"Integration order {} not supported for integration on prisms."
,
100
order);
101
}
102
}
103
}
// namespace NumLib
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
IntegrationGaussLegendrePrism.h
MathLib::WeightedPoint
Definition
WeightedPoint.h:22
NumLib::IntegrationGaussLegendrePrism::setIntegrationOrder
void setIntegrationOrder(unsigned const order)
Change the integration order.
Definition
IntegrationGaussLegendrePrism.cpp:49
NumLib::IntegrationGaussLegendrePrism::_n_sampl_pt
unsigned _n_sampl_pt
Definition
IntegrationGaussLegendrePrism.h:74
NumLib::IntegrationGaussLegendrePrism::_order
unsigned _order
Definition
IntegrationGaussLegendrePrism.h:73
NumLib::IntegrationGaussLegendrePrism::getNumberOfPoints
unsigned getNumberOfPoints() const
return the number of sampling points
Definition
IntegrationGaussLegendrePrism.h:42
NumLib::IntegrationGaussLegendrePrism::getWeightedPoint
MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
Definition
IntegrationGaussLegendrePrism.h:47
NumLib
Definition
ProjectData.h:46
anonymous_namespace{IntegrationGaussLegendrePrism.cpp}::getWeightedPointConcrete
MathLib::WeightedPoint getWeightedPointConcrete(unsigned const igp)
Definition
IntegrationGaussLegendrePrism.cpp:28
anonymous_namespace{IntegrationGaussLegendrePrism.cpp}::getNumberOfPointsConcrete
constexpr unsigned getNumberOfPointsConcrete()
Definition
IntegrationGaussLegendrePrism.cpp:21
MathLib::GaussLegendreTri
Definition
GaussLegendreTri.h:27
MathLib::GaussLegendre
Definition
GaussLegendre.h:26
NumLib
Fem
Integration
IntegrationGaussLegendrePrism.cpp
Generated by
1.11.0