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