PolyFEM
|
Functions | |
integrate_exact (f) | |
integrate_approx (f, scheme) | |
list_schemes () | |
generate_monomials (order) | |
is_valid (scheme, tol=1e-6) | |
pick_scheme (all_schemes, order) | |
generate_cpp (selected_schemes) | |
main () | |
triangle.generate_cpp | ( | selected_schemes | ) |
Generate cpp code to fill points & weights.
Definition at line 147 of file triangle.py.
Referenced by main().
triangle.generate_monomials | ( | order | ) |
Generate bivariate monomials up to given order.
Definition at line 77 of file triangle.py.
Referenced by pick_scheme().
triangle.integrate_approx | ( | f, | |
scheme | |||
) |
Integrate numerically over the reference triangle.
Definition at line 22 of file triangle.py.
Referenced by pick_scheme().
triangle.integrate_exact | ( | f | ) |
Integrate a function over the reference triangle (0,0), (1,0), (0,1).
Definition at line 10 of file triangle.py.
Referenced by pick_scheme().
triangle.is_valid | ( | scheme, | |
tol = 1e-6 |
|||
) |
A scheme is valid if: 1. All its weights sums up to one; 2. All the weights are positive; 3. All its points are inside the reference triangle; 4. No point lie on an edge.
Definition at line 90 of file triangle.py.
Referenced by pick_scheme().
triangle.list_schemes | ( | ) |
List all existing schemes for triangles.
Definition at line 34 of file triangle.py.
Referenced by main().
triangle.main | ( | ) |
Definition at line 169 of file triangle.py.
References generate_cpp(), list_schemes(), main(), and pick_scheme().
Referenced by main().
triangle.pick_scheme | ( | all_schemes, | |
order | |||
) |
Picks the best scheme for a given polynomial degree, following this strategy: - Tries all schemes with the same order as required. - Eliminate schemes with weights that do not sum up to 1, or points that lie outside the reference triangle. - Among the remaining schemes, compare the integration error over all bivariate monomials of inferior order. - Keeps only the scheme with total integration error lower than a certain threshold. - Among those, keep the one with fewer number of integration points. - Finally, break ties using the integration error accumulated over the monomials.
Definition at line 106 of file triangle.py.
References generate_monomials(), integrate_approx(), integrate_exact(), and is_valid().
Referenced by main().