XC Open source finite element analysis program
MaterialLoader.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 //MaterialLoader.h
28 
29 #ifndef MATERIALLOADER_H
30 #define MATERIALLOADER_H
31 
32 #include "Loader.h"
33 #include <map>
34 
35 namespace XC {
36 class Material;
37 class GeomSection;
38 class InteractionDiagram;
39 class InteractionDiagram2d;
40 class InteractionDiagramData;
41 
45 class MaterialLoader: public Loader
46  {
47  public:
48  typedef std::map<std::string,Material *> map_materials;
49  typedef map_materials::const_iterator const_iterator;
50  typedef map_materials::iterator iterator;
51 
52  typedef std::map<std::string,GeomSection *> map_geom_secc;
53  typedef map_geom_secc::const_iterator const_geom_secc_iterator;
54  typedef map_geom_secc::iterator geom_secc_iterator;
55 
56  typedef std::map<std::string,InteractionDiagram *> map_interaction_diagram;
57  typedef map_interaction_diagram::const_iterator const_diag_interacc_iterator;
58  typedef map_interaction_diagram::iterator diag_interacc_iterator;
59 
60  typedef std::map<std::string,InteractionDiagram2d *> map_interaction_diagram2d;
61  typedef map_interaction_diagram2d::const_iterator const_diag_interacc2d_iterator;
62  typedef map_interaction_diagram2d::iterator diag_interacc2d_iterator;
63  private:
64  map_materials materials;
65  int tag_mat;
66  map_geom_secc geom_secciones;
67  map_interaction_diagram diagramas_interaccion;
68  map_interaction_diagram2d diagramas_interaccion2d;
69  protected:
70  friend class ElementLoader;
71  public:
73  const map_materials &Map(void) const;
74  const_iterator begin(void) const;
75  const_iterator end(void) const;
76  iterator begin(void);
77  iterator end(void);
78  const_iterator find(const std::string &str) const;
79  iterator find(const std::string &str);
80  Material *find_ptr(const std::string &str);
81  const Material *find_ptr(const std::string &nmb) const;
82  Material *find_ptr(const int &tag);
83  const Material *find_ptr(const int &tag) const;
84  std::string getName(const int &tag) const;
85  GeomSection *find_ptr_geom_section(const std::string &nmb);
86  const GeomSection *find_ptr_geom_section(const std::string &nmb) const;
87  InteractionDiagram *find_ptr_interaction_diagram(const std::string &nmb);
88  const InteractionDiagram *find_ptr_interaction_diagram(const std::string &nmb) const;
90  const InteractionDiagram2d *find_ptr_interaction_diagram2d(const std::string &nmb) const;
91  bool existeMaterial(const std::string &nmb) const;
92  bool existeGeomSection(const std::string &nmb) const;
93  bool InteractionDiagramExists(const std::string &nmb) const;
94  bool InteractionDiagramExists2d(const std::string &nmb) const;
95  Material *newMaterial(const std::string &,const std::string &);
96  Material &getMaterial(const std::string &);
97  GeomSection *newSectionGeometry(const std::string &);
98  GeomSection &getGeomSection(const std::string &);
99  InteractionDiagram *newInteractionDiagram(const std::string &);
100  InteractionDiagram *calcInteractionDiagram(const std::string &,const InteractionDiagramData &diag_data);
101  InteractionDiagram &getInteractionDiagram(const std::string &);
102  InteractionDiagram2d *new2DInteractionDiagram(const std::string &);
103  InteractionDiagram2d *calcInteractionDiagramNMy(const std::string &,const InteractionDiagramData &diag_data);
104  InteractionDiagram2d *calcInteractionDiagramNMz(const std::string &,const InteractionDiagramData &diag_data);
105  InteractionDiagram2d &getNMzInteractionDiagram(const std::string &);
106  ~MaterialLoader(void);
107  void clearAll(void);
108 
109  };
110 
111 } // end of XC namespace
112 
113 #endif
const map_materials & Map(void) const
Returns a reference to the material container.
Definition: MaterialLoader.cc:660
InteractionDiagram * calcInteractionDiagram(const std::string &, const InteractionDiagramData &diag_data)
New interaction diagram.
Definition: MaterialLoader.cc:547
const_iterator begin(void) const
Returns an iterator which points to principio de la lista.
Definition: MaterialLoader.cc:664
Base class for materials.
Definition: Material.h:85
InteractionDiagram & getInteractionDiagram(const std::string &)
Returns a reference to the interaction diagram which identifier is being passed as parameter...
Definition: MaterialLoader.cc:836
GeomSection * find_ptr_geom_section(const std::string &nmb)
Si encuentra el material cuyo nombre se pasa as parameter returns a pointer al mismo, otherwise it returns nullptr.
Definition: MaterialLoader.cc:752
Material * find_ptr(const std::string &str)
Si encuentra el material cuyo nombre se pasa as parameter returns a pointer al mismo, otherwise it returns nullptr.
Definition: MaterialLoader.cc:686
GeomSection * newSectionGeometry(const std::string &)
Defines a new material.
Definition: MaterialLoader.cc:491
bool existeGeomSection(const std::string &nmb) const
Returns true if the section geometry identified by the string being passed as parameter exists...
Definition: MaterialLoader.cc:849
InteractionDiagram2d * new2DInteractionDiagram(const std::string &)
New 2d interaction diagram.
Definition: MaterialLoader.cc:529
InteractionDiagram * find_ptr_interaction_diagram(const std::string &nmb)
Si encuentra el material cuyo nombre se pasa as parameter returns a pointer al mismo, otherwise it returns nullptr.
Definition: MaterialLoader.cc:774
InteractionDiagram2d * find_ptr_interaction_diagram2d(const std::string &nmb)
Si encuentra el material cuyo nombre se pasa as parameter returns a pointer al mismo, otherwise it returns nullptr.
Definition: MaterialLoader.cc:796
InteractionDiagram2d * calcInteractionDiagramNMy(const std::string &, const InteractionDiagramData &diag_data)
New 2D interaction diagram (N-My)
Definition: MaterialLoader.cc:580
@ingroup MATSCCDiagInt
Definition: InteractionDiagram2d.h:43
bool InteractionDiagramExists(const std::string &nmb) const
Returns true if the 3D interaction diagram identified by the string being passed as parameter exists...
Definition: MaterialLoader.cc:854
const_iterator end(void) const
Returns an iterator apuntando después of the final de la lista.
Definition: MaterialLoader.cc:667
Material * newMaterial(const std::string &, const std::string &)
Defines a new material.
Definition: MaterialLoader.cc:472
Finite element model generation tools.
Definition: Preprocessor.h:58
Material & getMaterial(const std::string &)
Returns a reference to the material which identifier is being passed as parameter.
Definition: MaterialLoader.cc:818
Element creation manager.
Definition: ElementLoader.h:39
GeomSection & getGeomSection(const std::string &)
Returns a reference to the section geometry which identifier is being passed as parameter.
Definition: MaterialLoader.cc:827
InteractionDiagram2d * calcInteractionDiagramNMz(const std::string &, const InteractionDiagramData &diag_data)
New 2D interaction diagram (N-Mz)
Definition: MaterialLoader.cc:613
const_iterator find(const std::string &str) const
Si encuentra el material cuyo nombre se pasa as parameter returns an iterator which points to mismo...
Definition: MaterialLoader.cc:677
InteractionDiagram * newInteractionDiagram(const std::string &)
New interaction diagram.
Definition: MaterialLoader.cc:511
bool InteractionDiagramExists2d(const std::string &nmb) const
Returns true if the 2D interaction diagram identified by the string being passed as parameter exists...
Definition: MaterialLoader.cc:859
Base class for the preprocessor objects that create model entities: nodes, elements, loads, etc.
Definition: Loader.h:50
Material handler (definition, searching,...).
Definition: MaterialLoader.h:45
bool existeMaterial(const std::string &nmb) const
True if material exists.
Definition: MaterialLoader.cc:844
================================================================================
Definition: ContinuaReprComponent.h:34
MaterialLoader(Preprocessor *owr)
Default constructor.
Definition: MaterialLoader.cc:152
@ingroup MATSCCDiagInt
Definition: InteractionDiagramData.h:41
Cross section geometry.
Definition: GeomSection.h:62
@ingroup MATSCCDiagInt
Definition: InteractionDiagram.h:48
std::string getName(const int &tag) const
Returns the name that corresponds to the material tag being passed as parameter.
Definition: MaterialLoader.cc:737