Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // STAR-CCM+ macro: step.java
- // Written by STAR-CCM+ 12.02.010
- package macro;
- import java.util.*;
- import star.common.*;
- import star.base.neo.*;
- import star.vis.*;
- import star.base.report.*;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.OutputStream;
- import java.nio.file.Files;
- import java.nio.file.Paths;
- public class step extends StarMacro {
- public void execute() {
- execute0();
- }
- private void execute0() {
- Simulation simulation_0 =
- getActiveSimulation();
- double z = 0.005;
- try {
- // Collecting the simualtion file name
- String simulationName = simulation_0.getPresentationName();
- // Open Buffered Input and Output Readers
- // Creating file with name "<sim_file_name>+report.csv"
- BufferedWriter bwout = new BufferedWriter(new FileWriter((simulationName +"report.csv")));
- while (z < 0.45){
- PlaneSection planeSection_1 =
- ((PlaneSection) simulation_0.getPartManager().getObject("\u043F\u0440\u043E\u0445\u043E\u0434\u043D\u043E\u0435 \u0441\u0435\u0447\u0435\u043D\u0438\u0435"));
- Coordinate coordinate_2 =
- planeSection_1.getOriginCoordinate();
- Units units_0 =
- ((Units) simulation_0.getUnitsManager().getObject("m"));
- coordinate_2.setCoordinate(units_0, units_0, units_0, new DoubleVector(new double[] {0.0031250000320142135, 0.002723076133406721, z}));
- ExpressionReport expressionReport_0 =
- ((ExpressionReport) simulation_0.getReportManager().getReport("\u0412\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 1"));
- expressionReport_0.printReport();
- z = z + 0.001;
- bwout.write(expressionReport_0.toString() +"\n");
- }
- bwout.close();
- } catch (IOException iOException) {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement