Check TemperatureMonitor is unstructured in Charge #2859
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Greptile Overview
Updated On: 2025-10-01 16:14:14 UTC
Summary
This PR corrects the monitor validation logic in Charge simulations within the TCAD module. The change modifies which monitor types require `unstructured=True` in the validation routine.Specifically, the validation now checks
SteadyPotentialMonitorandTemperatureMonitorinstead of the previous combination ofSteadyPotentialMonitorandSteadyFreeCarrierMonitor. This means:TemperatureMonitormust now be unstructured in Charge simulationsSteadyFreeCarrierMonitorcan now be structured (unstructured=False)SteadyPotentialMonitorcontinues to require unstructured=TrueThe change aligns the code implementation with the existing comment that states "only Temperature and Potential monitors can be structured". Previously, the code was inconsistent with this documentation, incorrectly treating
SteadyFreeCarrierMonitoras requiring unstructured configuration while not enforcing this requirement forTemperatureMonitor.This validation occurs in the
HeatChargeSimulationclass and affects how users configure monitors in multi-physics simulations that combine heat transfer and charge transport physics. The change ensures proper computational backend compatibility for different monitor types in the TCAD charge simulation framework.Important Files Changed
Changed Files
Confidence score: 4/5
Sequence Diagram
sequenceDiagram participant User participant HeatChargeSimulation participant Validators participant GridSpec participant Structures participant Monitors participant BoundarySpec participant Sources User->>HeatChargeSimulation: "Create simulation instance" HeatChargeSimulation->>Validators: "_post_init_validators()" Validators->>HeatChargeSimulation: "_estimate_charge_mesh_size()" User->>HeatChargeSimulation: "Validate structures" HeatChargeSimulation->>Validators: "check_unsupported_geometries()" Validators->>Structures: "Check geometry dimensions" Structures-->>Validators: "Return validation result" Validators-->>HeatChargeSimulation: "Validation complete" User->>HeatChargeSimulation: "Validate monitors" HeatChargeSimulation->>Validators: "_monitors_cross_solids()" Validators->>HeatChargeSimulation: "_check_cross_solids()" HeatChargeSimulation->>Structures: "Check intersecting media" Structures-->>HeatChargeSimulation: "Return intersection data" HeatChargeSimulation-->>Validators: "Return validation result" Validators-->>HeatChargeSimulation: "Monitor validation complete" User->>HeatChargeSimulation: "Check charge simulation setup" HeatChargeSimulation->>Validators: "check_charge_simulation()" Validators->>HeatChargeSimulation: "_check_simulation_types()" HeatChargeSimulation->>BoundarySpec: "Check voltage BCs" BoundarySpec-->>HeatChargeSimulation: "Return BC count" HeatChargeSimulation->>Monitors: "Check charge monitors" Monitors-->>HeatChargeSimulation: "Return monitor types" HeatChargeSimulation-->>Validators: "Return simulation type validation" Validators-->>HeatChargeSimulation: "Charge validation complete" User->>HeatChargeSimulation: "Plot simulation properties" HeatChargeSimulation->>HeatChargeSimulation: "plot_property()" HeatChargeSimulation->>Sources: "plot_sources()" HeatChargeSimulation->>Monitors: "plot_monitors()" HeatChargeSimulation->>BoundarySpec: "plot_boundaries()" BoundarySpec->>HeatChargeSimulation: "_construct_heat_charge_boundaries()" HeatChargeSimulation-->>User: "Return plotted axes"