XC Open source finite element analysis program
MapCuerpos.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 //MapCuerpos.h
28 
29 #ifndef MapCuerpos_H
30 #define MapCuerpos_H
31 
32 #include "MapEnt.h"
33 #include "Body.h"
34 
35 namespace XC {
36 
38 //
40 class MapCuerpos: public MapEnt<Body>
41  {
42  private:
43  void UpdateSets(Body *) const;
44  protected:
45 
46 
47  public:
48  MapCuerpos(Cad *cad= nullptr);
49 
50  bool conciliaNDivs(void);
51  bool checkNDivs(void) const;
52 
53  template <class B>
54  Body *New(void);
55 
56  };
57 
58 
60 template <class B>
62  {
63  Body *retval= busca(getTag());
64  if(!retval) //It doesn't already exist.
65  {
66  Preprocessor *preprocessor= getPreprocessor();
67  retval= new B(preprocessor);
68  if(retval)
69  {
70  retval->Nombre()= "f"+boost::lexical_cast<std::string>(getTag());
71  (*this)[getTag()]= retval;
72  UpdateSets(retval);
73  tag++;
74  }
75  }
76  return retval;
77  }
78 
79 } //end of XC namespace
80 #endif
const Preprocessor * getPreprocessor(void) const
Return a pointer to preprocessor.
Definition: MapCadMemberBase.cc:54
Six-faced solid.
Definition: Body.h:64
Body * busca(const Indice &)
Body contaainer.
Definition: MapCuerpos.h:40
Body * New(void)
Creates a new cuerpo.
Definition: MapCuerpos.h:61
Finite element model generation tools.
Definition: Preprocessor.h:58
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
bool checkNDivs(void) const
Checks that the number of divisions of the edges are compatible.
Definition: MapCuerpos.cc:71
MapCuerpos(Cad *cad=nullptr)
Constructor.
Definition: MapCuerpos.cc:43
bool conciliaNDivs(void)
Conciliates the number of divisions of the lines.
Definition: MapCuerpos.cc:63
================================================================================
Definition: ContinuaReprComponent.h:34
Geometric entities container (points, lines, surfaces,...).
Definition: MapEnt.h:42