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

#include <FluidAgent.h>

Inheritance diagram for FluidAgent:
Collaboration diagram for FluidAgent:

Public Member Functions

 FluidAgent (Coupling *coup, std::string mod, std::string obj, MPI_Comm com, int withSolid=0)
 
virtual void input (double t)
 
virtual void load_module ()
 
virtual void unload_module ()
 
virtual void init_module (double t, double dt)
 
virtual void finalize ()
 
virtual void read_restart_data ()
 
virtual void output_restart_files (double t)
 
virtual void output_visualization_files (double t)
 
virtual void create_buffer_all ()
 
virtual void init_convergence (int iPredCorr)
 
virtual int check_convergence (double tolerMass, double tolerTract, double tolerVelo)
 
virtual int compute_integrals ()
 
- Public Member Functions inherited from Agent
 Agent (Coupling *cp, std::string mod, std::string obj, const char *agent_name, MPI_Comm com, bool wgm=false, bool skipio=false)
 
virtual ~Agent ()
 
void init_subscheduler (double t)
 
void callMethod (Scheduler_voidfn1_t fn, double t)
 
void schedule ()
 
double max_timestep (double t, double dt)
 
Actionget_main_action ()
 
void register_new_attribute (std::string target_window_, std::string attr_, char loc_, int type_, int ncomp_, const char *unit_)
 
void register_clone_attribute (int cond, std::string target_window_, std::string attr_, std::string parent_window_, std::string parent_attr_, int wg_=1, const char *ptnname_=0, int val_=0)
 
void register_use_attribute (std::string target_window_, std::string attr_, std::string parent_window_, std::string parent_attr_, int wg_=1, const char *ptnname_=0, int val_=0)
 
void create_registered_attributes (std::string tmpBuf)
 
void create_registered_window_attributes (std::string target_window)
 
void assign_attributes ()
 
void add_data ()
 
void add_icaction (Action *act)
 
void add_bcaction (Action *act, int l=1)
 
void add_bcinitaction (Action *act)
 
void add_gmaction (Action *act)
 
void init_callback (const char *surf_win, const char *vol_win, void *option=NULL)
 
void init_bcactions (double t)
 
void obtain_bc (double *a, int *l=NULL)
 
void init_gmactions (double t)
 
void obtain_gm (double *da)
 
void init_bcinitaction (double t)
 
void run_bcinitaction (double t, double dt)
 
Couplingget_coupling ()
 
void register_interpolate (InterpolateBase *ip)
 
std::string get_surface_window () const
 
std::string get_volume_window () const
 
MPI_Comm get_communicator () const
 
std::string get_rocmod_name () const
 
std::string get_modinstance_name () const
 
std::string get_agent_name () const
 
int get_comm_rank () const
 
double get_old_dt () const
 
double * get_integrals ()
 
void print (FILE *f)
 
void get_time_string (double t, std::string &s)
 

Public Attributes

std::string ifluid
 
std::string fluid
 
std::string fluid_plag
 
std::string fluidSurfIn
 
std::string fluidVolIn
 
std::string fluidPlagIn
 
std::string fluidVPIn
 
std::string ifluid_all
 
std::string ifluid_i
 
std::string ifluid_b
 
std::string ifluid_nb
 
std::string ifluid_ni
 
std::string propBufAll
 
std::string fluidBufNG
 
std::string propBuf
 
std::string fluidBufB
 
std::string fluidBufNB
 
std::string fluidBufPC
 
std::string fluidBufBak
 
std::string fluidBufPRE
 
std::string fluidVolBak
 
std::string fluidPlagBak
 
int f_mdot_hdl
 
int f_mdot_pre_hdl
 
int f_ts_hdl
 
int f_ts_pre_hdl
 
int f_vm_hdl
 
int f_vm_pre_hdl
 
int nc_hdl
 
int nc_tmp_hdl
 
int sq_dist_hdl
 

Protected Attributes

bool with_plag
 
string plag_window
 
int with_solid
 
- Protected Attributes inherited from Agent
const std::string agent_name
 
MPI_Comm communicator
 
Couplingcoupling
 
PhysicsAction action
 
SchdulerList bcScheduler
 
UserScheduler bcInitScheduler
 
UserScheduler gmScheduler
 
UserScheduler icScheduler
 
int comm_rank
 
int init_handle
 
int update_handle
 
int pre_hdf_handle
 
int post_hdf_handle
 
int finalize_handle
 
int compute_integrals_handle
 
int ic_handle
 
int bc_handle
 
int gm_handle
 
bool withgm
 
int dobackup
 
string rocmod_name
 
string mod_instance
 
string inDir
 
string outDir
 
string suffix
 
double initial_time
 
double timestamp
 
double current_time
 
double current_deltatime
 
double old_dt
 
std::string surf_window
 
std::string vol_window
 
std::string tmp_window
 
void * option_data
 
InterpolateList interpolateList
 
AttributeList attributeList
 
int pc_hdls [2][3]
 
int pc_count
 
double integrals [MAN_INTEG_SIZE]
 
bool skipInputIO
 

Additional Inherited Members

- Protected Types inherited from Agent
typedef vector< InterpolateBase * > InterpolateList
 
typedef vector< AttributeBase * > AttributeList
 
- Protected Member Functions inherited from Agent
Schedulerget_bcScheduler (unsigned int level)
 
void init_function_handles ()
 
void create_window (const char *window_name)
 
void split_surface_window (const std::string surfAll, const std::string surf_i, const std::string surf_nb, const std::string surf_b, const std::string surf_ni)
 
int read_by_control_file (double t, const std::string base, const std::string window)
 
void write_data_files (double t, const std::string base, const std::string attr, const char *ref=NULL)
 
void write_control_file (double t, const std::string base, const std::string window)
 
virtual void store_solutions (int converged)
 
int check_convergence_help (int vcur, int vpre, double tol, std::string str)
 
- Static Protected Attributes inherited from Agent
static int read_by_control_handle =0
 
static int read_files_handle =0
 
static int obtain_attr_handle =0
 
static int write_attr_handle =0
 
static int write_ctrl_handle =0
 

Detailed Description

Definition at line 29 of file FluidAgent.h.

Constructor & Destructor Documentation

FluidAgent ( Coupling coup,
std::string  mod,
std::string  obj,
MPI_Comm  com,
int  withSolid = 0 
)

Definition at line 41 of file FluidAgent.C.

References Agent::dobackup, fluid, fluid_plag, fluidBufB, fluidBufBak, fluidBufNB, fluidBufNG, fluidBufPC, fluidBufPRE, fluidPlagBak, fluidPlagIn, fluidSurfIn, fluidVolBak, fluidVolIn, fluidVPIn, ifluid, ifluid_all, ifluid_b, ifluid_i, ifluid_nb, ifluid_ni, load_module(), propBuf, propBufAll, Agent::tmp_window, and with_solid.

41  :
42  Agent(cp, mod, obj, "Fluid", com, true),
43  with_plag(false), with_solid(withSolid)
44 {
45  load_module();
46 
47  ifluid = "ifluid"; // for input
48  fluid = "fluid";
49  fluid_plag = "fluid_plag";
50 
51  // Rocin windows, Input buffer windows
52  fluidSurfIn = "fluidSurfIn";
53  fluidVolIn = "fluidVolIn";
54  fluidPlagIn = "fluidPlagIn";
55  fluidVPIn = "fluidVolIn fluidPlagIn";
56 
57  ifluid_all = "ifluid_all"; // tmp buffer
58  ifluid_i = "ifluid"; // FluidBuf
59 
60  // Surface windows for Rocout, Surface window buffers
61  ifluid_b = "ifluid_b"; // fluidBufBOUT
62  ifluid_nb = "ifluid_nb"; // fluidBufNBOUT
63  ifluid_ni = "ifluid_ni"; // fluidBufNIOUT
64 
65  propBufAll = "FluidPropAll";
66  fluidBufNG = "FluidBufNG"; // fluidBufNG
67  propBuf = "FluidProp";
68  fluidBufB = "FluidBufB";
69  fluidBufNB = "FluidBufNB";
70 
71  fluidBufPC = "FluidBufPC"; // surface data to be backed up
72  fluidBufBak = "fluidBufBak"; // back up PC iterations
73  fluidBufPRE = "FluidBufPRE"; // for convergence check
74 
75  fluidVolBak = "FluidVolBak"; // backup of volume data
76  fluidPlagBak = "FluidPlagBak"; // backup of volume data
77 
79 
80  if (!with_solid) dobackup = 0;
81 }
std::string fluidPlagIn
Definition: FluidAgent.h:66
bool with_plag
Definition: FluidAgent.h:52
std::string ifluid_all
Definition: FluidAgent.h:69
T mod(const T &x, const T &m)
Return the modulo of a number.
Definition: CImg.h:4788
std::string fluidBufB
Definition: FluidAgent.h:80
std::string fluidBufBak
Definition: FluidAgent.h:84
std::string fluidVPIn
Definition: FluidAgent.h:67
std::string ifluid_b
Definition: FluidAgent.h:73
std::string fluidVolBak
Definition: FluidAgent.h:87
std::string propBufAll
Definition: FluidAgent.h:77
std::string ifluid_i
Definition: FluidAgent.h:70
std::string propBuf
Definition: FluidAgent.h:79
std::string fluid
Definition: FluidAgent.h:61
std::string fluidPlagBak
Definition: FluidAgent.h:88
std::string fluidBufNG
Definition: FluidAgent.h:78
std::string fluidVolIn
Definition: FluidAgent.h:65
std::string tmp_window
Definition: Agent.h:149
virtual void load_module()
Definition: FluidAgent.C:83
std::string fluid_plag
Definition: FluidAgent.h:62
int dobackup
Definition: Agent.h:139
std::string ifluid_ni
Definition: FluidAgent.h:75
std::string fluidBufPC
Definition: FluidAgent.h:83
std::string fluidSurfIn
Definition: FluidAgent.h:64
Agent(Coupling *cp, std::string mod, std::string obj, const char *agent_name, MPI_Comm com, bool wgm=false, bool skipio=false)
Definition: Agent.C:201
int with_solid
Definition: FluidAgent.h:54
std::string ifluid_nb
Definition: FluidAgent.h:74
std::string fluidBufNB
Definition: FluidAgent.h:81
std::string ifluid
Definition: FluidAgent.h:60
std::string fluidBufPRE
Definition: FluidAgent.h:85

Here is the call graph for this function:

Member Function Documentation

int check_convergence ( double  tolerMass,
double  tolerTract,
double  tolerVelo 
)
virtual

Reimplemented from Agent.

Definition at line 551 of file FluidAgent.C.

References Agent::check_convergence_help(), f_mdot_hdl, f_mdot_pre_hdl, f_ts_hdl, f_ts_pre_hdl, f_vm_hdl, f_vm_pre_hdl, and MAN_DEBUG.

552 {
553  MAN_DEBUG(3, ("Rocstar: FluidAgent::check_convergence .\n"));
554 
555  int result = 0;
556  if (!check_convergence_help(f_vm_hdl, f_vm_pre_hdl, tolerVelo, "vm")) return result;
557  if (!check_convergence_help(f_ts_hdl, f_ts_pre_hdl, tolerTract, "ts")) return result;
558  if (!check_convergence_help(f_mdot_hdl, f_mdot_pre_hdl, tolerMass, "mdot")) return result;
559  return 1;
560 }
int f_ts_hdl
Definition: FluidAgent.h:90
int f_ts_pre_hdl
Definition: FluidAgent.h:90
int f_vm_pre_hdl
Definition: FluidAgent.h:90
int check_convergence_help(int vcur, int vpre, double tol, std::string str)
Definition: Agent.C:743
int f_mdot_pre_hdl
Definition: FluidAgent.h:90
int f_vm_hdl
Definition: FluidAgent.h:90
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
int f_mdot_hdl
Definition: FluidAgent.h:90

Here is the call graph for this function:

int compute_integrals ( )
virtual

Reimplemented from Agent.

Definition at line 562 of file FluidAgent.C.

References COM_call_function(), Agent::compute_integrals_handle, Agent::integrals, and MAN_DEBUG.

563 {
564  if (compute_integrals_handle > 0) {
565  MAN_DEBUG(3, ("Rocstar: FluidAgent::compute_integrals.\n"));
567  }
568  return 1;
569 }
int compute_integrals_handle
Definition: Agent.h:133
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
double integrals[MAN_INTEG_SIZE]
Definition: Agent.h:162

Here is the call graph for this function:

void create_buffer_all ( )
virtual

Reimplemented from Agent.

Definition at line 202 of file FluidAgent.C.

References COM_call_function(), COM_clone_attribute(), COM_DOUBLE, COM_get_attribute_handle(), COM_INTEGER, COM_new_attribute(), COM_new_window(), COM_resize_array(), COM_use_attribute(), COM_window_init_done(), RocBlas::copy, Agent::create_buffer_all(), Agent::create_registered_window_attributes(), f_mdot_hdl, f_mdot_pre_hdl, f_ts_hdl, f_ts_pre_hdl, f_vm_hdl, f_vm_pre_hdl, fluidBufB, fluidBufBak, fluidBufNB, fluidBufNG, fluidBufPC, fluidBufPRE, fluidPlagBak, fluidVolBak, Agent::get_coupling(), Coupling::get_max_ipc(), ifluid_b, ifluid_i, ifluid_nb, ifluid_ni, nc_hdl, nc_tmp_hdl, Agent::pc_count, Agent::pc_hdls, plag_window, propBuf, propBufAll, read_restart_data(), sq_dist_hdl, Agent::surf_window, Agent::vol_window, with_plag, and with_solid.

