Placeholder¶
In pyinduct.placeholder you find placeholders for symbolic Term definitions.
-
class
FieldVariable(function_label, order=(0, 0), weight_label=None, location=None, exponent=1, raised_spatially=False)[source]¶ Bases:
pyinduct.placeholder.PlaceholderClass that represents terms of the systems field variable
.Note
Use
TemporalDerivedFieldVariableandSpatialDerivedFieldVariableif no mixed derivatives occur.Parameters: - function_label (str) – Label of shapefunctions to use for approximation, see
register_base()for more information about how to register an approximation basis. - tuple of int (order) – Tuple of temporal_order and spatial_order derivation order.
- weight_label (str) – Label of weights for which coefficients are to be calculated (defaults to function_label).
- location – Where the expression is to be evaluated.
- exponent – Exponent of the term.
Examples
Assuming some shapefunctions have been registered under the label
"phi"the following expressions hold:>>> x_dtdz = FieldVariable("phi", order=(1, 1))
>>> x_ddt_at_3 = FieldVariable("phi", order=(2, 0), location=3)
>>> x_dt_squared = FieldVariable("phi", order=(1, 0), exponent=2)
- function_label (str) – Label of shapefunctions to use for approximation, see
-
class
TestFunction(function_label, order=0, location=None)[source]¶ Bases:
pyinduct.placeholder.SpatialPlaceholderClass that works as a placeholder for test-functions in an equation.
Parameters: - function_label (str) –
- order (int) –
- location –
-
class
EquationTerm(scale, arg)[source]¶ Bases:
objectBase class for all accepted terms in a weak formulation.
Parameters: - scale –
- arg –
-
class
Input(function_handle, index=0, order=0, exponent=1)[source]¶ Bases:
pyinduct.placeholder.PlaceholderClass that works as a placeholder for the input of a system.
Parameters: - function_handle (callable) –
- index – If input is a vector, which element shall be used.
- order – See
Placeholder. - exponent – See
FieldVariable.
-
class
IntegralTerm(integrand, limits, scale=1.0)[source]¶ Bases:
pyinduct.placeholder.EquationTermClass that represents an integral term in a weak equation.
Parameters: - integrand –
- limits (tuple) –
- scale –
-
class
Placeholder(data, order=(0, 0), location=None)[source]¶ Bases:
objectBase class that works as a placeholder for terms that are later parsed into a canonical form.
Parameters: - data (arbitrary) – Data to store in the placeholder.
- order (tuple) – (temporal_order, spatial_order) derivative orders that are to be applied before evaluation.
- location (numbers.Number) – Location to evaluate at before further computation.
-
derive(temp_order=0, spat_order=0)[source]¶ Mimics a copy constructor and adds the given derivative orders.
Note
The desired derivative orders temp_order and spat_order are added to the original orders.
Parameters: - temp_order – Temporal derivative order to be added.
- spat_order – Spatial derivative order to be added.
Returns: New
Placeholderinstance with the desired derivative order.
-
class
ScalarFunction(function_label, order=0, location=None)[source]¶ Bases:
pyinduct.placeholder.SpatialPlaceholderClass that works as a placeholder for spatial-functions in an equation such as spatial dependent coefficients.
Parameters: - function_label (str) –
- order (int) –
- location –
-
class
ScalarTerm(argument, scale=1.0)[source]¶ Bases:
pyinduct.placeholder.EquationTermClass that represents a scalar term in a weak equation.
Parameters: - argument –
- scale –
-
class
Scalars(values, target_term=None, target_weight_label=None)[source]¶ Bases:
pyinduct.placeholder.PlaceholderPlaceholder for scalars that will be replaced later.
Parameters: - values – Iterable object containing the scalars for every n-th equation.
- target_term (dict) – Coefficient matrix to
add_to(). - target_weight_label (str) – Desired weight label.
-
class
SpatialPlaceholder(data, order=0, location=None)[source]¶ Bases:
pyinduct.placeholder.PlaceholderBase class for all spatially-only dependent placeholders. The deeper meaning of this abstraction layer is to offer an easier to use interface.


