XC Open source finite element analysis program
MapSurfaces.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 //MapSurfaces.h
28 
29 #ifndef MAPSurfaces_H
30 #define MAPSurfaces_H
31 
32 #include "MapEnt.h"
33 #include "Face.h"
34 
35 namespace XC {
36  class QuadSurface;
37 
39 //
41 class MapSurfaces: public MapEnt<Face>
42  {
43  private:
44  void UpdateSets(Face *) const;
45  protected:
46 
47 
48  public:
49  MapSurfaces(Cad *cad= nullptr);
50 
51  bool conciliaNDivs(void);
52  bool checkNDivs(void) const;
53 
54  template <class F>
55  Face *Nueva(void);
56 
57  QuadSurface *newQuadSurfacePts(const size_t &, const size_t &,const size_t &,const size_t &);
58  QuadSurface *newQuadSurfaceLines(const size_t &, const size_t &,const size_t &,const size_t &);
59  QuadSurface *newQuadSurfaceGridPoints(const boost::python::list &);
60  };
61 
62 
64 template <class F>
66  {
67  Face *retval= busca(getTag());
68  if(!retval) //Surface is new.
69  {
70  Preprocessor *preprocessor= getPreprocessor();
71  retval= new F(preprocessor);
72  if(retval)
73  {
74  retval->Nombre()= "f"+boost::lexical_cast<std::string>(getTag());
75  (*this)[getTag()]= retval;
76  UpdateSets(retval);
77  tag++;
78  }
79  }
80  return retval;
81  }
82 } //end of XC namespace
83 #endif
Surface.
Definition: Face.h:41
QuadSurface * newQuadSurfaceLines(const size_t &, const size_t &, const size_t &, const size_t &)
New quadrilateral surface.
Definition: MapSurfaces.cc:90
const Preprocessor * getPreprocessor(void) const
Return a pointer to preprocessor.
Definition: MapCadMemberBase.cc:54
Face * busca(const Indice &)
bool conciliaNDivs(void)
Crea concilia el number of divisions of the lines.
Definition: MapSurfaces.cc:61
bool checkNDivs(void) const
Verifica que los number of divisions of the edges are compatible.
Definition: MapSurfaces.cc:69
MapSurfaces(Cad *cad=nullptr)
Constructor.
Definition: MapSurfaces.cc:42
Face * Nueva(void)
Creates a new surface.
Definition: MapSurfaces.h:65
Finite element model generation tools.
Definition: Preprocessor.h:58
Contenedor de puntos del modelo.
Definition: MapSurfaces.h:41
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
Quadrangle defined by its four vertices.
Definition: QuadSurface.h:40
QuadSurface * newQuadSurfaceGridPoints(const boost::python::list &)
New quadrilateral surface.
Definition: MapSurfaces.cc:101
================================================================================
Definition: ContinuaReprComponent.h:34
Geometric entities container (points, lines, surfaces,...).
Definition: MapEnt.h:42
QuadSurface * newQuadSurfacePts(const size_t &, const size_t &, const size_t &, const size_t &)
New quadrilateral surface.
Definition: MapSurfaces.cc:79