MOAB: Mesh Oriented datABase
(version 5.2.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: Tests a paraboloid mesh for compatibility with the ParaboloidDomain. 00031 // USAGE: 00032 // 00033 // ORIG-DATE: 25-Jan-2013 00034 // 00035 // AUTHOR: Boyd Tidwell 00036 // 00037 // DESCRIPTION: 00038 // ============ 00039 /*! \file main.cpp 00040 00041 describe main.cpp here 00042 00043 */ 00044 // DESCRIP-END. 00045 // 00046 #include <iostream> 00047 using std::cout; 00048 using std::endl; 00049 #include <cstdlib> 00050 00051 #include "Mesquite.hpp" 00052 #include "MeshImpl.hpp" 00053 #include "MsqError.hpp" 00054 #include "Vector3D.hpp" 00055 #include "MeshInterface.hpp" 00056 #include "TestUtil.hpp" 00057 00058 using namespace MBMesquite; 00059 00060 class ParaboloidDomain : public MeshDomain 00061 { 00062 public: 00063 virtual void closest_point( Mesh::VertexHandle /*handle*/, const Vector3D& position, Vector3D& closest, 00064 Vector3D& /*normal*/, MsqError& /*err*/ ) const 00065 { 00066 closest = Vector3D( position[0], position[1], position[0] * position[0] + position[1] * position[1] ); 00067 }; 00068 00069 virtual void snap_to( Mesh::VertexHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00070 00071 virtual void vertex_normal_at( Mesh::VertexHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00072 virtual void element_normal_at( Mesh::ElementHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00073 00074 virtual void vertex_normal_at( const Mesh::VertexHandle* /*handles*/, Vector3D /*coordinates*/[], 00075 unsigned /*count*/, MsqError& /*err*/ ) const {}; 00076 00077 virtual void domain_DoF( const Mesh::EntityHandle* /*handle_array*/, unsigned short* /*dof_array*/, 00078 size_t /*num_handles*/, MsqError& /*err*/ ) const {}; 00079 }; 00080 00081 int main() 00082 { 00083 MsqPrintError err( cout ); 00084 MBMesquite::MeshImpl mesh; 00085 std::string file_name = TestDir + "/2D/vtk/quads/untangled/paraboloid.vtk"; 00086 mesh.read_vtk( file_name.c_str(), err ); 00087 if( err ) return 1; 00088 00089 ParaboloidDomain domain; 00090 00091 MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &domain, true, true, false ); 00092 00093 std::cout << "Paraboloid Domain Test Passes" << std::endl; 00094 return 0; 00095 }