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

#include <basic_actions.h>

Inheritance diagram for SurfDiver:
Collaboration diagram for SurfDiver:

Public Member Functions

 SurfDiver (FluidAgent *fag, SolidAgent *sag)
 
void init (double t)
 
virtual void run (double t, double dt, double alpha)
 
- Public Member Functions inherited from Action
 Action (void *p=0, char *name=NULL)
 
 Action (int n, const char *at[], int *i=NULL, void *p=0, char *name=NULL)
 
 Action (int n, const std::string at[], int *i=NULL, void *p=0, char *name=NULL)
 
virtual ~Action ()
 
virtual void declare (Scheduler &)
 
virtual void finalize ()
 
virtual char * name ()
 
void set_name (const char *name)
 
virtual void print (FILE *f)
 
virtual void print_toposort (FILE *f)
 
virtual void schedule ()
 

Protected Attributes

FluidAgentfagent
 
SolidAgentsagent
 
std::string outdir
 
std::string fluid_mesh_str
 
std::string solid_mesh_str
 
int fluid_mesh
 
int solid_mesh
 
int RFC_transfer
 
int RFC_interpolate
 
int RFC_readcntr
 
int RFC_overlay
 
int RFC_write
 
int RFC_read
 
- Protected Attributes inherited from Action
char * action_name
 
char ** attr
 
int * idx
 
int count
 
void * usr_ptr
 
std::vector< int > inout
 

Additional Inherited Members

- Protected Types inherited from Action
enum  { IN =1, OUT =2, INOUT =3 }
 
- Protected Member Functions inherited from Action
int get_attribute_handle (int i)
 
int get_attribute_handle_const (int i)
 
int get_attribute_handle (const std::string str)
 
void set_attr (int n, const std::string at[], int *id=NULL)
 
void set_attr (int n, const char *at[], int *id=NULL)
 
void set_io (int n, const int *io)
 
void set_io (const char *io)
 
int get_io (int i)
 

Detailed Description

Definition at line 107 of file basic_actions.h.

Constructor & Destructor Documentation

SurfDiver ( FluidAgent fag,
SolidAgent sag 
)

Definition at line 104 of file Surfdiver.C.

References fagent, Agent::get_rocmod_name(), outdir, and sagent.

104  :
105  Action( 0, (const char**)NULL, NULL, NULL, (char *)"SurfDiver"),
106  fagent(fag), sagent(sag)
107 {
108  outdir = "Rocman/"+fagent->get_rocmod_name()+sagent->get_rocmod_name()+"/";
109 }
FluidAgent * fagent
SolidAgent * sagent
std::string outdir
std::string get_rocmod_name() const
Definition: Agent.h:221
Action(void *p=0, char *name=NULL)
Definition: Action.C:32

Here is the call graph for this function:

Member Function Documentation

void init ( double  t)
virtual

Reimplemented from Action.

Definition at line 111 of file Surfdiver.C.

References _load_rocface(), COM_get_attribute_handle_const(), COM_get_function_handle(), fagent, fluid_mesh, fluid_mesh_str, FluidAgent::fluidBufNG, Agent::get_coupling(), Coupling::get_rocmancontrol_param(), Agent::get_rocmod_name(), RFC_interpolate, RFC_overlay, RFC_read, RFC_readcntr, RFC_transfer, RFC_write, sagent, solid_mesh, solid_mesh_str, and SolidAgent::solidBuf.

112 {
115 
118 
120  RFC_readcntr = COM_get_function_handle( "RFC.read_control_file");
121  RFC_overlay = COM_get_function_handle( "RFC.overlay");
122  RFC_write = COM_get_function_handle( "RFC.write_overlay");
123  RFC_transfer = COM_get_function_handle("RFC.least_squares_transfer");
124  RFC_interpolate = COM_get_function_handle("RFC.interpolate");
125  RFC_read = COM_get_function_handle( "RFC.read_overlay");
126 }
FluidAgent * fagent
int RFC_interpolate
std::string solid_mesh_str
int RFC_transfer
SolidAgent * sagent
Coupling * get_coupling()
Definition: Agent.h:213
std::string fluidBufNG
Definition: FluidAgent.h:78
std::string get_rocmod_name() const
Definition: Agent.h:221
std::string solidBuf
Definition: SolidAgent.h:68
void _load_rocface(FluidAgent *fagent, SolidAgent *sagent, const RocmanControl_parameters *param)
std::string fluid_mesh_str
int COM_get_attribute_handle_const(const char *waname)
Definition: roccom_c++.h:420
int RFC_readcntr
const RocmanControl_parameters * get_rocmancontrol_param()
Definition: Coupling.h:184
int COM_get_function_handle(const char *wfname)
Definition: roccom_c++.h:428

Here is the call graph for this function:

void run ( double  t,
double  dt,
double  alpha 
)
virtual

Reimplemented from Action.

Reimplemented in SurfDiverAfterRemeshing.

Definition at line 128 of file Surfdiver.C.

References COM_call_function(), COM_get_attribute_handle(), COM_get_default_communicator(), COM_set_default_communicator(), COM_set_profiling(), COM_window_init_done(), fagent, fluid_mesh, Agent::get_comm_rank(), Agent::get_communicator(), Agent::get_rocmod_name(), Agent::get_time_string(), MAN_DEBUG, outdir, FluidAgent::output_restart_files(), SolidAgent::output_restart_files(), read_file(), RFC_overlay, RFC_read, RFC_write, sagent, and solid_mesh.

