xc
ElementHandler.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 //ElementHandler.h
28 
29 #ifndef ELEMENTHANDLER_H
30 #define ELEMENTHANDLER_H
31 
32 #include "preprocessor/prep_handlers/ProtoElementHandler.h"
33 
34 namespace XC {
35 
40  {
41  public:
43  {
44  Element *seed;
46  SeedElemHandler &operator=(const SeedElemHandler &);
47  void free_mem(void);
48  protected:
49  void add(Element *);
50  public:
51  SeedElemHandler(Preprocessor *preprocessor)
52  : ProtoElementHandler(preprocessor), seed(nullptr) {}
53  Element *GetSeedElement(void)
54  { return seed; }
55  const Element *GetSeedElement(void) const
56  { return seed; }
57  int getDefaultTag(void) const;
58  void clearAll(void);
59  ~SeedElemHandler(void);
60  };
61  private:
62  SeedElemHandler seed_elem_handler;
63  protected:
64  virtual void add(Element *);
65  public:
67  Element *getElement(int tag);
68 
69  void new_element(Element *e);
70  inline SeedElemHandler &getSeedElemHandler(void)
71  { return seed_elem_handler; }
72  const Element *get_seed_element(void) const
73  { return seed_elem_handler.GetSeedElement(); }
74 
75  virtual void Add(Element *);
76 
77  int getDefaultTag(void) const;
78  void setDefaultTag(const int &tag);
79 
80  void clearAll(void);
81  };
82 
83 } // end of XC namespace
84 
85 #endif
void setDefaultTag(const int &tag)
Sets the default tag for next element.
Definition: ElementHandler.cc:92
Finite element model generation tools.
Definition: Preprocessor.h:58
void add(Element *)
Defines seed element.
Definition: ElementHandler.cc:58
Element * getElement(int tag)
Returns a pointer to the element identified by the tag being passed as parameter. ...
Definition: ElementHandler.cc:97
Element creation manager.
Definition: ElementHandler.h:39
ProtoElementHandler(Preprocessor *preprocessor)
Default constructor.
Definition: ProtoElementHandler.cc:93
Base class for the finite elements.
Definition: Element.h:109
~SeedElemHandler(void)
Destructor.
Definition: ElementHandler.cc:66
virtual void Add(Element *)
Adds the element and set its identifier (tag), use in EntPMdlr class.
Definition: ElementHandler.cc:124
void new_element(Element *e)
Adds a new element to the model.
Definition: ElementHandler.cc:136
Finite element creation.
Definition: ProtoElementHandler.h:49
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Definition: ElementHandler.h:42