Skip to content

Conversation

momchil-flex
Copy link
Collaborator

  • Remove current ModeSolverMonitor and ModeSolverData
  • Introduce instead ModeFieldMonitor and ModeFieldData
  • Put mode_spec and freqs as fields in ModeSolver
  • ModeSolverData is the return of .solve and stores the ModeSolver simulation, plane, and mode_spec as well as well as the ModeFieldData and ModeIndexData

Notes:

  • ModeSolverData is not storing the entire ModeSolver instance because of circular dependence in ModeSolver.solve which returns ModeSolverData...
  • Yet to add a field plotting method which will use a lot of the same code from SimulationData

@momchil-flex momchil-flex requested a review from tylerflex March 23, 2022 01:46
Copy link
Collaborator

@tylerflex tylerflex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending some discussion around the really minor comments I have.

----------
mode_solver : :class:`.ModeSolver`
Original mode solver instance.
data_dict : Dict[str, :class:`.AbstractModeData`]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe here we just put the same type as line 44 with the union.

"mode_spec": self.mode_spec,
}
for name, obj in json_dict.items():
Tidy3dData.save_string(handle, name, obj.json())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note this is not storing 'Infinity' as a string.

"mode_spec": ModeSpec,
}
obj_dict = {}
for name, obj in json_dict.items():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clever ;)

ModeSource
Modal source containing specification in ``mode``.
:class:`.ModeSource`
Mode source with specifications taken from the ModeSolver instance and the method
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:class: on modeSolver

----------
mode_spec : :class:`ModeSpec`
:class:`ModeSpec` object containing specifications of mode.
freqs : List[float]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these freqs are all stored in the ModeSolver? So do we want to:
a) keep it the way it is
b) use self.freqs here?
b) use self.freqs if freqs is None or something fancier like this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I kinda like keeping it the way it is because it makes sure the user knows what's happening and passes the frequencies they want, or in general knows that it's possible to export a monitor with different (e.g. more) frequencies that they used in the solver. So I'm between a) or c), but like a).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let's keep it (a) then, that's fine with me.

ModeMonitor
Monitor that measures modes specified by ``mode_spec`` on ``plane`` at ``freqs``.
:class:`.ModeMonitor`
Mode monitor with specifications taken from the ModeSolver instance and the method
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:class:ModeSolver

Some shared code with SimulationData w.r.t. plotting fields
SimulationData.plot_field now doesn't need x/y/z/ for a 2D monitor
@momchil-flex momchil-flex merged commit aee7ea9 into develop Mar 23, 2022
@tylerflex tylerflex deleted the momchil/mode_solver branch March 30, 2022 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants