DOLFIN
DOLFIN C++ interface
Edge.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 Johan Hoffman 2006.
19 // Modified by Kristoffer Selim 2009.
20 //
21 // First added: 2006-06-02
22 // Last changed: 2011-02-08
23 
24 #ifndef __EDGE_H
25 #define __EDGE_H
26 
27 #include <memory>
28 
29 #include "Mesh.h"
30 #include "MeshEntity.h"
31 #include "MeshEntityIteratorBase.h"
32 #include "MeshFunction.h"
33 
34 namespace dolfin
35 {
36 
38 
39  class Edge : public MeshEntity
40  {
41  public:
42 
49  Edge(const Mesh& mesh, std::size_t index) : MeshEntity(mesh, 1, index) {}
50 
55  Edge(MeshEntity& entity) : MeshEntity(entity.mesh(), 1, entity.index()) {}
56 
58  ~Edge() {}
59 
72  double length() const;
73 
90  double dot(const Edge& edge) const;
91 
92  };
93 
96 
97 }
98 
99 #endif
Definition: adapt.h:29
Edge(const Mesh &mesh, std::size_t index)
Definition: Edge.h:49
An Edge is a MeshEntity of topological dimension 1.
Definition: Edge.h:39
MeshEntityIteratorBase< Edge > EdgeIterator
An EdgeIterator is a MeshEntityIterator of topological dimension 1.
Definition: Edge.h:95
double dot(const Edge &edge) const
Definition: Edge.cpp:48
double length() const
Definition: Edge.cpp:30
Definition: MeshEntity.h:42
const Mesh & mesh() const
Definition: MeshEntity.h:99
~Edge()
Destructor.
Definition: Edge.h:58
Edge(MeshEntity &entity)
Definition: Edge.h:55
std::size_t index() const
Definition: MeshEntity.h:113
Definition: Mesh.h:82
Base class for MeshEntityIterators.
Definition: MeshEntityIteratorBase.h:36