30 #include "../Rocsurf/test/IM_Reader.h"
39 void read_file(
const char *fname,
const string &wname,
double alpha) {
40 char *lastdot=strrchr( const_cast<char *>(fname),
'.');
50 if ( strcmp( lastdot,
".hdf")==0)
56 MPI_Comm comm_null = MPI_COMM_NULL;
57 std::string bufwin(
"bufwin");
58 std::cout <<
"Reading file " << fname <<
"..." << std::endl;
60 std::cout <<
"Done reading file " << fname <<
"." << std::endl;
72 std::cout <<
"Obtained window " << wname
73 <<
" from file " << fname << std::endl;
80 int main(
int argc,
char *argv[]) {
84 std::cerr <<
"Usage: " << argv[0]
85 <<
" <HDF|RocinControlFile1> <HDF|RocinControlFile2> [<out_prefix>] [<RocfaceControlFile>]\n\n"
86 <<
"\t<HDF|RocinControl File1> specifies the files for the first window\n"
87 <<
"\t<HDF|RocinControl File2> specifies the files for the second window\n"
88 <<
"\t<out_prefix> specifies a prefix for output files. \n\t\tDefault is the current directory\n"
89 <<
"\t<RocfaceControlFile> specifies a file name for Rocface control parameters. \n"
91 << argv[0] <<
" \"ifluid*.hdf\" \"isolid*.hdf\" " <<
"\n\t\t"
92 << argv[0] <<
" Rocflo/Rocin/\"ifluid*.txt\" Rocfrac/Rocin/\"isolid*.txt\" Rocman/RocfloRocfrac/" <<
"\n\t\t"
99 string fnames[2] = {string(argv[1]), string(argv[2])};
100 string pre = (argc>3)?argv[3]:
"";
102 if ( !pre.empty() && pre[pre.size()-1] !=
'/') pre.append(
"/");
111 std::cout <<
"Reading Rocface control file..." << std::endl;
113 std::cout <<
"Finished reading Rocface control file." << std::endl;
117 for (
int k=0;
k<2; ++
k) {
119 string::size_type n0 = fnames[
k].find_last_of(
"/");
122 if ( n0 == std::string::npos) fname=fnames[
k];
123 else fname = fnames[
k].substr( n0+1, fnames[
k].size());
125 string::size_type
ni;
126 ni = fname.find_first_of(
".:_-*[]?\\\"\'0123456789");
129 if ( ni == std::string::npos) {
131 fnames[
k].append(
".hdf");
134 if ( fname[ni] ==
'_' && (fname[ni+1] ==
's' || fname[ni+1] ==
'f'))
136 wnames[
k] = pre+fname.substr( 0, ni);
139 "Two input files must have different alphabetic prefix");
149 const char *format =
"HDF";
151 std::cout <<
"Starting mesh overlay..." << std::endl;
154 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.
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_init(int *argc, char ***argv)
void int int REAL REAL REAL *z blockDim dim * ni
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)