xc
NodePtrsWithIDs.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //NodePtrsWithIDs.h
29 
30 #ifndef NodePtrsWithIDs_h
31 #define NodePtrsWithIDs_h
32 
33 #include "NodePtrs.h"
34 #include "utility/matrix/ID.h"
35 #include "utility/actor/actor/MovableObject.h"
36 
37 namespace XC {
38 class Node;
39 class Domain;
40 class Channel;
41 class FEM_ObjectBroker;
42 
44 //
46 class NodePtrsWithIDs: public NodePtrs, public MovableObject
47  {
48  protected:
50 
51  DbTagData &getDbTagData(void) const;
52  int sendData(Communicator &comm);
53  int recvData(const Communicator &comm);
54 
55 
56  friend class Element;
57  void set_node_ptrs(Domain *domain);
58  public:
59  NodePtrsWithIDs(Element *owr,size_t numNodes);
60 
61  inline const size_t numNodes(void)
62  { return NodePtrs::size(); }
63  // public methods to obtain information about dof & connectivity
64  int getNumExternalNodes(void) const;
65  NodePtrs &getNodePtrs(void);
66  const NodePtrs &getNodePtrs(void) const;
67  const ID &getExternalNodes(void) const;
68  int getTagNode(const int &i) const;
69 
70 
71  bool set_id_nodes(int Nd1,int Nd2);
72  bool set_id_nodes(int nd1,int nd2,int nd3);
73  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4);
74  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5);
75  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6);
76  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7);
77  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8);
78  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8,int nd9);
79  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,int nd8,int nd9,int nd10
80  ,int nd11,int nd12,int nd13,int nd14,int nd15,int nd16,int nd17,int nd18,int nd19,int nd20);
81  bool set_id_nodes(int nd1,int nd2,int nd3,int nd4,int nd5,int nd6,int nd7,
82  int nd8,int nd9,int nd10,int nd11,int nd12,int nd13,
83  int nd14,int nd15,int nd16,int nd17,int nd18,int nd19,
84  int nd20, int nd21, int nd22,int nd23, int nd24, int nd25,
85  int nd26,int nd27);
86  bool set_id_nodes(const std::vector<int> &inodes);
87  bool set_id_nodes(const ID &inodes);
88  bool set_id_node(const int &i, const int &inode);
89  void reverse(void);
90  void Print(std::ostream &os) const;
91  int sendSelf(Communicator &);
92  int recvSelf(const Communicator &);
93  boost::python::dict getPyDict(void) const;
94  void setPyDict(const boost::python::dict &);
95 
96  bool equalNumDOF(void);
97  bool checkNumDOF(const size_t &, const size_t &);
98 
99  };
100 
101 std::ostream &operator<<(std::ostream &,const NodePtrsWithIDs &);
102 
103 } //end of XC namespace
104 #endif
void Print(std::ostream &os) const
Printing...
Definition: NodePtrsWithIDs.cc:289
Communication parameters between processes.
Definition: Communicator.h:66
Object that can move between processes.
Definition: MovableObject.h:100
bool equalNumDOF(void)
True if all nodes has the same DOF number.
Definition: NodePtrsWithIDs.cc:248
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Vector of integers.
Definition: ID.h:95
Base class for the finite elements.
Definition: Element.h:112
NodePtrsWithIDs(Element *owr, size_t numNodes)
@ brief Default constructor.
Definition: NodePtrsWithIDs.cc:34
ID connectedExternalNodes
contains the tags of the end nodes.
Definition: NodePtrsWithIDs.h:49
NodePtrs & getNodePtrs(void)
Returns a pointer to the node vector.
Definition: NodePtrsWithIDs.cc:58
int recvData(const Communicator &comm)
Receives object members through the communicator argument.
Definition: NodePtrsWithIDs.cc:317
int sendData(Communicator &comm)
Sends object members through the communicator argument.
Definition: NodePtrsWithIDs.cc:313
Element pointers to nodes.
Definition: NodePtrs.h:60
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: NodePtrsWithIDs.cc:306
int getNumExternalNodes(void) const
Return the number of external nodes.
Definition: NodePtrsWithIDs.cc:50
boost::python::dict getPyDict(void) const
Return a Python dictionary with the object members values.
Definition: NodePtrsWithIDs.cc:321
const ID & getExternalNodes(void) const
Returns external nodes identifiers.
Definition: NodePtrsWithIDs.cc:62
int getTagNode(const int &i) const
Returns the tag of the i-th node.
Definition: NodePtrsWithIDs.cc:66
void set_node_ptrs(Domain *domain)
Set los pointers to the nodes.
Definition: NodePtrsWithIDs.cc:127
Node pointer container for elements.
Definition: NodePtrsWithIDs.h:46
void setPyDict(const boost::python::dict &)
Set the values of the object members from a Python dictionary.
Definition: NodePtrsWithIDs.cc:329
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int recvSelf(const Communicator &)
Receive the object.
Definition: NodePtrsWithIDs.cc:348
bool set_id_node(const int &i, const int &inode)
Sets the i-th node identifier (tag).
Definition: NodePtrsWithIDs.cc:103
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
bool set_id_nodes(int Nd1, int Nd2)
Sets identifiers for nodes 1 and 2.
Definition: NodePtrsWithIDs.cc:134
void reverse(void)
Reverse the node sequence.
Definition: NodePtrsWithIDs.cc:363
bool checkNumDOF(const size_t &, const size_t &)
Check DOF number on nodes.
Definition: NodePtrsWithIDs.cc:269
int sendSelf(Communicator &)
Send the object.
Definition: NodePtrsWithIDs.cc:335