xc
BidimMecLoad.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 //BidimMecLoad.h
29 
30 #ifndef BidimMecLoad_h
31 #define BidimMecLoad_h
32 
33 
34 #include "BidimLoad.h"
35 #include "utility/geom/pos_vec/Pos3d.h"
36 #include <utility/matrix/Vector.h>
37 #include <utility/matrix/Matrix.h>
38 #include "utility/geom/pos_vec/Vector3d.h"
39 
41 
42 namespace XC {
43 
45 //
47 template <size_t force_vector_dim>
48 class BidimMecLoad: public BidimLoad
49  {
50  public:
51  BidimMecLoad(int tag, int classTag, const ID &theElementTags)
52  : BidimLoad(tag, classTag, theElementTags) {}
53  BidimMecLoad(int tag, int classTag)
54  : BidimLoad(tag, classTag) {}
55 
56  static size_t getForceVectorDimension(void)
57  { return force_vector_dim; }
58 
59  virtual Vector getLocalForce(void) const;
60  Vector3d getVector3dLocalForce(void) const;
61  virtual const Matrix &getLocalForces(void) const;
62  virtual const Matrix &getGlobalVectors(const Matrix &) const= 0;
63  virtual const Matrix &getGlobalForces(void) const;
64 
65  virtual SlidingVectorsSystem3d getResultant(const Pos3d &p= Pos3d(), bool initialGeometry= true) const= 0;
66  };
67 
69 template <size_t force_vector_dim>
71  {
72  Vector retval(force_vector_dim);
73  std::cerr << getClassName() << "::" << __FUNCTION__
74  << "; not implemented." << std::endl;
75  return retval;
76  }
77 
80 template <size_t force_vector_dim>
82  {
83  Vector f= getLocalForce();
84  Vector3d retval;
85  if(f.Size()==2)
86  retval= Vector3d(f[0],f[1],f[2]);
87  else
88  retval= Vector3d(f[0],f[1],0.0);
89  return retval;
90  }
91 
93 template <size_t force_vector_dim>
95  {
96  static Matrix retval;
97  std::cerr << getClassName() << "::" << __FUNCTION__
98  << "; not implemented." << std::endl;
99  return retval;
100  }
101 
103 template <size_t force_vector_dim>
105  { return this->getGlobalVectors(this->getLocalForces()); }
106 
107 } // end of XC namespace
108 
109 #endif
110 
Float vector abstraction.
Definition: Vector.h:94
virtual const Matrix & getLocalForces(void) const
Returns the components of the force vectors.
Definition: BidimMecLoad.h:94
Load over bidimensional elements.
Definition: BidimLoad.h:41
Vector of integers.
Definition: ID.h:95
Mechanical load (forces) over bidimensional elements.
Definition: BidimMecLoad.h:48
virtual Vector getLocalForce(void) const
Returns force expressed in local coordinates.
Definition: BidimMecLoad.h:70
int Size(void) const
Returns the size of the Vector.
Definition: Vector.h:240
virtual std::string getClassName(void) const
Returns demangled class name.
Definition: EntityWithOwner.cc:90
Posición en tres dimensiones.
Definition: Pos3d.h:44
Sliding vectors system en un espacio tridimensional.
Definition: SlidingVectorsSystem3d.h:39
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
Vector3d getVector3dLocalForce(void) const
Return the local components of the force in a Vector3d.
Definition: BidimMecLoad.h:81
virtual const Matrix & getGlobalForces(void) const
Return the forces on each element expressed in global coordinates.
Definition: BidimMecLoad.h:104
Vector en tres dimensiones.
Definition: Vector3d.h:39