sbrisard / janus

Discretization of the Lippmann--Schwinger equation with periodic boundary conditions
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Discrete Green operators should not share continuous Green operators #15

Open sbrisard opened 8 years ago

sbrisard commented 8 years ago

The current implementation of DiscreteGreenOperator2D/DiscreteGreenOperator3D holds an instance of AbstractGreenOperator. Then DiscreteGreenOperator.set_frequency might call self.green.set_frequency(), while self.green.apply_by_freq() might be applied later. The problem lies in the fact that two instances of DiscreteGreenOperator -- say g1 and g2 -- might share the same AbstractGreenOperator. As a consequence, calling g1.set_frequency() affects the state of g2, which is a bug.