Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Control_parameters Class Reference

#include <Coupling.h>

Collaboration diagram for Control_parameters:

Public Member Functions

 Control_parameters ()
 
void read ()
 
void print ()
 
void update_communicator ()
 
void update_start_time (int step, double t)
 

Public Attributes

char coupling_scheme [MAXLEN]
 
char fluid_module [MAXLEN]
 
char solid_module [MAXLEN]
 
char burn_module [MAXLEN]
 
char output_module [MAXLEN]
 
MPI_Comm communicator
 
double simue_time
 
double init_time
 
double current_time
 
double time_step
 
double maxwalltime
 
int maxNumDumps
 
int current_dump
 
int maxNumPredCorrCycles
 
int maxNumTimeSteps
 
double outputIntervalTime
 
double zoomFactor
 
double tolerTract
 
double tolerVelo
 
double tolerMass
 
double tolerDisp
 
char timingDataDir [MAXLEN]
 
std::string timingDataFile
 
int cur_step
 
double LastOutputTime
 
int LastOutputStep
 
int InterruptFlag
 
int AutoRestart
 
int controlVerb
 
bool controlDebug
 
int iOutput
 
int myRank
 
double startTime
 

Detailed Description

Definition at line 43 of file Coupling.h.

Constructor & Destructor Documentation

Definition at line 166 of file rocstar_driver.C.

References AutoRestart, communicator, controlVerb, cur_step, current_dump, InterruptFlag, max(), maxNumDumps, maxNumPredCorrCycles, maxNumTimeSteps, maxwalltime, MPI_COMM_WORLD, output_module, simue_time, timingDataDir, tolerDisp, tolerMass, tolerTract, tolerVelo, and zoomFactor.

167 {
168  // default
170  zoomFactor = 0;
171  cur_step = 0;
172  maxwalltime = 3.15E7;
173  simue_time = 1.0E12;
174  strcpy(timingDataDir, "./");
175  AutoRestart = 0;
176  InterruptFlag = 0;
177  maxNumDumps = 0;
178  current_dump = 0;
182  strcpy(output_module,"Rocout");
183  strcpy(timingDataDir,"Rocman/Profiles");
184  controlVerb = 5;
185 }
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
double simue_time
Definition: Coupling.h:52
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
double tolerTract
Definition: Coupling.h:66
double maxwalltime
Definition: Coupling.h:56
MPI_Comm communicator
Definition: Coupling.h:51
int maxNumPredCorrCycles
Definition: Coupling.h:60
double tolerMass
Definition: Coupling.h:68
char output_module[MAXLEN]
Definition: Coupling.h:49
char timingDataDir[MAXLEN]
Definition: Coupling.h:71
double tolerVelo
Definition: Coupling.h:67
double zoomFactor
Definition: Coupling.h:64
double tolerDisp
Definition: Coupling.h:69

Here is the call graph for this function:

Member Function Documentation

void print ( void  )

Definition at line 296 of file rocstar_driver.C.

References AutoRestart, coupling_scheme, current_time, maxNumDumps, maxNumPredCorrCycles, maxNumTimeSteps, maxwalltime, outputIntervalTime, simue_time, time_step, timingDataDir, timingDataFile, tolerDisp, tolerMass, tolerTract, tolerVelo, and zoomFactor.

Referenced by rocstar_driver().

