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.Constantclass.- Parameters:
value – The initial value. None indicates a value of zero.
name – A
strname.domain – The domain on which the
Constantis defined.space – The space on which the
Constantis defined.space_type – The space type for the
Constant. ‘primal’, ‘dual’, ‘conjugate’, or ‘conjugate_dual’.shape – A
tupleofintobjects defining the shape of the value.comm – The communicator for the
Constant.static – Defines whether the
Constantis 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
Constantmay be cached. Default static.
Remaining arguments are passed to the
firedrake.constant.Constantconstructor.
- 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
Functionis 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
Functionmay be cached. Default static.
Remaining arguments are passed to the
firedrake.function.Functionconstructor.
- class tlm_adjoint.firedrake.variables.Cofunction(*args, space_type='conjugate_dual', static=False, cache=None, **kwargs)
Extends the
firedrake.cofunction.Cofunctionclass.- Parameters:
space_type – The space type for the
Cofunction. ‘dual’ or ‘conjugate_dual’.static – Defines whether the
Cofunctionis 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
Cofunctionmay be cached. Default static.
Remaining arguments are passed to the
firedrake.cofunction.Cofunctionconstructor.- equals(other)
Check equality.
- class tlm_adjoint.firedrake.variables.ZeroConstant(*, name=None, domain=None, space=None, space_type='primal', shape=None, comm=None)
A
Constantwhich is flagged as having a value of zero.Arguments are passed to the
Constantconstructor, together with static=True and cache=True.
- class tlm_adjoint.firedrake.variables.ZeroFunction(*args, **kwargs)
A
Functionwhich is flagged as having a value of zero.Arguments are passed to the
Functionconstructor, 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.Constantwhich is zero, but has no value.
- class tlm_adjoint.firedrake.variables.ReplacementZeroFunction(*args, **kwargs)
Represents a symbolic
firedrake.function.Functionwhich is zero, but has no value.
- tlm_adjoint.firedrake.variables.to_firedrake(y, space, *, name=None)
Convert a variable to a
firedrake.function.Functionorfiredrake.cofunction.Cofunction.- Parameters:
y – A variable.
space – The space for the return value.
name – A
strname.
- Returns:
The
firedrake.function.Functionorfiredrake.cofunction.Cofunction.