Commit 0b16af9f authored by Martin Reinecke's avatar Martin Reinecke
Browse files

re-introduce weighting for now

parent 6abc0315
Pipeline #19376 passed with stage
in 4 minutes and 22 seconds
......@@ -111,7 +111,7 @@ class LaplaceOperator(EndomorphicOperator):
ret /= np.sqrt(dposc)
ret[prefix + (slice(None, 2),)] = 0.
ret[prefix + (-1,)] = 0.
return Field(self.domain, val=ret)
return Field(self.domain, val=ret).weight(-0.5, spaces=self._space)
def _adjoint_times(self, x):
axes = x.domain.axes[self._space]
......@@ -122,7 +122,7 @@ class LaplaceOperator(EndomorphicOperator):
sl_r = prefix + (slice(1, None),) # "right" slice
dpos = self._dpos.reshape((1,)*axis + (nval-1,))
dposc = self._dposc.reshape((1,)*axis + (nval,))
y = x.val.copy()
y = x.weight(0.5, spaces=self._space).val
y /= np.sqrt(dposc)
y[prefix + (slice(None, 2),)] = 0.
y[prefix + (-1,)] = 0.
......@@ -131,4 +131,4 @@ class LaplaceOperator(EndomorphicOperator):
ret[sl_l] = deriv
ret[prefix + (-1,)] = 0.
ret[sl_r] -= deriv
return Field(self.domain, val=ret)
return Field(self.domain, val=ret).weight(-1, spaces=self._space)
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