37 int main(
int argc,
char *argv[]) {
41 std::cout <<
"Add pane connectivity to a given mesh." << std::endl;
42 std::cout <<
"Usage:\n\tTo run in serial: " << argv[0]
43 <<
" <input filename patterns or Rocin control file> <output file prefix> " << endl;
44 std::cout <<
"\n\tTo run in parallel: <mpirun-command> " << argv[0]
45 <<
" -com-mpi <Rocin control file> <output file prefix> " << endl;
46 std::cout <<
"If the second argument does not end with .hdf, then each pane is written into a separate file." << std::endl;
50 std::cout <<
"Reading mesh file \"" << argv[1] <<
'"' << endl;
52 std::string fname(argv[1]), wname;
53 string::size_type n0 = fname.find_last_of(
"/");
55 if ( n0 != std::string::npos)
56 fname = fname.substr( n0+1, fname.size());
59 ni = fname.find_first_of(
".:-*[]?\\\"\'0123456789");
62 if ( ni == std::string::npos) {
66 while (fname[ni-1]==
'_') --
ni;
67 wname = fname.substr( 0, ni);
70 std::cout <<
"Creating window \"" << wname <<
'"' << endl;
74 std::cout <<
"Reading window " << endl;
76 const char *lastdot=std::strrchr( argv[1],
'.');
78 if ( lastdot && std::strcmp( lastdot,
".txt")==0)
87 std::cout <<
"Obtaining the mesh " << endl;
91 std::cout <<
"Resizing the array " << endl;
94 std::cout <<
"deleting the attribute" << endl;
101 std::cout <<
"finishing up window initialization" << endl;
104 std::cout <<
"Computing connectivity map... " << endl;
109 const string pconn = wname+
".pconn";
113 std::cout <<
"Output window into file..." << endl;
115 std::cout <<
"loading Rocout" << endl;
128 (
char*)wname.c_str(),
"000");
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
#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.
void COM_window_init_done(const char *w_str, int pane_changed=true)
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
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
#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)
#define COM_EXTERN_MODULE(moduleName)