MOAB: Mesh Oriented datABase  (version 5.4.1)
MsqIRel.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2009 Sandia National Laboratories.  Developed at the
00005     University of Wisconsin--Madison under SNL contract number
00006     624796.  The U.S. Government and the University of Wisconsin
00007     retain certain rights to 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     (2009) [email protected]
00024 
00025   ***************************************************************** */
00026 
00027 /** \file MsqIRel.hpp
00028  *  \brief
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_MSQ_IREL_HPP
00033 #define MSQ_MSQ_IREL_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include "MsqIGeom.hpp"
00037 #include "iRel.h"
00038 
00039 namespace MBMesquite
00040 {
00041 
00042 /* General MeshDomain on iGeom & iRel implementation */
00043 
00044 class MsqIRel : public MsqCommonIGeom
00045 {
00046   public:
00047     MsqIRel( iGeom_Instance geom, iRel_Instance irel_iface, iRel_PairHandle irel_instance );
00048 
00049     virtual ~MsqIRel();
00050 
00051     void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinat ) const;
00052 
00053     void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00054 
00055     void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00056 
00057     void vertex_normal_at( const Mesh::VertexHandle* handles,
00058                            Vector3D coordinates[],
00059                            unsigned count,
00060                            MsqError& err ) const;
00061 
00062     void closest_point( Mesh::VertexHandle handle,
00063                         const Vector3D& position,
00064                         Vector3D& closest,
00065                         Vector3D& normal,
00066                         MsqError& err ) const;
00067 
00068     void domain_DoF( const Mesh::VertexHandle* handle_array,
00069                      unsigned short* dof_array,
00070                      size_t num_vertices,
00071                      MsqError& err ) const;
00072 
00073   protected:
00074     /** Get geometric entity owning a mesh entity */
00075     int geom_from_mesh( Mesh::EntityHandle mesh_handle_in,
00076                         iBase_EntityHandle& geom_handle_out,
00077                         int& geom_dimension_out ) const;
00078 
00079     int geom_from_mesh( Mesh::EntityHandle const* mesh_handles_in,
00080                         iBase_EntityHandle* geom_handles_out,
00081                         unsigned short* geom_dimensions_out,
00082                         size_t count ) const;
00083 
00084   private:
00085     /** ITAPS interface implementation for mesh->geometry association */
00086     iRel_Instance relateIface;
00087     iRel_PairHandle relateInstance;
00088 
00089     /** temporary storage of geometry entity handles */
00090     mutable std::vector< iBase_EntityHandle > geomHandles;
00091 };
00092 }  // namespace MBMesquite
00093 
00094 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines