Sierra Toolkit Version of the Day
UnitTestIOFixture.cpp
00001 #include <stk_io/util/IO_Fixture.hpp>
00002 
00003 #include <stk_util/unit_test_support/stk_utest_macros.hpp>
00004 
00005 #include <string>
00006 
00007 STKUNIT_UNIT_TEST( IOFixture, iofixture )
00008 {
00009   // A simple test for reading and writing an exodus file using the IOFixture.
00010 
00011   stk::ParallelMachine pm = MPI_COMM_WORLD;
00012 
00013   stk::io::util::IO_Fixture fixture(pm);
00014 
00015   std::string input_base_filename = "unit_test.g";
00016 
00017   // Initialize meta data from exodus file
00018   fixture.initialize_meta_data( input_base_filename, "exodusii" );
00019 
00020   // Commit meta_data
00021   stk::mesh::fem::FEMMetaData & meta_data = fixture.meta_data();
00022   meta_data.commit();
00023 
00024   // bulk_data initialize (from exodus file)
00025   fixture.initialize_bulk_data();
00026 
00027   // exodus file creation
00028   std::string output_base_filename = "unit_test_output.e";
00029   fixture.create_output_mesh( output_base_filename, "exodusii" );
00030 
00031   // process output
00032   double time_step = 0;
00033   fixture.add_timestep_to_output_mesh( time_step );
00034 
00035   // Since correctness can only be established by running SEACAS tools, correctness
00036   // checking is left to the test XML.
00037 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends