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