Flow123d
release_1.8.2-2141-g34b6400
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
flow123d
src
mesh
nodes.hh
Go to the documentation of this file.
1
/*!
2
*
3
* Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4
*
5
* This program is free software; you can redistribute it and/or modify it under
6
* the terms of the GNU General Public License version 3 as published by the
7
* Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8
*
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
*
13
*
14
* @file nodes.hh
15
* @brief Nodes of a mesh.
16
*/
17
18
#ifndef NODE_H
19
#define NODE_H
20
21
#include "
system/global_defs.h
"
22
#include "
mesh/mesh_types.hh
"
23
#include <armadillo>
24
25
26
27
28
/**
29
* Class of node.
30
* First approach in turning to class.
31
*/
32
class
Node
{
33
private
:
34
/// Node point in 3D space.
35
arma::vec3
coordinates
;
36
37
public
:
38
/**
39
* Default constructor.
40
*/
41
Node
()
42
//: element(NULL)
43
{
coordinates
.zeros();}
44
45
/**
46
* Construct form given coordinates.
47
*
48
* Possibly there could be also constructor from a vector.
49
*/
50
Node
(
double
x,
double
y,
double
z)
51
//: element(NULL)
52
{
coordinates
(0)=x;
coordinates
(1)=y;
coordinates
(2)=z;}
53
54
/**
55
* Old getter methods. OBSOLETE.
56
*/
57
inline
double
getX
()
const
58
{
return
coordinates
[0];}
59
inline
double
getY
()
const
60
{
return
coordinates
[1];}
61
inline
double
getZ
()
const
62
{
return
coordinates
[2];}
63
64
65
/**
66
* Getter method for nodal point. Can be used also for modification.
67
*/
68
inline
arma::vec3
&
point
()
69
{
return
coordinates
; }
70
71
inline
const
arma::vec3
&
point
()
const
72
{
return
coordinates
; }
73
74
/**
75
* Difference of two nodes is a vector.
76
*/
77
inline
arma::vec3
operator-
(
const
Node
&n2)
const
78
{
79
return
( this->
point
() - n2.
point
() );
80
}
81
82
83
/**
84
* Distance of two nodes.
85
*/
86
inline
double
distance
(
const
Node
&n2)
const
87
{
88
return
norm(*
this
- n2, 2);
89
}
90
91
92
// Misc
93
int
aux
;
// Auxiliary flag
94
};
95
96
#endif
97
//-----------------------------------------------------------------------------
98
// vim: set cindent:
arma::vec3
Definition:
doxy_dummy_defs.hh:17
Node::getY
double getY() const
Definition:
nodes.hh:59
Node
Definition:
nodes.hh:32
Node::operator-
arma::vec3 operator-(const Node &n2) const
Definition:
nodes.hh:77
Node::distance
double distance(const Node &n2) const
Definition:
nodes.hh:86
Node::coordinates
arma::vec3 coordinates
Node point in 3D space.
Definition:
nodes.hh:35
Node::getZ
double getZ() const
Definition:
nodes.hh:61
global_defs.h
Global macros to enhance readability and debugging, general constants.
Node::getX
double getX() const
Definition:
nodes.hh:57
Node::aux
int aux
Definition:
nodes.hh:93
Node::point
const arma::vec3 & point() const
Definition:
nodes.hh:71
Node::point
arma::vec3 & point()
Definition:
nodes.hh:68
mesh_types.hh
Generated by
1.8.5