xc
Element1D.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //Element1D.h
28 
29 #ifndef Element1D_h
30 #define Element1D_h
31 
32 #include <domain/mesh/element/ElementBase.h>
33 
34 class Segment3d;
35 
36 namespace XC {
37 class Node;
38 class Material;
39 class Domain;
40 class CrdTransf;
41 class CrdTransf2d;
42 class CrdTransf3d;
43 class DeformationPlane;
44 
48 //
51 class Element1D : public ElementBase<2>
52  {
53  void unidimensional_meshing(const NodePtrArray3d &,ElemPtrArray3d &) const;
54  protected:
55  mutable std::vector<double> tributaryLengths;
56 
57  ElemPtrArray3d put_on_mesh(const NodePtrArray3d &,meshing_dir dm) const;
58  ElemPtrArray3d cose(const SetEstruct &f1,const SetEstruct &f2) const;
59 
60  int sendCoordTransf(int posFlag,const int &,const int &,CommParameters &);
61  CrdTransf *recvCoordTransf(int posFlag,const int &,const int &,const CommParameters &);
62  CrdTransf2d *recvCoordTransf2d(int posFlag,const int &,const int &,const CommParameters &);
63 
64  CrdTransf3d *recvCoordTransf3d(int posFlag,const int &,const int &,const CommParameters &);
65 
66  public:
67  Element1D(int tag, int classTag);
68  Element1D(int tag, int classTag,int Nd1,int Nd2);
69  void setDomain(Domain *theDomain);
70  Matrix getLocalAxes(bool) const;
71  virtual CrdTransf *getCoordTransf(void);
72  virtual const CrdTransf *getCoordTransf(void) const;
73  virtual CrdTransf *checkCoordTransf(void);
74  virtual const CrdTransf *checkCoordTransf(void) const;
75  virtual const Matrix &getCooPoints(const size_t &ndiv) const;
76  virtual const Vector &getCooPoint(const double &xrel) const;
77  Segment3d getLineSegment(bool initialGeometry= true) const;
78  double getDist2(const Pos2d &p,bool initialGeometry= true) const;
79  double getDist(const Pos2d &p,bool initialGeometry= true) const;
80  double getDist2(const Pos3d &p,bool initialGeometry= true) const;
81  double getDist(const Pos3d &p,bool initialGeometry= true) const;
82 
83  size_t getDimension(void) const;
84  int getVtkCellType(void) const;
85 
86  virtual void computeTributaryLengths(bool initialGeometry= true) const;
87  double getTributaryLength(const Node *) const;
88 
89  void vector2dUniformLoadGlobal(const Vector &);
90  void vector2dUniformLoadLocal(const Vector &);
91  void vector2dPointByRelDistLoadGlobal(const double &,const Vector &);
92  void vector2dPointByRelDistLoadLocal(const double &,const Vector &);
93  void vector2dPointLoadGlobal(const Vector &,const Vector &);
94  void vector2dPointLoadLocal(const Vector &,const Vector &);
95  void vector3dUniformLoadGlobal(const Vector &);
96  void vector3dUniformLoadLocal(const Vector &);
97  void vector3dPointByRelDistLoadGlobal(const double &,const Vector &);
98  void vector3dPointByRelDistLoadLocal(const double &,const Vector &);
99  void vector3dPointLoadGlobal(const Vector &,const Vector &);
100  void vector3dPointLoadLocal(const Vector &,const Vector &);
101  void strainLoad(const DeformationPlane &p1, const DeformationPlane &p2);
102 
103 
104  };
105 
106 } //end of XC namespace
107 #endif
Segment3d getLineSegment(bool initialGeometry=true) const
Return the segment defined by the element.
Definition: Element1D.cc:583
Float vector abstraction.
Definition: Vector.h:93
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: Element1D.cc:473
double getDist(const Pos2d &p, bool initialGeometry=true) const
Return the the distance from the element to the point being passed as parameter.
Definition: Element1D.cc:598
CrdTransf provides the abstraction of a frame coordinate transformation.
Definition: CrdTransf.h:87
virtual CrdTransf * getCoordTransf(void)
Returns (if possible) a pointer to the coordinate transformation.
Definition: Element1D.cc:479
virtual CrdTransf * checkCoordTransf(void)
Returns (and checks that it exists) a const pointer to the coordinate transformation.
Definition: Element1D.cc:487
double getTributaryLength(const Node *) const
Return the tributary length corresponding to the node being passed as parameter.
Definition: Element1D.cc:716
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:43
size_t getDimension(void) const
Return the element dimension (0, 1, 2 or 3).
Definition: Element1D.cc:313
Matrix getLocalAxes(bool) const
Returs a matrix with the axes of the element as matrix rows [[x1,y1,z1],[x2,y2,z2],...·].
Definition: Element1D.cc:511
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:51
virtual const Vector & getCooPoint(const double &xrel) const
Return the point that correspond to the relative coordinate 0<=xrel<=1.
Definition: Element1D.cc:562
Base class for 2D coordinate transformation.
Definition: CrdTransf2d.h:77
Deformation plane for a cross-section.
Definition: DeformationPlane.h:53
ElemPtrArray3d put_on_mesh(const NodePtrArray3d &, meshing_dir dm) const
Places the element on the mesh.
Definition: Element1D.cc:380
double getDist2(const Pos2d &p, bool initialGeometry=true) const
Return the squared distance from the element to the point que is being passed as parameter.
Definition: Element1D.cc:593
Element1D(int tag, int classTag)
Constructor.
Definition: Element1D.cc:55
virtual void computeTributaryLengths(bool initialGeometry=true) const
Calcula the tributary lengths that corresponds to each node of the element.
Definition: Element1D.cc:706
CrdTransf2d * recvCoordTransf2d(int posFlag, const int &, const int &, const CommParameters &)
Recibe una coordinate transformation 2d through the channel being passed as parameter.
Definition: Element1D.cc:662
virtual const Matrix & getCooPoints(const size_t &ndiv) const
Return points distributed between the nodes as a matrix with the coordinates as rows.
Definition: Element1D.cc:537
structured set, i.
Definition: SetEstruct.h:45
Three-dimensional array of pointers to nodes.
Definition: NodePtrArray3d.h:50
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Base class for finite element with pointer to nodes container.
Definition: ElementBase.h:46
Communication parameters between processes.
Definition: CommParameters.h:65
Matrix of floats.
Definition: Matrix.h:108
CrdTransf * recvCoordTransf(int posFlag, const int &, const int &, const CommParameters &)
Recibe la coordinate transformation through the channel being passed as parameter.
Definition: Element1D.cc:635
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:116
int getVtkCellType(void) const
Interfaz con VTK.
Definition: Element1D.cc:701
Mesh node.
Definition: Node.h:110
int sendCoordTransf(int posFlag, const int &, const int &, CommParameters &)
Envía la coordinate transformation through the channel being passed as parameter. ...
Definition: Element1D.cc:618
Base class for 3D coordinate transformation.
Definition: CrdTransf3d.h:80
CrdTransf3d * recvCoordTransf3d(int posFlag, const int &, const int &, const CommParameters &)
Recibe una coordinate transformation 3d through the channel being passed as parameter.
Definition: Element1D.cc:681