203 {
205 
208  // COM_use_attribute( propBufAll, surf_window+".bcflag");
209  // Mesh motion velocities
210  COM_new_attribute( propBufAll+".vm", 'n', COM_DOUBLE, 3, "m/s");
211  COM_new_attribute( propBufAll+".rb", 'e', COM_DOUBLE, 1, "m/s");
212  COM_new_attribute( propBufAll+".positions",'n',COM_DOUBLE,3,"m");
213  COM_new_attribute( propBufAll+".cflag",'n',COM_INTEGER,1,"");
214  COM_resize_array(propBufAll+".atts");
215  if ( COM_get_attribute_handle( surf_window+".cnstr_type") >0) {
217  COM_use_attribute( propBufAll, surf_window+".cnstr_type");
219  // a temporary buffer to store ".cnstr_type" of fluid at restart
220  COM_clone_attribute( propBufAll+".cnstr_type_bak", surf_window+".cnstr_type");
221  }
224 
225  std::string bcflag = surf_window+".bcflag";
226  // create a window for surface propagation if run in fluid-alone
227  if ( !with_solid) {
229  COM_use_attribute( propBuf, surf_window+".mesh", 0, bcflag.c_str(), 1);
234  }
235 
236  // update
237  //split_surface_window( ifluid_all, ifluid_i, ifluid_nb, ifluid_b, ifluid_ni);
238 
239  // ifluid_i is the fluidBuf in old rocman
240  // Precondition: The window fluidSurf should have been defined and contain
241  // the following variables: pf, qc, qr, rhof_alp, nf_alp, tf, Tf, mdot_alp,
242  // Tflm_alp, du_alp, and rhofvf_alp.
243 
245  COM_use_attribute( ifluid_i, surf_window+".mesh", 1, bcflag.c_str(), 0);
246  COM_use_attribute( ifluid_i, surf_window+".mesh", 1, bcflag.c_str(), 1);
247 
248  COM_new_attribute(ifluid_i+".rhos", 'e', COM_DOUBLE, 1, "kg/(m^3)");
249  COM_new_attribute(ifluid_i+".mdot", 'e', COM_DOUBLE, 1, "kg/(m^2 s)");
250  COM_new_attribute(ifluid_i+".mdot_old", 'e', COM_DOUBLE, 1, "kg/(m^2 s)");
251  COM_new_attribute(ifluid_i+".mdot_grad", 'e', COM_DOUBLE, 1, "kg/(m^2 s)");
252  COM_new_attribute(ifluid_i+".mdot_tmp", 'e', COM_DOUBLE, 1, "kg/(m^2 s)");
253  COM_resize_array(ifluid_i+".rhos");
254  COM_resize_array(ifluid_i+".mdot");
255  COM_resize_array(ifluid_i+".mdot_old");
256  COM_resize_array(ifluid_i+".mdot_grad");
257  COM_resize_array(ifluid_i+".mdot_tmp");
258 
259  COM_new_attribute( ifluid_i+".vs", 'e', COM_DOUBLE, 3, "m/s");
260  COM_new_attribute( ifluid_i+".vs_alp", 'e', COM_DOUBLE, 3, "m/s");
261  COM_new_attribute( ifluid_i+".vs_old", 'e', COM_DOUBLE, 3, "m/s");
262  COM_resize_array( ifluid_i+".vs");
263  COM_resize_array( ifluid_i+".vs_alp");
264  COM_resize_array( ifluid_i+".vs_old");
265 
266  // for compute distances
267  if ( with_solid) {
268  COM_clone_attribute( ifluid_i+".nc_tmp", surf_window+".nc");
269  COM_new_attribute( ifluid_i+".sq_dist", 'n', COM_DOUBLE, 1, "m");
270  COM_resize_array( ifluid_i+".sq_dist");
271  }
272 
274 // COM_resize_array( ifluid_i+".atts");
276 
278  COM_use_attribute( fluidBufNG, ifluid_i+".mesh", 0, "", 0);
284 
286  COM_use_attribute( fluidBufB, surf_window+".mesh", 0, bcflag.c_str(), 1);
292 
294  COM_use_attribute( fluidBufNB, surf_window+".mesh", 0, bcflag.c_str(), 0);
300 
301  //COM_delete_window( ifluid_b);
302  //COM_delete_window( ifluid_nb);
303  //COM_delete_window( ifluid_ni);
304 
305  // Create windows for output of burning patches, including ghost nodes/cells
306  // (variables include all of fluidSurf, and mdot, mdot_old, vm,
307  // vs, vs_old, ts, nc_t0, sq_dist)
309  COM_use_attribute( ifluid_b, surf_window+".mesh", 1, bcflag.c_str(), 1);
311 
314 
315  if ( with_solid) {
317  COM_use_attribute( ifluid_b, ifluid_i+".vs_old");
318  if (COM_get_attribute_handle( ifluid_i+".ts")>0) {
320  COM_use_attribute( ifluid_b, ifluid_i+".nc_t0");
321  COM_use_attribute( ifluid_b, ifluid_i+".sq_dist");
322  }
323  }
324 
326  COM_use_attribute( ifluid_b, ifluid_i+".mdot_old");
327 
329 
330  // Create windows for output of nonburning patches, including ghosts.
331  // (variables include all of fluidSurf, and vm, vm_old, vs, vs_old,
332  // ts, nc_t0, sq_dist)
334  COM_use_attribute( ifluid_nb, surf_window+".mesh", 1, bcflag.c_str(),0);
336 
339 
340  if ( with_solid) {
342  COM_use_attribute( ifluid_nb, ifluid_i+".vs_old");
343  if (COM_get_attribute_handle( ifluid_i+".ts")>0) {
346  COM_use_attribute( ifluid_nb, ifluid_i+".sq_dist");
347  }
348  }
350 
351  // Create windows for output of nonburning patches, including ghosts.
352  // (variables include all of fluidSurf)
354  COM_use_attribute( ifluid_ni, surf_window+".mesh", 1, bcflag.c_str(),2);
356 
359 
361 
362  // setup for pc iterations
363  int maxPredCorr = get_coupling()->get_max_ipc();
364  if ( maxPredCorr>1) {
365  // Create a window to encapsulate the surface data to be backed up
370 
371  // Create a window to store backed-up surface data
376 
377  // Create window for backing up volume data
383 
384  // Create window for backing up Plag data
385  if ( with_plag) {
391  }
392 
393  // Create window for convergence check
401 
402  // Initlaize the attribute handles to be stored/restored
405 
408 
409  pc_count = 2;
410  if ( with_plag) {
413  pc_count ++;
414  }
421  }
422 
423  // Split surface window for output
424  // ifluid is fluidBuf in INITIALIZE_FLUID() ???
425  // update
426 // split_surface_window( ifluid_all, ifluid_i, ifluid_nb, ifluid_b, ifluid_ni);
427 
428  // for compute_distances
432 
433  if (!get_coupling()->initial_start()) {
434  int cnstr_type_hdl = COM_get_attribute_handle( surf_window+".cnstr_type");
435  int cnstr_type_bak_hdl = COM_get_attribute_handle( propBufAll+".cnstr_type_bak");
436  if (cnstr_type_hdl > 0) {
437  // backup ".cnstr_type" of fluid and restore it later
438  // this will discard the values in HDF restart files!
439  COM_call_function( RocBlas::copy, &cnstr_type_hdl, &cnstr_type_bak_hdl);
440  }
442  if (cnstr_type_hdl > 0) {
443  COM_call_function( RocBlas::copy, &cnstr_type_bak_hdl, &cnstr_type_hdl);
444  }
445  }
446 }
int get_max_ipc() const
Definition: Coupling.h:161
string plag_window
Definition: FluidAgent.h:53
bool with_plag
Definition: FluidAgent.h:52
int sq_dist_hdl
Definition: FluidAgent.h:92
std::string fluidBufB
Definition: FluidAgent.h:80
std::string fluidBufBak
Definition: FluidAgent.h:84
int nc_hdl
Definition: FluidAgent.h:92
static int copy
Definition: RocBlas.h:34
std::string ifluid_b
Definition: FluidAgent.h:73
std::string fluidVolBak
Definition: FluidAgent.h:87
int f_ts_hdl
Definition: FluidAgent.h:90
int pc_hdls[2][3]
Definition: Agent.h:158
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
std::string propBufAll
Definition: FluidAgent.h:77
std::string ifluid_i
Definition: FluidAgent.h:70
std::string propBuf
Definition: FluidAgent.h:79
std::string fluidPlagBak
Definition: FluidAgent.h:88
void COM_use_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Use the subset of panes of another window of which the given pane attribute has value val...
Definition: roccom_c++.h:224
std::string vol_window
Definition: Agent.h:148
int f_ts_pre_hdl
Definition: FluidAgent.h:90
Coupling * get_coupling()
Definition: Agent.h:213
std::string fluidBufNG
Definition: FluidAgent.h:78
virtual void create_buffer_all()
Definition: Agent.C:361
int f_vm_pre_hdl
Definition: FluidAgent.h:90
std::string surf_window
Definition: Agent.h:148
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
virtual void read_restart_data()
Definition: FluidAgent.C:448
void COM_clone_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Clone the subset of panes of another window of which the given pane attribute has value val...
Definition: roccom_c++.h:234
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
int f_mdot_pre_hdl
Definition: FluidAgent.h:90
int f_vm_hdl
Definition: FluidAgent.h:90
std::string ifluid_ni
Definition: FluidAgent.h:75
std::string fluidBufPC
Definition: FluidAgent.h:83
int pc_count
Definition: Agent.h:160
void create_registered_window_attributes(std::string target_window)
Definition: Agent.C:350
int nc_tmp_hdl
Definition: FluidAgent.h:92
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
Definition: roccom_c++.h:118
int with_solid
Definition: FluidAgent.h:54
std::string ifluid_nb
Definition: FluidAgent.h:74
std::string fluidBufNB
Definition: FluidAgent.h:81
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
Definition: roccom_c++.h:200
std::string fluidBufPRE
Definition: FluidAgent.h:85
int f_mdot_hdl
Definition: FluidAgent.h:90

