tlm_adjoint.firedrake.variables
Firedrake variables.
Module Contents
- class tlm_adjoint.firedrake.variables.Constant(value=None, *args, name=None, domain=None, space=None, space_type='primal', shape=None, comm=None, static=False, cache=None, **kwargs)
Extends the
firedrake.constant.Constant
class.- Parameters:
value – The initial value. None indicates a value of zero.
name – A
str
name.domain – The domain on which the
Constant
is defined.space – The space on which the
Constant
is defined.space_type – The space type for the
Constant
. ‘primal’, ‘dual’, ‘conjugate’, or ‘conjugate_dual’.shape – A
tuple
ofint
objects defining the shape of the value.comm – The communicator for the
Constant
.static – Defines whether the
Constant
is static, meaning that it is stored by reference in checkpointing/replay, and an associated tangent-linear variable is zero.cache – Defines whether results involving the
Constant
may be cached. Default static.
Remaining arguments are passed to the
firedrake.constant.Constant
constructor.
- class tlm_adjoint.firedrake.variables.Function(*args, space_type='primal', static=False, cache=None, **kwargs)
Extends
firedrake.function.Function
.- Parameters:
space_type – The space type for the
Function
. ‘primal’ or ‘conjugate’.static – Defines whether the
Function
is static, meaning that it is stored by reference in checkpointing/replay, and an associated tangent-linear variable is zero.cache – Defines whether results involving the
Function
may be cached. Default static.
Remaining arguments are passed to the
firedrake.function.Function
constructor.
- class tlm_adjoint.firedrake.variables.Cofunction(*args, space_type='conjugate_dual', static=False, cache=None, **kwargs)
Extends the
firedrake.cofunction.Cofunction
class.- Parameters:
space_type – The space type for the
Cofunction
. ‘dual’ or ‘conjugate_dual’.static – Defines whether the
Cofunction
is static, meaning that it is stored by reference in checkpointing/replay, and an associated tangent-linear variable is zero.cache – Defines whether results involving the
Cofunction
may be cached. Default static.
Remaining arguments are passed to the
firedrake.cofunction.Cofunction
constructor.- equals(other)
Check equality.
- class tlm_adjoint.firedrake.variables.ZeroConstant(*, name=None, domain=None, space=None, space_type='primal', shape=None, comm=None)
A
Constant
which is flagged as having a value of zero.Arguments are passed to the
Constant
constructor, together with static=True and cache=True.
- class tlm_adjoint.firedrake.variables.ZeroFunction(*args, **kwargs)
A
Function
which is flagged as having a value of zero.Arguments are passed to the
Function
constructor, together with static=True and cache=True.
- class tlm_adjoint.firedrake.variables.ReplacementConstant(x, count)
Represents a symbolic
firedrake.constant.Constant
, but has no value.
- class tlm_adjoint.firedrake.variables.ReplacementFunction(x, count)
Represents a symbolic
firedrake.function.Function
, but has no value.
- class tlm_adjoint.firedrake.variables.ReplacementCofunction(x, count)
Represents a symbolic
firedrake.cofunction.Cofunction
, but has no value.
- class tlm_adjoint.firedrake.variables.ReplacementZeroConstant(*args, **kwargs)
Represents a symbolic
firedrake.constant.Constant
which is zero, but has no value.
- class tlm_adjoint.firedrake.variables.ReplacementZeroFunction(*args, **kwargs)
Represents a symbolic
firedrake.function.Function
which is zero, but has no value.
- tlm_adjoint.firedrake.variables.to_firedrake(y, space, *, name=None)
Convert a variable to a
firedrake.function.Function
orfiredrake.cofunction.Cofunction
.- Parameters:
y – A variable.
space – The space for the return value.
name – A
str
name.
- Returns:
The
firedrake.function.Function
orfiredrake.cofunction.Cofunction
.