awslabs / palace

3D finite element solver for computational electromagnetics
https://awslabs.github.io/palace/dev
Apache License 2.0
224 stars 50 forks source link

Keep getting "Linear Solver not converging" and "PCG Solver not converging" #226

Closed Jenny-Huang-629 closed 3 days ago

Jenny-Huang-629 commented 2 months ago

Hi, I am attempting to run simulation using Palace for the first time. However, I keep getting "Linear Solver not converging" and "PCG Solver not converging". I have been trying different possible ways to solve it, for example lowering convergence tolerance or increasing Maximum number of iterations, etc. But still got the same error. Any suggestions on this issue?

Jenny-Huang-629 commented 2 months ago

gmsh_palace_example_2wb.pdf gmsh_palace_example_2wb.json

These are the msh file and config file we are using. (Since .msh file can not be attached here, I converted into a pdf file)

sebastiangrimberg commented 2 months ago

Hi @Jenny-Huang-629, thanks for sharing your mesh. I think there is a problem with the definition of your mesh and geometry. I am seeing that you have an inconsistent overlapping mesh at the outer boundary of your substrate and the outer box of your computational domain. Here is what I see when I open your mesh in Gmsh:

image

You probably need to fix your mesh generation code to avoid this and ensure your mesh is well formed. My suspicion is that is why Palace is giving warning messages.

Jenny-Huang-629 commented 2 months ago

Hi, thanks for replying! Do you know if there is a way to remove the overlap in the mesh through Gmsh?

sebastiangrimberg commented 2 months ago

This needs to be done at the geometry level before generating the mesh, since it would appear that the 3D geometry model doesn't know that these two surfaces are overlapping. How are you constructing your 3D geometry? Is it through the Gmsh API?

Jenny-Huang-629 commented 2 months ago

I am constructing the geometry using qiskit metal and exporting just the wireframe of the design (with no mesh) as a .msh file using the native GmshRenderer. Then, I add the mesh in using Gmsh and export it from Gmsh.

sebastiangrimberg commented 2 months ago

I have not used the Qiskit Metal Gmsh renderer myself so am not sure how to fix the issue there unfortunately. There might also be a way to resolve the issue in Gmsh after you import it, but again I'm not sure. The problem is clear, though. Somehow your outer "vacuumbox" domain is being meshed without conformity to the inner "dielectric(layer 3)" domain. In fact it looks like the "vacuum_box" domain might be misformed altogether, as visualizing just that mesh domain looks incorrect even outside of the substrate:

Screenshot 2024-04-09 at 3 56 12 PM

sebastiangrimberg commented 1 week ago

Hi @Jenny-Huang-629, did you ever get a chance to revisit this an investigate your geometry and mesh? I am inclined to close the issue for now as mesh related and not related to Palace, but let me know if there is reason to keep it open.