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  virtual void setDefaultMaterial(const std::string &);
58  Element *getSeedElement(void);
59  const Element *getSeedElement(void) const;
60  int getDefaultTag(void) const;
61  void clearAll(void);
62  Element *newElement(const std::string &);
63  Element *newElement(const std::string &,const ID &);
64  };
65  private:
66  SeedElemHandler seed_elem_handler;
67  protected:
68  virtual void add(Element *);
69  public:
71  Element *getElement(int tag);
72 
73  void new_element(Element *e);
74  inline SeedElemHandler &getSeedElemHandler(void)
75  { return seed_elem_handler; }
76  const Element *get_seed_element(void) const
77  { return seed_elem_handler.getSeedElement(); }
78 
79  virtual void Add(Element *);
80 
81  int getDefaultTag(void) const;
82  void setDefaultTag(const int &tag);
83 
84  void clearAll(void);
85  };
86 
87 } // end of XC namespace
88 
89 #endif
void setDefaultTag(const int &tag)
Sets the default tag for next element.
Definition: ElementHandler.cc:178
Element * newElement(const std::string &)
Create a new seed element.
Definition: ElementHandler.cc:147
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:183
Vector of integers.
Definition: ID.h:95
Element creation manager.
Definition: ElementHandler.h:40
Base class for the finite elements.
Definition: Element.h:112
Element * getSeedElement(void)
Return a pointer to the seed element.
Definition: ElementHandler.cc:120
virtual void setDefaultMaterial(const std::string &)
Sets the default material name for new elements.
Definition: ElementHandler.cc:89
~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:213
void new_element(Element *e)
Adds a new element to the model.
Definition: ElementHandler.cc:229
Finite element creation.
Definition: ProtoElementHandler.h:50
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Definition: ElementHandler.h:43