xc
ProtoTruss.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 //ProtoTruss.h
29 
30 #ifndef ProtoTruss_h
31 #define ProtoTruss_h
32 
33 #include <domain/mesh/element/Element1D.h>
34 
35 namespace XC {
36 class Node;
37 class Material;
38 
42 //
45 class ProtoTruss: public Element1D
46  {
47  protected:
49 
50  int numDOF;
51  int dimSpace;
54 
55  // static data - single copy for all objects of the class
56  static Matrix trussM2; // class wide matrix for 2*2
57  static Matrix trussM3; // class wide matrix for 3*3
58  static Matrix trussM4; // class wide matrix for 4*4
59  static Matrix trussM6; // class wide matrix for 6*6
60  static Matrix trussM12; // class wide matrix for 12*12
61  static Vector trussV2; // class wide Vector for size 2
62  static Vector trussV3; // class wide Vector for size 3
63  static Vector trussV4; // class wide Vector for size 44
64  static Vector trussV6; // class wide Vector for size 6
65  static Vector trussV12; // class wide Vector for size 12
66 
67  int sendData(Communicator &comm);
68  int recvData(const Communicator &comm);
69  void setup_matrix_vector_ptrs(int dofNd1);
70 
71  public:
72  ProtoTruss(int tag, int classTag,int Nd1,int Nd2,int ndof,int dimSpace);
73 
74  virtual const Material *getMaterial(void) const= 0;
75  virtual Material *getMaterial(void)= 0;
76  Material &getMaterialRef(void);
77  virtual double getRho(void) const= 0;
78  virtual double getLinearRho(void) const;
79 
80  virtual ElementalLoad *createInertiaLoad(const Vector &);
81 
82  virtual double getAxialForce(void) const= 0;
83  virtual double getInitialStrain(void) const;
84 
85  // public methods to obtain information about dof & connectivity
86  int getNumDIM(void) const;
87  int getNumDOF(void) const;
88 
89  virtual const Matrix &getExtrapolationMatrix(void) const
90  { return extrapolation_matrix; }
91  Matrix getExtrapolatedValues(const Matrix &) const;
92 
93  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
94  };
95 
96 } //end of XC namespace
97 #endif
int getNumDIM(void) const
Return the dimension of the space on which the element is defined (2D or 3D).
Definition: ProtoTruss.cc:63
boost::python::list getValuesAtNodes(const std::string &, bool silent=false) const
Return a python list with the values of the argument property at element nodes.
Definition: ProtoTruss.cc:207
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
int numDOF
number of dof for truss
Definition: ProtoTruss.h:50
static Matrix extrapolation_matrix
Extrapolation matrix.
Definition: ProtoTruss.h:48
Base class for materials.
Definition: Material.h:93
Vector * theVector
pointer to objects vector (a class wide Vector)
Definition: ProtoTruss.h:53
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: ProtoTruss.cc:143
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
virtual double getLinearRho(void) const
Returns the element mass per unit length.
Definition: ProtoTruss.cc:153
Matrix * theMatrix
pointer to objects matrix (a class wide Matrix)
Definition: ProtoTruss.h:52
int getNumDOF(void) const
Returns the number of DOFs.
Definition: ProtoTruss.cc:58
void setup_matrix_vector_ptrs(int dofNd1)
Set the number of dof for element and set matrix and vector pointers.
Definition: ProtoTruss.cc:75
Base class for truss elements.
Definition: ProtoTruss.h:45
ProtoTruss(int tag, int classTag, int Nd1, int Nd2, int ndof, int dimSpace)
Default constructor.
Definition: ProtoTruss.cc:52
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: ProtoTruss.cc:133
Matrix of floats.
Definition: Matrix.h:111
Material & getMaterialRef(void)
Returns a reference to element&#39;s material.
Definition: ProtoTruss.cc:67
Matrix getExtrapolatedValues(const Matrix &) const
Extrapolate from Gauss points to nodes.
Definition: ProtoTruss.cc:269
Base class for loads over elements.
Definition: ElementalLoad.h:79
int dimSpace
truss in 2 or 3d domain
Definition: ProtoTruss.h:51
virtual double getInitialStrain(void) const
Return the element initial strain.
Definition: ProtoTruss.cc:190
virtual ElementalLoad * createInertiaLoad(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: ProtoTruss.cc:163