11 for(
int i = 0;
i < number_of_points*3;
i++)
13 if(std::fabs(coords[
i]) < tol && (coords[i] != 0.0)){
14 std::cout <<
"WRLSURF2HDF> WARNING: node " << (i/3)+1 <<
"/"
15 << number_of_points <<
" "
16 << (((i%3)==0 ?
"x " : ((i%3) < 2) ?
"y " :
"z "))
17 <<
"coordinate = " << coords[i] << std::endl;
24 main(
int argc,
char *argv[])
28 std::getline(std::cin,line);
29 std::string::size_type
x = 0;
31 std::vector<double> coords;
33 x = line.find(
"point [");
34 while(x == std::string::npos && !std::cin.eof()){
35 std::getline(std::cin,line);
36 x = line.find(
"point [");
39 std::cerr <<
"File error 1." << std::endl;
42 std::getline(std::cin,line);
44 unsigned int count = 1;
45 while(x == std::string::npos && !std::cin.eof()){
46 std::istringstream Istr(line);
48 Istr >> xc >> yc >> zc;
53 std::getline(std::cin,line);
57 std::cerr <<
"File error 2." << std::endl;
60 unsigned int number_of_nodes = coords.size()/3;
62 nc.
init(number_of_nodes,&(coords[0]));
63 getline(std::cin,line);
64 x = line.find(
"coordIndex [");
65 while(x == std::string::npos && !std::cin.eof()){
66 getline(std::cin,line);
67 x = line.find(
"coordIndex [");
70 std::cerr <<
"File error 3." << std::endl;
74 std::vector<Mesh::IndexType> element(3);
75 std::getline(std::cin,line);
77 while(x == std::string::npos && !std::cin.eof()){
78 std::istringstream Istr(line);
81 Istr >> element[0] >> delim >> element[1] >> delim >> element[2] >> delim >> dummy;
86 std::getline(std::cin,line);
90 std::cerr <<
"File error 4." << std::endl;
94 unsigned int nvert = nc.
Size();
95 unsigned int ntri = ec.
Nelem();
96 std::cout <<
"Number of vertices: " << nvert << std::endl
97 <<
"Number of triangles: " << ntri << std::endl;
void AddElement(const std::vector< IndexType > &elem)
General connectivity object.
This file contains the prototypes for Roccom API.
void CheckCoordinates(double *coords, int number_of_points, double tol)
bool TRAIL_WriteWindow(const std::string &wname, const std::string &path, const std::string &twin, const std::string &tpath, double t, unsigned int id, MPI_Comm comm, std::ostream *=NULL)
int TRAIL_SurfaceMesh2Window(const std::string &wname, int pane_id, Mesh::NodalCoordinates &, Mesh::Connectivity &)
Creates a window from a Mesh object. (copies data)
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)