The first input argument to the create method is a physics interface tag that is used as a handle to this physics interface. The second input argument is the type of physics interface. The third input argument is the tag of the geometry to which the physics interface is assigned.
The first input argument to create is a feature tag that is used as a handle to this boundary condition. The second input argument is the type of boundary condition. The third input argument is the spatial dimension for the geometric entity that this boundary condition should be assigned to. Building on the previous example of creating a 2D rectangle, the input argument being 1 means that the dimension of this boundary is 1 (that is, an edge boundary in 2D).
Use Record Code or any of the other tools for automatic generation of code to learn more about the syntax and methods for other physics interface features and other physics interfaces.
Below is a larger block of code that removes, creates, and accesses physics interface feature nodes. It uses the Iterator class and methods available in the
java.util package. For more information, see the Java
® documentation.
Since the Name can be changed by the user, and thereby vary from model to model even if the physics is identical, it is not very useful when programming using the API. Instead, the
Tag is most frequently used, as in many of the previous examples. However, sometimes the
Type is also useful. It gives a human-readable description of a feature that cannot be changed by the user. For example, in the case of a
Temperature boundary condition for a
Heat Transfer in Solids interface, a call to
will return the string HeatSource, regardless of which
Name is displayed in the Model Builder.