![]() |
Peano
|
Dictionary which specifies the unknown names plus their cardinality. More...
Public Member Functions | |
def | __init__ (self) |
def | enable_second_order (self) |
def | add_all_solver_constants (self) |
def | add_makefile_parameters (self, peano4_project, path_of_ccz4_application) |
def | add_tracer (self, name, coordinates, project, number_of_entries_between_two_db_flushes, data_delta_between_two_snapsots, time_delta_between_two_snapsots, clear_database_after_flush, tracer_unknowns=None) |
Data Fields | |
integer_constants | |
double_constants | |
Default_Time_Step_Size_Relaxation | |
Static Public Attributes | |
float | Default_Time_Step_Size_Relaxation = 0.1 |
Private Member Functions | |
def | _add_standard_includes (self) |
Static Private Attributes | |
dictionary | _FO_formulation_unknowns |
dictionary | _SO_formulation_unknowns |
Dictionary which specifies the unknown names plus their cardinality.
Abstract base class for any CCZ4 solver Each CCZ4 solver inherits from this abstract base class which really only defines some generic stuff such as the unknowns and includes that every single solver will use. The solver should, more or less, work out of the box, but you have to do three things if you use a subclass: 1. If you use a CCZ4 solver, you will still have to add all the libraries to your Peano project such that the Makefile picks them up. For this, the solver offers an add_makefile_parameters(). 2. You have to set the initial conditions via
At this point, different CCZ4 solver variants might require different syntax. The term volumeCentre for example above is only defined in a finite volume ontext.
Further to that, you might want to have to set boundary conditions. By default, we do not set any boundary conditions. This works fine if periodic boundary conditions are used. But once you switch off periodic boundary conditions, you have to tell the solver how to treat the boundary. This is typically done via set_implementation(), too.
Setting particular implementations via set_implementation() is not always convenient or possible. You might want to add new functions to your classes, do something in the solver constructor, and so forth. If so, feel free to modify the file MySolverName.cpp which the tool generates. In this context, you might want to pass in
which ensures that you get the right hook-in methods generated when you invoke the Python script for the first time. These methods will contain todo comments for you. Subsequent runs of the Python API should not overwrite the solver implementation.
Each CCZ4 solver requires a minimal set of constants. These are represented by integer_constants and double_constants. Please augment these dictionaries. Eventually, you have to submit all the constants via add_all_solver_constants().
Has to be class attribute, as we need it in the constructor, i.e. before the abstract object is created.
Definition at line 8 of file CCZ4Solver.py.
def CCZ4Solver.AbstractCCZ4Solver.__init__ | ( | self | ) |
Constructor Initialise the two dictionaries with default values (which work).
Definition at line 128 of file CCZ4Solver.py.
|
private |
Add the headers for the compute kernels and initial condition implementations Usually called by the subclass constructor.
Definition at line 164 of file CCZ4Solver.py.
References coupling.StaticCoupling.StaticCoupling.add_user_action_set_includes().
Referenced by CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStep.__init__(), CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_SecondOrderFormulation_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStep.__init__(), CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), and CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStep.__init__().
def CCZ4Solver.AbstractCCZ4Solver.add_all_solver_constants | ( | self | ) |
Add domain-specific constants I need a couple of constants. I could either replace them directly within the Python snippets below, but I prefer here to go a different way and to export them as proper C++ constants. There are two ways to inject solver constants into Peano: We can either add them to the Makefile as global const expressions, or we can add them to the ExaHyPE2 solver. The latter is the route we go down here, as these constants logically belong to the solver and not to the project. This operation uses the parent class' add_solver_constants(). You still can use this operation to add further parameters. Or you can, as a user, always add new entries to integer_constants or double_constants and then call this routine rather than adding individual constants one by one.
Definition at line 187 of file CCZ4Solver.py.
References CCZ4Solver.AbstractCCZ4Solver.double_constants, and CCZ4Solver.AbstractCCZ4Solver.integer_constants.
Referenced by SBH.FVSolver.__init__().
def CCZ4Solver.AbstractCCZ4Solver.add_makefile_parameters | ( | self, | |
peano4_project, | |||
path_of_ccz4_application | |||
) |
Add include path and minimal required cpp files to makefile If you have multiple CCZ4 solvers, i.e. different solvers of CCZ4 or multiple instances of the CCZ4 type, please call this operation only once on one of your solvers. At the moment, I add hte following cpp files to the setup: - InitialValues.cpp - CCZ4Kernels.cpp - SecondOrderAuxiliaryVariablesReconstruction.cpp You can always add further files via
Definition at line 216 of file CCZ4Solver.py.
def CCZ4Solver.AbstractCCZ4Solver.add_tracer | ( | self, | |
name, | |||
coordinates, | |||
project, | |||
number_of_entries_between_two_db_flushes, | |||
data_delta_between_two_snapsots, | |||
time_delta_between_two_snapsots, | |||
clear_database_after_flush, | |||
tracer_unknowns = None |
|||
) |
Add tracer to project Consult exahype2.tracer.DumpTracerIntoDatabase for an explanation of some of the arguments. Most of them are simply piped through to this class. The tracer is given a name and initial coordinates (list of three-tuples). We need to know the underlying project as well, as we have to add the tracing to the time stepping and the database update to the plotting.
Reimplemented in CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStep, CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStepWithEnclaveTasking, CCZ4Solver.CCZ4Solver_FD4_SecondOrderFormulation_GlobalAdaptiveTimeStepWithEnclaveTasking, CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStep, CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStepWithEnclaveTasking, CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStepWithEnclaveTasking, and CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStep.
Definition at line 250 of file CCZ4Solver.py.
def CCZ4Solver.AbstractCCZ4Solver.enable_second_order | ( | self | ) |
Definition at line 158 of file CCZ4Solver.py.
References CCZ4Solver.AbstractCCZ4Solver.integer_constants.
|
staticprivate |
Definition at line 83 of file CCZ4Solver.py.
Referenced by CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStep.__init__(), CCZ4Solver.CCZ4Solver_FV_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_SecondOrderFormulation_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStep.__init__(), CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), and CCZ4Solver.CCZ4Solver_RKDG_GlobalAdaptiveTimeStep.__init__().
|
staticprivate |
Definition at line 114 of file CCZ4Solver.py.
Referenced by CCZ4Solver.CCZ4Solver_FD4_SecondOrderFormulation_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__().
|
static |
Definition at line 126 of file CCZ4Solver.py.
Referenced by CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), and CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStep.__init__().
CCZ4Solver.AbstractCCZ4Solver.Default_Time_Step_Size_Relaxation |
Definition at line 160 of file CCZ4Solver.py.
Referenced by CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStepWithEnclaveTasking.__init__(), and CCZ4Solver.CCZ4Solver_FD4_GlobalAdaptiveTimeStep.__init__().
CCZ4Solver.AbstractCCZ4Solver.double_constants |
Definition at line 140 of file CCZ4Solver.py.
Referenced by SBH.Limiter.__init__(), SBH.FVSolver.__init__(), and CCZ4Solver.AbstractCCZ4Solver.add_all_solver_constants().
CCZ4Solver.AbstractCCZ4Solver.integer_constants |
Definition at line 136 of file CCZ4Solver.py.
Referenced by CCZ4Solver.AbstractCCZ4Solver.add_all_solver_constants(), and CCZ4Solver.AbstractCCZ4Solver.enable_second_order().