18 string bd_name = string(
MESH_DIR ) + string(
"/../examples/earth/boundary_points.dat" );
19 string loops = string(
MESH_DIR ) + string(
"/../examples/earth/SaveLoopCounts" );
31 lon = atan2( p[1], p[0] );
34 return 2.0 * M_PI + lon;
42 int main(
int argc,
char** argv )
46 if( NULL ==
mb )
return 1;
59 std::vector< double > coords;
60 ifstream bdFile(
bd_name.c_str() );
63 cout << endl <<
"Failed to open file " <<
bd_name << endl;
68 while( !bdFile.eof() )
72 coords.push_back( co );
74 cout <<
" number of boundary points:" << coords.size() / 3 <<
"\n";
76 vector< int > loopsindx;
77 ifstream loopFile(
loops.c_str() );
78 while( !loopFile.eof() )
82 loopsindx.push_back( indx );
84 cout <<
"number of loops: " << loopsindx.size() / 2 <<
"\n";
94 for(
size_t i = 0; i < loopsindx.size() / 2; i++ )
96 num_edges += ( loopsindx[2 * i + 1] - loopsindx[2 * i] + 1 );
102 for(
size_t i = 0; i < loopsindx.size() / 2; i++ )
104 for(
int j = loopsindx[2 * i]; j <= loopsindx[2 * i + 1]; j++ )
108 if( j == loopsindx[2 * i + 1] ) j2 = loopsindx[2 * i] - 1;
109 conn_array[2 * i1] = verts[j - 1];
110 conn_array[2 * i1 + 1] = verts[j2];
116 Range bedges( handle, handle + num_edges - 1 );
124 gids.resize( verts.
size() );
125 for(
int j = 0; j < (int)verts.
size(); j++ )
137 std::vector< CartVect > co3;
138 co3.resize( verts.
size() );
140 for(
size_t i = 0; i < verts.
size(); i++ )
143 double lat1 =
getLat( p );
144 double lon1 =
getLon( p );
145 co3[i] =
CartVect( lon1, lat1, 0. );