37 #include <sys/types.h>
44 #define CG_CHECK(routine, args) \
46 int ier = routine args; \
48 cerr << "ghostbuster: " #routine " (line " << __LINE__ << " in " \
49 << __FILE__ << ") failed: " << cg_get_error() << std::endl; \
67 int main(
int argc,
char *argv[]) {
69 cout <<
"Usage: " << argv[0] <<
" <inputfile>" << endl;
76 string file_in(argv[1]);
77 string::size_type c = file_in.length();
78 if (file_in.substr(c - 5) ==
".cgns") {
80 CG_CHECK(cg_open, (file_in.c_str(), MODE_READ, &fn));
86 int B, cellDim, physDim;
88 for (B=1; B<=nBases; ++B) {
89 CG_CHECK(cg_base_read, (fn, B, baseName, &cellDim, &physDim));
90 std::string name(baseName);
92 if (c <= 7 || name.substr(c - 7) !=
"_ridges") {
94 materials += name +
' ';
97 if (!materials.empty())
98 materials.erase(materials.size() - 1);
100 cout <<
"Error: " << argv[0] <<
" only handles CGNS files at this time."
105 std::cout <<
"Found materials: " << materials << std::endl;
107 string file_out(file_in);
108 c = file_out.rfind(
'/');
109 if (c != string::npos)
110 file_out.replace(0, c + 1,
"gb_");
112 file_out.insert(0,
"gb_");
126 char time_level[33] =
"";
128 vector<string>::iterator w;
129 for (w=wins.begin(); w!=wins.end(); ++w) {
131 NULL, time_level, &
length);
This file contains the prototypes for Roccom API.
Automatically close open files, datasets, etc.
int COM_get_attribute_handle(const char *waname)
double length(Vector3D *const v, int n)
Rocout creates a series of Roccom windows by reading in a list of files.
#define COM_UNLOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
#define CG_CHECK(routine, args)
void COM_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)
Contains declaration of the base class for Roccom implementations.