XC Open source finite element analysis program
MapTrfGeom.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 //MapTrfGeom.h
28 
29 #ifndef MAPTrfGeom_H
30 #define MAPTrfGeom_H
31 
32 #include "preprocessor/cad/MapCadMember.h"
33 #include "TrfGeom.h"
34 #include "boost/lexical_cast.hpp"
35 
36 
37 namespace XC {
38 
40 //
42 class MapTrfGeom: public MapCadMember<TrfGeom>
43  {
44  protected:
45 
46 
47  public:
48  MapTrfGeom(Cad *cad= nullptr);
49 
50  template <class T>
51  TrfGeom *Nueva(void);
52  TrfGeom *newTransformation(const std::string &type);
53 
54 
55  };
56 
58 template <class T>
59 XC::TrfGeom *XC::MapTrfGeom::Nueva(void)
60  {
61  TrfGeom *retval= busca(getTag());
62  if(!retval) //Doesn't already exist.
63  {
64  Preprocessor *preprocessor= getPreprocessor();
65  retval= new T(preprocessor);
66  if(retval)
67  {
68  retval->Nombre()= "t"+boost::lexical_cast<std::string>(getTag());
69  (*this)[getTag()]= retval;
70  tag++;
71  }
72  }
73  return retval;
74  }
75 
76 } //end of XC namespace
77 #endif
const Preprocessor * getPreprocessor(void) const
Return a pointer to preprocessor.
Definition: MapCadMemberBase.cc:54
TrfGeom * busca(const Indice &)
TrfGeom * newTransformation(const std::string &type)
Defines a new transformation.
Definition: MapTrfGeom.cc:49
Finite element model generation tools.
Definition: Preprocessor.h:58
Container for model entities.
Definition: MapCadMember.h:42
Model geometry manager. Management of geometry entities: points, lines, surfaces, bodies...
Definition: Cad.h:69
Definition: TrfGeom.h:49
MapTrfGeom(Cad *cad=nullptr)
Constructor.
Definition: MapTrfGeom.cc:45
Contenedor de puntos del modelo.
Definition: MapTrfGeom.h:42
================================================================================
Definition: ContinuaReprComponent.h:34