MOAB: Mesh Oriented datABase  (version 5.4.0)
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,
00062                                    Vector3D coordinates[],
00063                                    unsigned count,
00064                                    MsqError& err ) const;
00065 
00066     virtual void closest_point( Mesh::VertexHandle handle,
00067                                 const Vector3D& position,
00068                                 Vector3D& closest,
00069                                 Vector3D& normal,
00070                                 MsqError& err ) const;
00071 
00072     virtual void domain_DoF( const Mesh::VertexHandle* handle_array,
00073                              unsigned short* dof_array,
00074                              size_t num_handles,
00075                              MsqError& err ) const;
00076 };
00077 
00078 class MESQUITE_EXPORT LineDomain : public MeshDomain, public CurveDomain
00079 {
00080   private:
00081     MsqLine mGeom;
00082 
00083   public:
00084     LineDomain( const Vector3D& point, const Vector3D& dir ) : mGeom( point, dir ) {}
00085 
00086     LineDomain( const MsqLine& line ) : mGeom( line ) {}
00087 
00088     const MsqLine& geom() const
00089     {
00090         return mGeom;
00091     }
00092 
00093     virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00094 
00095     virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00096     virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00097 
00098     virtual void vertex_normal_at( const Mesh::VertexHandle* handles,
00099                                    Vector3D coordinates[],
00100                                    unsigned count,
00101                                    MsqError& err ) const;
00102 
00103     virtual void closest_point( Mesh::VertexHandle handle,
00104                                 const Vector3D& position,
00105                                 Vector3D& closest,
00106                                 Vector3D& normal,
00107                                 MsqError& err ) const;
00108 
00109     virtual void domain_DoF( const Mesh::VertexHandle* handle_array,
00110                              unsigned short* dof_array,
00111                              size_t num_handles,
00112                              MsqError& err ) const;
00113 
00114     virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
00115 
00116     virtual void position_from_length( const double from_here[3],
00117                                        double length,
00118                                        double result_point[3],
00119                                        MsqError& err );
00120 };
00121 
00122 class MESQUITE_EXPORT CircleDomain : public MeshDomain, CurveDomain
00123 {
00124   private:
00125     MsqCircle mGeom;
00126 
00127   public:
00128     CircleDomain( const Vector3D& center, const Vector3D& normal, double radius ) : mGeom( center, normal, radius ) {}
00129 
00130     CircleDomain( const MsqCircle& circle ) : mGeom( circle ) {}
00131 
00132     const MsqCircle& geom() const
00133     {
00134         return mGeom;
00135     }
00136 
00137     virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00138 
00139     virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
00140     virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
00141 
00142     virtual void vertex_normal_at( const Mesh::VertexHandle* handles,
00143                                    Vector3D coordinates[],
00144                                    unsigned count,
00145                                    MsqError& err ) const;
00146 
00147     virtual void closest_point( Mesh::VertexHandle handle,
00148                                 const Vector3D& position,
00149                                 Vector3D& closest,
00150                                 Vector3D& normal,
00151                                 MsqError& err ) const;
00152 
00153     virtual void domain_DoF( const Mesh::VertexHandle* handle_array,
00154                              unsigned short* dof_array,
00155                              size_t num_handles,
00156                              MsqError& err ) const;
00157 
00158     virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
00159 
00160     virtual void position_from_length( const double from_here[3],
00161                                        double length,
00162                                        double result_point[3],
00163                                        MsqError& err );
00164 };
00165 
00166 }  // namespace MBMesquite
00167 
00168 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines