xc
Line.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 //Line.h
29 
30 #ifndef LINE_H
31 #define LINE_H
32 
33 #include "LineBase.h"
34 
35 class Segment3d;
36 
37 namespace XC {
38 
42 class Line: public LineBase
43  {
44  protected:
45  Pos3dArray get_positions(void) const;
46  Edge *split_at(Pnt *,const double &,const double &);
47 
48  int create_gmsh_line(void) const;
49  public:
50  Line(Preprocessor *m,const size_t &ndiv= 4);
51  Line(const std::string &name= "",Preprocessor *m= nullptr,const size_t &ndiv= 4);
52  virtual SetEstruct *getCopy(void) const;
53 
54  // Geometry.
55  double getLength(void) const;
56  Pos3d getCentroid(void) const;
57  virtual Vector3d getIVector(void) const;
58  virtual Vector3d getJVector(void) const;
59  Edge *splitAtPoint(Pnt *p);
60  Edge *splitAtLambda(const double &);
61  Edge *splitAtNaturalCoord(const double &);
62  Edge *splitAtPos3d(const Pos3d &, const double &tol= 1e-6);
63  double getLambda(const Pos3d &) const;
65  inline virtual size_t getNumberOfVertices(void) const
66  { return 2; }
67  virtual BND3d Bnd(void) const;
68  double getSquaredDistanceTo(const Pos3d &) const;
69  double getDist(const Pos3d &) const;
70  const Vector &getVector(void) const;
71  Segment3d getLineSegment(void) const;
72  virtual const Vector &getTang(const double &) const;
73 
74  // VTK
75  int getVtkCellType(void) const;
76  };
77 
78 } //end of XC namespace
79 #endif
Edge * splitAtPos3d(const Pos3d &, const double &tol=1e-6)
Divides the edge at the point argument.
Definition: Line.cc:224
int create_gmsh_line(void) const
Ask Gmsh to create the line corresponding to this one.
Definition: Line.cc:287
Pos3dArray get_positions(void) const
Returns ndiv+1 positions equally spaced along the line.
Definition: Line.cc:257
Float vector abstraction.
Definition: Vector.h:94
virtual Vector3d getJVector(void) const
Returns a vector in the direction of the local Y axis.
Definition: Line.cc:86
Edge * split_at(Pnt *, const double &, const double &)
Divides the line by the point being passed as parameter.
Definition: Line.cc:130
Line(Preprocessor *m, const size_t &ndiv=4)
Constructor.
Definition: Line.cc:44
Segment en tres dimensiones.
Definition: Segment3d.h:41
Base class for one-dimensional geometry objects.
Definition: Edge.h:48
Edge * splitAtPoint(Pnt *p)
Divides the line by the point being passed as parameter.
Definition: Line.cc:165
Finite element model generation tools.
Definition: Preprocessor.h:59
double getLength(void) const
Return the line length.
Definition: Line.cc:56
Array of positions in a three-dimensional space.
Definition: Pos3dArray.h:38
int getVtkCellType(void) const
VTK interface.
Definition: Line.cc:298
Base class for 1D entities.
Definition: LineBase.h:41
virtual BND3d Bnd(void) const
Returns the line boundary.
Definition: Line.cc:240
Pos3d getCentroid(void) const
Return the centroid of the line.
Definition: Line.cc:65
virtual size_t getNumberOfVertices(void) const
Return the number of vertices.
Definition: Line.h:65
Line: base class for 1D objects.
Definition: Line.h:42
double getDist(const Pos3d &) const
Returns the distance to the position being passed as parameter.
Definition: Line.cc:126
"boundary" en tres dimensiones.
Definition: BND3d.h:34
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:102
Point (KPoint).
Definition: Pnt.h:50
double getSquaredDistanceTo(const Pos3d &) const
Returns the squared distance to the position being passed as parameter.
Definition: Line.cc:121
Edge * splitAtNaturalCoord(const double &)
Divides the line by the point obtained by: p1+lambda*VDir().
Definition: Line.cc:209
structured set, i.
Definition: SetEstruct.h:47
Posición en tres dimensiones.
Definition: Pos3d.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Segment3d getLineSegment(void) const
Returns the segment than links the line ends.
Definition: Line.cc:111
Edge * splitAtLambda(const double &)
Divides the line by the point obtained by: p1+lambda*VDir().
Definition: Line.cc:195
virtual Vector3d getIVector(void) const
Returns a vector in the direction of the local X axis.
Definition: Line.cc:75
const Vector & getVector(void) const
Returns the vector that goes for back end to front end.
Definition: Line.cc:266
virtual SetEstruct * getCopy(void) const
Virtual constructor.
Definition: Line.cc:52
Vector en tres dimensiones.
Definition: Vector3d.h:39
virtual const Vector & getTang(const double &) const
Returns a unit vector in the tangent direction in the point defined by s.
Definition: Line.cc:277