MOAB: Mesh Oriented datABase  (version 5.3.1)
MeshDomain1D.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2008 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     (2008) kraftche@cae.wisc.edu
00024 
00025   ***************************************************************** */
00026 
00027 /** \file MeshDomain1D.hpp
00028  *  \brief
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_MESH_DOMAIN1D_HPP
00033 #define MSQ_MESH_DOMAIN1D_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include "MeshInterface.hpp"
00037 #include "MsqGeomPrim.hpp"
00038 #include "CurveDomain.hpp"
00039 
00040 namespace MBMesquite
00041 {
00042 
00043 class MESQUITE_EXPORT PointDomain : public MeshDomain
00044 {
00045   private:
00046     Vector3D mGeom;
00047 
00048   public:
00049     PointDomain( const Vector3D& location ) : mGeom( location ) {}
00050 
00051     const Vector3D& geom() const
00052     {
00053         return mGeom;
00054     }
00055 
00056     virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00057 
00058     virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00059     virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00060 
00061     virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
00062                                    MsqError& err ) const;
00063 
00064     virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
00065                                 Vector3D& normal, MsqError& err ) const;
00066 
00067     virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
00068                              MsqError& err ) const;
00069 };
00070 
00071 class MESQUITE_EXPORT LineDomain : public MeshDomain, public CurveDomain
00072 {
00073   private:
00074     MsqLine mGeom;
00075 
00076   public:
00077     LineDomain( const Vector3D& point, const Vector3D& dir ) : mGeom( point, dir ) {}
00078 
00079     LineDomain( const MsqLine& line ) : mGeom( line ) {}
00080 
00081     const MsqLine& geom() const
00082     {
00083         return mGeom;
00084     }
00085 
00086     virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00087 
00088     virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00089     virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00090 
00091     virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
00092                                    MsqError& err ) const;
00093 
00094     virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
00095                                 Vector3D& normal, MsqError& err ) const;
00096 
00097     virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
00098                              MsqError& err ) const;
00099 
00100     virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
00101 
00102     virtual void position_from_length( const double from_here[3], double length, double result_point[3],
00103                                        MsqError& err );
00104 };
00105 
00106 class MESQUITE_EXPORT CircleDomain : public MeshDomain, CurveDomain
00107 {
00108   private:
00109     MsqCircle mGeom;
00110 
00111   public:
00112     CircleDomain( const Vector3D& center, const Vector3D& normal, double radius ) : mGeom( center, normal, radius ) {}
00113 
00114     CircleDomain( const MsqCircle& circle ) : mGeom( circle ) {}
00115 
00116     const MsqCircle& geom() const
00117     {
00118         return mGeom;
00119     }
00120 
00121     virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00122 
00123     virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00124     virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00125 
00126     virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
00127                                    MsqError& err ) const;
00128 
00129     virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
00130                                 Vector3D& normal, MsqError& err ) const;
00131 
00132     virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
00133                              MsqError& err ) const;
00134 
00135     virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
00136 
00137     virtual void position_from_length( const double from_here[3], double length, double result_point[3],
00138                                        MsqError& err );
00139 };
00140 
00141 }  // namespace MBMesquite
00142 
00143 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines