xc
ProtoElementHandler.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 //ProtoElementHandler.h
29 
30 #ifndef PROTOELEMENTHANDLER_H
31 #define PROTOELEMENTHANDLER_H
32 
33 #include "PrepHandler.h"
34 #include "MaterialHandler.h"
35 #include "TransfCooHandler.h"
36 #include "BeamIntegratorHandler.h"
37 #include <map>
38 
39 namespace XC {
40 class Element;
41 
51  {
52  Element *create_element(const std::string &cmd,int tag_elem);
53 
54  std::string material_name;
55  int num_sec;
56  int dim_elem;
57  std::string transformation_name;
58  std::string integrator_name;
59  int dir;
60  protected:
61  virtual void add(Element *)= 0;
62  const MaterialHandler &get_material_handler(void) const;
63  MaterialHandler::const_iterator get_iter_material(void) const;
64  const Material *get_ptr_material(void) const;
65  const TransfCooHandler &get_transf_coo_handler(void) const;
66  TransfCooHandler::const_iterator get_iter_transf_coo(void) const;
67  const CrdTransf *get_ptr_transf_coo(void) const;
69  BeamIntegratorHandler::const_iterator get_iter_beam_integrator(void) const;
70  const BeamIntegration *get_ptr_beam_integrator(void) const;
71 
72  friend class Preprocessor;
73 
74  public:
75  ProtoElementHandler(Preprocessor *preprocessor);
76  virtual int getDefaultTag(void) const= 0;
77 
78  virtual void setDefaultMaterial(const std::string &);
79  const std::string &getDefaultMaterial(void) const;
80  void setNumSections(const int &);
81  int getNumSections(void) const;
82  void setDimElem(const int &);
83  int getDimElem(void) const;
84  void setDefaultTransf(const std::string &);
85  const std::string &getDefaultTransf(void) const;
86  void setDefaultIntegrator(const std::string &);
87  const std::string &getDefaultIntegrator(void) const;
88 
89  Element *newElement(const std::string &,const ID &);
90 
91  };
92 
93 } // end of XC namespace
94 
95 #endif
BeamIntegratorHandler::const_iterator get_iter_beam_integrator(void) const
Returns an iterator to the integrator whose name corresponds to the contents of integrator_name.
Definition: ProtoElementHandler.cc:139
Finite element model generation tools.
Definition: Preprocessor.h:59
CrdTransf provides the abstraction of a frame coordinate transformation.
Definition: CrdTransf.h:88
void setDefaultTransf(const std::string &)
Sets the name of the default coordinate transformation for new elements.
Definition: ProtoElementHandler.cc:545
const Material * get_ptr_material(void) const
Returns a pointer to the material whose name corresponds to material_name contents.
Definition: ProtoElementHandler.cc:119
Base class for materials.
Definition: Material.h:93
Vector of integers.
Definition: ID.h:95
void setDimElem(const int &)
Sets the default dimension (0D,1D,2D or 3D) for new elements.
Definition: ProtoElementHandler.cc:537
Base class for the preprocessor objects that create model entities: nodes, elements, loads, etc.
Definition: PrepHandler.h:47
ProtoElementHandler(Preprocessor *preprocessor)
Default constructor.
Definition: ProtoElementHandler.cc:104
const std::string & getDefaultTransf(void) const
Returns the name of the default coordinate transformation for new elements.
Definition: ProtoElementHandler.cc:549
Base class for the finite elements.
Definition: Element.h:112
void setDefaultIntegrator(const std::string &)
Sets the name of the default integrator for new elements.
Definition: ProtoElementHandler.cc:553
const BeamIntegration * get_ptr_beam_integrator(void) const
Returns a pointer to the integrator whose name corresponds to the contents of integrator_name.
Definition: ProtoElementHandler.cc:145
MaterialHandler::const_iterator get_iter_material(void) const
Returns an iterator to the material whose name corresponds to material_name contents.
Definition: ProtoElementHandler.cc:114
const std::string & getDefaultMaterial(void) const
Returns the default material name for new elements.
Definition: ProtoElementHandler.cc:525
int getNumSections(void) const
Returns the default number of sections for new elements.
Definition: ProtoElementHandler.cc:533
Base class for integration on beam elements.
Definition: BeamIntegration.h:80
const CrdTransf * get_ptr_transf_coo(void) const
Returns a pointer to the coordinate transformation with the name being passed as parameter (nullptr i...
Definition: ProtoElementHandler.cc:169
Manager for the creation/deletion of coordinate transformations.
Definition: TransfCooHandler.h:50
const BeamIntegratorHandler & get_beam_integrator_handler(void) const
Returns a reference to de integrator handler.
Definition: ProtoElementHandler.cc:134
Material handler (definition, searching,...).
Definition: MaterialHandler.h:46
Finite element creation.
Definition: ProtoElementHandler.h:50
const MaterialHandler & get_material_handler(void) const
Returns a reference to the material handler.
Definition: ProtoElementHandler.cc:109
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
const std::string & getDefaultIntegrator(void) const
Returns the name of the default integrator for new elements.
Definition: ProtoElementHandler.cc:557
TransfCooHandler::const_iterator get_iter_transf_coo(void) const
Returns an iterator to the coordinate transformation with the name being passed as parameter...
Definition: ProtoElementHandler.cc:165
const TransfCooHandler & get_transf_coo_handler(void) const
Returns a reference to the coordinate transformation handler.
Definition: ProtoElementHandler.cc:161
Beam integrators handler.
Definition: BeamIntegratorHandler.h:42
Element * newElement(const std::string &, const ID &)
Create a new element.
Definition: ProtoElementHandler.cc:498
virtual void setDefaultMaterial(const std::string &)
Sets the default material name for new elements.
Definition: ProtoElementHandler.cc:521
int getDimElem(void) const
Returns the default dimension (0D,1D,2D or 3D) for new elements.
Definition: ProtoElementHandler.cc:541
void setNumSections(const int &)
Default number of sections for new elements.
Definition: ProtoElementHandler.cc:529