def __init__(self, domain, shape=(), count=None): Terminal.__init__(self) counted_init(self, count=count, countedclass=Constant) self._ufl_domain = as_domain(domain) self._ufl_shape = shape # Repr string is build in such way, that reconstruction # with eval() is possible self._repr = "Constant({}, {}, {})".format(repr(self._ufl_domain), repr(self._ufl_shape), repr(self._count))
def __init__(self, function_space, count=None): FormArgument.__init__(self) counted_init(self, count, Coefficient) if isinstance(function_space, FiniteElementBase): # For legacy support for .ufl files using cells, we map # the cell to The Default Mesh element = function_space domain = default_domain(element.cell()) function_space = FunctionSpace(domain, element) elif not isinstance(function_space, AbstractFunctionSpace): error("Expecting a FunctionSpace or FiniteElement.") self._ufl_function_space = function_space self._ufl_shape = function_space.ufl_element().value_shape() self._repr = "Coefficient(%s, %s)" % (repr( self._ufl_function_space), repr(self._count))
def __init__(self, function_space, count=None): FormArgument.__init__(self) counted_init(self, count, Coefficient) if isinstance(function_space, FiniteElementBase): # For legacy support for .ufl files using cells, we map # the cell to The Default Mesh element = function_space domain = default_domain(element.cell()) function_space = FunctionSpace(domain, element) elif not isinstance(function_space, AbstractFunctionSpace): error("Expecting a FunctionSpace or FiniteElement.") self._ufl_function_space = function_space self._ufl_shape = function_space.ufl_element().value_shape() self._repr = as_native_str("Coefficient(%s, %s)" % ( repr(self._ufl_function_space), repr(self._count)))
def __init__(self, count=None): Terminal.__init__(self) counted_init(self, count, Label)
def __init__(self, count=None): IndexBase.__init__(self) counted_init(self, count, Index)