Closed arturgower closed 4 years ago
This led to quite a few simplifications. The need for the type FrequencySimulation
is not so obvious anymore. Still, no current plans to restructure this.
I know you've made this change already, but I was wondering: why is it natural for the background medium to be stored in the source? Why not provide it separately (or even bundle it up with the Particle
s in some kind of Domain
object) and pass into the source during the simulation?
The background medium
is semantically part of the source
, it is the medium the source travels in. As shown above, separating it actually allows for nonsense simulations (a source being used in the wrong medium). Also it turns out that almost everywhere we needed source
we also needed the source medium
, so it made things simpler to have source
have a field medium
.
At present
Source
only has the fieldscoef
andfield
. This leads to some problems, first it means that the constructor is used in the formFrequencySimulation(medium, particles, source)
, becauseSource
has forgotten itsmedium
. This then also allows us to do nonsense like this:If we had particles, then this would lead to non-sense results. The constructor
FrequencySimulation
should never have the freedom to choose a medium which is different from theSource
.