Commit 5cbe6880 authored by csongor's avatar csongor
Browse files

WIP: dim, dof and shape fix

parent d8b9b918
...@@ -1994,7 +1994,12 @@ class field(object): ...@@ -1994,7 +1994,12 @@ class field(object):
return gotten return gotten
def get_shape(self): def get_shape(self):
global_shape = np.sum([space.get_shape() for space in self.domain]) if len(self.domain) > 1:
global_shape = reduce(lambda x, y: x.get_shape()+y.get_shape(),
global_shape = self.domain[0].get_shape()
if isinstance(global_shape, tuple): if isinstance(global_shape, tuple):
return global_shape return global_shape
else: else:
...@@ -2017,10 +2022,14 @@ class field(object): ...@@ -2017,10 +2022,14 @@ class field(object):
Dimension of space. Dimension of space.
""" """
return[space.get_shape() for space in self.domain])) return
def get_dof(self, split=False): def get_dof(self, split=False):
return np.sum([len(space.get_shape()) for space in self.domain]) dim = self.get_dim()
if np.issubdtype(self.dtype, np.complex):
return 2*dim
return dim
def _map(self, function, *args): def _map(self, function, *args):
return utilities.field_map(self.get_shape(), function, *args) return utilities.field_map(self.get_shape(), function, *args)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment