xc
Vertex.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.3 $
48 // $Date: 2005/11/03 23:11:55 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/graph/graph/Vertex.h,v $
50 
51 
52 #ifndef Vertex_h
53 #define Vertex_h
54 
55 // Written: fmk
56 // Revision: A
57 //
58 // Description: This file contains the class definition for Vertex.
59 // Vertex is an element of a graph.
60 //
61 // What: "@(#) Vertex.h, revA"
62 
63 #include "utility/tagged/TaggedObject.h"
64 #include "utility/actor/actor/MovableObject.h"
65 #include "utility/matrix/ID.h"
66 
67 #define START_VERTEX_NUM 0
68 namespace XC {
69 
71 //
79 class Vertex: public TaggedObject, public MovableObject
80  {
81  private:
82  int myRef;
83  double myWeight;
84  int myColor;
85  int myDegree;
86  int myTmp;
87  std::set<int> myAdjacency;
88  protected:
89  int sendData(CommParameters &);
90  int recvData(const CommParameters &);
91 
92  public:
93  Vertex(int tag= 0, int ref= 0, double weight=0, int color =0);
94 
95  virtual void setWeight(double newWeight);
96  virtual void setColor(int newColor);
97  virtual void setTmp(int newTmp);
98 
99  virtual int getRef(void) const;
100  virtual double getWeight(void) const;
101  virtual int getColor(void) const;
102  virtual int getTmp(void) const;
103 
104  virtual int addEdge(int otherTag);
105  virtual int getDegree(void) const;
106  virtual const std::set<int> &getAdjacency(void) const;
107 
108  virtual void Print(std::ostream &os, int flag =0);
109  int sendSelf(CommParameters &);
110  int recvSelf(const CommParameters &);
111  };
112 } // end of XC namespace
113 
114 #endif
115 
int sendData(CommParameters &)
Send object members through the channel being passed as parameter.
Definition: Vertex.cpp:157
virtual void setWeight(double newWeight)
Assigns a weight to the vertex.
Definition: Vertex.cpp:74
Vertex of a graph.
Definition: Vertex.h:79
int sendSelf(CommParameters &)
Send vertex data.
Definition: Vertex.cpp:182
virtual void Print(std::ostream &os, int flag=0)
Print stuff.
Definition: Vertex.cpp:138
virtual double getWeight(void) const
Returns the weight of the vertex.
Definition: Vertex.cpp:90
Object that can move between processes.
Definition: MovableObject.h:99
virtual int getRef(void) const
Returns the vertices integer reference.
Definition: Vertex.cpp:86
virtual int getDegree(void) const
Returns the vertex degree on the graph.
Definition: Vertex.cpp:121
int recvSelf(const CommParameters &)
Receives vertex data.
Definition: Vertex.cpp:197
virtual int getColor(void) const
Returns the color of the vertex.
Definition: Vertex.cpp:94
virtual void setColor(int newColor)
Assigns a color to the vertex.
Definition: Vertex.cpp:78
virtual int getTmp(void) const
Returns the vertices temporary variable.
Definition: Vertex.cpp:98
virtual void setTmp(int newTmp)
To set the temporary variable of the vertex to newTmp.
Definition: Vertex.cpp:82
Object idenfied by an integer (tag).
Definition: TaggedObject.h:91
virtual const std::set< int > & getAdjacency(void) const
Return the adjacency list of the vertex in the graph.
Definition: Vertex.cpp:128
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
int recvData(const CommParameters &)
Receives object members through the channel being passed as parameter.
Definition: Vertex.cpp:168
Communication parameters between processes.
Definition: CommParameters.h:65
virtual int addEdge(int otherTag)
Appends an edge to the vertex.
Definition: Vertex.cpp:113
Vertex(int tag=0, int ref=0, double weight=0, int color=0)
Constructor.
Definition: Vertex.cpp:68