xc
ElementHandler.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 //ElementHandler.h
29 
30 #ifndef ELEMENTHANDLER_H
31 #define ELEMENTHANDLER_H
32 
33 #include "preprocessor/prep_handlers/ProtoElementHandler.h"
34 
35 namespace XC {
36 
41  {
42  public:
44  {
45  private:
46  Element *seed;
47  std::string elementType;
49  SeedElemHandler &operator=(const SeedElemHandler &);
50  void free(void);
51  void alloc(Element *);
52  protected:
53  void add(Element *);
54  public:
55  SeedElemHandler(Preprocessor *preprocessor);
56  ~SeedElemHandler(void);
57 
58  virtual void setDefaultMaterial(const std::string &);
59  virtual void setNumSections(const int &);
60  virtual void setDimElem(const int &);
61  virtual void setDefaultTransf(const std::string &);
62  virtual void setDefaultIntegrator(const std::string &);
63 
64  Element *getSeedElement(void);
65  const Element *getSeedElement(void) const;
66  int getDefaultTag(void) const;
67  void clearAll(void);
68  Element *newElement(const std::string &);
69  Element *newElement(const std::string &,const ID &);
70  };
71  private:
72  SeedElemHandler seed_elem_handler;
73  protected:
74  virtual void add(Element *);
75  public:
77  Element *getElement(int tag);
78 
79  void new_element(Element *e);
80  inline SeedElemHandler &getSeedElemHandler(void)
81  { return seed_elem_handler; }
82  const Element *get_seed_element(void) const
83  { return seed_elem_handler.getSeedElement(); }
84 
85  virtual void Add(Element *);
86 
87  int getDefaultTag(void) const;
88  void setDefaultTag(const int &tag);
89 
90  void clearAll(void);
91  };
92 
93 } // end of XC namespace
94 
95 #endif
virtual void setDimElem(const int &)
Sets the dimension for new elements (when applicable).
Definition: ElementHandler.cc:129
virtual void setDefaultTransf(const std::string &)
Sets the default coordinate transformation for new elements (when applicable).
Definition: ElementHandler.cc:149
void setDefaultTag(const int &tag)
Sets the default tag for next element.
Definition: ElementHandler.cc:259
Element * newElement(const std::string &)
Create a new seed element.
Definition: ElementHandler.cc:228
Finite element model generation tools.
Definition: Preprocessor.h:59
void add(Element *)
Defines seed element.
Definition: ElementHandler.cc:75
Element * getElement(int tag)
Returns a pointer to the element identified by the tag being passed as parameter. ...
Definition: ElementHandler.cc:264
Vector of integers.
Definition: ID.h:95
Element creation manager.
Definition: ElementHandler.h:40
Base class for the finite elements.
Definition: Element.h:112
virtual void setDefaultIntegrator(const std::string &)
Sets the default integrator name for new elements (when applicable).
Definition: ElementHandler.cc:169
Element * getSeedElement(void)
Return a pointer to the seed element.
Definition: ElementHandler.cc:201
virtual void setDefaultMaterial(const std::string &)
Sets the default material name for new elements.
Definition: ElementHandler.cc:91
~SeedElemHandler(void)
Destructor.
Definition: ElementHandler.cc:84
virtual void Add(Element *)
Adds the element and set its identifier (tag), use in EntPMdlr class.
Definition: ElementHandler.cc:294
void new_element(Element *e)
Adds a new element to the model.
Definition: ElementHandler.cc:310
Finite element creation.
Definition: ProtoElementHandler.h:50
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Definition: ElementHandler.h:43
virtual void setNumSections(const int &)
Sets the default number of sections for new elements (when applicable).
Definition: ElementHandler.cc:110