XC Open source finite element analysis program
ClosedTriangleMesh.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 //ClosedTriangleMesh.h
28 
29 #ifndef CLOSEDTRIANGLEMESH_H
30 #define CLOSEDTRIANGLEMESH_H
31 
32 #include "xc_utils/src/geom/d2/Triedro3d.h"
33 #include <set>
34 #include <deque>
35 #include "utility/actor/actor/MovableObject.h"
36 
37 class Triang3dMesh;
38 class TriangleMap;
39 
40 namespace XC {
41 
42 class Vector;
43 class FiberSectionBase;
44 
46 //
48 class ClosedTriangleMesh: public GeomObj3d, public MovableObject
49  {
50  protected:
51  typedef std::vector<Triedro3d> v_triedros;
52  typedef v_triedros::iterator iterator;
53  typedef v_triedros::const_iterator const_iterator;
54 
55  v_triedros triedros;
56  double tol;
57  double rMax;
58  double rMin;
59 
60  GeomObj::list_Pos3d get_interseccion(const Pos3d &p) const;
61  protected:
63  virtual void setMatrizPosiciones(const Matrix &);
64  int sendData(CommParameters &);
65  int recvData(const CommParameters &);
66  public:
67  ClosedTriangleMesh(void);
68  ClosedTriangleMesh(const Pos3d &org,const Triang3dMesh &mll);
71  virtual ClosedTriangleMesh *clon(void) const;
72 
73  virtual double GetMax(short unsigned int i) const;
74  virtual double GetMin(short unsigned int i) const;
75  virtual Pos3d Cdg(void) const;
76  virtual double Longitud(void) const;
77  virtual double Area(void) const;
78  virtual double Volumen(void) const;
79  virtual double Ix(void) const;
80  virtual double Iy(void) const;
81  virtual double Iz(void) const;
82  short unsigned int Dimension() const
83  { return 3; }
84 
85  size_t GetNumFacetas(void) const;
86 
87  TriangleMap getTriangleMap(void) const;
88 
89  iterator begin(void);
90  iterator end(void);
91  const_iterator begin() const;
92  const_iterator end() const;
93  size_t size(void) const;
94 
95  const_iterator BuscaTriedro(const Pos3d &p) const;
96  const Triedro3d *BuscaPtrTriedro(const Pos3d &p) const;
97 
98  int sendSelf(CommParameters &);
99  int recvSelf(const CommParameters &);
100  void write(std::ofstream &);
101  void read(std::ifstream &);
102  void writeTo(const std::string &);
103  void readFrom(const std::string &);
104  void Print(std::ostream &os) const;
105  };
106 
107 } // end of XC namespace
108 
109 #endif
ClosedTriangleMesh & operator=(const ClosedTriangleMesh &otro)
Assignment operator.
Definition: ClosedTriangleMesh.cc:84
void read(std::ifstream &)
Lee la matriz de un archivo binario.
Definition: ClosedTriangleMesh.cc:370
const Triedro3d * BuscaPtrTriedro(const Pos3d &p) const
Busca el triedro que contiene al punto being passed as parameter.
Definition: ClosedTriangleMesh.cc:217
@ingroup MATSCCDiagInt
Definition: ClosedTriangleMesh.h:48
void getMatrizPosiciones(Matrix &)
Returns a matriz con las coordenadas de los puntos que definen cada uno de los triedros.
Definition: ClosedTriangleMesh.cc:320
int recvSelf(const CommParameters &)
Receives object through the channel being passed as parameter.
Definition: ClosedTriangleMesh.cc:416
double rMin
Radius of the convex-hull circunscribed sphere.
Definition: ClosedTriangleMesh.h:58
int sendData(CommParameters &)
Sends object members through the channel being passed as parameter.
Definition: ClosedTriangleMesh.cc:381
Object that can move between processes.
Definition: MovableObject.h:91
void write(std::ofstream &)
Escribe la matriz en un archivo binario.
Definition: ClosedTriangleMesh.cc:359
int sendSelf(CommParameters &)
Envia el objeto through the channel being passed as parameter.
Definition: ClosedTriangleMesh.cc:403
Definition: Matrix.h:82
const_iterator BuscaTriedro(const Pos3d &p) const
Busca el triedro que contiene al punto being passed as parameter.
Definition: ClosedTriangleMesh.cc:202
GeomObj::list_Pos3d get_interseccion(const Pos3d &p) const
Radius of the sphere that passes through the nearest vertex.
Definition: ClosedTriangleMesh.cc:277
ClosedTriangleMesh(void)
Default constructor.
Definition: ClosedTriangleMesh.cc:50
Communication parameters between processes.
Definition: CommParameters.h:65
virtual void setMatrizPosiciones(const Matrix &)
Crea los triedros que definen el diagrama a partir de una matriz con las coordenadas de los puntos qu...
Definition: ClosedTriangleMesh.cc:343
================================================================================
Definition: ContinuaReprComponent.h:34
int recvData(const CommParameters &)
Receives object members through the channel being passed as parameter.
Definition: ClosedTriangleMesh.cc:392
virtual ClosedTriangleMesh * clon(void) const
Virtual constructor.
Definition: ClosedTriangleMesh.cc:117