Displaying the Geometry
Use the function mphgeom to display the geometry in a MATLAB figure:
mphgeom(model)
To specify the geometry to display, enter:
mphgeom(model, <geomtag>)
where <geomtag> is the tag of the geometry node to display. If the model only contains a single geometry the tag <geomtag> can be left empty. When specifying a property the geometry tag is required.
Adding a view property will add some view settings from the COMSOL model such as axes labels (units) and grid and supports hiding of geometric entities. Usually it is sufficient to use the auto value for the view property:
mphgeom(model, <geomtag>, 'view', 'auto')
When running mphgeom the geometry node is automatically built. Set the build property to specify how the geometry node is supposed to be built before displaying it. Enter:
mphgeom(model, <geomtag>, 'build', build)
where build is a string with the value: 'off', 'current', or the geometry feature tag <ftag>, which, respectively, does not build the geometry (off), builds the geometry up to the current feature (current), or builds the geometry up to the specified geometry feature node (ftag).
If the geometry contains workplane, you can plot the geometry entities inside a specified workplane as a 2D geometry. Enter:
mphgeom(model, <geomtag>, 'workplane', <wptag>)
where <wptag> is the tag of the workplane to use. It is also possible to combine the workplane geometry display with the build property to display the geometry built up to a certain feature.
Use the parent property to specify the axes handle where to display the plot:
mphgeom(model, <geomtag>, 'parent', <axes>)
The following properties are also available to specify the vertex, edge, or face rendering:
vertexmode
edgemode
facemode
vertexlabels
edgelabels
facelabels
domainlabels
edgecolor
vertexlabelscolor
edgelabelscolor
facelabelscolor
domainlabelscolor
facealpha
Use mphgeom to display a specified geometric entity. To set the geometric entity, enter the entity property and set the geometric entity index in the selection property to:
mphgeom(model, <geomtag>, 'entity', entity, 'selection', <idx>)
where entity can be either 'point', 'edge', 'boundary', or 'domain', and <idx> is a positive integer array that contains the list of the geometric entity indices.
You can get the handle of the plotted geometry entities with the command:
h = mphgeom(model, <geomtag>, ...)
where h is a Patch array of the plotted entities.