XC Open source finite element analysis program
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 //
73 class Vertex: public TaggedObject, public MovableObject
74  {
75  private:
76  int myRef;
77  double myWeight;
78  int myColor;
79  int myDegree;
80  int myTmp;
81  std::set<int> myAdjacency;
82  protected:
83  int sendData(CommParameters &);
84  int recvData(const CommParameters &);
85 
86  public:
87  Vertex(int tag= 0, int ref= 0, double weight=0, int color =0);
88 
89  virtual void setWeight(double newWeight);
90  virtual void setColor(int newColor);
91  virtual void setTmp(int newTmp);
92 
93  virtual int getRef(void) const;
94  virtual double getWeight(void) const;
95  virtual int getColor(void) const;
96  virtual int getTmp(void) const;
97 
98  virtual int addEdge(int otherTag);
99  virtual int getDegree(void) const;
100  virtual const std::set<int> &getAdjacency(void) const;
101 
102  virtual void Print(std::ostream &os, int flag =0);
103  int sendSelf(CommParameters &);
104  int recvSelf(const CommParameters &);
105  };
106 } // end of XC namespace
107 
108 #endif
109 
Vertex(int tag=0, int ref=0, double weight=0, int color=0)
Constructor.
Definition: Vertex.cpp:64
int recvData(const CommParameters &)
Receives object members through the channel being passed as parameter.
Definition: Vertex.cpp:141
int recvSelf(const CommParameters &)
Recibe.
Definition: Vertex.cpp:169
virtual void setColor(int newColor)
Assigns a color to the vertex.
Definition: Vertex.cpp:74
virtual int addEdge(int otherTag)
Appends an edge to the vertex.
Definition: Vertex.cpp:95
virtual int getDegree(void) const
Returns the vertex degree on the graph.
Definition: Vertex.cpp:103
virtual double getWeight(void) const
Returns the weight of the vertex.
Definition: Vertex.cpp:84
virtual void setWeight(double newWeight)
Assigns a weight to the vertex.
Definition: Vertex.cpp:70
virtual int getColor(void) const
Returns the color of the vertex.
Definition: Vertex.cpp:88
Object that can move between processes.
Definition: MovableObject.h:91
Vertex of a graph.
Definition: Vertex.h:73
Object idenfied by an integer (tag).
Definition: TaggedObject.h:82
virtual const std::set< int > & getAdjacency(void) const
Return the adjacency list of the vertex in the graph.
Definition: Vertex.cpp:107
virtual void Print(std::ostream &os, int flag=0)
Prints.
Definition: Vertex.cpp:111
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34
int sendSelf(CommParameters &)
Envía.
Definition: Vertex.cpp:155
int sendData(CommParameters &)
Send object members through the channel being passed as parameter.
Definition: Vertex.cpp:130