Commit 9740e2f3 authored by Martin Reinecke's avatar Martin Reinecke

small enhancements

parent ef70d560
Pipeline #26671 passed with stages
in 11 minutes
...@@ -170,6 +170,11 @@ class Field(object): ...@@ -170,6 +170,11 @@ class Field(object):
""" """
return Field(domain, dobj.from_global_data(arr)) return Field(domain, dobj.from_global_data(arr))
@staticmethod
def from_local_data(domain, arr):
domain = DomainTuple.make(domain)
return Field(domain, dobj.from_local_data(domain.shape, arr))
def to_global_data(self): def to_global_data(self):
"""Returns an array containing the full data of the field. """Returns an array containing the full data of the field.
...@@ -802,6 +807,24 @@ class Field(object): ...@@ -802,6 +807,24 @@ class Field(object):
def __ipow__(self, other): def __ipow__(self, other):
return self._binary_helper(other, op='__ipow__') return self._binary_helper(other, op='__ipow__')
def __lt__(self, other):
return self._binary_helper(other, op='__lt__')
def __le__(self, other):
return self._binary_helper(other, op='__le__')
def __ne__(self, other):
return self._binary_helper(other, op='__ne__')
def __eq__(self, other):
return self._binary_helper(other, op='__eq__')
def __ge__(self, other):
return self._binary_helper(other, op='__ge__')
def __gt__(self, other):
return self._binary_helper(other, op='__gt__')
def __repr__(self): def __repr__(self):
return "<nifty4.Field>" return "<nifty4.Field>"
......
...@@ -40,4 +40,4 @@ def WienerFilterCurvature(R, N, S, inverter): ...@@ -40,4 +40,4 @@ def WienerFilterCurvature(R, N, S, inverter):
The minimizer to use during numerical inversion The minimizer to use during numerical inversion
""" """
op = SandwichOperator(R, N.inverse) + S.inverse op = SandwichOperator(R, N.inverse) + S.inverse
return InversionEnabler(op, inverter, S.times) return InversionEnabler(op, inverter, S)
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