DOLFIN
DOLFIN C++ interface
Face.h
1 // Copyright (C) 2006-2010 Anders Logg
2 //
3 // This file is part of DOLFIN.
4 //
5 // DOLFIN is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // DOLFIN is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // Modified by Garth N. Wells, 2011
19 //
20 // First added: 2006-06-02
21 // Last changed: 2011-02-22
22 
23 #ifndef __FACE_H
24 #define __FACE_H
25 
26 #include <memory>
27 
28 #include "MeshEntity.h"
29 #include "MeshEntityIteratorBase.h"
30 #include "MeshFunction.h"
31 
32 namespace dolfin
33 {
34 
35  class Mesh;
36  class Point;
37 
39 
40  class Face : public MeshEntity
41  {
42  public:
43 
45  Face(const Mesh& mesh, std::size_t index) : MeshEntity(mesh, 2, index) {}
46 
48  ~Face() {}
49 
51  double area() const;
52 
54  double normal(std::size_t i) const;
55 
57  Point normal() const;
58 
59  };
60 
63 
64 }
65 
66 #endif
Definition: adapt.h:29
Definition: Point.h:40
A Face is a MeshEntity of topological dimension 2.
Definition: Face.h:40
Point normal() const
Compute normal to the face.
Definition: Face.cpp:97
MeshEntityIteratorBase< Face > FaceIterator
A FaceIterator is a MeshEntityIterator of topological dimension 2.
Definition: Face.h:62
~Face()
Destructor.
Definition: Face.h:48
double area() const
Calculate the area of the face (triangle)
Definition: Face.cpp:30
Definition: MeshEntity.h:42
const Mesh & mesh() const
Definition: MeshEntity.h:99
Face(const Mesh &mesh, std::size_t index)
Constructor.
Definition: Face.h:45
std::size_t index() const
Definition: MeshEntity.h:113
Definition: Mesh.h:82
Base class for MeshEntityIterators.
Definition: MeshEntityIteratorBase.h:36