|
[Sponsors] |
June 16, 2020, 10:12 |
Getting the value of a report into my macro
|
#1 |
New Member
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 6 |
Hallo everybody,
I am new to this forum and this is my first question: How do I get the value of a report or function into my macro? So far I have tried this: Code:
package macro; import java.util.*; import star.common.*; import star.base.neo.*; import star.base.report.*; public class try_and_error extends StarMacro { public void execute() { execute0(); } private void execute0() { Simulation simulation_0 = getActiveSimulation(); StepStoppingCriterion stepStoppingCriterion_0 = ((StepStoppingCriterion) simulation_0.getSolverStoppingCriterionManager().getSolverStoppingCriterion("Maximum Steps")); stepStoppingCriterion_0.setMaximumNumberSteps(49); simulation_0.getSimulationIterator().run(); old_room = simulation_0.getReportManager().getReport("T_room_supply_report").getReportMonitorValue(); //double old_room = 295.0; //This workes fine double correction = 0.1; String str_new_room = String.valueOf(old_room + correction); UserFieldFunction userFieldFunction_0 = ((UserFieldFunction) simulation_0.getFieldFunctionManager().getFunction("T_room_supply")); userFieldFunction_0.setDefinition(str_new_room); } } The goal is to reset a boundarycondition after some iterations, and use its previous value and some report to calculate the new value. Thanks for reading my post and for any help and advice! |
|
June 17, 2020, 11:13 |
P.s.
|
#2 |
New Member
Lisa Weck
Join Date: Jun 2020
Posts: 4
Rep Power: 6 |
Also, it would help a lot to know where i can find an overview over all the ccm+-classes and methods, that can be used in a macro.
|
|
May 9, 2022, 08:03 |
|
#3 | |
New Member
Emre
Join Date: Sep 2020
Posts: 7
Rep Power: 6 |
Quote:
If you have found the answer to your original question i would love to hear it. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Starccm+ Report Java macro error | lzw | STAR-CCM+ | 6 | October 9, 2019 21:30 |
Macro to generate CSV by reading report values | ashmrao | STAR-CCM+ | 6 | October 7, 2019 05:29 |
fvOptions | npatricia | OpenFOAM | 6 | May 23, 2018 06:21 |
timestep extraction for macro | manuc | Tecplot | 0 | August 10, 2016 13:20 |
Java Macro with a condition on a Report | Mark_89 | STAR-CCM+ | 0 | August 21, 2013 08:05 |