MOAB: Mesh Oriented datABase  (version 5.2.1)
main_imesh.cpp File Reference
#include "Mesquite.hpp"
#include "MsqIMesh.hpp"
#include "MeshImpl.hpp"
#include "MsqError.hpp"
#include "InstructionQueue.hpp"
#include "TerminationCriterion.hpp"
#include "QualityAssessor.hpp"
#include "PlanarDomain.hpp"
#include "MeshWriter.hpp"
#include "TestUtil.hpp"
#include "IdealWeightInverseMeanRatio.hpp"
#include "EdgeLengthQualityMetric.hpp"
#include "LPtoPTemplate.hpp"
#include "FeasibleNewton.hpp"
#include "ConjugateGradient.hpp"
#include "SmartLaplacianSmoother.hpp"
#include <iostream>
#include "iBase.h"
+ Include dependency graph for main_imesh.cpp:

Go to the source code of this file.

Functions

void usage ()
Meshget_imesh_mesh (const char *file_name)
Meshget_native_mesh (const char *file_name)
int run_global_smoother (Mesh *mesh, MsqError &err)
int run_local_smoother (Mesh *mesh, MsqError &err)
int main (int argc, char *argv[])

Variables

std::string default_file_name = "/3D/vtk/large_box_hex_1000.vtk"

Function Documentation

Mesh* get_imesh_mesh ( const char *  file_name)
Mesh* get_native_mesh ( const char *  file_name)
int main ( int  argc,
char *  argv[] 
)

Definition at line 97 of file main_imesh.cpp.

References default_file_name, get_imesh_mesh(), get_native_mesh(), mesh, run_global_smoother(), run_local_smoother(), usage, and MBMesquite::MeshWriter::write_vtk().

{
    MBMesquite::MsqPrintError err( cout );

    // command line arguments
    const char* file_name = 0;
    bool use_native = false, opts_done = false;
    for( int arg = 1; arg < argc; ++arg )
    {
        if( !opts_done && argv[arg][0] == '-' )
        {
            if( !strcmp( argv[arg], "-N" ) )
                use_native = true;
            else if( !strcmp( argv[arg], "--" ) )
                opts_done = true;
            else
                usage();
        }
        else if( !file_name )
            file_name = argv[arg];
        else
            usage();
    }
    if( !file_name )
    {
        file_name = default_file_name.c_str();
        cout << "No file specified: using default: " << default_file_name << endl;
    }

    // Try running a global smoother on the mesh
    Mesh* mesh = use_native ? get_native_mesh( file_name ) : get_imesh_mesh( file_name );
    if( !mesh )
    {
        std::cerr << "Failed to load input file.  Aborting." << std::endl;
        return 1;
    }

    MeshWriter::write_vtk( mesh, "original.vtk", err );
    if( err ) return 1;
    cout << "Wrote \"original.vtk\"" << endl;
    run_global_smoother( mesh, err );
    if( err ) return 1;

    // Try running a local smoother on the mesh
    mesh = use_native ? get_native_mesh( file_name ) : get_imesh_mesh( file_name );
    if( !mesh )
    {
        std::cerr << "Failed to load input file.  Aborting." << std::endl;
        return 1;
    }

    run_local_smoother( mesh, err );
    if( err ) return 1;

    return 0;
}
int run_global_smoother ( Mesh mesh,
MsqError err 
)
int run_local_smoother ( Mesh mesh,
MsqError err 
)
void usage ( )

Definition at line 77 of file main_imesh.cpp.

References default_file_name.

{
    cout << "main [-N] [filename]" << endl;
    cout << "  -N : Use native representation instead of TSTT implementation\n";
    cout << "  If no file name is specified, will use \"" << default_file_name << '"' << endl;
    exit( 1 );
}

Variable Documentation

std::string default_file_name = "/3D/vtk/large_box_hex_1000.vtk"

Definition at line 75 of file main_imesh.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines