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 [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: 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*/, 00064 const Vector3D& position, 00065 Vector3D& closest, 00066 Vector3D& /*normal*/, 00067 MsqError& /*err*/ ) const 00068 { 00069 closest = Vector3D( position[0], position[1], position[0] * position[0] + position[1] * position[1] ); 00070 }; 00071 00072 virtual void snap_to( Mesh::VertexHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00073 00074 virtual void vertex_normal_at( Mesh::VertexHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00075 virtual void element_normal_at( Mesh::ElementHandle /*entity_handle*/, Vector3D& /*coordinate*/ ) const {}; 00076 00077 virtual void vertex_normal_at( const Mesh::VertexHandle* /*handles*/, 00078 Vector3D /*coordinates*/[], 00079 unsigned /*count*/, 00080 MsqError& /*err*/ ) const {}; 00081 00082 virtual void domain_DoF( const Mesh::EntityHandle* /*handle_array*/, 00083 unsigned short* /*dof_array*/, 00084 size_t /*num_handles*/, 00085 MsqError& /*err*/ ) const {}; 00086 }; 00087 00088 int main() 00089 { 00090 MsqPrintError err( cout ); 00091 MBMesquite::MeshImpl mesh; 00092 std::string file_name = TestDir + "unittest/mesquite/2D/vtk/quads/untangled/paraboloid.vtk"; 00093 mesh.read_vtk( file_name.c_str(), err ); 00094 if( err ) return 1; 00095 00096 ParaboloidDomain domain; 00097 00098 MeshDomainAssoc mesh_and_domain = MeshDomainAssoc( &mesh, &domain, true, true, false ); 00099 00100 std::cout << "Paraboloid Domain Test Passes" << std::endl; 00101 return 0; 00102 }