libMesh
plane.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2017 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 #ifndef LIBMESH_PLANE_H
21 #define LIBMESH_PLANE_H
22 
23 // Local includes
24 #include "libmesh/surface.h"
25 
26 namespace libMesh
27 {
28 
36 class Plane : public Surface
37 {
38 public:
39 
43  Plane ();
44 
48  Plane (const Point & p, const Point & n);
49 
55  Plane (const Point & p0, const Point & p1, const Point & p2);
56 
60  Plane (const Plane & other_plane);
61 
65  ~Plane ();
66 
70  void create_from_point_normal (const Point & p, const Point & n);
71 
77  void create_from_three_points (const Point & p0,
78  const Point & p1,
79  const Point & p2 );
80 
84  void xy_plane (const Real zpos=0.);
85 
89  void xz_plane (const Real ypos=0.);
90 
94  void yz_plane (const Real xpos=0.);
95 
100  virtual bool above_surface (const Point & p) const libmesh_override;
101 
106  virtual bool below_surface (const Point & p) const libmesh_override;
107 
115  virtual bool on_surface (const Point & p) const libmesh_override;
116 
120  virtual Point closest_point (const Point & p) const libmesh_override;
121 
126  virtual Point unit_normal (const Point & p) const libmesh_override;
127 
132  const Point & get_planar_point() const;
133 
134 
135 private:
139  const Point & normal () const { return _normal; }
140 
146 };
147 
148 } // namespace libMesh
149 
150 #endif // LIBMESH_PLANE_H
Point _point
The plane is defined by a point and a normal.
Definition: plane.h:144
void create_from_point_normal(const Point &p, const Point &n)
Defines a plane containing point p with normal n.
Definition: plane.C:70
virtual Point closest_point(const Point &p) const libmesh_override
Definition: plane.C:169
virtual bool below_surface(const Point &p) const libmesh_override
Definition: plane.C:144
void create_from_three_points(const Point &p0, const Point &p1, const Point &p2)
Defines a plane intersecting the three points p0, p1, and p2.
Definition: plane.C:78
The libMesh namespace provides an interface to certain functionality in the library.
~Plane()
Destructor.
Definition: plane.C:64
virtual bool on_surface(const Point &p) const libmesh_override
Definition: plane.C:151
const Point & normal() const
Definition: plane.h:139
void xy_plane(const Real zpos=0.)
Creates an XY plane located at z=zpos.
Definition: plane.C:94
Plane()
Dummy Constructor.
Definition: plane.C:32
void yz_plane(const Real xpos=0.)
Creates an YZ plane located at x=xpos.
Definition: plane.C:116
const Point & get_planar_point() const
Definition: plane.C:189
virtual bool above_surface(const Point &p) const libmesh_override
Definition: plane.C:127
This class defines a plane.
Definition: plane.h:36
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Point _normal
Definition: plane.h:145
The base class for all "surface" related geometric objects.
Definition: surface.h:42
virtual Point unit_normal(const Point &p) const libmesh_override
Definition: plane.C:184
void xz_plane(const Real ypos=0.)
Creates an XZ plane located at y=ypos.
Definition: plane.C:105
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38