xc
NodePtrsWithIDs.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 //NodePtrsWithIDs.h
28 
29 #ifndef NodePtrsWithIDs_h
30 #define NodePtrsWithIDs_h
31 
32 #include "NodePtrs.h"
33 #include "utility/matrix/ID.h"
34 #include "utility/actor/actor/MovableObject.h"
35 
36 namespace XC {
37 class Node;
38 class Domain;
39 class Channel;
40 class FEM_ObjectBroker;
41 
43 //
45 class NodePtrsWithIDs: public NodePtrs, public MovableObject
46  {
47  protected:
49 
50  DbTagData &getDbTagData(void) const;
51  int sendData(CommParameters &cp);
52  int recvData(const CommParameters &cp);
53 
54 
55  friend class Element;
56  void set_node_ptrs(Domain *domain);
57  public:
58  NodePtrsWithIDs(Element *owr,size_t numNodes);
59 
60  inline const size_t numNodes(void)
61  { return NodePtrs::size(); }
62  // public methods to obtain information about dof & connectivity
63  int getNumExternalNodes(void) const;
64  NodePtrs &getNodePtrs(void);
65  const NodePtrs &getNodePtrs(void) const;
66  const ID &getExternalNodes(void) const;
67  int getTagNode(const int &i) const;
68 
69 
70  void set_id_nodes(int Nd1,int Nd2);
71  void set_id_nodes(int nd1,int nd2,int nd3);
72  void set_id_nodes(int nd1,int nd2,int nd3,int nd4);
73  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5);
74  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6);
75  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7);
76  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8);
77  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8,int nd9);
78  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8,int nd9,int nd10
79  ,int nd11,int nd12,int nd13,int nd14,int nd15,int nd16,int nd17,int nd18,int nd19,int nd20);
80  void set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,
81  int nd8,int nd9,int nd10,int nd11,int nd12,int nd13,
82  int nd14,int nd15,int nd16,int nd17,int nd18,int nd19,
83  int nd20, int nd21, int nd22,int nd23, int nd24, int nd25,
84  int nd26,int nd27);
85  void set_id_nodes(const std::vector<int> &inodes);
86  void set_id_nodes(const ID &inodes);
87  void Print(std::ostream &os) const;
88  int sendSelf(CommParameters &);
89  int recvSelf(const CommParameters &);
90  bool equalNumDOF(void);
91  bool checkNumDOF(const size_t &, const size_t &);
92 
93  };
94 
95 std::ostream &operator<<(std::ostream &,const NodePtrsWithIDs &);
96 
97 } //end of XC namespace
98 #endif
int sendSelf(CommParameters &)
Send the object.
Definition: NodePtrsWithIDs.cc:269
void Print(std::ostream &os) const
Printing...
Definition: NodePtrsWithIDs.cc:238
Object that can move between processes.
Definition: MovableObject.h:99
bool equalNumDOF(void)
True if all nodes has the same DOF number.
Definition: NodePtrsWithIDs.cc:201
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:43
Vector of integers.
Definition: ID.h:93
Base class for the finite elements.
Definition: Element.h:109
NodePtrsWithIDs(Element *owr, size_t numNodes)
@ brief Default constructor.
Definition: NodePtrsWithIDs.cc:33
ID connectedExternalNodes
contains the tags of the end nodes.
Definition: NodePtrsWithIDs.h:48
NodePtrs & getNodePtrs(void)
Returns a pointer to the node vector.
Definition: NodePtrsWithIDs.cc:54
Pointers to nodes.
Definition: NodePtrs.h:59
void set_id_nodes(int Nd1, int Nd2)
Sets identifiers for nodes 1 and 2.
Definition: NodePtrsWithIDs.cc:97
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: NodePtrsWithIDs.cc:255
int recvSelf(const CommParameters &)
Receive the object.
Definition: NodePtrsWithIDs.cc:280
int getNumExternalNodes(void) const
Return the number of external nodes.
Definition: NodePtrsWithIDs.cc:46
const ID & getExternalNodes(void) const
Returns external nodes identifiers.
Definition: NodePtrsWithIDs.cc:58
int sendData(CommParameters &cp)
Sends object members through the channel being passed as parameter.
Definition: NodePtrsWithIDs.cc:262
int getTagNode(const int &i) const
Returns the tag of the i-th node.
Definition: NodePtrsWithIDs.cc:62
void set_node_ptrs(Domain *domain)
Set los pointers to the nodes.
Definition: NodePtrsWithIDs.cc:90
Node pointer container for elements.
Definition: NodePtrsWithIDs.h:45
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
int recvData(const CommParameters &cp)
Receives object members through the channel being passed as parameter.
Definition: NodePtrsWithIDs.cc:266
Communication parameters between processes.
Definition: CommParameters.h:65
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
bool checkNumDOF(const size_t &, const size_t &)
Check DOF number on nodes.
Definition: NodePtrsWithIDs.cc:219