Peano
Loading...
Searching...
No Matches
solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks Class Reference

DG solver adding tasks to baseline code. More...

Inheritance diagram for solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks:
Collaboration diagram for solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks:

Public Member Functions

 __init__ (self, name, dimensions, poly_degree, unknowns_per_cell_node, solutions_per_face_node, projections_per_face_node, min_h, max_h, assembly_matrix, assembly_matrix_scaling, mass_matrix, mass_matrix_scaling, face_from_cell_projection, face_from_cell_projection_scaling, cell_from_face_projection, cell_from_face_projection_scaling, riemann_matrix, boundary_matrix, cell_relaxation, face_relaxation, approximate_system_matrix, approximate_system_matrix_scaling, integration_points, solver_tolerance, custom_init_actionset=None, custom_plot_actionset=None, custom_init_cell="", enable_plotting=True, plot_predicate="true", solver_includes="")
 Construct the solver.
 
 add_to_init_solution (self, observer)
 See superclass' constructor.
 
 add_to_solve (self, observer)
 
 add_to_Peano4_datamodel (self, datamodel, verbose)
 
 add_use_statements (self, observer)
 This routine should still be called even if overwritten in child class.
 
- Public Member Functions inherited from solvers.api.Solver.Solver
 typename (self)
 
 instance_name (self)
 Return the name of the object that will be created for this solver.
 
 create_readme_descriptor (self)
 
 add_to_abstract_solver (self, header, implementation)
 
 add_to_vertex_data (self, name, size)
 Add in extra attributes on the fly.
 
 add_to_cell_data (self, name, size)
 Add in extra attributes on the fly.
 
 add_to_face_data (self, name, size)
 Add in extra attributes on the fly.
 
 name (self)
 
 __str__ (self)
 

Protected Attributes

 _task_name
 
 _cell_marker_for_tasks
 
 _action_set_project_into_cell_and_update_cell_solution
 
 _action_set_update_residual
 
- Protected Attributes inherited from solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver
 _dimensions
 
 _poly_degree
 
 _unknowns_per_cell_node
 
 _solutions_per_face_node
 
 _projections_per_face_node
 
 _assembly_matrix
 
 _assembly_matrix_scaling
 
 _mass_matrix
 
 _mass_matrix_scaling
 
 _face_from_cell_projection
 
 _face_from_cell_projection_scaling
 
 _cell_from_face_projection
 
 _cell_from_face_projection_scaling
 
 _riemann_matrix
 
 _boundary_matrix
 
 _approximate_system_matrix
 
 _approximate_system_matrix_scaling
 
 _cell_relaxation
 
 _face_relaxation
 
 _solver_tolerance
 
 _solver_includes
 
 _custom_init_actionset
 
 _custom_plot_actionset
 
 _custom_init_cell
 
 _enable_plotting
 
 _plot_predicate
 
 _integration_points
 
 _track_solution_between_cycles
 
 _unknowns_per_cell
 
 _unknowns_per_face_solution
 
 _unknowns_per_face_projection
 
 _use_smart_pointer
 
- Protected Attributes inherited from solvers.api.Solver.Solver
 _name
 
 _vertex_data
 
 _face_data
 
 _cell_data
 
 _abstract_solver_header_extras
 
 _abstract_solver_implementation_extras
 

Additional Inherited Members

- Data Fields inherited from solvers.api.Solver.Solver
 min_h
 
 max_h
 

Detailed Description

DG solver adding tasks to baseline code.

See the documentation for solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver first. The class adds a few simple features:

  1. We create a cell marker which holds the task numbers.
  2. This one is added to the mesh within add_to_Peano4_datamodel().
  3. We tell both the mesh initialisation and each solve step to use the data.
  4. We swap out the residual computation and the cell update with a bespoke task-based implementation

Definition at line 21 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.

Constructor & Destructor Documentation

◆ __init__()

solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.__init__ (   self,
  name,
  dimensions,
  poly_degree,
  unknowns_per_cell_node,
  solutions_per_face_node,
  projections_per_face_node,
  min_h,
  max_h,
  assembly_matrix,
  assembly_matrix_scaling,
  mass_matrix,
  mass_matrix_scaling,
  face_from_cell_projection,
  face_from_cell_projection_scaling,
  cell_from_face_projection,
  cell_from_face_projection_scaling,
  riemann_matrix,
  boundary_matrix,
  cell_relaxation,
  face_relaxation,
  approximate_system_matrix,
  approximate_system_matrix_scaling,
  integration_points,
  solver_tolerance,
  custom_init_actionset = None,
  custom_plot_actionset = None,
  custom_init_cell = "",
  enable_plotting = True,
  plot_predicate = "true",
  solver_includes = "" 
)

Construct the solver.

Please consult the tutorial on data masking for a discussion of the load_store_compute_flag settings.

Parameters
poly_degreeInteger The degree of the polynomial that we use. Has to be bigger or equal to one.
unknowns_per_cell_nodePositive Integer This is the \( K^c \) from the solver description.
solutions_per_face_nodePositive Integer This is the \( K^f \) from the solver description.
projections_per_face_nodePositive Integer This is the \( K^f_{f \gets c} \) from the solver description.
cell_relaxationFloat
This is the \( \omega _c \) from the description above and typically chosen form \( ]0,1[ \) though some scenarios benefit from a slight overrelaxation.
assembly_matrix\( \mathbb{R}^{K^c * (p+1)^{d} \times K^c * (p+1)^{d}}\) This is the cell-to-cell matrix which defines how the cell nodes couple to one another. Is is a square matrix. You can pass in None. In this case, the generated C++ code will not compile, but you will be allowed to fill it in manually.
assembly_matrix_scaling\( \mathbb{R}^{K^c * (p+1)^{d} \times K^c * (p+1)^{d}}\) This is a matrix of ints that prescribes how we scale each element in the assembly_matrix ie for each i,j, we do: assembly_matrix[i,j] *= ( h )^( assembly_matrix_scaling[i,j] )
mass_matrix\( \mathbb{R}^{K^c * (p+1)^{d} \times K^c * (p+1)^{d}}\)
mass_matrix_scaling\( \mathbb{R}^{K^c * (p+1)^{d} \times K^c * (p+1)^{d}}\) This is a matrix of ints that prescribes how we scale each element in the mass_matrix ie for each i,j, we do: mass_matrix[i,j] *= ( h )^( mass_matrix_scaling[i,j] )
face_from_cell\( \mathbb{R}^{2d * 2K^f_{f \gets c} * (p+1)^{d-1} \times K^c * (p+1)^{d}}\) This matrix projects the cell solution onto all of the faces. Note the extra factor of \( 2d \). The structure of this matrix is quite important. The rows should be structured in blocks of \( 2K^f_{f \gets c} * (p+1)^{d-1} \), ie one for each face, in the familiar Peano ordering. We note that this is the same as the number of projections we store per face. We note that, since the 0th face has left-side projections which should be set outside of the cell, that at least half of the rows of the matrix should be empty. We also note that each face contains multiple nodes, and they should be ordered sequentially in the typical Peano fashion, i.e. greedily along each coordinate axis until full, starting from the negative. For each face, with two nodes, with two values (q and u) being projected onto the face, the rows should be ordered as follows:
  1. Negative projection of q onto node 0
  2. Negative projection of q onto node 1
  3. Negative projection of u onto node 0
  4. Negative projection of u onto node 1
  5. Positive projection of q onto node 0
  6. Positive projection of q onto node 1
  7. Positive projection of u onto node 0
  8. Positive projection of u onto node 1 In two dimensions, all of the negative projections should be 0 on faces 0 and 1. Ditto for the positive projections on faces 2 and 3.
cell_from_face\( \mathbb{R}^{K^c * (p+1)^{d} \times 2d K^f * (p+1)^{d-1}}\) This matrix projects the face solution onto the cells. Note the extra factor of \( 2d \), similar to face_from_cell matrix. Some clever indexing is required in the backend here. The enumeration of the cols should follow a similar pattern to the rows of face_from_cell.
cell_from_face_scaling\( \mathbb{R}^{K^c * (p+1)^{d} \times 2d K^f * (p+1)^{d-1}}\) This is a matrix of ints that prescribes how we scale each element in the cell_from_face ie for each i,j, we do: cell_from_face[i,j] *= ( h )^( cell_from_face_scaling[i,j] )
Riemann_matrix\( \mathbb{R}^{ K^f (p+1)^{d-1} \times 2K^f_{f \gets c} (p+1)^{d-1}} \) The matrix that combines the left/right projections on the cell and outputs a value which determines \( q \).
face_relaxationFloat This is the \( \omega _f \) from above. Chosen from \( ]0,1[ \).
approximate_system_matrix\( \mathbb{R}^{K^c (p+1)^d \times K^c (p+1)^d} \) Approximation \( \tilde{A} \) which will be internally inverted, so it has to be non-singular.
approximate_system_matrix_scaling\( \mathbb{R}^{K^c (p+1)^d \times K^c (p+1)^d} \)
integration_points[Float] Sequence of polynomial_degree+1 entries which identify the position of the integration points along the unit interval.

Reimplemented from solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver.

Definition at line 37 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.

References solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.__init__().

Referenced by solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.__init__().

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

Member Function Documentation

◆ add_to_init_solution()

◆ add_to_Peano4_datamodel()

◆ add_to_solve()

◆ add_use_statements()

solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_use_statements (   self,
  observer 
)

Field Documentation

◆ _action_set_project_into_cell_and_update_cell_solution

solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._action_set_project_into_cell_and_update_cell_solution
protected

◆ _action_set_update_residual

solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._action_set_update_residual
protected

◆ _cell_marker_for_tasks

◆ _task_name


The documentation for this class was generated from the following file: