Skip to content

Commit

Permalink
Merge pull request #43 from frkasper/2402
Browse files Browse the repository at this point in the history
2402 cycle
  • Loading branch information
frkasper authored Mar 20, 2024
2 parents 6f2679e + e7401d1 commit c993eda
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 39 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ MacroUtils is a collection of high-level APIs in order to make your life easier

## Requires

1. Simcenter STAR-CCM+ 2310 libraries;
1. Simcenter STAR-CCM+ 2402 libraries;

1. Integrated development environment (IDE) supporting JDK 17.0.6 and gradle
1. Integrated development environment (IDE) supporting JDK 17.0.8 and gradle

## Recommended IDE

NetBeans 17 or later.
NetBeans 18 or later.

## Need an older version?

Expand Down
2 changes: 1 addition & 1 deletion macroutils/src/macroutils/MacroUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @since STAR-CCM+ v7.02, May of 2012
* @author Fabio Kasper
* @version 2310
* @version 2402
*/
public final class MacroUtils {

Expand Down
3 changes: 1 addition & 2 deletions macroutils/src/macroutils/creator/CreateRegion.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import macroutils.MacroUtils;
import macroutils.StaticDeclarations;
import star.common.GeometryPart;
import star.common.ManagesParts;
import star.common.Region;
import star.common.RegionManager;
import star.common.Simulation;
Expand Down Expand Up @@ -117,7 +116,7 @@ public ArrayList<Region> fromParts(ArrayList<GeometryPart> agp,
ArrayList<Region> ar1 = _get.regions.all(false);
ar1.removeAll(ar0);
_io.say.msg(vo, "Regions created: %d", ar1.size());
ArrayList<ManagesParts> amp = new ArrayList<>();
ArrayList<SimulationPartManager> amp = new ArrayList<>();
amp.add(_sim.get(SimulationPartManager.class));
//-- Attempt to automatically create the Interfaces.
rmg.updateInterfacesFromPartContacts(amp, im.getMode());
Expand Down
5 changes: 2 additions & 3 deletions macroutils/src/macroutils/misc/MainRemover.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import java.util.ArrayList;
import java.util.Collections;
import java.util.Vector;
import java.util.List;
import java.util.stream.Collectors;
import macroutils.MacroUtils;
import star.base.neo.ClientServerObject;
import star.base.neo.ClientServerObjectManager;
import star.base.neo.NeoObjectVector;
import star.base.neo.NeoProperty;
import star.base.report.Monitor;
import star.base.report.MonitorManager;
Expand Down Expand Up @@ -388,7 +387,7 @@ private void _invalidCells(boolean aggressiveRemoval) {
for (String s : npKeys) {
_io.say.msg(true, " - %-35s: %s", s, np.get(s).toString());
}
Vector inputs = fvRegions.stream().collect(Collectors.toCollection(Vector::new));
List<Region> inputs = fvRegions.stream().collect(Collectors.toList());
_sim.getMeshManager().removeInvalidCells(inputs, np);
_io.say.ok(true);
}
Expand Down
40 changes: 17 additions & 23 deletions macroutils/src/macroutils/setter/SetGeometry.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package macroutils.setter;

import java.util.ArrayList;
import java.util.Vector;
import java.util.stream.Collectors;
import macroutils.MacroUtils;
import star.base.neo.NeoObjectVector;
import star.cadmodeler.SolidModelPart;
import star.common.GeometryPart;
import star.common.PartCurve;
Expand Down Expand Up @@ -84,16 +81,15 @@ public void splitPartSurfaceByAngle(PartSurface ps, double angle, boolean vo) {
/**
* Splits the given Part Surfaces by an angle.
*
* @param aps given ArrayList of Part Surfaces.
* @param angle given Split Angle.
* @param vo given verbose option. False will not print anything.
* @param inputs given ArrayList of Part Surfaces.
* @param angle given Split Angle.
* @param vo given verbose option. False will not print anything.
*/
public void splitPartSurfacesByAngle(ArrayList<PartSurface> aps, double angle, boolean vo) {
public void splitPartSurfacesByAngle(ArrayList<PartSurface> inputs, double angle, boolean vo) {
_io.say.action("Splitting Part Surfaces by Angle", vo);
_io.say.objects(aps, "Part Surfaces", vo);
_io.say.objects(inputs, "Part Surfaces", vo);
_io.say.msg(vo, "Split Angle: %g.", angle);
Vector inputs = aps.stream().collect(Collectors.toCollection(Vector::new));
for (PartSurface ps : aps) {
for (PartSurface ps : inputs) {
_get.partSurfaces.manager(ps).splitPartSurfacesByAngle(inputs, angle);
}
_io.say.ok(vo);
Expand All @@ -113,25 +109,23 @@ public void splitPartSurfacesByPartCurves(GeometryPart gp, boolean vo) {
/**
* Splits the given Part Surfaces by the given Part Curves.
*
* @param aps given ArrayList of Part Surfaces.
* @param apc given ArrayList of Part Curves.
* @param vo given verbose option. False will not print anything.
* @param inputsPS given ArrayList of Part Surfaces.
* @param inputsPC given ArrayList of Part Curves.
* @param vo given verbose option. False will not print anything.
*/
public void splitPartSurfacesByPartCurves(ArrayList<PartSurface> aps,
ArrayList<PartCurve> apc, boolean vo) {
public void splitPartSurfacesByPartCurves(ArrayList<PartSurface> inputsPS,
ArrayList<PartCurve> inputsPC, boolean vo) {
_io.say.action("Splitting Part Surfaces by Part Curves", vo);
_io.say.objects(aps, "Part Surfaces", vo);
_io.say.objects(apc, "Part Curves", vo);
boolean pssSamePart = _chk.is.withinSamePart(new ArrayList<>(aps));
boolean pcsSamePart = _chk.is.withinSamePart(new ArrayList<>(apc));
_io.say.objects(inputsPS, "Part Surfaces", vo);
_io.say.objects(inputsPC, "Part Curves", vo);
boolean pssSamePart = _chk.is.withinSamePart(new ArrayList<>(inputsPS));
boolean pcsSamePart = _chk.is.withinSamePart(new ArrayList<>(inputsPC));
if (!(pssSamePart && pcsSamePart)) {
_io.say.msg(vo, "Objects do not share the same Geometry Part. Returning NULL!");
return;
}
Vector inputsPC = apc.stream().collect(Collectors.toCollection(Vector::new));
Vector inputsPS = aps.stream().collect(Collectors.toCollection(Vector::new));
for (PartSurface ps : aps) {
_get.partSurfaces.manager(ps).splitPartSurfacesByPartCurves(inputsPS,inputsPC);
for (PartSurface ps : inputsPS) {
_get.partSurfaces.manager(ps).splitPartSurfacesByPartCurves(inputsPS, inputsPC);
}
_io.say.ok(vo);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test/test_demo01.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_cell_count():


def test_solution():
test_utils.assert_iteration(DEMO_ID, 100, tolerance=25, relative=False)
test_utils.assert_iteration(DEMO_ID, 110, tolerance=30, relative=False)


def test_report():
Expand Down
6 changes: 3 additions & 3 deletions tests/test/test_demo05.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_kart_wrap_part_surfaces_count():


def test_cell_count():
test_utils.assert_cell_count(DEMO_ID, 610000, tolerance=0.025)
test_utils.assert_cell_count(DEMO_ID, 630000, tolerance=0.025)


def test_solution():
Expand All @@ -45,7 +45,7 @@ def test_scalar_pressure_kart_min():


def test_scalar_pressure_kart_max():
test_utils.assert_scene_max(DEMO_ID, 'Pressure Kart', 'Scalar', 5.0,
test_utils.assert_scene_max(DEMO_ID, 'Pressure Kart', 'Scalar', 1.1,
tolerance=1.0, relative=False)


Expand All @@ -55,7 +55,7 @@ def test_scalar_pressure_section_min():


def test_scalar_pressure_section_max():
test_utils.assert_scene_max(DEMO_ID, 'Pressure Section', 'Scalar', 5.0,
test_utils.assert_scene_max(DEMO_ID, 'Pressure Section', 'Scalar', 1.1,
tolerance=1.0, relative=False)


Expand Down
2 changes: 1 addition & 1 deletion tests/test/test_demo11.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_subtract_part_surfaces_count():


def test_cell_count():
test_utils.assert_cell_count(DEMO_ID, 165000, tolerance=0.025)
test_utils.assert_cell_count(DEMO_ID, 157000, tolerance=0.025)


def test_scalar_min():
Expand Down
4 changes: 2 additions & 2 deletions tests/test/test_demo15.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def test_solution_ss():


def test_pressure_drop_report_ss():
test_utils.assert_report(ss_sim(), 'Pressure Drop', 8.1,
tolerance=0.1, relative=False)
test_utils.assert_report(ss_sim(), 'Pressure Drop', 8.0,
tolerance=0.25, relative=False)


def test_pressure_scalar_min_ss():
Expand Down

0 comments on commit c993eda

Please sign in to comment.