Skip to content
Snippets Groups Projects
Commit c15eb016 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

cleanup

parent e8f33125
No related branches found
No related tags found
1 merge request!209WIP: Byebye volume factors
Pipeline #
......@@ -19,7 +19,6 @@
import numpy as np
from .. import DomainTuple
from ..spaces import RGSpace
from ..utilities import infer_space
from .linear_operator import LinearOperator
from .. import dobj
from .. import utilities
......@@ -65,7 +64,7 @@ class FFTOperator(LinearOperator):
# Initialize domain and target
self._domain = DomainTuple.make(domain)
self._space = infer_space(self._domain, space)
self._space = utilities.infer_space(self._domain, space)
adom = self._domain[self._space]
if target is None:
......@@ -161,16 +160,8 @@ class FFTOperator(LinearOperator):
ldat2 = dobj.local_data(tmp).reshape(ldat.shape)
tmp = dobj.from_local_data(x.val.shape, ldat2, distaxis=0)
Tval = Field(tdom, tmp)
if x.domain[self._space].harmonic:
if (mode == LinearOperator.TIMES or
mode == LinearOperator.ADJOINT_TIMES):
if mode & (LinearOperator.TIMES | LinearOperator.ADJOINT_TIMES):
fct = self._domain[self._space].scalar_dvol()
else:
fct = 1./(self._domain[self._space].scalar_dvol()*self._domain[self._space].dim)
else:
if (mode == LinearOperator.TIMES or
mode == LinearOperator.ADJOINT_TIMES):
fct = 1./(self._target[self._space].scalar_dvol()*self._target[self._space].dim)
else:
fct = self._target[self._space].scalar_dvol()
if fct != 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment