variable.py 397 Bytes
Newer Older
Philipp Arras's avatar
Philipp Arras committed
1
from .model import Model
Martin Reinecke's avatar
Martin Reinecke committed
2
from ..operators.scaling_operator import ScalingOperator
3
4


Philipp Arras's avatar
Philipp Arras committed
5
class Variable(Model):
6
7
8
9
    """
    Returns the MultiField.
    """
    def __init__(self, position):
Philipp Arras's avatar
Philipp Arras committed
10
        super(Variable, self).__init__(position)
11
12

        self._value = position
Philipp Arras's avatar
Philipp Arras committed
13
        self._gradient = ScalingOperator(1., position.domain)
14
15
16

    def at(self, position):
        return self.__class__(position)