Skip to content

Nonuniform Mesh API #296

Closed
Closed
@tylerflex

Description

@tylerflex

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

  1. Add MeshSpec() as another accepted value in one of Simulation.grid_size. When computing grid boundaries, add a special case to handle a MeshSpec().
  2. Keep Simulation.grid_size as float or array and make an external plugin to generate a grid_size given MeshSpec(), simulation and other parameters.3.
  3. Make MeshSpec() the only way to define discretization, but supply other MeshSpec() types to handle uniform or user specified grid sizes.4.
  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 optional freq Field to the Simulation, 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, the MeshSpec 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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions