Skip to content

Tutorial mesh generation did not complete #64

Description

@ninjamongeese

While generating mesh, i get the following error:

C:\ProgramData\anaconda3\lib\site-packages\scipy\optimize\_minpack_py.py:178: RuntimeWarning: The iteration is not making good progress, as measured by the 
  improvement from the last five Jacobian evaluations.
  warnings.warn(msg, RuntimeWarning)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[8], line 1
----> 1 Mesh(
      2     sim=sim,
      3     metal_res=1 / 80,
      4     nonmetal_res=1 / 40,
      5     smooth=(1.1, 1.5, 1.5),
      6     min_lines=5,
      7     expand_bounds=((0, 0), (0, 0), (10, 40)),
      8 )

File C:\ProgramData\anaconda3\lib\site-packages\pyems-0.1.0-py3.10.egg\pyems\mesh.py:594, in Mesh.__init__(self, sim, metal_res, nonmetal_res, smooth, min_lines, expand_bounds, simulation_bounds)
    591 # set later
    592 self.bounded_types = None
--> 594 self.generate_mesh()

File C:\ProgramData\anaconda3\lib\site-packages\pyems-0.1.0-py3.10.egg\pyems\mesh.py:619, in Mesh.generate_mesh(self, show_pml)
    617 self._gen_mesh_for_bounded_types(self.size_ordered_bounded_types)
    618 self._trim_air_mesh()
--> 619 self._smooth_pml_mesh_lines()
    621 self._set_mesh_from_lines()
    622 if show_pml:

File C:\ProgramData\anaconda3\lib\site-packages\pyems-0.1.0-py3.10.egg\pyems\mesh.py:722, in Mesh._smooth_pml_mesh_lines(self)
    717     spacing = limit_spacing * smooth_factor
    718 elif (
    719     spacing < limit_spacing
    720     and limit_spacing / spacing >= smooth_factor
    721 ):
--> 722     raise RuntimeError(
    723         "PML mesh smoothing is increasing the simulation "
    724         "box size.  This should never happen.  Either "
    725         "structures in your PML are non-uniform in the "
    726         "direction of the PML in which case you'll get an "
    727         "error anyway, or this is a bug in pyems."
    728     )
    730 # only smooth lines if necessary
    731 if np.isclose(spacing, limit_spacing, rtol=1e-3, atol=0):

RuntimeError: PML mesh smoothing is increasing the simulation box size.  This should never happen.  Either structures in your PML are non-uniform in the direction of the PML in which case you'll get an error anyway, or this is a bug in pyems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions