Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/SphericalDomain.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Sandia Corporation and Argonne National
5  Laboratory. Under the terms of Contract DE-AC04-94AL85000
6  with Sandia Corporation, the U.S. Government retains certain
7  rights in 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  diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24  pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov,
25  kraftche@cae.wisc.edu
26 
27  ***************************************************************** */
36 #ifndef MSQ_SPHERICAL_DOMAIN_HPP
37 #define MSQ_SPHERICAL_DOMAIN_HPP
38 
39 #include "MeshInterface.hpp"
40 #include "Vector3D.hpp"
41 
42 namespace Mesquite
43 {
49  {
50  public:
51  SphericalDomain(const Vector3D& center, double radius )
52  : mCenter(center), mRadius(radius)
53  {}
54 
55  virtual ~SphericalDomain() { }
56 
57  DomainHint hint() const { return SMOOTH_DOMAIN; }
58 
59  void set_sphere(const Vector3D& center, double radius)
60  {
61  mCenter = center;
62  mRadius = radius;
63  }
64 
65  virtual void snap_to(Mesh::EntityHandle entity_handle,
66  Vector3D &coordinate) const;
67 
68  virtual void normal_at(Mesh::EntityHandle entity_handle,
69  Vector3D &coordinate) const;
70 
71  virtual void normal_at(Mesh::EntityHandle handle,
72  Vector3D coords[],
73  unsigned count,
74  MsqError& err) const;
75 
76  virtual void closest_point( Mesh::EntityHandle handle,
77  const Vector3D& position,
78  Vector3D& closest,
79  Vector3D& normal,
80  MsqError& err ) const;
81 
82  private:
84  double mRadius;
85  };
86 }
87 
88 #endif
virtual void normal_at(Mesh::EntityHandle entity_handle, Vector3D &coordinate) const
Returns the normal of the domain to which "entity_handle" is constrained.
Used to hold the error state and return it to the application.
DomainHint
A hint on the characteristics of the domain that Mesquite may use to determine what, if any, scheme to use to cache characteristics of the geometric domain.
void set_sphere(const Vector3D &center, double radius)
This file contains the Mesquite mesh interface. Many users will want to implement a concrete class de...
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
void * EntityHandle
Opaque EntityHandle type and tag type.
DomainHint hint() const
Give a hint about the nature of the domain for better performance.
SphericalDomain(const Vector3D &center, double radius)
virtual void snap_to(Mesh::EntityHandle entity_handle, Vector3D &coordinate) const
Modifies "coordinate" so that it lies on the domain to which "entity_handle" is constrained.
virtual void closest_point(Mesh::EntityHandle handle, const Vector3D &position, Vector3D &closest, Vector3D &normal, MsqError &err) const
evaluate closest point and normal