Part Libraries
It is possible to define and store sequences of geometry instructions that can be called multiple times within a model. Such sequences of geometry instructions are called parts, and each appearance of a part in the geometry sequence is called a part instance. It is possible to create, save, and call instances of user-defined parts, which may contain complex combinations of geometry primitives, boolean operations, and programming instructions such as if/else statements.
A part instance can be treated as a highly application-specific geometry primitive that can be used to bypass repetitive tasks during the setup of complicated model geometries consisting of a large number of similar entities. Because parts can be fully parameterized, multiple instances of a single part can be used to create entities of many different sizes and shapes. For example, a single part representing a certain type of lens can be used to create multiple part instances corresponding to lenses of different diameters and focal lengths.
The Ray Optics Module Part Library
Several add-on modules include specialized, built-in parts that are distributed with the installation of COMSOL Multiphysics, similar to the way the Application Library examples are distributed. These can be accessed via the Part Libraries. The Ray Optics Module includes a part library containing standard geometric entities typically used in optics applications, such as the following:
All entities in the built-in Part Libraries are fully parameterized, making them easy to adapt to a wide range of large-scale industrial models.
Part Variants
Many parts in the Part Library for the Ray Optics Module include several different combinations of parameters, any of which can uniquely specify the size and shape of a part instance. For example, it may be convenient to define the shape of a lens either by specifying its radii of curvature or by entering a focal length. Similarly, parabolic reflectors can be specified either by focal length or by diameter and rim angle. These alternative parameterizations of a single part are called part variants. If a part has two or more variants, then a part variant can be selected when loading the part into the model.
For example, in 3D the part spherical_plano_convex_lens_3d is available. This creates a lens with one convex surface and one flat surface. The lens dimensions can be specified in terms of any of the following combinations of input parameters:
Diameter d, radius of curvature R, and edge thickness Te
Diameter d, radius of curvature R, and center thickness Tc
Diameter d, effective focal length f, refractive index n, and center thickness Tc
If a part supports multiple variants, then a dialog box appears when loading the part into the model. The dialog box in Figure 2-15 is shown when loading the spherical plano-convex lens described in the previous paragraph.
Figure 2-15: Setting to select a part variant when using the Ray Optics Module Part Library.
Part Libraries in the COMSOL Multiphysics Reference Manual