For measuring geometric and mass properties of a finalized geometry, use the Measure options under
Results >
Evaluation Group or
Results >
Derived Values. Note that, for historical reasons,
Derived Values are referred to as
Numerical in the COMSOL API. The
Evaluation Group option is a more recent addition to COMSOL Multiphysics and is the recommended option. The examples below applies to the Thermal Microactuator Simplified model, which you can find in the Application Libraries at
COMSOL Multiphysics >
Multiphysics.
The last two use the MassProperties feature, which also recomputes volume, so you see the volume twice (once from
MeasureVolume, once from
MassProperties).
Note that when using Derived Values, the
massResult array comes back transposed compared to the array returned by an
Evaluation Group.
Instead of using the ASCII letter u for the micro-prefix, you can embed the Unicode micro sign (
\u00b5) in your unit strings. For example:
Rather than hard-coding geometric entity numbers (for example 155,
167), define a named
Explicit selection and reuse it. For example:
Note: If you use the Record Code or
Record Method tools, the generated code will match the default user interface behavior, it writes all evaluated results into
Evaluation Group tables or
Table objects. It will not include direct assignments into
double[][] arrays or
double variables as shown above. The 2D array format is needed because each evaluation feature can compute multiple expressions or perform parametric sweeps.