OGS
IntegrationGaussLegendreRegular.h
Go to the documentation of this file.
1
13#pragma once
14
15#include <array>
16#include <cmath>
17
18#include "BaseLib/Error.h"
21
22namespace NumLib
23{
28template <unsigned N_DIM>
30{
31public:
36 explicit IntegrationGaussLegendreRegular(unsigned order = 2) : _order(order)
37 {
38 this->setIntegrationOrder(order);
39 }
40
42 void setIntegrationOrder(unsigned order)
43 {
44 this->_n_sampl_pt = static_cast<unsigned>(std::pow(order, N_DIM));
45 this->_order = order;
46 }
47
49 unsigned getIntegrationOrder() const { return _order; }
50
52 unsigned getNumberOfPoints() const { return _n_sampl_pt; }
53
58 MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
59 {
61 }
62
68 static std::array<unsigned, N_DIM> getPositionIndices(unsigned order,
69 unsigned igp);
70
76 static MathLib::WeightedPoint getWeightedPoint(unsigned const order,
77 unsigned const igp);
78
79private:
84 template <typename Method>
86 std::array<unsigned, N_DIM> const& pos);
87
88private:
89 unsigned _order;
90 unsigned _n_sampl_pt{0};
91};
92
93} // namespace NumLib
94
static std::array< unsigned, N_DIM > getPositionIndices(unsigned order, unsigned igp)
unsigned getIntegrationOrder() const
return current integration order.
unsigned getNumberOfPoints() const
return the number of sampling points
MathLib::WeightedPoint getWeightedPoint(unsigned const igp) const
void setIntegrationOrder(unsigned order)
Change the integration order.