The COMSOL API for Use with Java®
COMSOL 6.1 API Changes
Periodic Conditions — Destination Selection
The Destination Selection subnode under Periodic Condition nodes has been removed in version 6.1 and has been replaced by an optional Destination Selection section in the Settings windows for Periodic Condition nodes. It can still be added from the API for backward compatibility. The only difference in behavior for old API code when using Destination Selections is what the entities of the feature’s selection are when it is set to all boundaries:
A periodic condition:
PhysicsFeature pc = model.physics("ec").feature("pc1");
Set the selection to all boundaries of the destination domains feature:
pc.feature("dd1").selection().all();
The result of this statement typically differs between versions 6.0 and 6.1:
int[] entities = pc.feature("dd1").selection().entities();
In version 6.0, only the automatic destination entities from the parent’s automatic destination selection were returned. Now, the software returns all entities that overlap with the parent selections (source and destination). The interpretation of the all boundaries flag being set is still the same: making the periodic condition use the automatic destination. The only difference is what the API returns for the selection of the destination domains.
Fillets and Chamfers in 2D Geometries
In new 2D models, when adding Fillet and Chamfer features, you typically do not need to set the selectinsketch property, as it is set to on by default.
Geometry Export
The following method now sets the file format of the geometry export:
model.component(<ctag>).geom(<tag>).export().setType(<format>);
where <format> can take the following values: nativeascii, nativebin, parasolidbin, parasolidascii, acisbin, acisascii, iges, step, stlbin, stlascii, or dxf.
To get the file format that is set for the geometry export, use:
String fileType = model.component(<ctag>).geom(<tag>).export().
getType();