39 void read_file(
const char *fname,
const string &wname,
double alpha) {
40 char *lastdot=strrchr( const_cast<char *>(fname),
'.');
43 std::cout <<
"Reading file " << fname <<
"..." << std::endl;
50 bool processed =
false;
51 if(!(lastdot == NULL)){
52 if ( strcmp( lastdot,
".hdf")==0){
62 MPI_Comm comm_null = MPI_COMM_NULL;
63 std::string bufwin(
"bufwin");
87 int npanes, *pane_ids;
91 for (
int i=0;
i<npanes; ++
i) {
95 if ( flag==NULL || *flag>1) {
108 std::cout <<
"Applying total displacements..." << std::endl;
126 std::cout <<
"Obtained window " << wname
127 <<
" from file " << fname << std::endl;
134 int main(
int argc,
char *argv[]) {
138 std::cerr <<
"Usage: " << argv[0]
139 <<
" <HDF|RocinControlFile1> <HDF|RocinControlFile2> [<out_prefix>] [<RocfaceControlFile>]\n\n"
140 <<
"\t<HDF|RocinControl File1> specifies the files for the first window\n"
141 <<
"\t<HDF|RocinControl File2> specifies the files for the second window\n"
142 <<
"\t<out_prefix> specifies a prefix for output files. \n\t\tDefault is the current directory\n"
143 <<
"\t<RocfaceControlFile> specifies a file name for Rocface control parameters. \n"
145 << argv[0] <<
" \"ifluid*.hdf\" \"isolid*.hdf\" " <<
"\n\t\t"
146 << argv[0] <<
" Rocflo/Rocin/\"ifluid*.txt\" Rocfrac/Rocin/\"isolid*.txt\" Rocman/RocfloRocfrac/" <<
"\n\t\t"
153 string fnames[2] = {string(argv[1]), string(argv[2])};
154 string pre = (argc>3)?argv[3]:
"";
156 if ( !pre.empty() && pre[pre.size()-1] !=
'/') pre.append(
"/");
165 std::cout <<
"Reading Rocface control file..." << std::endl;
167 std::cout <<
"Finished reading Rocface control file." << std::endl;
171 for (
int k=0;
k<2; ++
k) {
173 string::size_type n0 = fnames[
k].find_last_of(
"/");
176 if ( n0 == std::string::npos) fname=fnames[
k];
177 else fname = fnames[
k].substr( n0+1, fnames[
k].size());
179 string::size_type
ni;
180 ni = fname.find_first_of(
".:_-*[]?\\\"\'0123456789");
183 if ( ni == std::string::npos) {
185 fnames[
k].append(
".hdf");
188 if ( fname[ni] ==
'_' && (fname[ni+1] ==
's' || fname[ni+1] ==
'f'))
190 wnames[
k] = pre+fname.substr( 0, ni);
193 "Two input files must have different alphabetic prefix");
204 const char *format =
"CGNS";
206 std::cout <<
"Starting mesh overlay..." << std::endl;
209 wnames[0].c_str(), wnames[1].c_str(), format);
void COM_delete_window(const char *wname)
void read_file(const char *fname, const string &wname, double alpha)
#define COM_assertion_msg(EX, msg)
This file contains the prototypes for Roccom API.
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)
void COM_delete_attribute(const char *wa_str)
Delete an existing attribute.
#define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
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_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...
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
void COM_delete_pane(const char *str, int pid)
void COM_init(int *argc, char ***argv)
void int int REAL REAL REAL *z blockDim dim * ni
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)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)