IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
MidpointQuadrature.hpp
Go to the documentation of this file.
1
2
3namespace ippl {
4 template <typename T, unsigned NumNodes1D, typename ElementType>
6 const ElementType& ref_element)
7 : Quadrature<T, NumNodes1D, ElementType>(ref_element) {
8 this->degree_m = 1;
9
10 this->a_m = 0.0;
11 this->b_m = 1.0;
12
14 }
15
16 template <typename T, unsigned NumNodes1D, typename ElementType>
18 const T segment_length = (this->b_m - this->a_m) / NumNodes1D;
19
20 this->weights_m = Vector<T, NumNodes1D>(segment_length);
21
23 for (unsigned i = 0; i < NumNodes1D; ++i) {
24 this->integration_nodes_m[i] = 0.5 * segment_length + i * segment_length + this->a_m;
25 }
26 }
27
28} // namespace ippl
Definition Archive.h:20
void computeNodesAndWeights() override
Computes the quadrature nodes and weights.
MidpointQuadrature(const ElementType &ref_element)
Construct a new Midpoint Quadrature object.
Vector< T, NumNodes1D > integration_nodes_m
Definition Quadrature.h:113
Vector< T, NumNodes1D > weights_m
Definition Quadrature.h:114
Quadrature(const ElementType &ref_element)
Construct a new Quadrature object.
Definition Quadrature.hpp:4
unsigned degree_m
Definition Quadrature.h:111