xc
LineBase.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 //LineBase.h
28 
29 #ifndef LINEBASE_H
30 #define LINEBASE_H
31 
32 #include "Edge.h"
33 
34 
35 namespace XC {
36 
40 class LineBase: public Edge
41  {
42  protected:
43  Pnt *p1;
44  Pnt *p2;
45 
47  inline Pnt *P1(void)
48  { return p1; }
50  virtual Pnt *P2(void)
51  { return p2; }
52  virtual bool check_points(void) const;
53  public:
54  LineBase(Preprocessor *m,const size_t &ndiv= 4);
55  LineBase(const std::string &nombre,Preprocessor *m,const size_t &ndiv= 4);
56  const Pnt *P1(void) const;
57  const Pnt *P2(void) const;
58 
59  virtual double getLambda(const Pos3d &) const= 0;
60 
61  virtual const Pnt *getVertex(const size_t &i) const;
62  virtual void SetVertice(const size_t &,Pnt *);
63  void SetVertice(const size_t &,const size_t &);
64  void SetVertices(Pnt *,Pnt *);
65 
66 
67  };
68 
69 } //end of XC namespace
70 #endif
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
Finite element model generation tools.
Definition: Preprocessor.h:58
virtual bool check_points(void) const
Checks that the points are defined.
Definition: LineBase.cc:65
Pnt * p1
Back end.
Definition: LineBase.h:43
Base class for 1D entities.
Definition: LineBase.h:40
virtual Pnt * P2(void)
Return pointer to front end.
Definition: LineBase.h:50
LineBase(Preprocessor *m, const size_t &ndiv=4)
Constructor.
Definition: LineBase.cc:41
virtual void SetVertice(const size_t &, Pnt *)
Sets the i-th vertex.
Definition: LineBase.cc:78
Pnt * p2
Front end.
Definition: LineBase.h:44
virtual const Pnt * getVertex(const size_t &i) const
Return the i-th vertex.
Definition: LineBase.cc:56
Point (KPoint).
Definition: Pnt.h:49
Pnt * P1(void)
Return pointer to back end.
Definition: LineBase.h:47
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
void SetVertices(Pnt *, Pnt *)
Assigns line ends.
Definition: LineBase.cc:103