|
Peano
|
Represents one named, point-wise PDE operator that a solver exposes for the user to implement: a C++ method name, its parameter list, and an implementation. More...

Data Structures | |
| class | Generator |
| Turns a PDETerm into the C++ text for its generated method: exactly one method - the static, GPU-offloadable overload if the term is stateless, otherwise the virtual instance method. More... | |
Public Member Functions | |
| __init__ (self, str name, str implementation=None, bool stateless=False) | |
| name: str The C++ method name, e.g. | |
| str | __repr__ (self) |
| str | __str__ (self) |
| "PDETerm.Generator" | generator (self) |
| Code generator for this term: an instance of this term's own (possibly subclass-specific) Generator. | |
Data Fields | |
| name | |
| implementation | |
| stateless | |
Static Public Attributes | |
| str | NAME |
| str | SIGNATURE |
Represents one named, point-wise PDE operator that a solver exposes for the user to implement: a C++ method name, its parameter list, and an implementation.
flux(), eigenvalues(), the nonconservative product, algebraic/point sources, boundary conditions, ... all have this same shape (see python/exahype2/solvers/fv/riemann/kernels.py for how they are actually declared in the generated abstract solver header).
Well-known terms should get their own PDETerm subclass which pins down name and signature and adds any term-specific behaviour -
A term's implementation is a C++ code snippet that becomes the generated method's body verbatim - including the empty string, which generates a method that does nothing (a no-op, not "contributes zero": it does not zero out the output for you) - or None (the default), which leaves the method pure virtual for you to implement by hand in your solver subclass instead of generating it. A term you don't want at all is simply never passed to solver.add_pde_term() in the first place.
implementation must not be None when stateless is True: the constructor raises ValueError in that case, since a stateless term's generated method is static, and static methods cannot be pure virtual - there would be no declaration left to signal "implement this by hand".
PDETerm only models what the term is (name, signature, implementation). It deliberately knows nothing about Jinja2 or the code generator: turning a solver's collection of terms into the generated abstract solver header remains the code generator's job, exactly as it is today.
Definition at line 6 of file PDETerm.py.
| exahype2.api.PDETerm.PDETerm.__init__ | ( | self, | |
| str | name, | ||
| str | implementation = None, |
||
| bool | stateless = False |
||
| ) |
name: str The C++ method name, e.g.
"flux" or "eigenvalues". Used by exahype2.api.Solver to key its collection of terms, i.e. has to be unique per solver.
implementation: str A C++ snippet that becomes the method's body verbatim (the empty string is a valid, generated no-op body), or None (the default) to leave the method pure virtual for you to implement by hand. Must not be None if stateless is True: the generated method is then static, and static methods cannot be pure virtual, so there would be nothing left to tell you to implement it by hand.
Reimplemented in exahype2.api.blockstructured.DirichletBoundaryConditions.DirichletBoundaryConditions, exahype2.api.Flux.Flux, exahype2.api.GradientRefinement.GradientRefinement, exahype2.api.InitPointWisely.InitPointWisely, exahype2.api.MassMatrix.MassMatrix, exahype2.api.MaxEigenvalue.MaxEigenvalue, exahype2.api.NonconservativeProduct.NonconservativeProduct, exahype2.api.PointSource.PointSource, exahype2.api.RefineErasePointwisely.RefineErasePointwisely, exahype2.api.VolumetricSource.VolumetricSource, exahype2.api.blockstructured.SommerfeldBoundaryConditions.SommerfeldBoundaryConditions, and exahype2.api.AdaptivityCriterion.AdaptivityCriterion.
Definition at line 47 of file PDETerm.py.
| str exahype2.api.PDETerm.PDETerm.__repr__ | ( | self | ) |
Definition at line 79 of file PDETerm.py.
| str exahype2.api.PDETerm.PDETerm.__str__ | ( | self | ) |
Definition at line 82 of file PDETerm.py.
Referenced by peano4.api.toolbox.particles.postprocessing.ParticleVTUReader.VTUParticleSet.__repr__().

