22 int main(
int argc,
char** argv )
26 std::cout <<
"Usage: " << argv[0] <<
" <filename>" << std::endl;
33 const char* tag_geom =
"GEOM_DIMENSION";
34 const char* tag_gid =
"GLOBAL_ID";
36 std::vector< EntityHandle > ents;
57 for( set_it = sets.
begin(); set_it != sets.
end(); ++set_it )
72 double total_area = 0.0;
88 std::cout <<
"Total area of meshes in surface " << gid <<
" = " << total_area << std::endl;
102 for(
int i = 0; i < int(
entities.size() ); i++ )
104 std::vector< EntityHandle > conn;
112 for(
int j = 2; j <= int( conn.size() ); ++j )
115 EntityHandle vertices[3] = { conn[0], conn[j - 1], conn[j - 2] };
119 rval =
mb->
get_coords( vertices, 3, coords[0].array() );
122 CartVect edge0 = coords[1] - coords[0];
123 CartVect edge1 = coords[2] - coords[0];
126 area += ( edge0 * edge1 ).
length() / 2.0;