The geometric multigrid solver accelerates the convergence of the iterative solver by solving the finite element problem on a series of meshes rather than a single one. The multigrid algorithm starts with the initial physics controlled mesh or user defined mesh and automatically builds a series of coarser meshes.
Example of a series of multigrid levels: Original mesh on the left and two coarser multigrid levels on the center and right.
Each additional mesh is approximately twice as coarse as the previous one. The total number of meshes depends on the size of the model: multigrid meshes are automatically built by the solver until the coarsest mesh leads to a low enough number of degrees of freedom to be solved with a direct solver.
Why does the multigrid solver fail?
Error: Problem setting up multigrid
While building the multigrid levels, the mesh size on the coarsest meshes might becomes larger than the size of the model’s smallest geometrical features. This is typically the case when the geometry includes small features or parts with a high aspect ratio.
Different strategies can be used to overcome this issue and resolve large models with the iterative multigrid solver. To illustrate them, we consider the following geometry:
This cube, made of one material, includes a sphere made of a second material and coated with a thin layer of a third material. The thickness of this layer is much smaller that the size of the sphere, which will cause the failure of the multigrid solver.
Approach 1: Replace the multigrid meshes that failed with user defined meshes.
Rather than letting the mesher automatically build coarser meshes from the initial mesh, manually build the meshes that failed using user-defined meshing sequences, and select these meshes within the multigrid solver settings. The number of multigrid levels required to solve the model can be seen in the settings for Multigrid 1:
In this example, three additional meshes are required, as seen in Number of multigrid levels. After clicking the compute button, the solver returns the error message: "Problem setting up multigrid". To visualize the multigrid meshes and see how many of them failed, select the keep generated multigrid levels in the settings for Multigrid 1:
After re-computing the solution, the multigrid levels are added as sub features to the solver node Step 1: Stationary:
This requires the Advanced study options to be activated in the show tab.
The corresponding coarser meshes will appear in the model builder:
Mesh 1 is the original mesh. Mesh 2 to 4 represent the multigrid levels 1 to 3, respectively. As seen in the above snapshot, Mesh 4 fails because it is too coarse to discretize the geometry.
Mesh failure example. Left: the surfaces on each side of the thin layer intersect each other, leading to meshing errors. The mesh consist of tetrahedral elements. Right: the intersection of these surfaces does not occur when using a swept (structured) mesh for the thin layer rather than the default tetrahedral elements.
In order to fix Mesh 4, follow one of these strategies:
- build the meshing sequence for Mesh 4 manually using a finer mesh or a swept mesh.
- add a new coarse mesh, Mesh 5, and change the settings in Multigrid Level 3 from Mesh 4 to Mesh 5.
- delete the coarsest mesh, Mesh 4, and the corresponding Multigrid Level 3 node under Step 1: Stationary to reduce the number of multigrid levels:
Approach 2: Build all the multigrid levels manually
Build the meshes manually using user-defined meshing sequences. Each subsequent mesh should be approximately twice as coarse as the previous one. Set the initial mesh to Mesh 1 in Step 1: Stationary and set the additional meshes as multigrid level sub features to Step 1: Stationary (Multigrid level 1 and 3, for instance, should be set to Mesh 2 and 4, respectively.)
If the multigrid level sub feature is not available, activate the advanced study options in the show tab as discussed earlier. In the solver settings, change Hierarchy generation method to Manual:
Snapshot of the solver settings set to Manual:
Please contact your technical support team if you have any more question at email@example.com.
COMSOL makes every reasonable effort to verify the information you view on this page. Resources and documents are provided for your information only, and COMSOL makes no explicit or implied claims to their validity. COMSOL does not assume any legal liability for the accuracy of the data disclosed. Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark details.