|
Peano
|
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, "PDETerm" term) | |
| str | signature (self) |
| The term's C++ parameter list. | |
| str | generate_declaration (self) |
| Declaration text for the abstract solver header: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - never both from one term. | |
| str | generate_definition (self) |
| Body of the generated method: the term's implementation verbatim. | |
| str | generate_out_of_class_definitions (self, str qualified_class_name) |
| Out-of-class method body for the solver's .cpp file: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - mirrors generate_declaration(), never both from one term. | |
| str | generate_stub_declaration (self) |
| Override declaration for the concrete solver class that the Python API generates when the user hasn't provided their own implementation of this term - the empty string if the term isn't left abstract (term.implementation is not None; a stateless term's method is static and thus never overridable in the first place, but that combination cannot occur anyway,. | |
| str | generate_stub_definition (self, str qualified_class_name) |
| Out-of-class body for generate_stub_declaration(): a trace-in (with x, and normal too if the term's signature has one), a logWarning noting the method is unimplemented, a "// @todo implement" comment, and logTraceOut - or the empty string under the same condition as generate_stub_declaration(). | |
Data Fields | |
| term | |
Protected Member Functions | |
| str | _generate_static_offloadable_declaration (self) |
| static GPU-offloadable declaration, or the empty string if the term isn't stateless. | |
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.
Never both from the same term;
If term.implementation is None, the method is left for the user to implement by hand: pure virtual (" = 0") for the non-stateless case, or - since static methods cannot be pure virtual - simply declared without a matching out-of-class definition for the stateless case. Otherwise the method is generated non-overridable ("final") with term.implementation as its body.
Embedded into PDETerm (reachable as term.generator) so that a term subclass can supply its own Generator -
Definition at line 85 of file PDETerm.py.
| exahype2.api.PDETerm.PDETerm.Generator.__init__ | ( | self, | |
| "PDETerm" | term | ||
| ) |
Definition at line 109 of file PDETerm.py.
|
protected |
static GPU-offloadable declaration, or the empty string if the term isn't stateless.
exahype2::Solver::Offloadable is a dummy tag argument that exists precisely because C++ cannot overload on staticness alone - it is what lets this static method coexist with the same-named, non-static, no-Offloadable-argument method that registering the same term name again without stateless would produce.
Definition at line 128 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.term.
Referenced by exahype2.api.PDETerm.PDETerm.Generator.generate_declaration().

| str exahype2.api.PDETerm.PDETerm.Generator.generate_declaration | ( | self | ) |
Declaration text for the abstract solver header: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - never both from one term.
Pure virtual (" = 0") if term.implementation is None, "final" otherwise; the static, stateless overload is unaffected by this distinction (static methods cannot be pure virtual) -
Definition at line 153 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator._generate_static_offloadable_declaration(), and exahype2.api.PDETerm.PDETerm.Generator.term.

| str exahype2.api.PDETerm.PDETerm.Generator.generate_definition | ( | self | ) |
Body of the generated method: the term's implementation verbatim.
Only meaningful when term.implementation is not None -
Definition at line 173 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.term.
Referenced by exahype2.api.PDETerm.PDETerm.Generator.generate_out_of_class_definitions().

| str exahype2.api.PDETerm.PDETerm.Generator.generate_out_of_class_definitions | ( | self, | |
| str | qualified_class_name | ||
| ) |
Out-of-class method body for the solver's .cpp file: the static, GPU-offloadable overload if this term is stateless, otherwise the virtual instance method - mirrors generate_declaration(), never both from one term.
The empty string if term.implementation is None: the user implements that method by hand instead, whether as an override of the pure virtual instance method or, for a stateless term, as an ordinary static method matching the declaration (name hiding, not override - static methods cannot be virtual).
qualified_class_name: str Fully qualified class name the definition is attached to, e.g. "examples::MySolver::AbstractMySolver".
Definition at line 182 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.generate_definition(), and exahype2.api.PDETerm.PDETerm.Generator.term.

| str exahype2.api.PDETerm.PDETerm.Generator.generate_stub_declaration | ( | self | ) |
Override declaration for the concrete solver class that the Python API generates when the user hasn't provided their own implementation of this term - the empty string if the term isn't left abstract (term.implementation is not None; a stateless term's method is static and thus never overridable in the first place, but that combination cannot occur anyway,.
Definition at line 220 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.term.
| str exahype2.api.PDETerm.PDETerm.Generator.generate_stub_definition | ( | self, | |
| str | qualified_class_name | ||
| ) |
Out-of-class body for generate_stub_declaration(): a trace-in (with x, and normal too if the term's signature has one), a logWarning noting the method is unimplemented, a "// @todo implement" comment, and logTraceOut - or the empty string under the same condition as generate_stub_declaration().
qualified_class_name: str Fully qualified class name the definition is attached to, e.g. "examples::MySolver::MySolver".
Reimplemented in exahype2.api.GradientRefinement.GradientRefinement.Generator.
Definition at line 238 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.signature(), and exahype2.api.PDETerm.PDETerm.Generator.term.

| str exahype2.api.PDETerm.PDETerm.Generator.signature | ( | self | ) |
The term's C++ parameter list.
Looked up as a SIGNATURE attribute on the owning term (e.g. Flux.SIGNATURE); a plain, custom PDETerm has to set term.SIGNATURE itself before it can generate code.
Definition at line 113 of file PDETerm.py.
References exahype2.api.PDETerm.PDETerm.Generator.term.
Referenced by exahype2.api.PDETerm.PDETerm.Generator.generate_stub_definition().

| exahype2.api.PDETerm.PDETerm.Generator.term |
Definition at line 110 of file PDETerm.py.
Referenced by exahype2.api.PDETerm.PDETerm.Generator._generate_static_offloadable_declaration(), exahype2.api.PDETerm.PDETerm.Generator.generate_declaration(), exahype2.api.PDETerm.PDETerm.Generator.generate_definition(), exahype2.api.PDETerm.PDETerm.Generator.generate_out_of_class_definitions(), exahype2.api.PDETerm.PDETerm.Generator.generate_stub_declaration(), exahype2.api.GradientRefinement.GradientRefinement.Generator.generate_stub_definition(), exahype2.api.PDETerm.PDETerm.Generator.generate_stub_definition(), and exahype2.api.PDETerm.PDETerm.Generator.signature().