MOAB: Mesh Oriented datABase  (version 5.4.1)
shape_improvement.cpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2004 Sandia Corporation and Argonne National
00005     Laboratory.  Under the terms of Contract DE-AC04-94AL85000
00006     with Sandia Corporation, the U.S. Government retains certain
00007     rights in this software.
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Lesser General Public
00011     License as published by the Free Software Foundation; either
00012     version 2.1 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     (lgpl.txt) along with this library; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023     [email protected], [email protected], [email protected],
00024     [email protected], [email protected], [email protected]
00025 
00026   ***************************************************************** */
00027 // -*- Mode : c++; tab-width: 3; c-tab-always-indent: t; indent-tabs-mode: nil; c-basic-offset: 3
00028 // -*-
00029 //
00030 //   SUMMARY:
00031 //     USAGE:
00032 //
00033 // ORIG-DATE: 19-Sep-03 at 10:57:52
00034 //  LAST-MOD: 21-Sep-03 at 15:03:52 by Thomas Leurent
00035 //
00036 //
00037 // DESCRIPTION:
00038 // ============
00039 /*! \file main.cpp
00040 
00041 Calls the MBMesquite wrappers. First command line argument is the mesh file.
00042 
00043  */
00044 // DESCRIP-END.
00045 //
00046 #include "TestUtil.hpp"
00047 
00048 #include "Mesquite.hpp"
00049 #include "MeshImpl.hpp"
00050 #include "MsqError.hpp"
00051 
00052 #include <iostream>
00053 using std::cout;
00054 using std::endl;
00055 #include <cstdlib>
00056 
00057 // algorythms
00058 #include "ShapeImprovementWrapper.hpp"
00059 #include "MsqTimer.hpp"
00060 
00061 using namespace MBMesquite;
00062 
00063 int main( int argc, char* argv[] )
00064 {
00065     MBMesquite::MsqPrintError err( cout );
00066 
00067     std::string file_name = TestDir + "unittest/mesquite/3D/vtk/tets/untangled/tire.vtk";
00068 
00069     // command line arguments
00070     if( argc == 1 )
00071     {
00072 
00073         cout << "No command line argument given for mesh file.\n"
00074              << "Defaulting to " << file_name << "\n";
00075     }
00076     else if( argc > 2 )
00077         cout << "Too many command line arguments.\n" << endl;
00078     else if( argc == 2 )
00079     {
00080         cout << " given 1 command line arguments.\n";
00081         file_name = argv[1];
00082     }
00083 
00084     MBMesquite::MeshImpl mesh;
00085     mesh.read_vtk( file_name.c_str(), err );
00086 
00087     // creates a wrapper
00088     ShapeImprovementWrapper wrapper;
00089 
00090     //  mesh->write_vtk("original_mesh",err); MSQ_CHKERR(err);
00091 
00092     // launches optimization on mesh_set1
00093     wrapper.run_instructions( &mesh, err );
00094     if( err ) return 1;
00095 
00096     //  mesh->write_vtk("smoothed_mesh", err); MSQ_CHKERR(err);
00097     print_timing_diagnostics( cout );
00098     return 0;
00099 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines