Release Notes > The COMSOL API for Use with Java® > COMSOL 5.1 API Changes

COMSOL 5.1 API Changes
Acoustics Module Changes
The ratio of specific heats is now a material parameter. If the default value was used in a model, add the following line to the Java® file to obtain the old behavior:
model.physics("cpf").feature("cpf1").set("gamma_mat", "userdef");
Electrochemistry Modules changes
There are changes for the Tertiary Current Distribution, Nernst-Planck interface. The Java® API syntax for creating and accessing vectors and tensors has changed, as well as the syntax for setting physics properties. See the following examples:
Old syntax:
model.physics("tcdee").feature("ice1").set("D_0", new String[]{"D1", "0", "0", "0", "D1", "0", "0", "0", "D1"});
model.physics("tcdee").feature("ice1").set("D_1", new String[]{"D2", "0", "0", "0", "D2", "0", "0", "0", "D2"});
model.physics("tcdee").feature("ice1").set("D_2", new String[]{"D3", "0", "0", "0", "D3", "0", "0", "0", "D3"});
New syntax (includes the species name in the first argument of the set method):
model.physics("tcdee").feature("ice1").set("D_c1", new String[]{"D1", "0", "0", "0", "D1", "0", "0", "0", "D1"});
model.physics("tcdee").feature("ice1").set("D_c2", new String[]{"D2", "0", "0", "0", "D2", "0", "0", "0", "D2"});
model.physics("tcdee").feature("ice1").set("D_c3", new String[]{"D3", "0", "0", "0", "D3", "0", "0", "0", "D3"});
Old syntax:
Dxx_c1, Dxy_c1, Dxz_c1...
New syntax (component index after the species name):
D_c1xx, D_c1xy, D_c1xz...
Old syntax:
model.physics("tcdee").feature("reac1").set("R_0", new String[]{"R1"});
model.physics("tcdee").feature("reac1").set("R_1", new String[]{"R2"});
model.physics("tcdee").feature("reac1").set("R_2", new String[]{"R3"});
New syntax (includes the species name in the first argument of the set method):
model.physics("tcdee").feature("reac1").set("R_c1", new String[]{"R1"});
model.physics("tcdee").feature("reac1").set("R_c2", new String[]{"R2"});
model.physics("tcdee").feature("reac1").set("R_c3", new String[]{"R3"});
Old syntax:
tfluxx_c1, tfluxy_c1, tfluxz_c1
New syntax (component index after the species name):
tflux_c1x, tflux_c1y, tflux_c1z
Old syntax:
model.physics("tcdee").feature("init1").setIndex("c2", "c20", 0);
model.physics("tcdee").feature("init1").setIndex("c3", "c30", 0);
model.physics("tcdee").feature("init1").setIndex("V", "V0", 0);
New syntax:
model.physics("tcdee").feature("init1").setIndex("initc", "c20", 1);
model.physics("tcdee").feature("init1").setIndex("initc", "c30", 2);
model.physics("tcdee").feature("init1").setIndex("initphil", "V0");
Old syntax:
model.physics("tcdee").prop("Convection").set("Convection", 1, "0");
model.physics("tcdee").prop("ConvectiveTerm").setIndex("ConvectiveTerm", "noncons", 0);
New syntax (the property name corresponds to the section in the user interface):
model.physics("tcdee").prop("TransportMechanism").set("Convection", 1, "0");
model.physics("tcdee").prop("AdvancedSettings").setIndex("ConvectiveTerm", "noncons", 0);
For information about API backward compatibility for the Surface Reactions interface, see the Chemical Reaction Engineering Module release notes.
ECAD Import Module changes
The default value for the grouping property of the Import function is now set to layer. Previously, the default was all.
For ODB++® and ODB++(X) files (the type property is odb), new rules apply for the initialization of the importlayer property of the Import function. Now, only layers of the types Metal and Dielectric are initialized with the string on in the importlayer string array. Previously this also included layers of type Drill.
LiveLink for Solid Edge® Changes
The default value for the keepfree property of the LiveLinkSolidEdge function is now set to on. Previously, the default was set to off.
LiveLink for SOLIDWORKS® Changes
The default value for the keepfree property of the LiveLinkSOLIDWORKS function is now set to on. Previously, the default was set to off.