xc
Line.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 //Line.h
28 
29 #ifndef LINE_H
30 #define LINE_H
31 
32 #include "LineBase.h"
33 
34 class Segment3d;
35 
36 namespace XC {
37 
41 class Line: public LineBase
42  {
43  protected:
44 
45  Pos3dArray get_positions(void) const;
46  Edge *split_at(Pnt *,const double &,const double &);
47  public:
48  Line(Preprocessor *m,const size_t &ndiv= 4);
49  Line(const std::string &nombre= "",Preprocessor *m= nullptr,const size_t &ndiv= 4);
50  virtual SetEstruct *getCopy(void) const;
51 
52  double getLength(void) const;
53  Pos3d getCentroid(void) const;
54  Edge *splitAtPoint(Pnt *p);
55  Edge *splitAtLambda(const double &);
56  Edge *splitAtCooNatural(const double &);
57 
58  double getLambda(const Pos3d &) const;
59 
61  inline virtual size_t getNumberOfVertices(void) const
62  { return 2; }
63  virtual BND3d Bnd(void) const;
64  double getSquaredDistanceTo(const Pos3d &pt) const;
65 
66  const Vector &getVector(void) const;
67  Segment3d getLineSegment(void) const;
68  virtual const Vector &getTang(const double &) const;
69  int getVtkCellType(void) const;
70 
71 
72  };
73 
74 } //end of XC namespace
75 #endif
Pos3dArray get_positions(void) const
Returns ndiv+1 positions equally spaced along the line.
Definition: Line.cc:183
Float vector abstraction.
Definition: Vector.h:93
Edge * split_at(Pnt *, const double &, const double &)
Divides the line by the point being passed as parameter.
Definition: Line.cc:95
Line(Preprocessor *m, const size_t &ndiv=4)
Constructor.
Definition: Line.cc:42
Base class for one-dimensional geometry objects.
Definition: Edge.h:46
Edge * splitAtPoint(Pnt *p)
Divides the line by the point being passed as parameter.
Definition: Line.cc:122
Finite element model generation tools.
Definition: Preprocessor.h:58
double getLength(void) const
Return the line length.
Definition: Line.cc:54
int getVtkCellType(void) const
VTK interface.
Definition: Line.cc:212
Base class for 1D entities.
Definition: LineBase.h:40
virtual BND3d Bnd(void) const
Returns the line boundary.
Definition: Line.cc:166
Pos3d getCentroid(void) const
Return the centroid of the line.
Definition: Line.cc:63
virtual size_t getNumberOfVertices(void) const
Return the number of vertices.
Definition: Line.h:61
Line: base class for 1D objects.
Definition: Line.h:41
double getLambda(const Pos3d &) const
Returns the parameter of the point in the line (distance to the line&#39;s first point measured over the ...
Definition: Line.cc:72
Point (KPoint).
Definition: Pnt.h:49
structured set, i.
Definition: SetEstruct.h:45
Edge * splitAtCooNatural(const double &)
Divides the line by the point obtained by: p1+lambda*VDir().
Definition: Line.cc:155
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
double getSquaredDistanceTo(const Pos3d &pt) const
Returns the squared distance to the position being passed as parameter.
Definition: Line.cc:91
Segment3d getLineSegment(void) const
Returns the segment than links the line ends.
Definition: Line.cc:81
Edge * splitAtLambda(const double &)
Divides the line by the point obtained by: p1+lambda*VDir().
Definition: Line.cc:143
const Vector & getVector(void) const
Returns the vector that goes for back end to front end.
Definition: Line.cc:192
virtual SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Line.cc:50
virtual const Vector & getTang(const double &) const
Returns a unit vector in the tangent direction in the point defined by s.
Definition: Line.cc:203