Switch for Materials
Use the Material Switch node () to switch between materials during a solver sweep. You add the materials as subnodes under the Material Switch node. Right-click to add a Blank Material or select Add Material from Library to select materials from the libraries in the Add Material window. You can also add a Layered Material or a Single Layer Material.
The switch for materials essentially acts as a switch statement in a programming language; that is, it dynamically selects one of its underlying branches depending on a parameter that can be controlled from the solvers, using a Material Sweep study. The parameter name is constructed based on the tag of the Material Switch node, using the special namespace matsw. For example, the parameter controlling a Switch node on the global level will typically be matsw.sw1, while for a component-level Switch it will be matsw.comp1.sw1.
During a material sweep, the sweep parameter takes consecutive integer values, starting from one, indicating which material under the switch that should currently provide material properties. You can use the parameter name in conditional expressions to control also other aspects of the model. Conversely, it is possible to control a material Switch also by manually defining the full switch parameter name in a Parameters node. You can then choose the parameter to sweep over in a standard Parametric Sweep node or assign it different (integer) values in different parameter Case nodes and sweep using a Parameter switch sweep.
The Material Switch node’s Settings window contains the following sections:
Material Contents
This section lists all of the material properties that are defined for the material or required by the physics in the model on domains where the Switch node is the active domain material. The table lists the Property, Name, Value, and Unit for the material property as well as the Property group to which the material property belongs. The Property group corresponds to the subnodes in the Model Builder with the same name. If required, edit the values or expression for the property’s Value.
The list includes properties that are defined by any of the materials under the Switch node. The left column provides visual cues about the status of each property:
A stop sign () indicates that some subnode is missing a required Value. That is, the material property is required by a physics feature in the model but is not defined for all switch cases.
A check mark () indicates that the property has a Value in all subnodes and is currently being used in the physics of the model.
Appearance
The settings in this section make it possible to control or change the default appearance of the material switch in the Graphics window when working in the materials or physics parts of the model tree. See The Settings Window for Material for more information.