If you consider the geometry sequence as a computer program, a geometry part corresponds to a subroutine, function, method, or procedure in a programming language. In other words, a geometry part is a geometry sequence whose input is a set of input parameters (having numerical values) and whose output is a set of geometry objects, making it possible to create instances of these parts using different input parameter values and different orientation and position in the overall geometry.
The geometry parts appear under the Geometry Parts node (
![](images/comsol_ref_geometry.14.017.01.png)
), located under
Global Definitions (
![](images/comsol_ref_geometry.14.017.02.png)
) in the model tree, so they are not attached to a specific model component. To create a part, right-click the
Global Definitions node, and then, from the
Geometry Parts submenu, select
3D Part,
2D Part, or
1D Part. If a
Geometry Parts node (
![](images/comsol_ref_geometry.14.017.03.png)
) exists, you can also right-click it to add a
3D Part,
2D Part, or
1D Part. To parameterize the geometry part you can use global parameters and input parameters (arguments), which you add in the
Part node’s
Settings window (see
Geometry Part Settings). You can also add local parameters using a
Local Parameters subnode (see
Local Parameters).
Then, in the Load Part window that opens, browse to a filename and click
Open. The file is scanned for geometry parts. It is not possible to load a part that is linked into the MPH-file. Such a part should be linked directly from the MPH-file where it is defined. If there is just one linkable part, it is added under the
Geometry Parts node. If the file contains more than one linkable parts, a
Load Part dialog box opens. Select one or more parts from the list of available parts. Finally click
OK. The selected parts are added under the
Geometry Parts node. For information about the settings for these loaded geometry parts, see
Loaded Part Settings.
If the parts contain references to global user-defined functions or parameters, those functions and parameters are also inserted in the model under the Global Definitions node. If a function or parameter with the same name already exists in the model, that function or parameter is not copied from the MPH-file.
To update a loaded part that has been modified in the MPH-file, click the Reload button in the
Settings window’s
File section. If the name or the location of the MPH-file has been changed, you can modify the path directly using the
Filename field or set the new filename using the
Browse button. Click the
Replace from Library button to replace the loaded part with one that is a part in the Part Libraries.
In a geometry sequence or part, you can create an instance of a geometry part by right-clicking the Geometry node and selecting a part from the
Geometry Parts menu. This adds a
Part Instance node (
![](images/comsol_ref_geometry.14.017.08.png)
), whose purpose is to build an instance of the part with new values of its input parameters (arguments). You can also change the position and orientation of the resulting part instances. See
Part Instance for details.
A Part Instance node can optionally make an instance of a local part instead of a part under
Global Definitions>Geometry Parts. To use a local part, select
Local part from the
Part list in the
Settings window for a
Part Instance node. In this case, the local part appears beneath the
Part Instance node as a
Local Part subnode.
Sometimes you want to inspect what happens when you build an instance of a part. To do so, right-click the Part Instance node (
![](images/comsol_ref_geometry.14.017.09.png)
), and select
Step Into (
![](images/comsol_ref_geometry.14.017.10.png)
). This builds all preceding features and shows a copy of the called part beneath the
Part Instance node. The copy is identical to the part, except that the input parameters have different values. You can now build features in the copy. You can also try out modifications in the copy. You can then apply the modifications in the part.