OOFEM 3.0
Loading...
Searching...
No Matches
sloangraphnode.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35/* Modified and optimized by: Borek Patzak */
36/* Author: Milan Jirasek */
37
38#include "sloangraphnode.h"
39#include "sloangraph.h"
40#include "mathfem.h"
41
42namespace oofem {
43SloanGraphNode :: SloanGraphNode(SloanGraph *graph, int numOld) : neighborList()
44{
45 this->graph = graph;
46 NumberOld = numOld;
47 NumberNew = 0;
49 Degree = 0;
50 Distance = -1;
51 Priority = -1;
52}
53
54SloanGraphNode :: ~SloanGraphNode()
55{ }
56
57void SloanGraphNode :: addNeighbor(int newNeighbor)
58{
59 // check if neighbor already in list
60 for ( int neighbor: this->neighborList ) {
61 if ( neighbor == newNeighbor ) {
62 return;
63 }
64 }
65
66 Degree++;
67 this->neighborList.push_front(newNeighbor);
68}
69
70int SloanGraphNode :: computeProfileHeight()
71{
72 int numberMin = NumberNew;
73 for ( int neighbor: this->neighborList ) {
74 numberMin = min( numberMin, this->graph->giveNode(neighbor).giveNewNumber() );
75 }
76
77 return ( NumberNew - numberMin + 1 );
78}
79} // end namespace oofem
int Priority
Node priority.
SloanGraph * graph
Associated graph structure, to which node belongs.
SloanGraphNode_StatusType nodeStatus
Status of node.
int NumberOld
Old (original) number.
int Degree
Node degree (number of adjacent edges).
int NumberNew
New (optimized) number.
std ::list< int > neighborList
List of neighbouring nodes (represent graph edges).
int Distance
Node distance.
FloatArrayF< N > min(const FloatArrayF< N > &a, const FloatArrayF< N > &b)

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011