21 #define PrintInfo false
48 int main(
int argc,
char* argv[] )
53 std::cerr <<
"Usage: " << argv[0] <<
" <inputfile> <outputfile> <tolerance>" << std::endl;
60 std::cerr <<
"Invalid Parallel Output File" << std::endl;
66 if( !( std::istringstream( argv[3] ) >> epsilon ) )
68 std::cerr <<
"Unable to parse tolerance" << std::endl;
74 MPI_Init( &argc, &argv );
82 std::ifstream file( argv[1] );
90 getline( file, line );
91 if( myID == count && line !=
"" )
94 rval =
mb->load_mesh( line.c_str() );
97 std::cerr <<
"Error Opening Mesh File " << line << std::endl;
103 count = ( count + 1 ) % numprocs;
109 std::cerr <<
"Error Opening Input File " << argv[1] << std::endl;
122 std::cerr <<
"Merge Failed" << std::endl;
130 rval =
mb->write_file(
outfile.c_str(), 0,
"PARALLEL=WRITE_PART" );
133 std::cerr <<
"Writing output file failed. Code:";
135 std::cerr <<
mb->get_error_string( rval ) << std::endl;
136 std::string foo =
"";
137 mb->get_last_error( foo );
138 std::cerr <<
"File Error: " << foo << std::endl;
158 int o_ct = 0, no_ct = 0, tmp = 0, o_tot = 0, no_tot = 0;
161 if( myID == 0 ) std::cout <<
"------------------------------------------" << std::endl;
163 mb->get_entities_by_dimension( 0, 0, ents );
172 MPI_Reduce( &o_ct, &o_tot, 1, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD );
175 std::cout <<
"There are " << o_tot <<
" vertices." << std::endl;
176 std::cout <<
"------------------------------------------" << std::endl;
187 mb->get_entities_by_dimension( 0, 3, ents );
201 MPI_Reduce( &o_ct, &o_tot, 1, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD );
202 MPI_Reduce( &no_ct, &no_tot, 1, MPI_INT, MPI_SUM, 0,
MPI_COMM_WORLD );
205 std::cout <<
"There are " << o_tot <<
" owned skin faces." << std::endl;
206 std::cout <<
"There are " << no_tot <<
" not owned skin faces." << std::endl;
207 std::cout <<
"The difference (Global Skin Faces) is " << ( o_tot - no_tot ) <<
"." << std::endl;
208 std::cout <<
"------------------------------------------" << std::endl;