|
[Sponsors] |
July 5, 2019, 09:47 |
Macro problem: export specific monitors
|
#1 |
New Member
Join Date: Feb 2011
Posts: 2
Rep Power: 0 |
Hi,
I'm trying to export some of my monitors from my simulation to a csv file using a macro (I have A LOT of monitors, so I have to use a macro). I want to export only the monitors which has "Force" in their name, and "time step" as trigger. My problem is that I can't find out how to write the line for filtering out the monitors I want. I can filter out the ones with "Force" in the name, no problem. But I don't know how to filter on trigger type. My code is as below: Code:
package macro; import java.util.*; import star.common.*; import star.base.neo.*; import star.base.report.*; public class solutionDataExport extends StarMacro { public void execute() { execute0(); } private void execute0() { Simulation simulation_0 = getActiveSimulation(); // Collect all monitors Collection<Monitor> monitorReports = simulation_0.getMonitorManager().getMonitors(); // Create an empty vector to which the monitors will be added Vector monitorsVector = new NeoObjectVector(new Object[] {}); // Add monitors with "Force" in name and trigger type time step to vector for (Iterator<Monitor> iterator = monitorReports.iterator(); iterator.hasNext();) { Monitor thisMonitor = iterator.next(); if (thisMonitor.getPresentationName().contains("Force") && ???){ monitorsVector.add(thisMonitor); } } // Export csv-file simulation_0.getMonitorManager().export("./simulationData.csv", ",", monitorsVector); } } Thanks in advance! |
|
Tags |
java, macro, monitors |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] Compiling OpenFOAM 5.0 on the Titan Supercomputer | wildfire230 | OpenFOAM Installation | 20 | May 6, 2020 08:30 |
Problem with UDF - DEFINE_SPECIFIC_HEAT macro | estevaotolentino | Fluent UDF and Scheme Programming | 4 | April 3, 2019 16:01 |
Domain Reference Pressure and mass flow inlet boundary | AdidaKK | CFX | 75 | August 20, 2018 06:37 |
Simple piston movement in cylinder- fluid models | arun1994 | CFX | 4 | July 8, 2016 03:54 |
TECPLOT 10 macro problem | Matthew Morse | Tecplot | 5 | July 5, 2004 02:31 |