297 {
298  printf("================ Rocstar Control file ================\n");
299  printf("Rocstar: CouplingScheme: '%s'\n", coupling_scheme);
300  printf("Rocstar: InitialTime: %f\n", current_time);
301  printf("Rocstar: MaximumTime: %f\n", simue_time);
302  printf("Rocstar: MaxWallTime: %f\n", maxwalltime);
303  printf("Rocstar: AutoRestart: %s\n",(AutoRestart ? "Yes" : "No"));
304  printf("Rocstar: MaxNumPredCorrCycles: %d\n", maxNumPredCorrCycles);
305  printf("Rocstar: MaxNumTimeSteps: %d\n", maxNumTimeSteps);
306  if(maxNumDumps > 0)
307  printf("Rocstar: MaxNumOutputDumps: %d\n", maxNumDumps);
308  printf("Rocstar: CurrentTimeStep: %e\n", time_step);
309  printf("Rocstar: OutputIntervalTime: %e\n", outputIntervalTime);
310  printf("Rocstar: ZoomFactor: %f\n", zoomFactor);
311  printf("Rocstar: TolerTract: %f\n", tolerTract);
312  printf("Rocstar: TolerVelo: %f\n", tolerVelo);
313  printf("Rocstar: TolerMass: %f\n", tolerMass);
314  printf("Rocstar: TolerDisp: %f\n", tolerDisp);
315  printf("Rocstar: ProfileDir: %s\n", timingDataDir);
316  printf("Rocstar: ProfileFile: %s\n", timingDataFile.c_str());
317  printf("=======================================================\n");
318 }
double time_step
Definition: Coupling.h:55
double simue_time
Definition: Coupling.h:52
double tolerTract
Definition: Coupling.h:66
double maxwalltime
Definition: Coupling.h:56
char coupling_scheme[MAXLEN]
Definition: Coupling.h:45
int maxNumPredCorrCycles
Definition: Coupling.h:60
double tolerMass
Definition: Coupling.h:68
char timingDataDir[MAXLEN]
Definition: Coupling.h:71
double tolerVelo
Definition: Coupling.h:67
double zoomFactor
Definition: Coupling.h:64
double tolerDisp
Definition: Coupling.h:69
std::string timingDataFile
Definition: Coupling.h:72
double current_time
Definition: Coupling.h:54
double outputIntervalTime
Definition: Coupling.h:63

Here is the caller graph for this function:

void read ( )

Definition at line 187 of file rocstar_driver.C.

References AutoRestart, burn_module, COM_BOOL_ATTRIBUTE, COM_call_function(), COM_delete_window(), COM_DOUBLE_ATTRIBUTE, COM_get_function_handle(), COM_INT_ATTRIBUTE, COM_LOAD_MODULE_STATIC_DYNAMIC, COM_new_window(), COM_STRING_ATTRIBUTE, COM_window_init_done(), COMMPI_Comm_rank(), communicator, coupling_scheme, current_time, fluid_module, get_restart_time(), init_profiling(), init_time, iOutput, MAN_DEBUG, maxNumDumps, maxNumPredCorrCycles, maxNumTimeSteps, maxwalltime, MPI_COMM_WORLD, myRank, output_module, outputIntervalTime, simue_time, solid_module, startTime, time_step, timingDataDir, tolerDisp, tolerMass, tolerTract, tolerVelo, update_communicator(), and zoomFactor.

Referenced by rocstar_driver().