128  {
129  MAN_DEBUG(1, ("[%d] Rocstar: SurfDiver::run() with t:%e dt:%e.\n", fagent->get_comm_rank(), t, dt));
130 
131  MPI_Comm comm = fagent->get_communicator();
132 
133  // dump meshes
134  MAN_DEBUG(1, ("[%d] Rocstar: SurfDiver::run() dumping output files for time %e.\n", fagent->get_comm_rank(), t));
137 
138  MPI_Barrier(comm);
139 
140  // run sequentially
141  if (fagent->get_comm_rank() == 0) {
142 
143  MPI_Comm oldcomm = COM_get_default_communicator();
144  COM_set_default_communicator( MPI_COMM_NULL);
145  // need to turn off profiling as it may hang for npes > 1
147 
148  // read meshes
149 
150  std::string time_str;
151  fagent->get_time_string(t, time_str);
152  std::string fluid_file = fagent->get_rocmod_name()+"/Rocout/ifluid_in_"+time_str+".txt";
153  std::string solid_file = sagent->get_rocmod_name()+"/Rocout/isolid_in_"+time_str+".txt";
154 
155  std::string fluid_wname = outdir+"ifluid";
156  std::string solid_wname = outdir+"isolid";
157 
158  read_file( fluid_file.c_str(), fluid_wname.c_str(), 1.);
159  COM_window_init_done( fluid_wname);
160 
161  read_file( solid_file.c_str(), solid_wname.c_str(), 1.);
162  COM_window_init_done( solid_wname);
163 
164  int fluid_mesh1 = COM_get_attribute_handle( (fluid_wname+".mesh").c_str());
165  int solid_mesh1 = COM_get_attribute_handle( (solid_wname+".mesh").c_str());
166 
167  const char *format = "HDF";
168 
169  // mesh overlay
170  MAN_DEBUG(2,("Starting mesh overlay..."));
171  COM_call_function( RFC_overlay, &fluid_mesh1, &solid_mesh1);
172 
173  // output overlay mesh
174  COM_call_function( RFC_write, &fluid_mesh1, &solid_mesh1,
175  fluid_wname.c_str(), solid_wname.c_str(), format);
176 
179  } // end of PE 0
180 
181  MPI_Barrier(comm);
182 
183  // reload overlay
184  std::string fluid_dir = outdir+"ifluid";
185  std::string solid_dir = outdir+"isolid";
186 
187  MAN_DEBUG(2,("Reload partitioned mesh overlay... "));
188  COM_call_function( RFC_read, &fluid_mesh, &solid_mesh, &comm, fluid_dir.c_str(), solid_dir.c_str(), "HDF");
189 }
FluidAgent * fagent
virtual void output_restart_files(double t)
Definition: SolidAgent.C:362
virtual void output_restart_files(double t)
Definition: FluidAgent.C:466
void read_file(const char *fname, const string &wname, double alpha)
Definition: autosurfer.C:39
void COM_set_default_communicator(MPI_Comm comm)
Definition: roccom_c++.h:67
SolidAgent * sagent
int COM_get_attribute_handle(const char *waname)
Definition: roccom_c++.h:412
void get_time_string(double t, std::string &s)
Definition: Agent.C:578
std::string outdir
std::string get_rocmod_name() const
Definition: Agent.h:221
void COM_window_init_done(const char *w_str, int pane_changed=true)
Definition: roccom_c++.h:102
void COM_set_profiling(int i)
Definition: roccom_c++.h:550
void COM_call_function(const int wf, int argc,...)
Definition: roccom_c.C:48
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
int get_comm_rank() const
Definition: Agent.h:224
MPI_Comm get_communicator() const
Definition: Agent.h:220
MPI_Comm COM_get_default_communicator()
Definition: roccom_c++.h:69

Here is the call graph for this function:

Member Data Documentation

FluidAgent* fagent
protected

Definition at line 114 of file basic_actions.h.

Referenced by init(), run(), SurfDiverAfterRemeshing::run(), and SurfDiver().

int fluid_mesh
protected

Definition at line 118 of file basic_actions.h.

Referenced by init(), and run().

std::string fluid_mesh_str
protected

Definition at line 117 of file basic_actions.h.

Referenced by init().

std::string outdir
protected

Definition at line 116 of file basic_actions.h.

Referenced by run(), and SurfDiver().

int RFC_interpolate
protected

Definition at line 119 of file basic_actions.h.

Referenced by init().

int RFC_overlay
protected

Definition at line 119 of file basic_actions.h.

Referenced by init(), and run().

int RFC_read
protected

Definition at line 120 of file basic_actions.h.

Referenced by init(), and run().

int RFC_readcntr
protected

Definition at line 119 of file basic_actions.h.

Referenced by init().

int RFC_transfer
protected

Definition at line 119 of file basic_actions.h.

Referenced by init().

int RFC_write
protected

Definition at line 120 of file basic_actions.h.

Referenced by init(), and run().

SolidAgent* sagent
protected

Definition at line 115 of file basic_actions.h.

Referenced by init(), run(), SurfDiverAfterRemeshing::run(), and SurfDiver().

int solid_mesh
protected

Definition at line 118 of file basic_actions.h.

Referenced by init(), and run().

std::string solid_mesh_str
protected

Definition at line 117 of file basic_actions.h.

Referenced by init().


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