xc
ClosedTriangleMesh.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 //ClosedTriangleMesh.h
29 
30 #ifndef CLOSEDTRIANGLEMESH_H
31 #define CLOSEDTRIANGLEMESH_H
32 
33 #include "utility/geom/d2/Trihedron.h"
34 #include <set>
35 #include <deque>
36 #include "utility/actor/actor/MovableObject.h"
37 
38 class Triang3dMesh;
39 class TriangleMap;
40 
41 namespace XC {
42 
43 class Vector;
44 class FiberSectionBase;
45 
47 //
51  {
52  protected:
53  typedef std::vector<Trihedron> v_trihedrons;
54  typedef v_trihedrons::iterator iterator;
55  typedef v_trihedrons::const_iterator const_iterator;
56 
57  v_trihedrons trihedrons;
58  double tol;
59  double rMax;
60  double rMin;
61 
63  protected:
64  void getPositionsMatrix(Matrix &);
65  virtual void setPositionsMatrix(const Matrix &);
66  int sendData(Communicator &);
67  int recvData(const Communicator &);
68  public:
69  ClosedTriangleMesh(void);
70  ClosedTriangleMesh(const Pos3d &org,const Triang3dMesh &mll);
73  virtual ClosedTriangleMesh *getCopy(void) const;
74 
75  virtual double GetMax(short unsigned int i) const;
76  virtual double GetMin(short unsigned int i) const;
77  virtual Pos3d getCenterOfMass(void) const;
78  virtual double getLength(void) const;
79  virtual double getArea(void) const;
80  virtual double getVolume(void) const;
81  virtual double Ix(void) const;
82  virtual double Iy(void) const;
83  virtual double Iz(void) const;
84  short unsigned int Dimension() const
85  { return 3; }
86 
87  size_t GetNumFacetas(void) const;
88 
89  TriangleMap getTriangleMap(void) const;
90 
91  iterator begin(void);
92  iterator end(void);
93  const_iterator begin() const;
94  const_iterator end() const;
95  size_t size(void) const;
96 
97  const_iterator findTrihedron(const Pos3d &p) const;
98  const Trihedron *findTrihedronPtr(const Pos3d &p) const;
99 
100  int sendSelf(Communicator &);
101  int recvSelf(const Communicator &);
102  void write(std::ofstream &);
103  void read(std::ifstream &);
104  void writeTo(const std::string &);
105  void readFrom(const std::string &);
106  void Print(std::ostream &os) const;
107  };
108 
109 } // end of XC namespace
110 
111 #endif
Base class for position lists.
Definition: PolyPos.h:35
void readFrom(const std::string &)
Read from file.
Definition: ClosedTriangleMesh.cc:102
Communication parameters between processes.
Definition: Communicator.h:66
GeomObj::list_Pos3d get_intersection(const Pos3d &p) const
Radius of the sphere that passes through the nearest vertex.
Definition: ClosedTriangleMesh.cc:282
int recvData(const Communicator &)
Receives object members through the communicator argument.
Definition: ClosedTriangleMesh.cc:399
ClosedTriangleMesh(void)
Default constructor.
Definition: ClosedTriangleMesh.cc:50
Object that can move between processes.
Definition: MovableObject.h:100
const_iterator findTrihedron(const Pos3d &p) const
Search for the trihedron that contains the point being passed as parameter.
Definition: ClosedTriangleMesh.cc:205
void read(std::ifstream &)
Read the matrix from a binary file.
Definition: ClosedTriangleMesh.cc:377
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: ClosedTriangleMesh.cc:424
void getPositionsMatrix(Matrix &)
Return a matrix with the coordinates of the points that define each one of the trihedrons.
Definition: ClosedTriangleMesh.cc:328
virtual double getArea(void) const
Return the object area.
Definition: ClosedTriangleMesh.cc:149
void Print(std::ostream &os) const
Print stuff.
Definition: ClosedTriangleMesh.cc:320
int sendData(Communicator &)
Sends object members through the communicator argument.
Definition: ClosedTriangleMesh.cc:388
virtual void setPositionsMatrix(const Matrix &)
Create the trihedrons that define the diagram from the matrix that contains the points that define ea...
Definition: ClosedTriangleMesh.cc:350
Definition: TriangleMap.h:131
double rMin
Radius of the convex-hull circunscribed sphere.
Definition: ClosedTriangleMesh.h:60
virtual double getVolume(void) const
Return the object volume.
Definition: ClosedTriangleMesh.cc:151
void write(std::ofstream &)
Write the matrix in a binary file.
Definition: ClosedTriangleMesh.cc:366
Posición en tres dimensiones.
Definition: Pos3d.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
A geometric figure composed of three planes meeting at a single vertex.
Definition: Trihedron.h:37
3D Triange mesh.
Definition: Triang3dMesh.h:37
Matrix of floats.
Definition: Matrix.h:111
virtual double getLength(void) const
Return the object length.
Definition: ClosedTriangleMesh.cc:147
Closed triangle mesh used to represent the interaction diagram (N,Mx,My) of a section.
Definition: ClosedTriangleMesh.h:50
const Trihedron * findTrihedronPtr(const Pos3d &p) const
Search for the trihedron that contains the point being passed as parameter.
Definition: ClosedTriangleMesh.cc:221
short unsigned int Dimension() const
Return the dimension of the object 0, 1, 2 or 3.
Definition: ClosedTriangleMesh.h:84
int sendSelf(Communicator &)
Send the object through the communicator argument.
Definition: ClosedTriangleMesh.cc:410
ClosedTriangleMesh & operator=(const ClosedTriangleMesh &)
Assignment operator.
Definition: ClosedTriangleMesh.cc:84
virtual ClosedTriangleMesh * getCopy(void) const
Virtual constructor.
Definition: ClosedTriangleMesh.cc:119
Clase base para los objetos en tres dimensiones.
Definition: GeomObj3d.h:43