Flow123d
nodes.cc
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2007 Technical University of Liberec. All rights reserved.
4  *
5  * Please make a following refer to Flow123d on your project site if you use the program for any purpose,
6  * especially for academic research:
7  * Flow123d, Research Centre: Advanced Remedial Technologies, Technical University of Liberec, Czech Republic
8  *
9  * This program is free software; you can redistribute it and/or modify it under the terms
10  * of the GNU General Public License version 3 as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along with this program; if not,
17  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 021110-1307, USA.
18  *
19  *
20  * $Id$
21  * $Revision$
22  * $LastChangedBy$
23  * $LastChangedDate$
24  *
25  * @file
26  * @ingroup mesh
27  * @brief Class nodes
28  *
29  */
30 
31 #if 0
32 #include "mesh/nodes.hh"
33 
34 Node::Node() {
35  coordinates = new double[3];
36 
37  n_elements = NDEF;
38 
39  scalar = 0.0;
40  //conc = NULL;
41  aux = NDEF;
42  faux = 0.0;
43 }
44 
45 void Node::set(double x, double y, double z) {
46  coordinates[0] = x;
47  coordinates[1] = y;
48  coordinates[2] = z;
49 }
50 
51 double Node::getX() {
52  return coordinates[0];
53 }
54 
55 double Node::getY() {
56  return coordinates[1];
57 }
58 
59 double Node::getZ() {
60  return coordinates[2];
61 }
62 
63 /**
64  * Calculation of distance between nodes (given node and this node).
65  *
66  */
67 double Node::distance(Node* node) {
68  ASSERT(!(node == NULL), "NULL as argument of method distance(TNode*)\n");
69 
70  double distance;
71 
72  distance = sqrt(
73  (node->getX() - getX()) * (node->getX() - getX())
74  + (node->getY() - getY()) * (node->getY() - getY())
75  + (node->getZ() - getZ()) * (node->getZ() - getZ())
76  );
77 
78  return distance;
79 }
80 #endif
81 //-----------------------------------------------------------------------------
82 // vim: set cindent: