libMesh
surface.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2024 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_SURFACE_H
21 #define LIBMESH_SURFACE_H
22 
23 // Local includes
24 #include "libmesh/point.h"
25 
26 namespace libMesh
27 {
28 
42 class Surface
43 {
44 public:
45 
49  Surface () = default;
50 
54  Surface (const Surface &) = default;
55 
59  virtual ~Surface () = default;
60 
65  virtual bool above_surface (const Point & p) const = 0;
66 
71  virtual bool below_surface (const Point & p) const = 0;
72 
80  virtual bool on_surface (const Point & p) const = 0;
81 
85  virtual Point closest_point (const Point & p) const = 0;
86 
91  virtual Point unit_normal (const Point & p) const = 0;
92 
101  virtual Point surface_coords (const Point & world_coords) const { return world_coords; }
102 
110  virtual Point world_coords (const Point & surf_coords) const { return surf_coords; }
111 };
112 
113 } // namespace libMesh
114 
115 #endif // LIBMESH_SURFACE_H
Surface()=default
Constructor.
virtual Point closest_point(const Point &p) const =0
The libMesh namespace provides an interface to certain functionality in the library.
virtual bool on_surface(const Point &p) const =0
virtual Point world_coords(const Point &surf_coords) const
Definition: surface.h:110
virtual bool above_surface(const Point &p) const =0
virtual Point unit_normal(const Point &p) const =0
virtual ~Surface()=default
Destructor.
virtual Point surface_coords(const Point &world_coords) const
Definition: surface.h:101
The base class for all "surface" related geometric objects.
Definition: surface.h:42
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:39
virtual bool below_surface(const Point &p) const =0