| "PDETerm.Generator" exahype2.api.PDETerm.PDETerm.generator | ( | self | ) |
Code generator for this term: an instance of this term's own (possibly subclass-specific) Generator.
Definition at line 270 of file PDETerm.py.
References peano4.api.output.ActionSet.ActionSet.__class__, peano4.api.output.Jinja2TemplatedHeaderImplementationFilePair.Jinja2TemplatedHeaderImplementationFilePair.__class__, and peano4.api.output.TemplatedHeaderFile.TemplatedHeaderFile.__class__.
Referenced by peano4.api.datamodel.Patch.Patch.__str__(), peano4.api.toolbox.particles.ParticleSet.ParticleSet.__str__(), peano4.api.datamodel.Patch.Patch.additional_load_and_store_arguments(), peano4.api.solversteps.Steps.Steps.clear(), peano4.api.datamodel.DaStGen2.DaStGen2.configure(), peano4.api.datamodel.Model.Model.construct_output(), peano4.api.solversteps.Steps.Steps.construct_output(), and peano4.api.toolbox.particles.ParticleSet.ParticleSet.readme_descriptor().

| exahype2.api.PDETerm.PDETerm.implementation |
Definition at line 76 of file PDETerm.py.
Referenced by peano4.api.output.ActionSet.ActionSet.__generate_header(), peano4.api.output.ActionSet.ActionSet.__generate_implementation(), and peano4.api.output.ActionSet.ActionSet.__generate_operation().
|
static |
Definition at line 44 of file PDETerm.py.
Referenced by exahype2.api.blockstructured.DirichletBoundaryConditions.DirichletBoundaryConditions.__init__(), exahype2.api.Flux.Flux.__init__(), exahype2.api.GradientRefinement.GradientRefinement.__init__(), exahype2.api.InitPointWisely.InitPointWisely.__init__(), exahype2.api.MassMatrix.MassMatrix.__init__(), exahype2.api.MaxEigenvalue.MaxEigenvalue.__init__(), exahype2.api.NonconservativeProduct.NonconservativeProduct.__init__(), exahype2.api.PointSource.PointSource.__init__(), exahype2.api.RefineErasePointwisely.RefineErasePointwisely.__init__(), exahype2.api.VolumetricSource.VolumetricSource.__init__(), and exahype2.api.blockstructured.SommerfeldBoundaryConditions.SommerfeldBoundaryConditions.__init__().
| exahype2.api.PDETerm.PDETerm.name |
Definition at line 75 of file PDETerm.py.
Referenced by solvers.aderdg.kernels.Gemms.Gemms.__repr__(), test_derive_load_store_compute_flag._FakeSubmodel.__repr__(), test_propagate_use_statements._FakeSubmodel.__repr__(), exaparty.api.particle.ExplicitEulerFixedSearchRadius.ExplicitEulerFixedSearchRadius.__setup_algorithm_steps(), exaparty.api.particle.AlgorithmStep.AlgorithmStep.__str__(), exahype2.api.Solver.Solver.Plotter._add_time_interval_bookkeeping_to_solver(), exaparty.api.particle.LeapfrogFixedSearchRadius.LeapfrogFixedSearchRadius._setup_algorithm_steps_dict(), exagrype.api.CCZ4Solver.CCZ4Solver._tasks_of_this_solver(), peano4.api.datamodel.DoF.DoF.additional_load_and_store_arguments_for_other_dof(), exaparty.api.particle.ExplicitEulerDynamicSearchRadius.ExplicitEulerDynamicSearchRadius.algorithm_steps(), exaparty.api.particle.tests.DastgenTestDummyParticle.DastgenTestDummyParticle.algorithm_steps(), exahype2.api.Solver.Solver.Plotter.create_finish_call(), exahype2.api.Solver.Solver.Plotter.create_is_active_predicate(), peano4.api.solversteps.UserActionSet.UserActionSet.get_action_set_name(), peano4.api.taskgraph.compiler.fuse-steps-illustrations._IllustrationActionSet.get_action_set_name(), test_fuse_steps._FakeActionSet.get_action_set_name(), peano4.api.datamodel.DoF.DoF.get_full_qualified_type(), peano4.api.datamodel.DoF.DoF.get_logical_type_name(), peano4.api.solversteps.Step.Step.get_observer_class_name(), dastgen2.attributes.Enumeration.Enumeration.get_to_string(), and exaparty.api.particle.Particle.Particle.readme_descriptor().
|
static |
Definition at line 45 of file PDETerm.py.
| exahype2.api.PDETerm.PDETerm.stateless |
Definition at line 77 of file PDETerm.py.