Here is the call graph for this function:

void finalize ( )
virtual

Reimplemented from Agent.

Definition at line 511 of file FluidAgent.C.

References COM_delete_window(), Agent::finalize(), fluidBufB, fluidBufBak, fluidBufNG, fluidBufPC, fluidBufPRE, fluidPlagBak, fluidVolBak, Agent::get_coupling(), Coupling::get_max_ipc(), ifluid_all, ifluid_b, ifluid_i, ifluid_nb, ifluid_ni, propBuf, propBufAll, with_plag, and with_solid.

512 {
513  if ( !with_solid)
523 
524  int maxPredCorr = get_coupling()->get_max_ipc();
525  if ( maxPredCorr>1) {
531  }
532 
533  Agent::finalize();
534 }
int get_max_ipc() const
Definition: Coupling.h:161
bool with_plag
Definition: FluidAgent.h:52
std::string ifluid_all
Definition: FluidAgent.h:69
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
std::string fluidBufB
Definition: FluidAgent.h:80
std::string fluidBufBak
Definition: FluidAgent.h:84
std::string ifluid_b
Definition: FluidAgent.h:73
std::string fluidVolBak
Definition: FluidAgent.h:87
std::string propBufAll
Definition: FluidAgent.h:77
std::string ifluid_i
Definition: FluidAgent.h:70
std::string propBuf
Definition: FluidAgent.h:79
std::string fluidPlagBak
Definition: FluidAgent.h:88
Coupling * get_coupling()
Definition: Agent.h:213
std::string fluidBufNG
Definition: FluidAgent.h:78
virtual void finalize()
Definition: Agent.C:466
std::string ifluid_ni
Definition: FluidAgent.h:75
std::string fluidBufPC
Definition: FluidAgent.h:83
int with_solid
Definition: FluidAgent.h:54
std::string ifluid_nb
Definition: FluidAgent.h:74
std::string fluidBufPRE
Definition: FluidAgent.h:85

Here is the call graph for this function:

void init_convergence ( int  iPredCorr)
virtual

Reimplemented from Agent.

Definition at line 536 of file FluidAgent.C.

References COM_call_function(), RocBlas::copy, f_mdot_hdl, f_mdot_pre_hdl, f_ts_hdl, f_ts_pre_hdl, f_vm_hdl, f_vm_pre_hdl, Agent::init_convergence(), and MAN_DEBUG.

537 {
538  MAN_DEBUG(2, ("Rocstar: FluidAgent::init_convergence at %d.\n", iPredCorr));
539 
540  // Copy current solution to pre for convergence check
542 
544 
546 
547  // STORE_SOLUTIONS
548  Agent::init_convergence( iPredCorr);
549 }
static int copy
Definition: RocBlas.h:34
int f_ts_hdl
Definition: FluidAgent.h:90
int f_ts_pre_hdl
Definition: FluidAgent.h:90
int f_vm_pre_hdl
Definition: FluidAgent.h:90
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
int f_mdot_pre_hdl
Definition: FluidAgent.h:90
int f_vm_hdl
Definition: FluidAgent.h:90
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
virtual void init_convergence(int iPredCorr)
Definition: Agent.C:720
int f_mdot_hdl
Definition: FluidAgent.h:90

