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:
48  int numDOF;
49  int dimSpace;
52 
53  // static data - single copy for all objects of the class
54  static Matrix trussM2; // class wide matrix for 2*2
55  static Matrix trussM3; // class wide matrix for 3*3
56  static Matrix trussM4; // class wide matrix for 4*4
57  static Matrix trussM6; // class wide matrix for 6*6
58  static Matrix trussM12; // class wide matrix for 12*12
59  static Vector trussV2; // class wide Vector for size 2
60  static Vector trussV3; // class wide Vector for size 3
61  static Vector trussV4; // class wide Vector for size 44
62  static Vector trussV6; // class wide Vector for size 6
63  static Vector trussV12; // class wide Vector for size 12
64 
65  int sendData(Communicator &comm);
66  int recvData(const Communicator &comm);
67  void setup_matrix_vector_ptrs(int dofNd1);
68 
69  public:
70  ProtoTruss(int tag, int classTag,int Nd1,int Nd2,int ndof,int dimSpace);
71 
72  virtual const Material *getMaterial(void) const= 0;
73  virtual Material *getMaterial(void)= 0;
74  Material &getMaterialRef(void);
75  virtual double getRho(void) const= 0;
76  virtual double getLinearRho(void) const;
77 
78  virtual void createInertiaLoad(const Vector &);
79 
80  virtual double getAxialForce(void) const= 0;
81  virtual double getInitialStrain(void) const;
82 
83  // public methods to obtain information about dof & connectivity
84  int getNumDIM(void) const;
85  int getNumDOF(void) const;
86 
87  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
88  };
89 
90 } //end of XC namespace
91 #endif
int getNumDIM(void) const
Return the dimension of the space on which the element is defined (2D or 3D).
Definition: ProtoTruss.cc:58
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:191
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:48
virtual void createInertiaLoad(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: ProtoTruss.cc:153
Base class for materials.
Definition: Material.h:93
Vector * theVector
pointer to objects vector (a class wide Vector)
Definition: ProtoTruss.h:51
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: ProtoTruss.cc:134
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:144
Matrix * theMatrix
pointer to objects matrix (a class wide Matrix)
Definition: ProtoTruss.h:50
int getNumDOF(void) const
Returns the number of DOFs.
Definition: ProtoTruss.cc:53
void setup_matrix_vector_ptrs(int dofNd1)
Set the number of dof for element and set matrix and vector pointers.
Definition: ProtoTruss.cc:70
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:47
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:124
Matrix of floats.
Definition: Matrix.h:111
Material & getMaterialRef(void)
Returns a reference to element&#39;s material.
Definition: ProtoTruss.cc:62
int dimSpace
truss in 2 or 3d domain
Definition: ProtoTruss.h:49
virtual double getInitialStrain(void) const
Return the element initial strain.
Definition: ProtoTruss.cc:175