6
6
// Modified by Garth N. Wells 2007.
8
8
// First added: 2006-05-08
9
// Last changed: 2008-05-28
9
// Last changed: 2008-03-10
15
#include <dolfin/common/types.h>
15
#include <dolfin/main/constants.h>
16
16
#include <dolfin/common/Variable.h>
18
#include "MeshTopology.h"
19
#include "MeshGeometry.h"
25
25
template <class T> class MeshFunction;
28
27
/// A Mesh consists of a set of connected and numbered mesh entities.
72
71
const Mesh& operator=(const Mesh& mesh);
74
73
/// Return number of vertices
75
inline uint numVertices() const { return _topology.size(0); }
74
inline uint numVertices() const { return data.topology.size(0); }
77
76
/// Return number of edges
78
inline uint numEdges() const { return _topology.size(1); }
77
inline uint numEdges() const { return data.topology.size(1); }
80
79
/// Return number of faces
81
inline uint numFaces() const { return _topology.size(2); }
80
inline uint numFaces() const { return data.topology.size(2); }
83
82
/// Return number of facets
84
inline uint numFacets() const { return _topology.size(_topology.dim() - 1); }
83
inline uint numFacets() const { return data.topology.size(data.topology.dim() - 1); }
86
85
/// Return number of cells
87
inline uint numCells() const { return _topology.size(_topology.dim()); }
89
/// Return coordinates of all vertices
90
inline real* coordinates() { return _geometry.x(); }
92
/// Return coordinates of all vertices
93
inline const real* coordinates() const { return _geometry.x(); }
95
/// Return connectivity for all cells
96
inline uint* cells() { return _topology(_topology.dim(), 0)(); }
98
/// Return connectivity for all cells
99
inline const uint* cells() const { return _topology(_topology.dim(), 0)(); }
86
inline uint numCells() const { return data.topology.size(data.topology.dim()); }
88
/// Return coordinates of all vertices
89
inline real* coordinates() { return data.geometry.x(); }
91
/// Return coordinates of all vertices
92
inline const real* coordinates() const { return data.geometry.x(); }
94
/// Return connectivity for all cells
95
inline uint* cells() { return data.topology(data.topology.dim(), 0)(); }
97
/// Return connectivity for all cells
98
inline const uint* cells() const { return data.topology(data.topology.dim(), 0)(); }
101
100
/// Return number of entities of given topological dimension
102
inline uint size(uint dim) const { return _topology.size(dim); }
101
inline uint size(uint dim) const { return data.topology.size(dim); }
104
/// Return mesh topology (non-const version)
105
inline MeshTopology& topology() { return _topology; }
107
/// Return mesh topology (const version)
108
inline const MeshTopology& topology() const { return _topology; }
110
/// Return mesh geometry (non-const version)
111
inline MeshGeometry& geometry() { return _geometry; }
113
/// Return mesh geometry (const version)
114
inline const MeshGeometry& geometry() const { return _geometry; }
119
/// Return mesh cell type
120
inline CellType& type() { dolfin_assert(_cell_type); return *_cell_type; }
122
/// Return mesh cell type
123
inline const CellType& type() const { dolfin_assert(_cell_type); return *_cell_type; }
103
/// Return mesh topology
104
inline MeshTopology& topology() { return data.topology; }
106
/// Return mesh topology
107
inline const MeshTopology& topology() const { return data.topology; }
109
/// Return mesh geometry
110
inline MeshGeometry& geometry() { return data.geometry; }
112
/// Return mesh geometry
113
inline const MeshGeometry& geometry() const { return data.geometry; }
115
/// Return mesh cell type
116
inline CellType& type() { dolfin_assert(data.cell_type); return *data.cell_type; }
118
/// Return mesh cell type
119
inline const CellType& type() const { dolfin_assert(data.cell_type); return *data.cell_type; }
125
121
/// Compute entities of given topological dimension and return number of entities
126
122
uint init(uint dim);