xc
BodyForces.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 //BodyForces.h
29 
30 #ifndef BodyForces_h
31 #define BodyForces_h
32 
33 #include "utility/actor/actor/MovableObject.h"
34 #include "utility/matrix/Vector.h"
35 
36 namespace XC {
37 
39 //
42  {
43  protected:
45 
46  DbTagData &getDbTagData(void) const;
47  int sendData(Communicator &);
48  int recvData(const Communicator &);
49 
50  public:
51  BodyForces(const size_t &sz);
52 
53  inline size_t size(void) const
54  { return forces.Size(); }
55 
56  inline double &operator[](const size_t &i)
57  { return forces[i]; }
58  inline const double &operator[](const size_t &i) const
59  { return forces[i]; }
60  inline double &operator()(const size_t &i)
61  { return forces(i); }
62  inline const double &operator()(const size_t &i) const
63  { return forces(i); }
64 
65  int sendSelf(Communicator &);
66  int recvSelf(const Communicator &);
67 
68  virtual void Print(std::ostream &s) const;
69  };
70 
72 inline std::ostream &operator<<(std::ostream &os,const BodyForces &bf)
73  {
74  bf.Print(os);
75  return os;
76  }
77 } //end of XC namespace
78 
79 #endif
Float vector abstraction.
Definition: Vector.h:94
virtual void Print(std::ostream &s) const
Sends object.
Definition: BodyForces.cc:85
Communication parameters between processes.
Definition: Communicator.h:66
int sendData(Communicator &)
Send members through the communicator argument.
Definition: BodyForces.cc:43
Body forces over an element.
Definition: BodyForces.h:41
Object that can move between processes.
Definition: MovableObject.h:100
int sendSelf(Communicator &)
Sends object.
Definition: BodyForces.cc:57
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Vector forces
Body force components.
Definition: BodyForces.h:44
int Size(void) const
Returns the size of the Vector.
Definition: Vector.h:235
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: BodyForces.cc:50
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: BodyForces.cc:36
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int recvSelf(const Communicator &)
Receives object.
Definition: BodyForces.cc:71