Inserting Contents from Models
You can insert components, geometry parts, parameters, and other model contents from versions in your database into the model currently opened in the COMSOL Desktop. This is a useful way of reusing modeling setups from existing models when you, for example, start with a new model.
From the Settings window of a model version, select the node you want to insert into the opened model from the model tree in the Contents section. Click Insert into Model () in the toolbar below the tree to insert the selected node.
Only a subset of all node types support insertion. The Insert into Model button () is disabled for unsupported selections.
The Insert into Model button () is a useful alternative to Inserting Parts and Other Model Contents from Databases via the Select Model window when you want to reuse multiple model tree nodes from the same source model. Going via the Contents section also has the advantage that you can right away select which node you want to insert from a source model in case the model has multiple such nodes of the same type.
Components, Geometries, Materials, and Physics
Select a component, geometry sequence, material, or physics node and click Insert into Model () to insert the selected node. If there is more than one target available in the opened model, the Insert into Model dialog box is shown giving you a list of possible targets for the insertion. Select a target parent node and click OK. The node is copied into the opened model and then selected in the Model Builder window.
Geometry Parts
Select a geometry part and click Insert into Model () to insert the selected part under Global Definitions>Geometry Parts in the model opened in the COMSOL Desktop. Unlike the plain copying done when inserting Components, Geometries, Materials, and Physics, the geometry part is loaded as auxiliary data into the model tree with a reference back to its source model version.
If the opened model contains components or geometry parts with the same space dimension as the selected geometry part, you have the option to also create a part instance of the inserted part. From the Insert into Model dialog box:
1
In the Insert As list, select Geometry part.
2
Select the Create part instance in geometry check box.
3
4
The geometry part is loaded into the model and a new part instance is created.
You can also insert the geometry sequence of the part as a plain copy into the opened model. Select Copy of geometry sequence in the Insert As list, select a target geometry, and click OK. In this case, no reference to the source model version is included.
The Copy of geometry sequence option may be used, for example, to create a new part by starting from the sequence of an existing part. Create a new part under Global Definitions in the Model Builder window with the same space dimension as the existing part in the database. Select the existing part in the Contents section, click Insert into Model (), and select the new part as the target for the copy.
Parameters
You can insert parameters from a model version in the database into the model opened in the COMSOL Desktop. Perhaps you have a list of parameters whose names and values you find yourself reusing over and over again in your modeling work. You can then save these parameters with a model in your database to be used as a template source for parameters when creating new models.
Select a Parameters node and click Insert into Model () to insert its list of parameters into the opened model. You can also click Details () to get a preview of the parameters in the Settings table of the Details dialog box — see also Model Settings.
Only global parameters found under Global Definitions support insertion. Inserting local parameters is not supported.
For a model in the COMSOL Desktop with a single Parameters node having an empty parameter list, the inserted parameters are added to the existing node’s list. The label of the Parameters node is also updated to that of the selected node’s label. For a model in the COMSOL Desktop that already contains parameters, the inserted parameters are instead added as a new Parameters node. Any Cases nodes present under the select Parameters node are inserted as well.
An initial Parameters node with an empty parameter list is automatically added when you create a new blank model in the Model Builder workspace. You may want to insert your list of parameters from the existing model version before writing any new parameters to avoid ending up with multiple Parameters nodes in the new model.
Parameter Name Collisions
An Insert into Model dialog box is shown asking you what to do if there are any name collisions between the parameters being inserted and the ones already present in the opened model. Select Overwrite to replace the current values of such duplicate parameters with those being inserted from. Select Rename Duplicates to instead rename inserted parameters found to be duplicates by appending a numerical suffix to their names. Other parameters, having no name collisions, are inserted as previously described.