xc
Element1D.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 //Element1D.h
29 
30 #ifndef Element1D_h
31 #define Element1D_h
32 
33 #include <domain/mesh/element/ElementBase.h>
34 
35 class Segment3d;
36 
37 namespace XC {
38 class Node;
39 class Material;
40 class Domain;
41 class CrdTransf;
42 class CrdTransf2d;
43 class CrdTransf3d;
44 class DeformationPlane;
45 
49 //
52 class Element1D: public ElementBase<2>
53  {
54  void unidimensional_meshing(const NodePtrArray3d &,ElemPtrArray3d &) const;
55  protected:
56  mutable std::vector<double> tributaryLengths;
57 
58  static void shape1d(const double &, double shp[2]);
59 
60  ElemPtrArray3d put_on_mesh(const NodePtrArray3d &,meshing_dir dm) const;
61  ElemPtrArray3d sew(const SetEstruct &f1,const SetEstruct &f2) const;
62 
63  int sendCoordTransf(int posFlag,const int &,const int &,Communicator &);
64  CrdTransf *recvCoordTransf(int posFlag,const int &,const int &,const Communicator &);
65  CrdTransf2d *recvCoordTransf2d(int posFlag,const int &,const int &,const Communicator &);
66 
67  CrdTransf3d *recvCoordTransf3d(int posFlag,const int &,const int &,const Communicator &);
68 
69 
70  public:
71  Element1D(int tag, int classTag);
72  Element1D(int tag, int classTag,int Nd1,int Nd2);
73 
74  BoolArray3d getNodePattern(void) const;
75  void setDomain(Domain *theDomain);
76  Matrix getLocalAxes(bool) const;
77  virtual CrdTransf *getCoordTransf(void);
78  virtual const CrdTransf *getCoordTransf(void) const;
79  int initializeCoordTransf(void);
80  virtual CrdTransf *checkCoordTransf(void);
81  virtual const CrdTransf *checkCoordTransf(void) const;
82  virtual const Matrix &getCooPoints(const size_t &ndiv) const;
83  virtual const Vector &getCooPoint(const double &xrel) const;
84  Segment3d getLineSegment(bool initialGeometry= true) const;
85  double getDist2(const Pos2d &p,bool initialGeometry= true) const;
86  double getDist(const Pos2d &p,bool initialGeometry= true) const;
87  double getDist2(const Pos3d &p,bool initialGeometry= true) const;
88  double getDist(const Pos3d &p,bool initialGeometry= true) const;
89  Pos2d getProjection(const Pos2d &p,bool initialGeometry= true) const;
90  Pos3d getProjection(const Pos3d &p,bool initialGeometry= true) const;
91 
92  size_t getDimension(void) const;
93  double getLength(bool initialGeometry= true) const;
94  int getVtkCellType(void) const;
95 
96  double getLocalCoordinates(const Pos3d &, bool initialGeometry= true) const;
97  ParticlePos3d getNaturalCoordinates(const Pos3d &, bool initialGeometry= true) const;
99  Vector getInterpolationFactors(const Pos3d &) const;
100 
101  void computeTributaryLengths(bool initialGeometry= true) const;
102  double getTributaryLength(const Node *) const;
103  void computeTributaryAreas(bool initialGeometry= true) const;
104  double getTributaryArea(const Node *) const;
105 
106  void vector2dUniformLoadGlobal(const Vector &);
107  void vector2dUniformLoadLocal(const Vector &);
108  void vector2dPartialUniformLoadGlobal(const double &, const double &, const Vector &);
109  void vector2dPartialUniformLoadLocal(const double &, const double &, const Vector &);
110  void vector2dPointByRelDistLoadGlobal(const double &,const Vector &);
111  void vector2dPointByRelDistLoadLocal(const double &,const Vector &);
112  void vector2dPointLoadGlobal(const Vector &,const Vector &);
113  void vector2dPointLoadLocal(const Vector &,const Vector &);
114  void vector3dUniformLoadGlobal(const Vector &);
115  void vector3dUniformLoadLocal(const Vector &);
116  void vector3dPointByRelDistLoadGlobal(const double &,const Vector &);
117  void vector3dPointByRelDistLoadLocal(const double &,const Vector &);
118  void vector3dPointLoadGlobal(const Vector &,const Vector &);
119  void vector3dPointLoadLocal(const Vector &,const Vector &);
120  void strainLoad(const DeformationPlane &p1, const DeformationPlane &p2);
121  };
122 
123 } //end of XC namespace
124 #endif
void vector3dUniformLoadGlobal(const Vector &)
Defines a uniform load on the vector from a vector in global coordinates.
Definition: Element1D.cc:269
double getLength(bool initialGeometry=true) const
Return the length of the segment defined by the element.
Definition: Element1D.cc:811
Segment3d getLineSegment(bool initialGeometry=true) const
Return the segment defined by the element.
Definition: Element1D.cc:784
Float vector abstraction.
Definition: Vector.h:94
Natural coordinates of an element&#39;s particle.
Definition: ParticlePos3d.h:41
Segment en tres dimensiones.
Definition: Segment3d.h:41
Base class for grids of bool in 3D (used to express if something exists or not in a (layer...
Definition: BoolArray3d.h:34
static void shape1d(const double &, double shp[2])
shape function routine for one-dimesional two node elements.
Definition: Element1D.cc:536
Communication parameters between processes.
Definition: Communicator.h:66
void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: Element1D.cc:642
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:826
int initializeCoordTransf(void)
Reinitialize coordinate transformation (for example after a "manual" change in the nodal coordinates...
Definition: Element1D.cc:657
Posición en dos dimensiones.
Definition: Pos2d.h:41
CrdTransf provides the abstraction of a frame coordinate transformation.
Definition: CrdTransf.h:88
virtual CrdTransf * getCoordTransf(void)
Returns (if possible) a pointer to the coordinate transformation.
Definition: Element1D.cc:648
CrdTransf2d * recvCoordTransf2d(int posFlag, const int &, const int &, const Communicator &)
Receive a 2D coordinate transformation through the communicator argument.
Definition: Element1D.cc:890
virtual CrdTransf * checkCoordTransf(void)
Returns (and checks that it exists) a const pointer to the coordinate transformation.
Definition: Element1D.cc:688
double getLocalCoordinates(const Pos3d &, bool initialGeometry=true) const
Return the local coordinates of the point.
Definition: Element1D.cc:933
double getTributaryArea(const Node *) const
Return the tributary LENGTH corresponding to the node being passed as parameter (assume unit width fo...
Definition: Element1D.cc:1003
double getTributaryLength(const Node *) const
Return the tributary length corresponding to the node being passed as parameter.
Definition: Element1D.cc:986
int sendCoordTransf(int posFlag, const int &, const int &, Communicator &)
Send the coordinate transformation through the communicator argument.
Definition: Element1D.cc:846
ParticlePos3d getNaturalCoordinates(const Pos3d &, bool initialGeometry=true) const
Return the local coordinates of the point.
Definition: Element1D.cc:945
CrdTransf * recvCoordTransf(int posFlag, const int &, const int &, const Communicator &)
Receives the coordinate transformation through the communicator argument.
Definition: Element1D.cc:863
Three-dimensional array of pointers to elements.
Definition: ElemPtrArray3d.h:47
size_t getDimension(void) const
Return the element dimension (0, 1, 2 or 3).
Definition: Element1D.cc:442
Matrix getLocalAxes(bool) const
Returns a matrix with the axes of the element as matrix rows [[x1,y1,z1],[x2,y2,z2],...·].
Definition: Element1D.cc:712
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
virtual const Vector & getCooPoint(const double &xrel) const
Return the point that correspond to the relative coordinate 0<=xrel<=1.
Definition: Element1D.cc:763
Base class for 2D coordinate transformation.
Definition: CrdTransf2d.h:78
Deformation plane for a cross-section.
Definition: DeformationPlane.h:54
ElemPtrArray3d put_on_mesh(const NodePtrArray3d &, meshing_dir dm) const
Put the elements on the nodes being passed as parameter.
Definition: Element1D.cc:543
double getDist2(const Pos2d &p, bool initialGeometry=true) const
Return the squared distance from the element to the point being passed as parameter.
Definition: Element1D.cc:821
Element1D(int tag, int classTag)
Constructor.
Definition: Element1D.cc:57
Vector getInterpolationFactors(const ParticlePos3d &) const
Returns interpolation factors for a material point.
Definition: Element1D.cc:955
void computeTributaryLengths(bool initialGeometry=true) const
Compute the tributary lengths that corresponds to each node of the element.
Definition: Element1D.cc:976
BoolArray3d getNodePattern(void) const
Return a grid of booleans, one for each of the element nodes.
Definition: Element1D.cc:527
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:738
structured set, i.
Definition: SetEstruct.h:47
CrdTransf3d * recvCoordTransf3d(int posFlag, const int &, const int &, const Communicator &)
Receive a 3D coordinate transformation through the communicator argument.
Definition: Element1D.cc:909
void vector2dPointLoadGlobal(const Vector &, const Vector &)
Define an elemental concentrated load at position p with value v expressed in global coordinates...
Definition: Element1D.cc:225
Pos2d getProjection(const Pos2d &p, bool initialGeometry=true) const
Return the projection of the argument on the element.
Definition: Element1D.cc:795
Posición en tres dimensiones.
Definition: Pos3d.h:44
Three-dimensional array of pointers to nodes.
Definition: NodePtrArray3d.h:51
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for finite element with pointer to nodes container.
Definition: ElementBase.h:47
Matrix of floats.
Definition: Matrix.h:111
void computeTributaryAreas(bool initialGeometry=true) const
Compute the tributary LENGTHS that corresponds to each node of the element (assume unit width for the...
Definition: Element1D.cc:997
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
int getVtkCellType(void) const
VTK interface.
Definition: Element1D.cc:929
Mesh node.
Definition: Node.h:111
Base class for 3D coordinate transformation.
Definition: CrdTransf3d.h:81