Skip to content

Electric field monitor for Charge #2566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

marc-flex
Copy link
Contributor

@marc-flex marc-flex commented Jun 12, 2025

Greptile Summary

Adds electric field monitoring capabilities to the Charge simulation module, enabling visualization and analysis of steady-state electric fields through a new SteadyElectricFieldMonitor class and associated data structures.

  • Added SteadyElectricFieldMonitor in tidy3d/components/tcad/monitors/charge.py to monitor Ex, Ey, Ez components
  • Implemented SteadyElectricFieldData class in tidy3d/components/tcad/data/monitor_data/charge.py handling electric field data with proper unit conversion (V/μm)
  • Added _cell_to_point_data utility in UnstructuredGridDataset for VTK-based cell-to-point data conversion
  • Added comprehensive test suite validating electric field monitoring for tetrahedral and triangular grids

@marc-flex marc-flex self-assigned this Jun 12, 2025
@marc-flex marc-flex marked this pull request as ready for review June 13, 2025 14:15
Copy link
Contributor

github-actions bot commented Jun 13, 2025

Diff Coverage

Diff: origin/develop...HEAD, staged and unstaged changes

  • tidy3d/components/data/unstructured/base.py (42.9%): Missing lines 577-579,581
  • tidy3d/components/tcad/data/monitor_data/charge.py (100%)
  • tidy3d/components/tcad/monitors/charge.py (100%)

Summary

  • Total: 36 lines
  • Missing: 4 lines
  • Coverage: 88%

tidy3d/components/data/unstructured/base.py

  573         vtk_obj,
  574     ):
  575         """Get point data values from a VTK object."""
  576 
! 577         cellDataToPointData = vtk["mod"].vtkCellDataToPointData()
! 578         cellDataToPointData.SetInputData(vtk_obj)
! 579         cellDataToPointData.Update()
  580 
! 581         return cellDataToPointData.GetOutput()
  582 
  583     @classmethod
  584     @requires_vtk
  585     def _get_values_from_vtk(

@marc-flex marc-flex force-pushed the marc/electric_field_monitor branch 2 times, most recently from a22f358 to 8ff1ec8 Compare June 13, 2025 15:54
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

7 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile

Comment on lines +524 to +538
"""Return copy of self with symmetry applied."""

new_Ex = self._symmetry_expanded_copy(property=self.Ex)
new_Ey = self._symmetry_expanded_copy(property=self.Ey)
new_Ez = self._symmetry_expanded_copy(property=self.Ez)

return self.updated_copy(
Ex=new_Ex,
Ey=new_Ey,
Ez=new_Ez,
symmetry=(0, 0, 0),
)
Copy link

Choose a reason for hiding this comment

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

logic: No validation for correct data type (IndexedVoltageDataArray) unlike SteadyFreeCarrierData and SteadyEnergyBandData

@marc-flex marc-flex force-pushed the marc/electric_field_monitor branch from 61b4a48 to 50d69e3 Compare June 16, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant