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

Functions

 integrate_exact (f)
 
 integrate_approx (f, scheme)
 
 list_schemes ()
 
 generate_monomials (order)
 
 is_valid (scheme, tol=1e-6, relaxed=False)
 
 pick_scheme (all_schemes, order, relaxed=False)
 
 generate_cpp (selected_schemes)
 
 main ()
 

Variables

 b
 

Function Documentation

◆ generate_cpp()

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

Definition at line 155 of file pyramid.py.

Referenced by main().

Here is the caller graph for this function:

◆ generate_monomials()

pyramid.generate_monomials (   order)
Generate trivariate monomials up to given order.

Definition at line 68 of file pyramid.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ integrate_approx()

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

Definition at line 37 of file pyramid.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ integrate_exact()

pyramid.integrate_exact (   f)
Integrate a function over the reference pyramid:
    0 <= z <= 1
    0 <= x <= (1 - z)
    0 <= y <= (1 - z)

Definition at line 17 of file pyramid.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ is_valid()

pyramid.is_valid (   scheme,
  tol = 1e-6,
  relaxed = False 
)
A scheme is valid if:
1. weights sum to 1
2. weights positive
3. points inside reference pyramid:
     0 <= z <= 1
     |x|, |y| <= 1 - z

Definition at line 82 of file pyramid.py.

Referenced by pick_scheme().

Here is the caller graph for this function:

◆ list_schemes()

pyramid.list_schemes ( )
List all existing schemes for tetrahedra.

Definition at line 51 of file pyramid.py.

Referenced by main().

Here is the caller graph for this function:

◆ main()

pyramid.main ( )

Definition at line 184 of file pyramid.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()

pyramid.pick_scheme (   all_schemes,
  order,
  relaxed = False 
)
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 115 of file pyramid.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:

Variable Documentation

◆ b

pyramid.b
Initial value:
1= np.array([
2 [0,0,0],
3 [0,1,0],
4 [1,1,0],
5 [1,0,0],
6 [0,0,1]
7])

Definition at line 9 of file pyramid.py.