Peano 4
Loading...
Searching...
No Matches
exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation Class Reference

Helper class to model a hyperbolic PDE in first-order conservative formulation. More...

Inheritance diagram for exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation:
Collaboration diagram for exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation:

Public Member Functions

 __init__ (self, unknowns, auxiliary_variables, dimensions)
 
 __str__ (self)
 
 LaTeX (self)
 
 substitute_expression (self, expression, new_expression)
 Usually used to set a symbolic variable (expression) to a value (new_expression).
 
 implementation_of_flux (self, invoke_evalf_before_output=False)
 Return implementation for flux along one coordinate axis (d) as C code.
 
 implementation_of_ncp (self, invoke_evalf_before_output=False)
 Return implementation for nonconservative product (ncp) along one coordinate axis (d) as C code.
 
 implementation_of_eigenvalues (self, invoke_evalf_before_output=False)
 Return eigenvalues.
 
 implementation_of_max_eigenvalue (self, invoke_evalf_before_output=False, use_absolute_values=True)
 Return maximum eigenvalue.
 
 implementation_of_sources (self, invoke_evalf_before_output=False)
 Return implementation for sources as C code.
 
- Public Member Functions inherited from exahype2.symhype.PDE.PDE
 unknown_identifier_for_plotter (self)
 Returns identifier for the unknowns.
 
 name_Q_entry (self, offset_in_Q, name)
 Q covers both unknowns plus auxiliary variables.
 
 name_auxiliary_variable (self, number, name)
 
 name_Q_entries (self, offset_in_Q, cardinality, name)
 
 grad (self, Q)
 
 implementation_of_homogeneous_Neumann_BC (self)
 
 implementation_of_boundary_conditions (self, invoke_evalf_before_output=False)
 invoke_evalf_before_output: boolean If your expression is a symbolic expression (default) then we use evalf before we pipe it into the output.
 
 implementation_of_initial_conditions (self, invoke_evalf_before_output=False)
 invoke_evalf_before_output: boolean If your expression is a symbolic expression (default) then we use evalf before we pipe it into the output.
 

Data Fields

 F
 
 ncp
 
 eigenvalues
 
 sources
 
 unknowns
 
 dimensions
 
- Data Fields inherited from exahype2.symhype.PDE.PDE
 unknowns
 
 auxiliary_variables
 
 dimensions
 
 Q
 
 delta_Q
 
 initial_values
 
 boundary_values
 
 x
 
 h
 

Additional Inherited Members

- Protected Member Functions inherited from exahype2.symhype.PDE.PDE
 _implementation_of_mapping_onto_named_quantities (self, is_cell_mapping=True, is_boundary=False, has_delta=False)
 Return the C code that maps the quantities from Q onto properly labelled quantities.
 

Detailed Description

Helper class to model a hyperbolic PDE in first-order conservative formulation.

To model your PDE, you typically run through a couple of single steps. First, include this package plus sympy. Next, create a new instance of this class to which you pass the number of equations in your PDE system, i.e., the number of unknowns you want to develop, plus the dimension.

As a consequence, the solver holds an equation pde which describes the PDE's right-hand side in the representation

\partial Q(t) + div_x F(Q)

Most people prefer not to work with a vector Q but with some symbolic names. Feel free to derive them from Q via constructs similar to

rho = euler.Q[0] j = sympy.Array(euler.Q[1:4]) E = euler.Q[4]

Definition at line 9 of file FirstOrderConservativePDEFormulation.py.

Constructor & Destructor Documentation

◆ __init__()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.__init__ ( self,
unknowns,
auxiliary_variables,
dimensions )

Reimplemented from exahype2.symhype.PDE.PDE.

Reimplemented in pde.PDE, and template_scenario.Template_Scenario.

Definition at line 33 of file FirstOrderConservativePDEFormulation.py.

Member Function Documentation

◆ __str__()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.__str__ ( self)

Definition at line 41 of file FirstOrderConservativePDEFormulation.py.

Referenced by peano4.toolbox.particles.postprocessing.ParticleVTUReader.VTUParticleSet.__repr__().

Here is the caller graph for this function:

◆ implementation_of_eigenvalues()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_eigenvalues ( self,
invoke_evalf_before_output = False )

Return eigenvalues.

This yields a set of eigenvalues, i.e., one per unknown. For many solvers such as Rusanov, you need only one.

d: int The axis along which we wanna have the eigenvalues

invoke_evalf_before_output: boolean If your expression is a symbolic expression (default) then we use evalf before we pipe it into the output. If your expression is something numeric, then evalf will fail (as it is not defined for scalar quantities).

Definition at line 178 of file FirstOrderConservativePDEFormulation.py.

References exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), Equations.Acoustic.Acoustic.dimensions, Equations.Advection.Advection.dimensions, Equations.Elastic.Elastic.dimensions, Equations.Equations.Equations.dimensions, Equations.Euler.Euler.dimensions, Equations.SWE.SWE_W_Bathimetry.dimensions, Equations.SWE.SWE_WO_Bathimetry.dimensions, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, matrixgenerators.DGMatrixGenerator.DGMatrixGenerator.dimensions, matrixgenerators.DLinear.DLinear.dimensions, matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.HybridDiscontinuousGalerkinDiscretisation.HybridDiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.MixedDiscontinuousGalerkinDiscretisation.MixedDiscontinuousGalerkinDiscretisation.dimensions, peano4.visualisation.PatchFileParser.PatchFileParser.dimensions, DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, Equations.Equations.Equations.eigenvalues(), Equations.Acoustic.Acoustic.eigenvalues(), Equations.Advection.Advection.eigenvalues(), Equations.Elastic.Elastic.eigenvalues(), Equations.Euler.Euler.eigenvalues(), Equations.SWE.SWE_W_Bathimetry.eigenvalues(), Equations.SWE.SWE_WO_Bathimetry.eigenvalues(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.eigenvalues, avalanche.Avalanche.unknowns, exahype2.solvers.aderdg.ADERDG.ADERDG.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns, exahype2.symhype.PDE.PDE.unknowns, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.unknowns, peano4.visualisation.PatchFileParser.PatchFileParser.unknowns, and convert::data::Variable.unknowns.

Here is the call graph for this function:

◆ implementation_of_flux()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_flux ( self,
invoke_evalf_before_output = False )

Return implementation for flux along one coordinate axis (d) as C code.

invoke_evalf_before_output: boolean If your expression is a symbolic expression (default) then we use evalf before we pipe it into the output. If your expression is something numeric, then evalf will fail (as it is not defined for scalar quantities).

Definition at line 108 of file FirstOrderConservativePDEFormulation.py.

References exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), Equations.Acoustic.Acoustic.dimensions, Equations.Advection.Advection.dimensions, Equations.Elastic.Elastic.dimensions, Equations.Equations.Equations.dimensions, Equations.Euler.Euler.dimensions, Equations.SWE.SWE_W_Bathimetry.dimensions, Equations.SWE.SWE_WO_Bathimetry.dimensions, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, matrixgenerators.DGMatrixGenerator.DGMatrixGenerator.dimensions, matrixgenerators.DLinear.DLinear.dimensions, matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.HybridDiscontinuousGalerkinDiscretisation.HybridDiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.MixedDiscontinuousGalerkinDiscretisation.MixedDiscontinuousGalerkinDiscretisation.dimensions, peano4.visualisation.PatchFileParser.PatchFileParser.dimensions, DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.F, avalanche.Avalanche.unknowns, exahype2.solvers.aderdg.ADERDG.ADERDG.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns, exahype2.symhype.PDE.PDE.unknowns, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.unknowns, peano4.visualisation.PatchFileParser.PatchFileParser.unknowns, and convert::data::Variable.unknowns.

Here is the call graph for this function:

◆ implementation_of_max_eigenvalue()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_max_eigenvalue ( self,
invoke_evalf_before_output = False,
use_absolute_values = True )

Return maximum eigenvalue.

Definition at line 220 of file FirstOrderConservativePDEFormulation.py.

References exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), Equations.Acoustic.Acoustic.dimensions, Equations.Advection.Advection.dimensions, Equations.Elastic.Elastic.dimensions, Equations.Equations.Equations.dimensions, Equations.Euler.Euler.dimensions, Equations.SWE.SWE_W_Bathimetry.dimensions, Equations.SWE.SWE_WO_Bathimetry.dimensions, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, matrixgenerators.DGMatrixGenerator.DGMatrixGenerator.dimensions, matrixgenerators.DLinear.DLinear.dimensions, matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.HybridDiscontinuousGalerkinDiscretisation.HybridDiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.MixedDiscontinuousGalerkinDiscretisation.MixedDiscontinuousGalerkinDiscretisation.dimensions, peano4.visualisation.PatchFileParser.PatchFileParser.dimensions, DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, Equations.Equations.Equations.eigenvalues(), Equations.Acoustic.Acoustic.eigenvalues(), Equations.Advection.Advection.eigenvalues(), Equations.Elastic.Elastic.eigenvalues(), Equations.Euler.Euler.eigenvalues(), Equations.SWE.SWE_W_Bathimetry.eigenvalues(), Equations.SWE.SWE_WO_Bathimetry.eigenvalues(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.eigenvalues, avalanche.Avalanche.unknowns, exahype2.solvers.aderdg.ADERDG.ADERDG.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns, exahype2.symhype.PDE.PDE.unknowns, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.unknowns, peano4.visualisation.PatchFileParser.PatchFileParser.unknowns, and convert::data::Variable.unknowns.

Here is the call graph for this function:

◆ implementation_of_ncp()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_ncp ( self,
invoke_evalf_before_output = False )

Return implementation for nonconservative product (ncp) along one coordinate axis (d) as C code.

invoke_evalf_before_output: boolean If your expression is a symbolic expression (default) then we use evalf before we pipe it into the output. If your expression is something numeric, then evalf will fail (as it is not defined for scalar quantities).

Definition at line 144 of file FirstOrderConservativePDEFormulation.py.

References exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), Equations.Acoustic.Acoustic.dimensions, Equations.Advection.Advection.dimensions, Equations.Elastic.Elastic.dimensions, Equations.Equations.Equations.dimensions, Equations.Euler.Euler.dimensions, Equations.SWE.SWE_W_Bathimetry.dimensions, Equations.SWE.SWE_WO_Bathimetry.dimensions, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions, exahype2.symhype.PDE.PDE.dimensions, matrixgenerators.DGMatrixGenerator.DGMatrixGenerator.dimensions, matrixgenerators.DLinear.DLinear.dimensions, matrixgenerators.MatrixGenerator.MatrixGenerator.dimensions, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.HybridDiscontinuousGalerkinDiscretisation.HybridDiscontinuousGalerkinDiscretisation.dimensions, petsc.solvers.MixedDiscontinuousGalerkinDiscretisation.MixedDiscontinuousGalerkinDiscretisation.dimensions, peano4.visualisation.PatchFileParser.PatchFileParser.dimensions, DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.dimensions, convert::data::PatchData.dimensions, convert::data::Variable.dimensions, Equations.Equations.Equations.ncp(), Equations.SWE.SWE_W_Bathimetry.ncp(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.ncp, avalanche.Avalanche.unknowns, exahype2.solvers.aderdg.ADERDG.ADERDG.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns, exahype2.symhype.PDE.PDE.unknowns, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.unknowns, peano4.visualisation.PatchFileParser.PatchFileParser.unknowns, and convert::data::Variable.unknowns.

Here is the call graph for this function:

◆ implementation_of_sources()

◆ LaTeX()

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.LaTeX ( self)

Definition at line 61 of file FirstOrderConservativePDEFormulation.py.

References Equations.Equations.Equations.eigenvalues(), Equations.Acoustic.Acoustic.eigenvalues(), Equations.Advection.Advection.eigenvalues(), Equations.Elastic.Elastic.eigenvalues(), Equations.Euler.Euler.eigenvalues(), Equations.SWE.SWE_W_Bathimetry.eigenvalues(), Equations.SWE.SWE_WO_Bathimetry.eigenvalues(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.eigenvalues, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.F, Equations.Equations.Equations.ncp(), Equations.SWE.SWE_W_Bathimetry.ncp(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.ncp, exahype2.symhype.PDE.PDE.Q, exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.sources, avalanche.Avalanche.unknowns, exahype2.solvers.aderdg.ADERDG.ADERDG.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.solvers.fv.FV.FV.unknowns(), exahype2.solvers.rkdg.RungeKuttaDG.RungeKuttaDG.unknowns(), exahype2.solvers.rkfd.CellCenteredFiniteDifferences.CellCenteredFiniteDifferences.unknowns(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns, exahype2.symhype.PDE.PDE.unknowns, petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.unknowns, peano4.visualisation.PatchFileParser.PatchFileParser.unknowns, and convert::data::Variable.unknowns.

Here is the call graph for this function:

◆ substitute_expression()

Field Documentation

◆ dimensions

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.dimensions

◆ eigenvalues

◆ F

◆ ncp

◆ sources

◆ unknowns

exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.unknowns

Definition at line 43 of file FirstOrderConservativePDEFormulation.py.

Referenced by peano4.visualisation.PatchFileParser.PatchFileParser.__parse_meta_data_line(), exahype2.symhype.PDE.PDE._implementation_of_mapping_onto_named_quantities(), avalanche.Avalanche.implementation_of_boundary_conditions(), exahype2.symhype.PDE.PDE.implementation_of_boundary_conditions(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_eigenvalues(), avalanche.Avalanche.implementation_of_flux(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_flux(), exahype2.symhype.PDE.PDE.implementation_of_homogeneous_Neumann_BC(), exahype2.symhype.PDE.PDE.implementation_of_initial_conditions(), avalanche.Avalanche.implementation_of_max_eigenvalue(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_max_eigenvalue(), avalanche.Avalanche.implementation_of_ncp(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_ncp(), avalanche.Avalanche.implementation_of_sources(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.implementation_of_sources(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.LaTeX(), exahype2.symhype.PDE.PDE.name_auxiliary_variable(), petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.number_of_matrix_entries_per_cell(), petsc.solvers.DiscontinuousGalerkinDiscretisation.DiscontinuousGalerkinDiscretisation.number_of_matrix_entries_per_face(), peano4.visualisation.PatchFileParser.PatchFileParser.probe(), exahype2.symhype.FirstOrderConservativePDEFormulation.FirstOrderConservativePDEFormulation.substitute_expression(), and exahype2.symhype.PDE.PDE.unknown_identifier_for_plotter().


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