|
43 | 43 | from .sweep import EMEFreqSweep, EMELengthSweep, EMEModeSweep, EMEPeriodicitySweep, EMESweepSpecType |
44 | 44 |
|
45 | 45 | # maximum numbers of simulation parameters |
46 | | -MAX_GRID_CELLS = 20e9 |
47 | 46 | WARN_MONITOR_DATA_SIZE_GB = 10 |
48 | 47 | MAX_MONITOR_INTERNAL_DATA_SIZE_GB = 50 |
49 | 48 | MAX_SIMULATION_DATA_SIZE_GB = 50 |
50 | 49 | WARN_MODE_NUM_CELLS = 1e5 |
| 50 | +MAX_MODE_NUM_CELLS = 5e6 |
51 | 51 |
|
52 | 52 |
|
53 | 53 | # eme specific simulation parameters |
@@ -807,14 +807,6 @@ def _validate_monitor_setup(self) -> None: |
807 | 807 |
|
808 | 808 | def _validate_size(self) -> None: |
809 | 809 | """Ensures the simulation is within size limits before simulation is uploaded.""" |
810 | | - |
811 | | - num_comp_cells = self.num_cells / 2 ** (np.sum(np.abs(self.symmetry))) |
812 | | - if num_comp_cells > MAX_GRID_CELLS: |
813 | | - raise SetupError( |
814 | | - f"Simulation has {num_comp_cells:.2e} computational cells, " |
815 | | - f"a maximum of {MAX_GRID_CELLS:.2e} are allowed." |
816 | | - ) |
817 | | - |
818 | 810 | num_freqs = len(self.freqs) |
819 | 811 | if num_freqs > MAX_NUM_FREQS: |
820 | 812 | raise SetupError( |
@@ -876,6 +868,12 @@ def _validate_modes_size(self) -> None: |
876 | 868 | def warn_mode_size(monitor: AbstractModeMonitor, msg_header: str, custom_loc: list) -> None: |
877 | 869 | """Warn if a mode component has a large number of points.""" |
878 | 870 | num_cells = np.prod(self.discretize_monitor(monitor).num_cells) |
| 871 | + if num_cells > MAX_MODE_NUM_CELLS: |
| 872 | + raise SetupError( |
| 873 | + msg_header + f"has {num_cells:.2e} computational cells " |
| 874 | + "in the transverse directions, " |
| 875 | + f"a maximum of {MAX_MODE_NUM_CELLS:.2e} are allowed." |
| 876 | + ) |
879 | 877 | if num_cells > WARN_MODE_NUM_CELLS: |
880 | 878 | consolidated_logger.warning( |
881 | 879 | msg_header + f"has a large number ({num_cells:1.2e}) of grid points. " |
|
0 commit comments