## Mesh & Geometry

### Geometry

#### Part Libraries

A *part* is a parametrized geometry that is defined by a number of *input parameters*. Previously known as *geometry subsequences* the use of parts is very useful for quick modeling of standard geometric features where control over their geometric parameters can be used in other operations, such as parametric sweeps. The following modules now have a *Part Library* containing ready-to-use geometry components that are common in their respective fields:

- Microfluidics Module: 2D and 3D channels.
- Mixer Module: 3D tanks and impellers.
- Ray Optics Module: 2D and 3D lenses, mirrors, and prisms.
- Structural Mechanics Module: 2D beam cross sections, 3D bolts.

By using these common parts, a lot of geometry modeling will be saved. Instances of these parts can be added to your model or application from the *Part Libraries* browser. Each instance of a part can have different values for the input parameters and you can position them relative to other geometry objects in your model. You can also create your own part libraries.

Note: Parts were called *geometry subsequences* in version 5.0.

When you create your own part, you get access to a new setting for a *Parameter Check*. This runs a check of your part's parameters, and displays an error message if the input parameters are outside of certain pre-determined conditions, such as the head of a bolt required to be smaller than its length.

### Mesh

#### Copy a Mesh to a Component of Higher Space Dimension

Using the *Copy* operation, it is now possible to copy a mesh to a model in a higher space dimension. For example, you can copy the mesh from a 2D geometry to a planar face in 3D, and then sweep this mesh throughout the geometry to create a 3D mesh.

In previous versions of COMSOL Multiphysics, you had to add the boundary layer mesh to the swept 3D mesh. This approach still works, but the new approach offers more control over the boundary layer mesh generation.

*Example of building a swept boundary layer mesh:*

Step 1 - Add a 2D component and use the Cross Section operation to create a 2D geometry from the planar faces of the 3D geometry defining the source of the sweep.

Step 2 - Build a boundary layer mesh for this 2D geometry.

Step 3 - Use the Copy operation to copy the 2D boundary layer mesh to the source faces of the 3D geometry.

Step 4 - Build the swept mesh using the copied surface boundary layer mesh as source.

Example of building a swept boundary layer mesh:

Step 1 - Add a 2D component and use the Cross Section operation to create a 2D geometry from the planar faces of the 3D geometry defining the source of the sweep.

Step 2 - Build a boundary layer mesh for this 2D geometry.

Step 3 - Use the Copy operation to copy the 2D boundary layer mesh to the source faces of the 3D geometry.

Step 4 - Build the swept mesh using the copied surface boundary layer mesh as source.

#### New Operation for Face Detection of Imported Meshes

A new operation, *Detect Faces*, allows you to add to a meshing sequence that corresponds to an imported mesh. Use this operation to automatically partition selected faces of an imported mesh along sharp ridges and boundaries of planar regions.

#### Improved Functionality for Creating a Geometry from a Mesh

When creating geometry from mesh in 3D, COMSOL Multiphysics automatically simplifies the surface mesh and removes defects in the mesh before creating the geometry from the resulting adapted mesh. This makes it possible to also create a geometry for surface meshes of low quality, and it increases the success rate of subsequent operations on the generated geometry, such as Boolean operations and meshing. You can tune the settings for this mesh simplification in the settings window of the *Geometry > Import* node.

*Step 1 of importing an STL mesh file of a spinal vertebra into COMSOL Multiphysics where a COMSOL geometry and mesh is created using new features that simplify and remove defects in the mesh. In this image, we see the original mesh, which was provided courtesy of Mark Yeoman, Continuum Blue Ltd., Ystrad Mynach, UK.*

*Step 2 of importing an STL mesh file of a spinal vertebra into COMSOL Multiphysics where a COMSOL geometry and mesh is created using new features that simplify and remove defects in the mesh. In this image, we see a COMSOL geometry created from the original mesh, which is provided courtesy of Mark Yeoman, Continuum Blue Ltd., Ystrad Mynach, UK.*

*Step 3 of importing an STL mesh file of a spinal vertebra into COMSOL Multiphysics where a COMSOL geometry and mesh is created using new features that simplify and remove defects in the mesh. In this image, we see a simplified mesh generated from the COMSOL geometry. The original mesh was provided courtesy of Mark Yeoman, Continuum Blue Ltd., Ystrad Mynach, UK.*

An STL mesh file of a spinal vertebra is imported into COMSOL Multiphysics where a COMSOL geometry is created, and then a COMSOL mesh is generated using new features that simplify and remove defects. The original mesh is provided courtesy of Mark Yeoman, Continuum Blue Ltd., Ystrad Mynach, UK.

#### Domain and Boundary Selections Corresponding to NASTRAN Property ID Numbers

When importing a NASTRAN file, there is a new setting called *Create Selections* that you can use to automatically generate selections corresponding to the property ID numbers of the domain and boundary elements in the file. These selections become available for specifying geometric entities throughout the component, for instance, in Material nodes and physics interfaces. There is also another new setting: Allow partitioning of shells. You can use this to allow the boundary partitioning algorithm to partition the boundary entities that are defined based on the property ID numbers in the file into smaller parts based on geometric features in the mesh, such as sharp ridges. Both options are selected by default.

### Functions and Operators

#### Operators for Maximum and Minimum over Time

The new operators *timemax* and *timemin* compute the maximum or minimum of an expression over a range of time steps. The operators can also evaluate the time value for which the maximum or minimum is achieved.

#### Operator for Accessing Any Solution

The new operator *withsol* is a generalization of the *with* and *at* operators, which makes it possible to access any solution in the model. The operator can be used both during the solving and in postprocessing steps.

#### Random Functions with Probability Distribution Defined by an Interpolation Function

The *Interpolation *function feature has two new settings: *Define primitive function* and* Define random function*. The* Define primitive function* feature defines a primitive function of the interpolation function. The *Define random function* feature defines a random function that samples from a probability distribution specified by the interpolation function.