PolyFEM
Loading...
Searching...
No Matches
triangle Namespace Reference

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 ()
 

Function Documentation

◆ generate_cpp()

triangle.generate_cpp (   selected_schemes)
Generate cpp code to fill points & weights.

Definition at line 147 of file triangle.py.

Referenced by main().

Here is the caller graph for this function:

◆ generate_monomials()

triangle.generate_monomials (   order)
Generate bivariate monomials up to given order.

Definition at line 77 of file triangle.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ integrate_approx()

triangle.integrate_approx (   f,
  scheme 
)
Integrate numerically over the reference triangle.

Definition at line 22 of file triangle.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ integrate_exact()

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().

Here is the caller graph for this function:

◆ is_valid()

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().

Here is the caller graph for this function:

◆ list_schemes()

triangle.list_schemes ( )
List all existing schemes for triangles.

Definition at line 34 of file triangle.py.

Referenced by main().

Here is the caller graph for this function:

◆ main()

triangle.main ( )

Definition at line 169 of file triangle.py.

References generate_cpp(), list_schemes(), main(), and pick_scheme().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pick_scheme()

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().

Here is the call graph for this function:
Here is the caller graph for this function: