CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Macro problem: export specific monitors

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 5, 2019, 09:47
Default Macro problem: export specific monitors
  #1
New Member
 
Join Date: Feb 2011
Posts: 2
Rep Power: 0
HerrOlsson is on a distinguished road
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);
  }
}
In other words, with what should I replace ??? in line 29 of the code to make it work as intended?
Thanks in advance!
HerrOlsson is offline   Reply With Quote

Reply

Tags
java, macro, monitors

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:37.