Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2008 Sandia National Laboratories. Developed at the
5 : : University of Wisconsin--Madison under SNL contract number
6 : : 624796. The U.S. Government and the University of Wisconsin
7 : : retain certain rights to this software.
8 : :
9 : : This library is free software; you can redistribute it and/or
10 : : modify it under the terms of the GNU Lesser General Public
11 : : License as published by the Free Software Foundation; either
12 : : version 2.1 of the License, or (at your option) any later version.
13 : :
14 : : This library is distributed in the hope that it will be useful,
15 : : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : : Lesser General Public License for more details.
18 : :
19 : : You should have received a copy of the GNU Lesser General Public License
20 : : (lgpl.txt) along with this library; if not, write to the Free Software
21 : : Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : :
23 : : (2008) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : /** \file MeshDomain1D.hpp
28 : : * \brief
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #ifndef MSQ_MESH_DOMAIN1D_HPP
33 : : #define MSQ_MESH_DOMAIN1D_HPP
34 : :
35 : : #include "Mesquite.hpp"
36 : : #include "MeshInterface.hpp"
37 : : #include "MsqGeomPrim.hpp"
38 : : #include "CurveDomain.hpp"
39 : :
40 : : namespace MBMesquite
41 : : {
42 : :
43 [ # # ]: 0 : class MESQUITE_EXPORT PointDomain : public MeshDomain
44 : : {
45 : : private:
46 : : Vector3D mGeom;
47 : :
48 : : public:
49 : : PointDomain( const Vector3D& location ) : mGeom( location ) {}
50 : :
51 : 0 : const Vector3D& geom() const
52 : : {
53 : 0 : return mGeom;
54 : : }
55 : :
56 : : virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
57 : :
58 : : virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
59 : : virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
60 : :
61 : : virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
62 : : MsqError& err ) const;
63 : :
64 : : virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
65 : : Vector3D& normal, MsqError& err ) const;
66 : :
67 : : virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
68 : : MsqError& err ) const;
69 : : };
70 : :
71 [ - + ]: 24 : class MESQUITE_EXPORT LineDomain : public MeshDomain, public CurveDomain
72 : : {
73 : : private:
74 : : MsqLine mGeom;
75 : :
76 : : public:
77 [ + - ]: 12 : LineDomain( const Vector3D& point, const Vector3D& dir ) : mGeom( point, dir ) {}
78 : :
79 : : LineDomain( const MsqLine& line ) : mGeom( line ) {}
80 : :
81 : 0 : const MsqLine& geom() const
82 : : {
83 : 0 : return mGeom;
84 : : }
85 : :
86 : : virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
87 : :
88 : : virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
89 : : virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
90 : :
91 : : virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
92 : : MsqError& err ) const;
93 : :
94 : : virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
95 : : Vector3D& normal, MsqError& err ) const;
96 : :
97 : : virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
98 : : MsqError& err ) const;
99 : :
100 : : virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
101 : :
102 : : virtual void position_from_length( const double from_here[3], double length, double result_point[3],
103 : : MsqError& err );
104 : : };
105 : :
106 [ # # ]: 0 : class MESQUITE_EXPORT CircleDomain : public MeshDomain, CurveDomain
107 : : {
108 : : private:
109 : : MsqCircle mGeom;
110 : :
111 : : public:
112 : : CircleDomain( const Vector3D& center, const Vector3D& normal, double radius ) : mGeom( center, normal, radius ) {}
113 : :
114 : : CircleDomain( const MsqCircle& circle ) : mGeom( circle ) {}
115 : :
116 : 0 : const MsqCircle& geom() const
117 : : {
118 : 0 : return mGeom;
119 : : }
120 : :
121 : : virtual void snap_to( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
122 : :
123 : : virtual void vertex_normal_at( Mesh::VertexHandle entity_handle, Vector3D& coordinate ) const;
124 : : virtual void element_normal_at( Mesh::ElementHandle entity_handle, Vector3D& coordinate ) const;
125 : :
126 : : virtual void vertex_normal_at( const Mesh::VertexHandle* handles, Vector3D coordinates[], unsigned count,
127 : : MsqError& err ) const;
128 : :
129 : : virtual void closest_point( Mesh::VertexHandle handle, const Vector3D& position, Vector3D& closest,
130 : : Vector3D& normal, MsqError& err ) const;
131 : :
132 : : virtual void domain_DoF( const Mesh::VertexHandle* handle_array, unsigned short* dof_array, size_t num_handles,
133 : : MsqError& err ) const;
134 : :
135 : : virtual double arc_length( const double position1[3], const double position2[3], MsqError& err );
136 : :
137 : : virtual void position_from_length( const double from_here[3], double length, double result_point[3],
138 : : MsqError& err );
139 : : };
140 : :
141 : : } // namespace MBMesquite
142 : :
143 : : #endif
|