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


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) | |
Additional Inherited Members | |
Data Fields inherited from solvers.api.Solver.Solver | |
| min_h | |
| max_h | |
DG solver adding tasks to baseline code.
See the documentation for solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver first. The class adds a few simple features:
Definition at line 21 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
| 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.
| poly_degree | Integer The degree of the polynomial that we use. Has to be bigger or equal to one. |
| unknowns_per_cell_node | Positive Integer This is the \( K^c \) from the solver description. |
| solutions_per_face_node | Positive Integer This is the \( K^f \) from the solver description. |
| projections_per_face_node | Positive Integer This is the \( K^f_{f \gets c} \) from the solver description. |
| cell_relaxation | Float 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:
|
| 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_relaxation | Float 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.


| solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_init_solution | ( | self, | |
| observer | |||
| ) |
See superclass' constructor.
We ask the superclass to add all of its action sets to the project's observer. After that, we add our own action set to the algorithm step.
Definition at line 115 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
References solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._task_name, peano4.api.toolbox.api.AssignNumbersToCells.AssignNumbersToCells._task_name, peano4.api.toolbox.api.EnumerateCellsAndVertices.AssignNumbersToMesh._task_name, peano4.api.toolbox.api.EnumerateCellsAndVertices.ClearNumbersOnMesh._task_name, and solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_init_solution().


| solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_Peano4_datamodel | ( | self, | |
| datamodel, | |||
| verbose | |||
| ) |
Reimplemented from solvers.api.Solver.Solver.
Definition at line 134 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
References solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._cell_marker_for_tasks, and solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_Peano4_datamodel().


| solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_solve | ( | self, | |
| observer | |||
| ) |
Definition at line 129 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
References solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._task_name, peano4.api.toolbox.api.AssignNumbersToCells.AssignNumbersToCells._task_name, peano4.api.toolbox.api.EnumerateCellsAndVertices.AssignNumbersToMesh._task_name, peano4.api.toolbox.api.EnumerateCellsAndVertices.ClearNumbersOnMesh._task_name, and solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_solve().


| solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_use_statements | ( | self, | |
| observer | |||
| ) |
This routine should still be called even if overwritten in child class.
Reimplemented from solvers.api.Solver.Solver.
Definition at line 139 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
References solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks._cell_marker_for_tasks, and solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_use_statements().


|
protected |
Definition at line 109 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
|
protected |
Definition at line 110 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
|
protected |
Definition at line 104 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
Referenced by solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_Peano4_datamodel(), and solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_use_statements().
|
protected |
Definition at line 103 of file DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.py.
Referenced by solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_init_solution(), solvers.api.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.DiscontinuousGalerkinDiscretisationPointWiseRiemannSolver_Tasks.add_to_solve(), peano4.api.toolbox.api.AssignNumbersToCells.AssignNumbersToCells.get_body_of_operation(), peano4.api.toolbox.api.EnumerateCellsAndVertices.AssignNumbersToMesh.get_body_of_operation(), and peano4.api.toolbox.api.EnumerateCellsAndVertices.ClearNumbersOnMesh.get_body_of_operation().