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