MOAB: Mesh Oriented datABase  (version 5.2.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) kraftche@cae.wisc.edu
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, Vector3D coordinates[], unsigned count,
00058                            MsqError& err ) const;
00059 
00060     void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest, Vector3D& normal,
00061                         MsqError& err ) const;
00062 
00063     void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_vertices,
00064                      MsqError& err ) const;
00065 
00066   protected:
00067     /** Get geometric entity owning a mesh entity */
00068     int geom_from_mesh( Mesh::EntityHandle mesh_handle_in, iBase_EntityHandle& geom_handle_out,
00069                         int& geom_dimension_out ) const;
00070 
00071     int geom_from_mesh( Mesh::EntityHandle const* mesh_handles_in, iBase_EntityHandle* geom_handles_out,
00072                         unsigned short* geom_dimensions_out, size_t count ) const;
00073 
00074   private:
00075     /** ITAPS interface implementation for mesh->geometry association */
00076     iRel_Instance relateIface;
00077     iRel_PairHandle relateInstance;
00078 
00079     /** temporary storage of geometry entity handles */
00080     mutable std::vector< iBase_EntityHandle > geomHandles;
00081 };
00082 }  // namespace MBMesquite
00083 
00084 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines