MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov, 00024 pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov 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-Feb-02 at 10:57:52 00034 // LAST-MOD: 14-Nov-02 at 17:33:19 by Thomas Leurent 00035 // 00036 // 00037 // DESCRIPTION: 00038 // ============ 00039 /*! \file main.cpp 00040 00041 describe main.cpp here 00042 00043 */ 00044 // DESCRIP-END. 00045 // 00046 00047 #include "TestUtil.hpp" 00048 00049 #include "Mesquite.hpp" 00050 #include "MeshImpl.hpp" 00051 #include "MsqError.hpp" 00052 #include "PlanarDomain.hpp" 00053 // algorythms 00054 #include "LaplaceWrapper.hpp" 00055 00056 #include <iostream> 00057 using std::cout; 00058 using std::endl; 00059 #include <cstdlib> 00060 00061 using namespace MBMesquite; 00062 00063 int main() 00064 { 00065 MBMesquite::MeshImpl mesh; 00066 MsqPrintError err( cout ); 00067 std::string file_name = TestDir + "unittest/mesquite/2D/vtk/quads/untangled/square_quad_2.vtk"; 00068 mesh.read_vtk( file_name.c_str(), err ); 00069 if( err ) return 1; 00070 00071 // create geometry: plane z=0, normal (0,0,1) 00072 Vector3D pnt( 0, 0, 5 ); 00073 Vector3D s_norm( 0, 0, 1 ); 00074 MBMesquite::PlanarDomain msq_geom( s_norm, pnt ); 00075 00076 // creates an intruction queue 00077 LaplaceWrapper laplacian_smoother; 00078 00079 mesh.write_vtk( "original_mesh.vtk", err ); 00080 if( err ) return 1; 00081 00082 // launches optimization on mesh_set1 00083 MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &msq_geom ); 00084 laplacian_smoother.run_instructions( &mesh_and_domain, err ); 00085 if( err ) return 1; 00086 00087 mesh.write_vtk( "smoothed_mesh.vtk", err ); 00088 if( err ) return 1; 00089 }