Initial Sections of the execute0 Method

Examine the initial sections of the execute0 method.

The first two sections of the method are:

Simulation simulation_0 =
  getActiveSimulation();
 
Units units_0 =
  simulation_0
  .getUnitsManager()
  .getPreferredUnits(
    new IntVector(
      new int[] {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
  )
);

where:

simulation_0
.getUnitsManager()
.getPreferredUnits(
  new IntVector(
    /* etc */

is equivalent to

simulation_0.getUnitsManager().getPreferredUnits(new IntVector(/* etc */

The call to getActiveSimulation() returns the Java object that represents the simulation currently active in the Simcenter STAR-CCM+ client window. This is the main object in the Java macro and provides access to many other object managers (for example RegionManager or RepresentationManager). The Java API documentation provides details on all methods available on the Simulation class.

The simulation_0 object is used to obtain the UnitsManager object. The UnitsManager object is used to find the Units object that represents the default unit for length in the active simulation (through the call to getPreferredUnits). The default unit for length is required when specifying the two points used in creating line probes.