#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void simu( int argc, char **argv ) { std::ifstream is_geom( argv[1] ); if( !is_geom.good() ) throw( Error( ERROR_LOCATION, (std::string)"couldn\'t open file \'" + argv[1] + "\'" ) ); Geometry geom( is_geom ); is_geom.close(); geom.build_surface(); EpotField *epot = NULL; if( argc > 2 ) { std::ifstream is_epot( argv[2] ); if( !is_epot.good() ) throw( Error( ERROR_LOCATION, (std::string)"couldn\'t open file \'" + argv[2] + "\'" ) ); epot = new EpotField( is_epot, geom ); is_epot.close(); } ParticleDataBase3D *pdb = NULL; if( argc > 3 ) { std::ifstream is_pdb( argv[3] ); if( !is_pdb.good() ) throw( Error( ERROR_LOCATION, (std::string)"couldn\'t open file \'" + argv[3] + "\'" ) ); pdb = new ParticleDataBase3D( is_pdb, geom ); is_pdb.close(); } // ----------------------------------- GTKPlotter plotter( &argc, &argv ); plotter.set_geometry( &geom ); if( epot ) { plotter.set_epot( epot ); EpotEfield *efield = new EpotEfield( *epot ); plotter.set_efield( efield ); } if( pdb ) { MeshScalarField *tdens = new MeshScalarField( geom ); pdb->build_trajectory_density_field( *tdens ); plotter.set_trajdens( tdens ); plotter.set_particledatabase( pdb ); } plotter.new_geometry_plot_window(); plotter.run(); } int main( int argc, char **argv ) { if( argc <= 1 ) { std::cout << "Usage: gtkplot \n"; exit( 1 ); } try { //ibsimu.set_message_output( outputFolder + "ibsimu.txt" ); ibsimu.set_message_threshold( MSG_VERBOSE, 1 ); ibsimu.set_thread_count( 4 ); simu( argc, argv ); } catch( Error e ) { e.print_error_message( ibsimu.message(0) ); exit( 1 ); } return( 0 ); }