Here is the call graph for this function:

void init_module ( double  t,
double  dt 
)
virtual

Reimplemented from Agent.

Definition at line 159 of file FluidAgent.C.

References COM_call_function(), COM_delete_window(), Agent::communicator, fluidPlagIn, fluidSurfIn, fluidVolIn, fluidVPIn, Agent::ic_handle, Agent::init_handle, Agent::init_module(), MAN_DEBUG, Agent::obtain_attr_handle, plag_window, Agent::vol_window, and with_plag.

Referenced by Coupling::init().

159  {
160  MAN_DEBUG(3, ("Rocstar: FluidAgent::init_module t=%e dt=%e.\n", t, dt));
161 
162  Agent::init_module(t, dt);
163 
164  // Call initialization routine of physics module
165  // was in Rocman.f90
167  fluidSurfIn.c_str(), fluidVPIn.c_str(),
169 
170  // Delete input buffer windows
173 #ifndef NATIVE_MP_IO
175 #endif
176  // INITIALIZE_XXX common portion
177 
178  // Reassign vol_window
179  std::string::size_type pos = vol_window.find( " ");
180  if ( pos != std::string::npos) {
181  plag_window = vol_window.substr( pos+1, vol_window.size());
182  vol_window = vol_window.substr( 0, pos);
183  }
184  with_plag = !plag_window.empty();
185 #ifdef NATIVE_MP_IO
186  with_plag = false;
187 #endif
188  MAN_DEBUG(3, ("Rocstar: vol_window = %s with_plag = %d.\n", vol_window.c_str(), with_plag));
189 
190  // Split surface window for output
191  // ifluid is fluidBuf in INITIALIZE_FLUID() ???
192  //split_surface_window( ifluid_all, ifluid_i, ifluid_nb, ifluid_b, ifluid_ni);
193 /*
194  std::string bcflag = surf_window+".bcflag";
195  COM_use_attribute( ifluid_i, surf_window+".mesh", 1, bcflag.c_str(), 0);
196  COM_use_attribute( ifluid_i, surf_window+".mesh", 1, bcflag.c_str(), 1);
197  COM_window_init_done( ifluid_i);
198 */
199 }
string plag_window
Definition: FluidAgent.h:53
int ic_handle
Definition: Agent.h:136
std::string fluidPlagIn
Definition: FluidAgent.h:66
virtual void init_module(double t, double dt)
Definition: Agent.C:416
bool with_plag
Definition: FluidAgent.h:52
void COM_delete_window(const char *wname)
Definition: roccom_c++.h:94
std::string fluidVPIn
Definition: FluidAgent.h:67
int init_handle
Definition: Agent.h:131
std::string vol_window
Definition: Agent.h:148
std::string fluidVolIn
Definition: FluidAgent.h:65
MPI_Comm communicator
Definition: Agent.h:114
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
std::string fluidSurfIn
Definition: FluidAgent.h:64
static int obtain_attr_handle
Definition: Agent.h:125

Here is the call graph for this function:

Here is the caller graph for this function:

void input ( double  t)
virtual

Implements Agent.

Definition at line 128 of file FluidAgent.C.

References COM_new_window(), COM_window_init_done(), Agent::communicator, fluid, fluid_plag, fluidPlagIn, fluidSurfIn, fluidVolIn, ifluid, and Agent::read_by_control_file().

128  {
129 
130  MPI_Barrier(communicator);
131  // if(!comm_rank)
132  // std::cout << "Fluid agent reading surface input." << std::endl;
134  // std::cout << comm_rank << ": done reading surface." << std::endl;
135  MPI_Barrier(communicator);
136  // if(!comm_rank)
137  // std::cout << "Fluid agent done reading surface input, reading volume" << std::endl;
139  // std::cout << comm_rank << ": done reading volume." << std::endl;
140  MPI_Barrier(communicator);
141  // if(!comm_rank)
142  // std::cout << "Fluid agent done reading volume" << std::endl;
143 
144 #ifndef NATIVE_MP_IO
148  }
149 #else
152 #endif
153 
154  MPI_Barrier(communicator);
155  // std::cout << "All processors made it past reading" << std::endl;
156 }
std::string fluidPlagIn
Definition: FluidAgent.h:66
std::string fluid
Definition: FluidAgent.h:61
int read_by_control_file(double t, const std::string base, const std::string window)
Definition: Agent.C:588
std::string fluidVolIn
Definition: FluidAgent.h:65
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
MPI_Comm communicator
Definition: Agent.h:114
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
Definition: roccom_c++.h:86
std::string fluid_plag
Definition: FluidAgent.h:62
std::string fluidSurfIn
Definition: FluidAgent.h:64
std::string ifluid
Definition: FluidAgent.h:60

Here is the call graph for this function:

void load_module ( )
virtual

Reimplemented from Agent.

Definition at line 83 of file FluidAgent.C.

References COM_assertion_msg, COM_F_FUNC2, COM_load_module(), Agent::comm_rank, Agent::init_function_handles(), MAN_DEBUG, Agent::mod_instance, rocflo_load_module(), rocflu_load_module(), and Agent::rocmod_name.

Referenced by FluidAgent().

