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
9
namespace
polyfem
10
{
11
namespace
quadrature
12
{
13
namespace
14
{
15
void
get_weight_and_points(
const
int
order,
const
bool
use_corner_quadrature, Eigen::MatrixXd &points, Eigen::VectorXd &weights)
16
{
17
if
(use_corner_quadrature)
18
{
19
switch
(order)
20
{
21
#include <
polyfem/autogen/auto_tetrahedron_corner.ipp
>
22
23
default
:
24
assert(
false
);
25
};
26
}
27
else
28
{
29
switch
(order)
30
{
31
#include <
polyfem/autogen/auto_tetrahedron.ipp
>
32
33
default
:
34
assert(
false
);
35
};
36
}
37
}
38
}
// namespace
39
40
TetQuadrature::TetQuadrature
(
bool
use_corner_quadrature) : use_corner_quadrature_(use_corner_quadrature)
41
{
42
}
43
44
void
TetQuadrature::get_quadrature
(
const
int
order,
Quadrature
&quad)
45
{
46
Quadrature
tmp;
47
48
get_weight_and_points(order,
use_corner_quadrature_
, quad.
points
, quad.
weights
);
49
50
assert(fabs(quad.
weights
.sum() - 1) < 1e-12);
51
assert(quad.
points
.minCoeff() >= 0 && quad.
points
.maxCoeff() <= 1);
52
53
assert(quad.
points
.rows() == quad.
weights
.size());
54
55
quad.
weights
/= 6;
56
}
57
}
// namespace quadrature
58
}
// namespace polyfem
LineQuadrature.hpp
quadrature
Quadrature quadrature
Definition
MassMatrixAssembler.cpp:30
TetQuadrature.hpp
auto_tetrahedron.ipp
auto_tetrahedron_corner.ipp
polyfem::quadrature::Quadrature
Definition
Quadrature.hpp:9
polyfem::quadrature::Quadrature::points
Eigen::MatrixXd points
Definition
Quadrature.hpp:11
polyfem::quadrature::Quadrature::weights
Eigen::VectorXd weights
Definition
Quadrature.hpp:12
polyfem::quadrature::TetQuadrature::use_corner_quadrature_
bool use_corner_quadrature_
Definition
TetQuadrature.hpp:17
polyfem::quadrature::TetQuadrature::TetQuadrature
TetQuadrature(bool use_corner_quadrature=false)
Definition
TetQuadrature.cpp:40
polyfem::quadrature::TetQuadrature::get_quadrature
void get_quadrature(const int order, Quadrature &quad)
Definition
TetQuadrature.cpp:44
polyfem
Definition
AMIPSEnergy.cpp:6
src
polyfem
quadrature
TetQuadrature.cpp
Generated by
1.9.8