85 MPI_Init(&argc,&argv);
91 std::cerr <<
"Usage: " << argv[0]
92 <<
" <src Rocin control> <targ Rocin control> [<out_prefix>] [<RocfaceControlFile>]\n\n"
93 <<
"\t<src Rocin control> specifies the Rocin control file for the old window\n"
94 <<
"\t<targ Rocin control> specifies the Rocin control file for the new window\n"
95 <<
"\t<out_prefix> specifies a prefix for output files. \n\t\tDefault is the current directory\n"
96 <<
"\t<RocfaceControlFile> specifies a file name for Rocface control parameters. \n"
98 << argv[0] <<
" Rocflo/Rocin/\"ifluid*.txt\" Rocfrac/Rocin/\"isolid*.txt\" Rocman/RocfloRocfrac/" <<
"\n\t\t"
107 fnames[0]=(string(argv[1]));
108 fnames[1]=(string(argv[2]));
109 fnames[2]=(string(argv[2]));
110 string pre = (argc>3)?argv[3]:
"";
112 if ( !pre.empty() && pre[pre.size()-1] !=
'/') pre.append(
"/");
122 std::cout <<
"Reading Rocface control file..." << std::endl;
125 std::cout <<
"Finished reading Rocface control file." << std::endl;
129 for (
int k=0;
k<3; ++
k) {
131 string::size_type n0 = fnames[
k].find_last_of(
"/");
134 if ( n0 == std::string::npos) fname=fnames[
k];
135 else fname = fnames[
k].substr( n0+1, fnames[
k].size());
137 string::size_type
ni;
138 ni = fname.find_first_of(
".:_-*[]?\\\"\'0123456789");
141 if ( ni == std::string::npos) {
143 fnames[
k].append(
".hdf");
146 if ( fname[ni] ==
'_' && (fname[ni+1] ==
's' || fname[ni+1] ==
'f'))
148 wnames[
k] = pre+fname.substr( 0, ni);
151 "Two input files must have different alphabetic prefix");
154 wnames[2] =
"new_surf";
158 string srcwin(wnames[0]);
159 string trgwin(wnames[1]);
160 string r_trgwin(wnames[2]);
163 std::vector<int> pane_id;
166 std::cout <<
"Reading mesh overlay..." << std::endl;
177 istringstream Istr(names);
178 for(
int i = 0;
i < num_attributes;
i++){
182 if((loc ==
'e' || loc ==
'n') && comtype ==
COM_DOUBLE){
184 cout <<
"Transferring attribute: " << aname <<
" on "
185 << (loc ==
'e' ?
"elements" :
"nodes") <<
"." << endl;
199 pane_id.resize(npanes);
200 for(
int i = 0;
i < npanes;
i++)
201 pane_id[
i] = srcpane_ids[
i];
205 for(
int p = 0;p < npanes;p++){
206 void *src_ptr = NULL;
209 void *trg_ptr = NULL;
212 COM_get_array((trgwin+
"."+aname).c_str(),pane_id[p],&src_ptr,&src_std,&src_cap);
214 COM_get_array((r_trgwin+
"."+aname).c_str(),pane_id[p],&trg_ptr,&trg_std,&trg_cap);
216 if(src_ptr && trg_ptr && (trg_std*trg_cap*src_std*src_cap >=0))
217 memcpy(trg_ptr,src_ptr,
sizeof(
double)*src_std*src_cap);
224 std::string rankstr(
"0");
226 std::ostringstream Ostr;
227 Ostr <<
"new_surf_" << setw(5) << setfill(
'0') << rank+1;
232 string controlfilename(Ostr.str() +
"_in.txt");
233 Ouf.open(controlfilename.c_str());
234 Ouf <<
"@Proc: " << rank << endl
235 <<
"@Files: " <<
"new_surf_" << setw(5)
236 << setfill(
'0') << rank+1 <<
".hdf" << endl;
239 std::vector<int>::iterator pii = pane_id.begin();
240 while(pii != pane_id.end())
241 Ouf << *pii++ <<
" ";
int COM_Type
Indices for derived data types.
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
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
void read_file(const char *fname, const string &wname, double alpha)
#define COM_assertion_msg(EX, msg)
void COM_get_array(const char *wa_str, int pane_id, void **addr, int *strd, int *cap)
Get the address for an attribute on a specific pane.
int COM_get_attribute_handle(const char *waname)
#define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
void COM_get_attributes(const char *wname, int *na, std::string &names)
void COM_print_profile(const char *fname, const char *header)
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
void COM_init(int *argc, char ***argv)
void int int REAL REAL REAL *z blockDim dim * ni
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
void COM_free_buffer(int **buf)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
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.
int COM_get_function_handle(const char *wfname)