dof_space.py 592 Bytes
Newer Older
Martin Reinecke's avatar
Martin Reinecke committed
1
import numpy as np
Martin Reinecke's avatar
Martin Reinecke committed
2
3
4
5
6
7
8
from .space import Space


class DOFSpace(Space):
    def __init__(self, dof_weights):
        super(DOFSpace, self).__init__()
        self._dvol = tuple(dof_weights)
Martin Reinecke's avatar
Martin Reinecke committed
9
        self._needed_for_hash += ['_dvol']
Martin Reinecke's avatar
Martin Reinecke committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

    @property
    def harmonic(self):
        return False

    @property
    def shape(self):
        return (len(self._dvol),)

    @property
    def dim(self):
        return len(self._dvol)

    def scalar_dvol(self):
        return None

    def dvol(self):
Martin Reinecke's avatar
Martin Reinecke committed
27
        return np.array(self._dvol)
Martin Reinecke's avatar
Martin Reinecke committed
28
29
30

    def __repr__(self):
        return 'this is a dof space'