188 {
189  // Load I/O modules
191 
192  string winname = "RocmanParam";
193  COM_new_window(winname.c_str());
194 
195  string attr;
196  COM_STRING_ATTRIBUTE("CouplingScheme", coupling_scheme);
197 
198  COM_STRING_ATTRIBUTE("FluidModule", fluid_module);
199 
200  COM_STRING_ATTRIBUTE("SolidModule", solid_module);
201 
202  COM_STRING_ATTRIBUTE("BurnModule", burn_module);
203 
204  COM_STRING_ATTRIBUTE("OutputModule", output_module);
205 
206  COM_DOUBLE_ATTRIBUTE("InitialTime", current_time);
207 
208  COM_DOUBLE_ATTRIBUTE("MaximumTime", simue_time);
209 
210  COM_DOUBLE_ATTRIBUTE("MaxWallTime", maxwalltime);
211 
212  COM_INT_ATTRIBUTE("MaxNumPredCorrCycles", maxNumPredCorrCycles);
213 
214  COM_INT_ATTRIBUTE("MaxNumTimeSteps", maxNumTimeSteps);
215 
216  COM_DOUBLE_ATTRIBUTE("CurrentTimeStep", time_step);
217 
218  COM_DOUBLE_ATTRIBUTE("OutputIntervalTime", outputIntervalTime);
219 
220  COM_DOUBLE_ATTRIBUTE("ZoomFactor", zoomFactor);
221 
222  // Tolerances for convergence check
223  COM_DOUBLE_ATTRIBUTE("TolerTract", tolerTract);
224 
225  COM_DOUBLE_ATTRIBUTE("TolerVelo", tolerVelo);
226 
227  COM_DOUBLE_ATTRIBUTE("TolerMass", tolerMass);
228 
229  COM_DOUBLE_ATTRIBUTE("TolerDisp", tolerDisp);
230 
231  COM_STRING_ATTRIBUTE("GENXTimingDataDir", timingDataDir);
232  COM_STRING_ATTRIBUTE("ProfileDir", timingDataDir);
233  COM_BOOL_ATTRIBUTE("AutoRestart",AutoRestart);
234  COM_INT_ATTRIBUTE("MaxNumDumps",maxNumDumps);
235  //
236  COM_window_init_done(winname.c_str());
237 
238  //===== Read in parameter file using Rocin
239  int IN_param = COM_get_function_handle( "IN.read_parameter_file");
240 
241  COM_call_function(IN_param, "RocstarControl.txt", (winname).c_str());
242 
243  // post process
244  strcat(timingDataDir, "/");
245 
246  if(AutoRestart)
247  current_time = get_restart_time("Restart.txt");
248 
249  init_time = current_time; // init time, remain constant
250  iOutput = (int)((1.000001*current_time)/outputIntervalTime)+1;
251 
252  COM_delete_window(winname.c_str());
253 
254  // load output module
255  const std::string &outputModule = output_module;
256  if (outputModule == "Rocout") {
257  MAN_DEBUG(3, ("[%d] Rocstar: load_module Rocout.\n", COMMPI_Comm_rank(communicator)));
259  }
260 #ifdef WITH_PANDA
261  else if (outputModule == "Rocpanda") {
262  MAN_DEBUG(3, ("[%d] Rocstar: load_module Rocpanda.\n", COMMPI_Comm_rank(communicator)));
263  COM_LOAD_MODULE_STATIC_DYNAMIC( Rocpanda, "OUT");
264  // Rocpanda server processes won't return
265  }
266 #endif
267  else {
269  printf("Rocstar: Error: Unknown output module %s!\n", output_module);
270  MPI_Abort(MPI_COMM_WORLD, -1);
271  }
272 
273  // get the MPI communicator set by Rocpanda
274  // this is important, update communicator if it is Rocpanda
276 
278 
279  // initialize profiling file
280  init_profiling(*this, myRank);
281 
282  if (myRank == 0) startTime = MPI_Wtime();
283  MPI_Bcast( &startTime, 1, MPI_DOUBLE, 0, communicator);
284 }
int COMMPI_Comm_rank(MPI_Comm c)
Definition: commpi.h:162
char burn_module[MAXLEN]
Definition: Coupling.h:48
void init_profiling(Control_parameters &param, int comm_rank)
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
double time_step
Definition: Coupling.h:55
double init_time
Definition: Coupling.h:53
double simue_time
Definition: Coupling.h:52
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
#define COM_DOUBLE_ATTRIBUTE(attrname, varname)
double get_restart_time(const string &restart_file)
double tolerTract
Definition: Coupling.h:66
#define COM_STRING_ATTRIBUTE(attrname, varname)
double maxwalltime
Definition: Coupling.h:56
char coupling_scheme[MAXLEN]
Definition: Coupling.h:45
MPI_Comm communicator
Definition: Coupling.h:51
int maxNumPredCorrCycles
Definition: Coupling.h:60
double tolerMass
Definition: Coupling.h:68
char output_module[MAXLEN]
Definition: Coupling.h:49
char timingDataDir[MAXLEN]
Definition: Coupling.h:71
double tolerVelo
Definition: Coupling.h:67
Definition: Rocin.h:64
Definition: Rocout.h:81
double zoomFactor
Definition: Coupling.h:64
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
Definition: roccom_c++.h:86
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
double tolerDisp
Definition: Coupling.h:69
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
double current_time
Definition: Coupling.h:54
double startTime
Definition: Coupling.h:87
#define COM_BOOL_ATTRIBUTE(attrname, varname)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
Definition: roccom_basic.h:111
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428
char fluid_module[MAXLEN]
Definition: Coupling.h:46
char solid_module[MAXLEN]
Definition: Coupling.h:47
#define COM_INT_ATTRIBUTE(attrname, varname)
double outputIntervalTime
Definition: Coupling.h:63

Here is the call graph for this function:

Here is the caller graph for this function:

void update_communicator ( )

Definition at line 287 of file rocstar_driver.C.

References COM_call_function(), COM_get_function_handle(), COM_set_default_communicator(), and communicator.

Referenced by read().

