Mesh Oriented datABase  (version 5.6.0)
An array-based unstructured mesh library
GeneralGnomonic.cpp File Reference
#include <iostream>
#include <sstream>
#include "moab/Core.hpp"
#include "moab/Interface.hpp"
#include "moab/IntxMesh/IntxUtils.hpp"
#include "moab/ProgOptions.hpp"
+ Include dependency graph for GeneralGnomonic.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 18 of file GeneralGnomonic.cpp.

19 {
20  string filein = "target_1.h5m";
21  string fileout = "project.h5m";
22 
23  ProgOptions opts;
24  opts.addOpt< std::string >( "model,m", "input file ", &filein );
25 
26  opts.addOpt< std::string >( "output,o", "output filename", &fileout );
27 
28  opts.parseCommandLine( argc, argv );
29 
30  Core moab;
31  Interface* mb = &moab;
32  EntityHandle sf;
33  ErrorCode rval = mb->create_meshset( MESHSET_SET, sf );MB_CHK_ERR( rval );
34 
35  rval = mb->load_file( filein.c_str(), &sf );MB_CHK_ERR( rval );
36 
37  EntityHandle outSet;
38  rval = mb->create_meshset( MESHSET_SET, outSet );MB_CHK_ERR( rval );
39  // get the coords of the first vertex entity handle
40  EntityHandle v1 = 1; // we know it must exist; we could get a specific one too :)
41 
42  CartVect P;
43  rval = mb->get_coords( &v1, 1, P.array() );MB_CHK_ERR( rval );
44 
45  rval = IntxUtils::global_gnomonic_projection_general( mb, sf, P, outSet );MB_CHK_ERR( rval );
46  std::cout << "writing output file " << fileout.c_str() << "\n";
47  rval = mb->write_file( fileout.c_str(), 0, 0, &outSet, 1 );MB_CHK_ERR( rval );
48 
49  return 0;
50 }

References ProgOptions::addOpt(), moab::CartVect::array(), moab::Core::create_meshset(), ErrorCode, moab::Core::get_coords(), moab::IntxUtils::global_gnomonic_projection_general(), moab::Core::load_file(), mb, MB_CHK_ERR, MESHSET_SET, ProgOptions::parseCommandLine(), and moab::Core::write_file().