PolyFEM
Loading...
Searching...
No Matches
TriQuadrature.cpp
Go to the documentation of this file.
1#include "TriQuadrature.hpp"
2#include "LineQuadrature.hpp"
3
4#include <vector>
5#include <cassert>
6#include <cmath>
7
8namespace polyfem
9{
10 namespace quadrature
11 {
12 namespace
13 {
14 void get_weight_and_points(const int order, Eigen::MatrixXd &points, Eigen::VectorXd &weights)
15 {
16 switch (order)
17 {
19
20 default:
21 assert(false);
22 };
23 }
24 } // namespace
25
29
30 void TriQuadrature::get_quadrature(const int order, Quadrature &quad)
31 {
32 Quadrature tmp;
33
34 get_weight_and_points(order, quad.points, quad.weights);
35
36 assert(fabs(quad.weights.sum() - 1) < 1e-14);
37 assert(quad.points.minCoeff() >= 0 && quad.points.maxCoeff() <= 1);
38
39 assert(quad.points.rows() == quad.weights.size());
40
41 quad.weights /= 2;
42 }
43 } // namespace quadrature
44} // namespace polyfem
Quadrature quadrature
void get_quadrature(const int order, Quadrature &quad)