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. When specifying additional properties the geometry tag is required. If the model only contains a single geometry the tag <geomtag> can be left empty.
The mphgeom function will use some of the view settings that are common between COMSOL and MATLAB to show content such as axes labels (units) and grid and supports hiding of geometric entities. This is controlled using the view option. To switch off the use of view settings set the view option to none:
mphgeom(model, <geomtag>, 'view', 'none')
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.