288 {
289  int get_comm = COM_get_function_handle( "OUT.get_comm");
290  if (get_comm > 0) {
291  COM_call_function( get_comm, &communicator);
293  }
294 }
void COM_set_default_communicator(MPI_Comm comm)
Definition: roccom_c++.h:67
MPI_Comm communicator
Definition: Coupling.h:51
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

Here is the caller graph for this function:

void update_start_time ( int  step,
double  t 
)

Definition at line 321 of file rocstar_driver.C.

References cur_step, current_time, iOutput, LastOutputStep, LastOutputTime, and outputIntervalTime.

Referenced by Coupling::read_restart_info(), and Coupling::restart_at_time().

322 {
323  cur_step = step;
324  current_time = t;
325  LastOutputTime = t;
327  // set output seq no
328  iOutput = (int)((1.000001*current_time)/outputIntervalTime)+1;
329 }
double LastOutputTime
Definition: Coupling.h:76
double current_time
Definition: Coupling.h:54
double outputIntervalTime
Definition: Coupling.h:63

Here is the caller graph for this function:

Member Data Documentation

int AutoRestart

Definition at line 79 of file Coupling.h.

Referenced by Control_parameters(), print(), and read().

char burn_module[MAXLEN]

Definition at line 48 of file Coupling.h.

Referenced by BurnAgent::BurnAgent(), create_coupling(), and read().

bool controlDebug

Definition at line 82 of file Coupling.h.

Referenced by rocstar_driver().

int controlVerb
char coupling_scheme[MAXLEN]

Definition at line 45 of file Coupling.h.

Referenced by create_coupling(), print(), and read().

int current_dump

Definition at line 58 of file Coupling.h.

Referenced by Control_parameters(), reached_simulation_time(), and rocstar_driver().

char fluid_module[MAXLEN]

Definition at line 46 of file Coupling.h.

Referenced by create_coupling(), and read().

double init_time

Definition at line 53 of file Coupling.h.

Referenced by Coupling::new_start(), read(), and CopyBflagFromBurn::run().

int InterruptFlag

Definition at line 78 of file Coupling.h.

Referenced by Control_parameters(), Coupling::Interrupt(), and Coupling::ProcessInterrupt().

int iOutput

Definition at line 85 of file Coupling.h.

Referenced by reached_restartdump_time(), read(), and update_start_time().

int LastOutputStep
double LastOutputTime
int maxNumDumps

Definition at line 57 of file Coupling.h.

Referenced by Control_parameters(), print(), reached_simulation_time(), and read().

int maxNumPredCorrCycles

Definition at line 60 of file Coupling.h.

Referenced by Control_parameters(), print(), read(), and rocstar_driver().

int maxNumTimeSteps
double maxwalltime

Definition at line 56 of file Coupling.h.

Referenced by Control_parameters(), print(), reached_simulation_time(), and read().

char output_module[MAXLEN]

Definition at line 49 of file Coupling.h.

Referenced by Control_parameters(), read(), and rocstar_driver().

double outputIntervalTime
double simue_time

Definition at line 52 of file Coupling.h.

Referenced by Control_parameters(), print(), reached_simulation_time(), and read().

char solid_module[MAXLEN]

Definition at line 47 of file Coupling.h.

Referenced by create_coupling(), and read().

double startTime

Definition at line 87 of file Coupling.h.

Referenced by reached_simulation_time(), and read().

double time_step
char timingDataDir[MAXLEN]

Definition at line 71 of file Coupling.h.

Referenced by Control_parameters(), init_profiling(), print(), and read().

std::string timingDataFile

Definition at line 72 of file Coupling.h.

Referenced by init_profiling(), print(), and rocstar_driver().

double tolerDisp

Definition at line 69 of file Coupling.h.

Referenced by Control_parameters(), print(), and read().

double tolerMass

Definition at line 68 of file Coupling.h.

Referenced by Coupling::check_convergence(), Control_parameters(), print(), and read().

double tolerTract

Definition at line 66 of file Coupling.h.

Referenced by Coupling::check_convergence(), Control_parameters(), print(), and read().

double tolerVelo

Definition at line 67 of file Coupling.h.

Referenced by Coupling::check_convergence(), Control_parameters(), print(), and read().

double zoomFactor

The documentation for this class was generated from the following files: