Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
transfer_actions.C File Reference
#include "basic_actions.h"
#include "transfer_actions.h"
#include "FluidAgent.h"
#include "SolidAgent.h"
#include "BurnAgent.h"
Include dependency graph for transfer_actions.C:

Go to the source code of this file.

Functions

 COM_EXTERN_MODULE (Rocsurf)
 
 COM_EXTERN_MODULE (Rocface)
 
static void load_rocsurf ()
 
void compute_overlay (FluidAgent *fagent, SolidAgent *sagent, double t)
 
void _load_rocface (FluidAgent *fagent, SolidAgent *sagent, const RocmanControl_parameters *param)
 

Function Documentation

void _load_rocface ( FluidAgent fagent,
SolidAgent sagent,
const RocmanControl_parameters param 
)

Definition at line 43 of file transfer_actions.C.

References COM_call_function(), COM_get_attribute_handle_const(), COM_get_function_handle(), COM_get_window_handle(), COM_LOAD_MODULE_STATIC_DYNAMIC, COM_set_profiling_barrier(), compute_overlay(), Control_parameters::current_time, FluidAgent::fluidBufNG, Agent::get_comm_rank(), Agent::get_communicator(), Coupling::get_control_param(), Agent::get_coupling(), Agent::get_modinstance_name(), MAN_DEBUG, rank, RocmanControl_parameters::remeshed, RocmanControl_parameters::rfc_verb, and SolidAgent::solidBuf.

Referenced by SurfDiver::init(), InterMeshTransfer::load_rocface(), and FullyCoupling::reload_rocface().

44 {
45  int rank = fagent->get_comm_rank();
46 
47  // INIT_ROCFACE of rocman.f90
48  if (COM_get_window_handle( "RFC") <=0 ) {
49  if(rank == 0)
50  MAN_DEBUG(3, ("Rocstar: load module RocFace.\n"));
51  COM_LOAD_MODULE_STATIC_DYNAMIC( Rocface, "RFC");
52 
53  int RFC_setv = COM_get_function_handle( "RFC.set_verbose");
54  COM_call_function( RFC_setv, &param->rfc_verb);
55 
56 #if 0
57  // if remeshed
58  MAN_DEBUG(3, ("Rocstar: remeshed: %d.\n", param->remeshed));
59  if (param->remeshed) {
60  double t = fagent->get_coupling()->get_control_param()->current_time;
61  compute_overlay( fagent, sagent, t);
62  }
63 #endif
64 
65  // load overlay
66  MPI_Comm comm = fagent->get_communicator();
67 
68  int RFC_read = COM_get_function_handle( "RFC.read_overlay");
69  int fluid_mesh = COM_get_attribute_handle_const( fagent->fluidBufNG+".mesh");
70  int solid_mesh = COM_get_attribute_handle_const( sagent->solidBuf+".mesh");
71  std::string rfc_dir = "Rocman/"+fagent->get_modinstance_name()+sagent->get_modinstance_name()+"/";
72  //std::string rfc_dir = "Rocman/RocfloRocsolid/";
73  std::string fluid_dir = rfc_dir+"ifluid";
74  std::string solid_dir = rfc_dir+"isolid";
75 
76  if(rank == 0)
77  MAN_DEBUG(2, ("Rocstar: read RocFace overlay mesh from %s.\n", rfc_dir.c_str()));
78 
79  //COM_call_function( RFC_read, &fluid_mesh, &solid_mesh, &comm, fluid_dir.c_str(), solid_dir.c_str(), "HDF");
80  COM_call_function( RFC_read, &fluid_mesh, &solid_mesh, &comm, fluid_dir.c_str(), solid_dir.c_str(), "CGNS");
81 
82  int RFC_transfer = COM_get_function_handle("RFC.least_squares_transfer");
83  int RFC_interpolate = COM_get_function_handle("RFC.interpolate");
84  COM_set_profiling_barrier( RFC_transfer, comm);
85  COM_set_profiling_barrier( RFC_interpolate, comm);
86  }
87 }
std::string get_modinstance_name() const
Definition: Agent.h:222
Coupling * get_coupling()
Definition: Agent.h:213
std::string fluidBufNG
Definition: FluidAgent.h:78
std::string solidBuf
Definition: SolidAgent.h:68
void COM_set_profiling_barrier(int hdl, MPI_Comm comm)
Definition: roccom_c++.h:554
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
int COM_get_window_handle(const char *wname)
Definition: roccom_c++.h:404
#define MAN_DEBUG(l, x)
Definition: rocman.h:98
int get_comm_rank() const
Definition: Agent.h:224
double current_time
Definition: Coupling.h:54
void compute_overlay(FluidAgent *fagent, SolidAgent *sagent, double t)
Definition: Surfdiver.C:192
static int rank
Definition: advectest.C:66
MPI_Comm get_communicator() const
Definition: Agent.h:220
const Control_parameters * get_control_param()
Definition: Coupling.h:183
#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

Here is the call graph for this function:

Here is the caller graph for this function:

COM_EXTERN_MODULE ( Rocsurf  )
COM_EXTERN_MODULE ( Rocface  )
void compute_overlay ( FluidAgent fagent,
SolidAgent sagent,
double  t 
)

Definition at line 192 of file Surfdiver.C.

References RocBlas::add, COM_call_function(), COM_get_attribute_handle(), COM_get_default_communicator(), COM_get_function_handle(), COM_set_default_communicator(), COM_set_profiling(), COM_window_init_done(), Agent::get_comm_rank(), Agent::get_communicator(), Agent::get_rocmod_name(), Agent::get_time_string(), MAN_DEBUG, read_file(), and SolidAgent::solidBuf.

Referenced by _load_rocface(), and SurfDiverAfterRemeshing::run().

192  {
193  MAN_DEBUG(1, ("[%d] Rocstar: compute_overlay with t:%e .\n", fagent->get_comm_rank(), t));
194 
195  MPI_Comm comm = fagent->get_communicator();
196 
197  MPI_Barrier(comm);
198 
199  // run sequentially
200  if (fagent->get_comm_rank() == 0) {
201 
202  MPI_Comm oldcomm = COM_get_default_communicator();
203  COM_set_default_communicator( MPI_COMM_NULL);
204  // need to turn off profiling as it may hang for npes > 1
206 
207  // read meshes
208 
209  std::string time_str;
210  fagent->get_time_string(t, time_str);
211  std::string fluid_file = fagent->get_rocmod_name()+"/Rocout/ifluid_"+time_str+".txt";
212  std::string solid_file = sagent->get_rocmod_name()+"/Rocout/isolid_"+time_str+".txt";
213 
214  std::string outdir = "Rocman/"+fagent->get_rocmod_name()+sagent->get_rocmod_name()+"/";
215  std::string fluid_wname = outdir+"ifluid";
216  std::string solid_wname = outdir+"isolid";
217 
218  // load two meshes
219  read_file( fluid_file.c_str(), fluid_wname.c_str(), 1.);
220  COM_window_init_done( fluid_wname);
221 
222  read_file( solid_file.c_str(), solid_wname.c_str(), 1.);
223  COM_window_init_done( solid_wname);
224 
225  int fluid_mesh1 = COM_get_attribute_handle( (fluid_wname+".mesh").c_str());
226  int solid_mesh1 = COM_get_attribute_handle( (solid_wname+".mesh").c_str());
227 
228  const char *format = "HDF";
229 
230  // call Rocblas to get deformed data HERE
231  int s_x_hdl = COM_get_attribute_handle( sagent->solidBuf + ".x");
232  int s_uhat_hdl = COM_get_attribute_handle( sagent->solidBuf + ".uhat");
233  int s_y_hdl = COM_get_attribute_handle( sagent->solidBuf + ".nc");
234 
235  // get deformed
236  COM_call_function( RocBlas::add, &s_x_hdl, &s_uhat_hdl, &s_y_hdl);
237 
238  int RFC_overlay = COM_get_function_handle( "RFC.overlay");
239  int RFC_write = COM_get_function_handle( "RFC.write_overlay");
240 
241  // mesh overlay
242  MAN_DEBUG(2,("Starting mesh overlay... "));
243  COM_call_function( RFC_overlay, &fluid_mesh1, &solid_mesh1);
244 
245  // output overlay mesh
246  COM_call_function( RFC_write, &fluid_mesh1, &solid_mesh1,
247  fluid_wname.c_str(), solid_wname.c_str(), format);
248 
251  } // end of PE 0
252 
253  MPI_Barrier(comm);
254 
255 }
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
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
static int add
Definition: RocBlas.h:35
std::string get_rocmod_name() const
Definition: Agent.h:221
std::string solidBuf
Definition: SolidAgent.h:68
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
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:

static void load_rocsurf ( )
inlinestatic

Definition at line 34 of file transfer_actions.C.

References COM_get_window_handle(), and COM_LOAD_MODULE_STATIC_DYNAMIC.

Referenced by LoadTransfer_FS::init(), LoadTransfer_FSc_ALE::init(), LoadTransferOnly_FSc_ALE::init(), and GetDeformedMesh_ALE::init().

35 {
36  if (COM_get_window_handle("SURF") <= 0) {
37  COM_LOAD_MODULE_STATIC_DYNAMIC( Rocsurf, "SURF");
38  }
39 }
int COM_get_window_handle(const char *wname)
Definition: roccom_c++.h:404
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
Definition: roccom_basic.h:111

Here is the call graph for this function:

Here is the caller graph for this function: