Closed
Description
Let's use this to iterate on the nonuniform mesh architecture and API?
General picture
Introducing the notion of a MeshSpec
that contains specifications about how the user wants the space to be discretized (minimum grids per wavelength, etc.).
a MeshSpec
+ Simulation
+ other parameters ultimately determines a set of coordinates in 1D that define the yee cell boundaries.
If these mesh specs will be contained directly in the Simulation
, when Simulation.grid
property is called, the coordinates from the mesh specs should be evaluated loaded into a Grid()
.
If these mesh specs are defined externally to set grid_size
, then the code functions as it does now.
Main API Options
- Add
MeshSpec()
as another accepted value in one ofSimulation.grid_size
. When computing grid boundaries, add a special case to handle aMeshSpec()
. - Keep
Simulation.grid_size
asfloat
orarray
and make an external plugin to generate agrid_size
givenMeshSpec()
,simulation
and other parameters.3. - Make
MeshSpec()
the only way to define discretization, but supply otherMeshSpec()
types to handle uniform or user specified grid sizes.4. - An Interim solution of 2 and then transition to 3 when it is more stable.
Considerations
- a. If no sources, need to define some notion of a wavelength or length scale. Can define this in the
MeshSpec
directly, or add an optionalfreq
Field
to theSimulation
, or have it be a kwarg in the plugin init. - b. What gets written into the json? A
MeshSpec
would be easier to read than raw coords. - c. How extendable is the architecture?
Thoughts
- We should avoid code that looks like:
if meshSpec1: do this elif meshSpec2 do this
. Ideally, theMeshSpec
should contain it's own way to generate a 1D grid from a set of parameters, whether that be size & center, structures, simulation, etc.
Metadata
Metadata
Labels
No labels