Definition at line 30 of file ExtractClose.cpp.
35 double x = -0.784768, y = 0.594952, z = -0.173698;
36 double lat = 28.6551, lon = 61.0204;
40 opts.
addOpt<
string >(
"inFile,i",
"Specify the input file name string ", &inputFile );
42 string outFile =
"out.h5m";
43 opts.
addOpt<
string >(
"outFile,o",
"Specify the output file name string ", &outFile );
45 opts.
addOpt<
double >( string(
"xpos,x" ), string(
"x position" ), &x );
46 opts.
addOpt<
double >( string(
"ypos,y" ), string(
"y position" ), &y );
47 opts.
addOpt<
double >( string(
"zpos,z" ), string(
"z position" ), &z );
49 opts.
addOpt<
double >( string(
"latitude,t" ), string(
"north latitude in degrees" ), &lat );
50 opts.
addOpt<
double >( string(
"longitude,w" ), string(
"east longitude in degrees" ), &lon );
52 bool spherical =
false;
53 opts.
addOpt<
void >(
"spherical,s",
"use spherical coords input (default false) ", &spherical );
55 double distance = 0.01;
56 opts.
addOpt<
double >( string(
"distance,d" ), string(
"distance " ), &distance );
74 cout <<
" reading file " << inputFile <<
" on " << numProcesses <<
" task";
75 if( numProcesses > 1 ) cout <<
"s";
92 std::cout <<
" use spherical coordinates on the sphere of radius 1.\n";
95 pos.
lat = lat * M_PI / 180;
96 pos.
lon = lon * M_PI / 180;
97 point = IntxUtils::spherical_to_cart( pos );
107 if( dist <= distance )
109 closeByCells.
insert( cell );
115 int numCells = (int)closeByCells.
size();
120 std::cout <<
" no close cells to the point " << point <<
" at distance less than " << distance <<
"\n";
125 std::cout <<
" write file " << outFile <<
" with cells closer than " << distance <<
" from " << point
128 if( numProcesses > 1 ) writeOpts = string(
"PARALLEL=WRITE_PART;" );
References moab::Core::add_entities(), ProgOptions::addOpt(), moab::Range::begin(), center(), moab::Core::create_meshset(), moab::Range::end(), ErrorCode, moab::Core::get_coords(), moab::Core::get_entities_by_dimension(), moab::Range::insert(), moab::IntxUtils::SphereCoords::lat, length(), moab::Core::load_file(), moab::IntxUtils::SphereCoords::lon, mb, MB_CHK_ERR, MB_CHK_SET_ERR, MESHSET_SET, ProgOptions::parseCommandLine(), moab::IntxUtils::SphereCoords::R, moab::Range::size(), moab::IntxUtils::spherical_to_cart(), test_file_name, and moab::Core::write_file().