Commit db6c8996 authored by Martin Reinecke's avatar Martin Reinecke

simplifications and comments

parent 8466e7fc
......@@ -6,9 +6,9 @@ from ..domain_tuple import DomainTuple
from .linear_operator import LinearOperator
# MR FIXME: this needs to be rewritten in a generic fashion
class DomainDistributor(LinearOperator):
def __init__(self, target, axis):
# TODO Replace this by a DiagonalOperator
if dobj.ntask > 1:
raise NotImplementedError('UpProj class does not support MPI.')
assert len(target) == 2
......
......@@ -17,12 +17,10 @@
# and financially supported by the Studienstiftung des deutschen Volkes.
from ..multi.multi_domain import MultiDomain
from ..multi.multi_field import MultiField
from .linear_operator import LinearOperator
class MultiAdaptor(LinearOperator):
"""Transforms a Field into a MultiField and vise versa when
def MultiAdaptor(target):
"""Transforms a Field into a MultiField and vice versa when
using adjoint_times.
Parameters
......@@ -30,30 +28,8 @@ class MultiAdaptor(LinearOperator):
target: MultiDomain
MultiDomain with only one entry (key).
"""
def __init__(self, target):
super(MultiAdaptor, self).__init__()
if not isinstance(target, MultiDomain) or len(target) > 1:
raise TypeError
self._target = target
self._domain = list(target.values())[0]
@property
def domain(self):
return self._domain
@property
def target(self):
return self._target
@property
def capability(self):
return self.TIMES | self.ADJOINT_TIMES
def apply(self, x, mode):
self._check_input(x, mode)
key = list(self.target.keys())[0]
if mode == self.TIMES:
return MultiField({key: x})
else:
return x[key]
if not isinstance(target, MultiDomain) or len(target) > 1:
raise TypeError
return SelectionOperator(target,target.keys()[0]).adjoint
self._target = target
self._domain = list(target.values())[0]
......@@ -4,6 +4,7 @@ from .endomorphic_operator import EndomorphicOperator
from .. import dobj
# MR FIXME: we should make sure that the domain is a harmonic RGSpace, correct?
class SymmetrizingOperator(EndomorphicOperator):
def __init__(self, domain):
self._domain = DomainTuple.make(domain)
......
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