MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / integrate_func

Method integrate_func

tools/Assembler/ShapeFunctions/LinearTriangleIntegrator.cpp:9–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7 : m_mesh(mesh), m_shape_func(shape_func) { }
8
9Float LinearTriangleIntegrator::integrate_func(size_t elem_idx,
10 size_t local_func_i, size_t local_func_j) {
11 // Note the following magic number comes from evaluating
12 // (shape_func_i * shape_func_j) at Gaussian quadrature points over
13 // triangle.
14 const Float coeff_ii = 1.0 / 6.0;
15 const Float coeff_ij = 1.0 / 12.0;
16 const Float vol = m_mesh->getElementVolume(elem_idx);
17 if (local_func_i == local_func_j) {
18 return coeff_ii * vol;
19 } else {
20 return coeff_ij * vol;
21 }
22}
23
24Float LinearTriangleIntegrator::integrate_grad(size_t elem_idx,
25 size_t local_func_i, size_t local_func_j) {

Callers 2

integrate_func_funcMethod · 0.45
TEST_FFunction · 0.45

Calls 1

getElementVolumeMethod · 0.45

Tested by 1

TEST_FFunction · 0.36