Plotting the mesh together with the solution

Solution Number: 1003
Title: Plotting the mesh together with the solution
Platform: All Platforms
Applies to: All Products
Versions: 3.5a, 4.0, 4.0a, 4.1, 4.2
Created: January 3, 2007
Last Modified: May 19, 2011
Categories: Postprocessing
Keywords:

Problem Description

How can I see both the mesh and the solution of my COMSOL Multiphysics model?

Solution

COMSOL 4

To plot the mesh together with a solution in COMSOL 4:

  • Start by creating a 3D or 2D Plot group showing the solution you are interested in.
  • Add a Mesh plot feature by right-clicking your 3D or 2D plot group. Make sure you select Element color: None in the Mesh settings window to see the solution, the other settings can be chosen depending on the situation at hand.

The picture below is created using the Thin-Layer Diffusion model from the Model Library (under COMSOL Multiphysics > Diffusion). This model with the mesh plot can be downloaded below.

Plotting mesh with solution

Note that mesh plots are also useful for visualizing the deformed mesh in models using the Deformed  Mesh physics interface. For examples, see Knowledge base 970, where the deformed mesh is shown as a surface plot in wireframe style.

COMSOL 3.5a

The most straight-forward way to see the mesh of a COMSOL Multiphysics model is to be in the mesh mode. The menu item Mesh > Mesh Visualization parameters lets you select which elements to plot, how they should be colored, etc.

You can also visualize the mesh in postprocessing mode. Proceed as follows:

  • On the General page of the Plot Parameters dialog box, clear the Auto check box for the Element refinement and enter 1.
  • If you have a 2D model, go to the Surface page. If you have a 3D model, go to the Subdomain page to plot the subdomain elements or the Boundary page to plot the boundary elements.
  • Select Fill style: Wireframe.
  • For a monochrome plot of the mesh, select Uniform color and click the Color button to pick a color. Without this option, the mesh will be colored according to the solution or any other expression entered in the Expression text field.
  • Note that if you want to plot the mesh and the solution in the same plot in a 2D model you will need to use the Keep current plot checkbox in the General page of the Plot Parameters window. First create one plot, then the other, making sure that the Keep current plot checkbox is selected.
  • If you want to, try combining your plot of the mesh with some other plot types. In a 3D model you can for instance plot the mesh on the boundary and the solution in filled color in the subdomain. To do this simply activate both subdomain and boundary plots by selecting the Subdomain and Boundary checkboxes on the General page of the Plot Parameters window. In the Boundary page visualize the mesh as described in the above steps. On the Subdomain page choose which quantity you wish to plot in color.
  • To recreate a similar combined plot as shown above, use the Thin-Layer Diffusion model from the Model Library (under COMSOL Multiphysics > Diffusion), with the boundary mesh elements in wireframe style shown on a deformed subdomain plot in filled style.

Related Files

mesh_plot_with_sol_41.mph 218 KB
mesh_plot_with_sol_42.mph 229 KB

Feedback

Poor | Excellent
Document quality?



Disclaimer

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.