IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
MidpointQuadrature.hpp
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
22 this->integration_nodes_m = Vector<T, NumNodes1D>();
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
void computeNodesAndWeights() override
Computes the quadrature nodes and weights.
Definition MidpointQuadrature.hpp:17
MidpointQuadrature(const ElementType &ref_element)
Construct a new Midpoint Quadrature object.
Definition MidpointQuadrature.hpp:5
This is the base class for all quadrature rules.
Definition Quadrature.h:35
Definition Vector.h:23
Definition Archive.h:20