DOLFIN
DOLFIN C++ interface
Toggle main menu visibility
Loading...
Searching...
No Matches
dolfin
mesh
Vertex.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
// First added: 2006-06-01
19
// Last changed: 2013-01-09
20
21
#ifndef __VERTEX_H
22
#define __VERTEX_H
23
24
#include <memory>
25
26
#include <dolfin/geometry/Point.h>
27
#include "Mesh.h"
28
#include "MeshEntity.h"
29
#include "MeshEntityIteratorBase.h"
30
#include "MeshFunction.h"
31
32
namespace
dolfin
33
{
34
36
37
class
Vertex
:
public
MeshEntity
38
{
39
public
:
40
42
Vertex
(
const
Mesh
&
mesh
, std::size_t
index
) :
MeshEntity
(
mesh
, 0,
index
) {}
43
45
Vertex
(
MeshEntity
& entity) :
MeshEntity
(entity.
mesh
(), 0, entity.
index
()) {}
46
48
~Vertex
() {}
49
51
double
x
(std::size_t i)
const
52
{
return
_mesh->geometry().x(_local_index, i); }
53
55
Point
point
()
const
56
{
return
_mesh->geometry().point(_local_index); }
57
59
const
double
*
x
()
const
60
{
return
_mesh->geometry().x(_local_index); }
61
62
};
63
65
typedef
MeshEntityIteratorBase<Vertex>
VertexIterator
;
66
67
}
68
69
#endif
dolfin::MeshEntityIteratorBase
Base class for MeshEntityIterators.
Definition
MeshEntityIteratorBase.h:37
dolfin::MeshEntity::mesh
const Mesh & mesh() const
Definition
MeshEntity.h:99
dolfin::MeshEntity::MeshEntity
MeshEntity()
Default Constructor.
Definition
MeshEntity.h:47
dolfin::MeshEntity::index
std::size_t index() const
Definition
MeshEntity.h:113
dolfin::Mesh
Definition
Mesh.h:83
dolfin::Point
Definition
Point.h:41
dolfin::Vertex::Vertex
Vertex(MeshEntity &entity)
Create vertex from mesh entity.
Definition
Vertex.h:45
dolfin::Vertex::x
double x(std::size_t i) const
Return value of vertex coordinate i.
Definition
Vertex.h:51
dolfin::Vertex::x
const double * x() const
Return array of vertex coordinates (const version).
Definition
Vertex.h:59
dolfin::Vertex::Vertex
Vertex(const Mesh &mesh, std::size_t index)
Create vertex on given mesh.
Definition
Vertex.h:42
dolfin::Vertex::point
Point point() const
Return vertex coordinates as a 3D point value.
Definition
Vertex.h:55
dolfin::Vertex::~Vertex
~Vertex()
Destructor.
Definition
Vertex.h:48
dolfin
Definition
adapt.h:30
dolfin::VertexIterator
MeshEntityIteratorBase< Vertex > VertexIterator
A VertexIterator is a MeshEntityIterator of topological dimension 0.
Definition
Vertex.h:65
Generated by
1.17.0