84 {
85  MAN_DEBUG(3, ("[%d] Rocstar: FluidAgent::load_module %s %s.\n", comm_rank, rocmod_name.c_str(), mod_instance.c_str()));
86 
87 #ifdef STATIC_LINK
88 # ifdef RFLO
89  if (rocmod_name == "Rocflo")
90  COM_F_FUNC2( rocflo_load_module, ROCFLO_LOAD_MODULE)( mod_instance.c_str(), mod_instance.length());
91 # elif defined(RFLU)
92  if (rocmod_name == "Rocflu")
93  COM_F_FUNC2( rocflu_load_module, ROCFLU_LOAD_MODULE)( mod_instance.c_str(), mod_instance.length());
94 # else
95  COM_assertion_msg(0, "Unknown FluidAgent mod!");
96 # endif
97 #else // dynamic loading
98  COM_assertion_msg(rocmod_name == "Rocflo" || rocmod_name == "Rocflu",
99  (std::string("Unknown FluidAgent module:")+rocmod_name).c_str());
100  COM_load_module(rocmod_name.c_str(), mod_instance.c_str());
101 #endif
102 
103  init_function_handles(); // defined in Agent
104 }
string rocmod_name
Definition: Agent.h:141
#define COM_assertion_msg(EX, msg)
#define COM_F_FUNC2(lowcase, uppercase)
Definition: roccom_basic.h:87
void COM_load_module(const char *libname, const char *winname)
Definition: roccom_c++.h:75
void init_function_handles()
Definition: Agent.C:234
subroutine rocflu_load_module(winName)
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
subroutine rocflo_load_module(winName)
string mod_instance
Definition: Agent.h:141
int comm_rank
Definition: Agent.h:130

Here is the call graph for this function:

Here is the caller graph for this function:

void output_restart_files ( double  t)
virtual

Implements Agent.

Definition at line 466 of file FluidAgent.C.

References COM_call_function(), fluid, fluid_plag, ifluid_all, ifluid_b, ifluid_nb, ifluid_ni, plag_window, Agent::post_hdf_handle, Agent::pre_hdf_handle, Agent::surf_window, Agent::vol_window, with_plag, Agent::write_control_file(), and Agent::write_data_files().

Referenced by SurfDiver::run().

466  {
467  static const std::string ifluid_prefix = "ifluid_all";
468 
469  if (pre_hdf_handle != -1)
471 
472  // Write out surface sub-windows
473 #if 1
474  write_data_files( t, ifluid_b, ifluid_b+".all");
475  write_data_files( t, ifluid_nb, ifluid_nb+".all");
476  write_data_files( t, ifluid_ni, ifluid_ni+".all");
477 #else
478  write_data_files( t, ifluid_prefix, ifluid_all+".all");
479 #endif
480  write_control_file( t, "ifluid*", surf_window.c_str());
481 
482  // Write out volume window
483  write_data_files( t, fluid, (vol_window+".all").c_str());
484  write_control_file( t, fluid, vol_window.c_str());
485 
486  // Write out Plag window
487  if ( with_plag) {
488  write_data_files( t, fluid_plag, (plag_window+".all").c_str());
490  }
491 
492  if (post_hdf_handle != -1)
494 
495 }
string plag_window
Definition: FluidAgent.h:53
bool with_plag
Definition: FluidAgent.h:52
std::string ifluid_all
Definition: FluidAgent.h:69
void write_data_files(double t, const std::string base, const std::string attr, const char *ref=NULL)
Definition: Agent.C:631
std::string ifluid_b
Definition: FluidAgent.h:73
std::string fluid
Definition: FluidAgent.h:61
std::string vol_window
Definition: Agent.h:148
int post_hdf_handle
Definition: Agent.h:132
std::string surf_window
Definition: Agent.h:148
int pre_hdf_handle
Definition: Agent.h:132
std::string fluid_plag
Definition: FluidAgent.h:62
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
void write_control_file(double t, const std::string base, const std::string window)
Definition: Agent.C:657
std::string ifluid_ni
Definition: FluidAgent.h:75
std::string ifluid_nb
Definition: FluidAgent.h:74

Here is the call graph for this function:

Here is the caller graph for this function:

void output_visualization_files ( double  t)
virtual

Implements Agent.

Definition at line 507 of file FluidAgent.C.

507  {
508  // TODO: Define visualization sub-windows
509 }
void read_restart_data ( )
virtual

Reimplemented from Agent.

Definition at line 448 of file FluidAgent.C.

References COM_call_function(), COM_clone_attribute(), COM_get_attribute_handle(), COM_get_attribute_handle_const(), fluidSurfIn, ifluid_i, Agent::obtain_attr_handle, and propBufAll.

Referenced by create_buffer_all().

449 {
450  // Obtain data for fluidBuf
451  int atts_hdl = COM_get_attribute_handle_const(fluidSurfIn+".atts");
452  int buf_hdl = COM_get_attribute_handle( ifluid_i+".atts");
453  COM_call_function( obtain_attr_handle, &atts_hdl, &buf_hdl);
454 
455  // Obtain data for propBufAll
456  int propBufAll_hdl = COM_get_attribute_handle( propBufAll+".atts");
457  COM_call_function( obtain_attr_handle, &atts_hdl, &propBufAll_hdl);
458 
459  // Obtain pconn for surface propagation
460  int pconn_hdl_const = COM_get_attribute_handle_const( fluidSurfIn+".pconn");
461  int pconn_hdl = COM_get_attribute_handle( fluidSurfIn+".pconn");
462  COM_call_function( obtain_attr_handle, &pconn_hdl_const, &pconn_hdl);
464 }
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
std::string propBufAll
Definition: FluidAgent.h:77
std::string ifluid_i
Definition: FluidAgent.h:70
void COM_clone_attribute(const char *wname, const char *attr, int wg=1, const char *ptnname=0, int val=0)
Clone the subset of panes of another window of which the given pane attribute has value val...
Definition: roccom_c++.h:234
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
int COM_get_attribute_handle_const(const char *waname)
Definition: roccom_c++.h:420
std::string fluidSurfIn
Definition: FluidAgent.h:64
static int obtain_attr_handle
Definition: Agent.h:125

Here is the call graph for this function:

Here is the caller graph for this function:

void unload_module ( )
virtual

Reimplemented from Agent.

Definition at line 106 of file FluidAgent.C.

References COM_close_module(), COM_F_FUNC2, COM_unload_module(), Agent::get_coupling(), Coupling::in_restart(), MAN_DEBUG, Agent::mod_instance, rocflo_unload_module(), rocflu_unload_module(), and Agent::rocmod_name.

107 {
108  MAN_DEBUG(3, ("Rocstar: FluidAgent::unload_module %s.\n", rocmod_name.c_str()));
109 #ifdef STATIC_LINK
110 # ifdef RFLO
111  if (rocmod_name == "Rocflo")
112  COM_F_FUNC2( rocflo_unload_module, ROCFLO_UNLOAD_MODULE)( mod_instance.c_str(), mod_instance.length());
113 # else
114 # ifdef RFLU
115  if (rocmod_name == "Rocflu")
116  COM_F_FUNC2( rocflu_unload_module, ROCFLU_UNLOAD_MODULE)( mod_instance.c_str(), mod_instance.length());
117 # endif
118 # endif
119 #else
120  // in restarting, close_module does not dlclose the shared lib
121  if (get_coupling()->in_restart())
122  COM_close_module(rocmod_name.c_str(), mod_instance.c_str());
123  else
124  COM_unload_module(rocmod_name.c_str(), mod_instance.c_str());
125 #endif
126 }
string rocmod_name
Definition: Agent.h:141
int in_restart() const
Definition: Coupling.h:164
#define COM_F_FUNC2(lowcase, uppercase)
Definition: roccom_basic.h:87
subroutine rocflu_unload_module(winName)
subroutine rocflo_unload_module(winName)
Coupling * get_coupling()
Definition: Agent.h:213
void COM_close_module(const char *libname, const char *winname=NULL)
Definition: roccom_c++.h:81
void COM_unload_module(const char *libname, const char *winname=NULL)
Definition: roccom_c++.h:78
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
string mod_instance
Definition: Agent.h:141

Here is the call graph for this function:

Member Data Documentation

int f_mdot_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

int f_mdot_pre_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

int f_ts_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

int f_ts_pre_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

int f_vm_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

int f_vm_pre_hdl

Definition at line 90 of file FluidAgent.h.

Referenced by check_convergence(), create_buffer_all(), and init_convergence().

std::string fluid

Definition at line 61 of file FluidAgent.h.

Referenced by FluidAgent(), input(), and output_restart_files().

std::string fluid_plag

Definition at line 62 of file FluidAgent.h.

Referenced by FluidAgent(), input(), and output_restart_files().

std::string fluidBufBak

Definition at line 84 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().

std::string fluidBufNB

Definition at line 81 of file FluidAgent.h.

Referenced by create_buffer_all(), declare_fluid_actions(), and FluidAgent().

std::string fluidBufPC

Definition at line 83 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().

std::string fluidBufPRE

Definition at line 85 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().

std::string fluidPlagBak

Definition at line 88 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().

std::string fluidPlagIn

Definition at line 66 of file FluidAgent.h.

Referenced by FluidAgent(), init_module(), and input().

std::string fluidSurfIn

Definition at line 64 of file FluidAgent.h.

Referenced by FluidAgent(), init_module(), input(), and read_restart_data().

std::string fluidVolBak

Definition at line 87 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().

std::string fluidVolIn

Definition at line 65 of file FluidAgent.h.

Referenced by FluidAgent(), init_module(), and input().

std::string fluidVPIn

Definition at line 67 of file FluidAgent.h.

Referenced by FluidAgent(), and init_module().

std::string ifluid

Definition at line 60 of file FluidAgent.h.

Referenced by FluidAgent(), and input().

std::string ifluid_all

Definition at line 69 of file FluidAgent.h.

Referenced by finalize(), FluidAgent(), and output_restart_files().

std::string ifluid_b

Definition at line 73 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), FluidAgent(), and output_restart_files().

std::string ifluid_nb

Definition at line 74 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), FluidAgent(), and output_restart_files().

std::string ifluid_ni

Definition at line 75 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), FluidAgent(), and output_restart_files().

int nc_hdl

Definition at line 92 of file FluidAgent.h.

Referenced by create_buffer_all(), and FullyCoupling::update_distances().

int nc_tmp_hdl

Definition at line 92 of file FluidAgent.h.

Referenced by create_buffer_all(), and FullyCoupling::update_distances().

string plag_window
protected

Definition at line 53 of file FluidAgent.h.

Referenced by create_buffer_all(), init_module(), and output_restart_files().

std::string propBuf
int sq_dist_hdl

Definition at line 92 of file FluidAgent.h.

Referenced by create_buffer_all(), and FullyCoupling::update_distances().

bool with_plag
protected

Definition at line 52 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), init_module(), and output_restart_files().

int with_solid
protected

Definition at line 54 of file FluidAgent.h.

Referenced by create_buffer_all(), finalize(), and FluidAgent().


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