XC Open source finite element analysis program
Segment.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 //Segment.h
28 
29 #ifndef SEGMENT_H
30 #define SEGMENT_H
31 
32 #include "Eje.h"
33 
34 
35 namespace XC {
36 
38 //
40 class Segment: public Eje
41  {
42  Spot *p1;
43  Spot *p2;
44  protected:
45 
46  public:
47  Segment(GeomSection *m,const size_t &ndiv= 4);
48  Segment(const std::string &nombre= "",GeomSection *m= nullptr,const size_t &ndiv= 4);
49  Spot *P1(void);
50  const Spot *P1(void) const;
51  Spot *P2(void);
52  const Spot *P2(void) const;
53  void setEndPoints(size_t, size_t);
54  int getVtkCellType(void) const;
55  int getMEDCellType(void) const;
57  inline virtual size_t NumVertices(void) const
58  { return 2; }
59  virtual const Spot *GetVertice(const size_t &i) const;
60  virtual Spot *GetVertice(const size_t &i);
61  virtual void SetVertice(const size_t &,Spot *);
62  virtual BND2d Bnd(void) const;
63  double getLong(void) const;
64 
65  };
66 
67 } //end of XC namespace
68 #endif
size_t ndiv
Number of divisions.
Definition: Eje.h:47
Point object for section geometry definition.
Definition: Spot.h:43
int getVtkCellType(void) const
Interfaz con VTK.
Definition: Segment.cc:111
int getMEDCellType(void) const
Interfaz con el formato MED de Salome.
Definition: Segment.cc:115
virtual BND2d Bnd(void) const
Returns the intervalo 2D ocupado por el segmento.
Definition: Segment.cc:102
virtual const Spot * GetVertice(const size_t &i) const
Returns the i-th vertex.
Definition: Segment.cc:75
Segment de recta entre dos puntos.
Definition: Segment.h:40
void setEndPoints(size_t, size_t)
Assigns end points.
Definition: Segment.cc:60
virtual size_t NumVertices(void) const
Returns the number of vertices.
Definition: Segment.h:57
virtual void SetVertice(const size_t &, Spot *)
Sets the i-th vertex.
Definition: Segment.cc:93
Spot * P2(void)
Returns a pointer to end point.
Definition: Segment.cc:52
Spot * P1(void)
Returns a pointer to start point.
Definition: Segment.cc:46
Base class for 1D entities in section definition.
Definition: Eje.h:43
Segment(GeomSection *m, const size_t &ndiv=4)
Constructor.
Definition: Segment.cc:38
================================================================================
Definition: ContinuaReprComponent.h:34
Cross section geometry.
Definition: GeomSection.h:62