top of page

How to Inspect the Mesh Inside a 3D Domain in COMSOL Multiphysics

Oct 25
3 min read

Updated: Oct 30

When you build a mesh in a 3D model, COMSOL shows you only the outside of it. You see the surface triangles, but you do not see what happens inside the domain. Are the elements inside fine enough? Does the boundary layer grow correctly into the volume? Where are the bad elements?


The meshed complex structure example. How to inspect the mesh in detail?
The meshed complex structure example. How to inspect the mesh in detail?


You can look inside the mesh using a Mesh plot in Results. In this article, you will learn how to do it step by step.


Step 1: Create a Mesh Plot


First, build your mesh. Then do one of these:

  • Click Plot in the Mesh toolbar, or

  • Right-click the Mesh node and select Plot.

COMSOL creates a new mesh dataset and a 3D plot group with a Mesh plot node inside. By default, it shows the outer surface of the mesh, colored by element quality.

You can also add a Mesh plot to any existing 3D plot group. Right-click the plot group and choose Mesh. This is useful when you want to see the mesh together with your results.


Step 2: Switch the Level to Volume


Open the Settings window of the Mesh plot node. In the Level section, you can choose what to display: All, Volume, Surface, Line, or Point.


Select Volume. Now COMSOL works with the 3D elements themselves, not just with the surface triangles. You can also choose the Element type: All, Tetrahedron, Pyramid, Prism, or Hexahedron. This is very handy if you want to check only the prism layers of a boundary layer mesh, for example.


But the picture still looks the same. The outer elements hide the inner ones. So we need one more step.


Step 3: Cut the Mesh with an Element Filter


This is the key trick. Scroll down to the Element Filter section and check Enable filter. Keep the Criterion as Logical expression (the default) and type a condition into the Expression field.


COMSOL shows only the elements where the condition is true. For example:

  • y > 0 shows only the half of the mesh with positive y. You now see a clean cut through the middle of your domain.

  • x < 2 [cm] cuts the mesh at x = 2 cm. You can use units directly in the expression.

  • (x > 0) && (z < 0) removes one quarter of the model, so you can look into the corner.


Location of the Element Filter settings.
Location of the Element Filter settings.

The cut is not a smooth plane. It follows the element faces, so you see whole elements, not sliced ones. This is exactly what you want when you check mesh quality, because you see the real shape and size of each element.

Mesh plot colored by the mesh quality.
Mesh plot colored by the mesh quality.

Tip: Put a parameter into the expression, for example, y > ycut. Then you can move the cut through the model just by changing ycut in Global Definitions → Parameters.


Step 4: Filter by Quality or Size


The element filter is not limited to coordinates. You can use the built-in mesh variables too:

  • qualskewness < 0.2 shows only elements with poor skewness quality. Now you see where the bad elements sit inside the volume.

  • h < 0.5[mm] shows only the smallest elements, for example in a refined region.

For Mesh plots, the Criterion list also offers Worst quality, Best quality, and Size. Combine one of them with Fraction of elements. For example, Worst quality with a fraction of 0.01 shows the worst 1% of elements. This is the fastest way to find the problem spots in a large 3D mesh.


Step 5: Shrink the Elements


Sometimes the cut is still too crowded. In the Shrink Elements section, set the Element scale factor to a value between 0 and 1, for example, 0.8. Each element becomes a little smaller around its own center, and you can see the gaps between them. This makes it much easier to see the layers of elements behind the first one.


Scaled mesh can show specific mesh elements more clearly.
Scaled mesh can show specific mesh elements more clearly.

Last tip: Choose the Coloring


In the coloring settings, you can set the Element color:

  • Quality (default) to see element quality,

  • Size to see the local element size,

  • Type to see which element types are used (very useful for swept or boundary layer meshes),

  • or a plain color if you just want a clean picture for a report.

The Wireframe color controls the color of the element edges. Black is the default.


Need Help with a Difficult Mesh? Ask Simulation Guys


Bad elements hidden inside the volume often cause convergence problems and wrong results. If your mesh does not behave, or you need a simulation done right the first time, contact Simulation Guys. Our COMSOL Consulting service helps you fix your model, and our Simulation on Demand service delivers the whole simulation for you.



bottom of page