XC Open source finite element analysis program
create_elem.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 //create_elem.h
28 
29 #ifndef CREATE_ELEM_H
30 #define CREATE_ELEM_H
31 
32 namespace XC {
33 class Element;
34 
35 template <typename ELEM>
36 ELEM *new_element(int tag_elem)
37  {
38  ELEM *retval= new ELEM(tag_elem); //Lo creamos.
39  return retval;
40  }
41 
43 template <typename ELEM>
44 ELEM *new_element_gen_mat(int tag_elem, Material *ptrMat)
45  {
46  ELEM *retval= new ELEM(tag_elem,ptrMat);
47  return retval;
48  }
49 
51 template <typename ELEM>
52 ELEM *new_element_dim_gen_mat(int tag_elem,int dime, Material *ptrMat)
53  {
54  ELEM *retval= new ELEM(tag_elem,dime,ptrMat);
55  return retval;
56  }
57 
58 template <typename ELEM>
59 ELEM *new_element_dim_gen_mat_dir(int tag_elem,int dime, Material *ptrMat,int d)
60  {
61  ELEM *retval= new ELEM(tag_elem, dime, ptrMat,d); //Lo creamos.
62  return retval;
63  }
64 
65 template <typename ELEM>
66 ELEM *new_element_gen_mat_crd(int tag_elem, Material *ptrMat, CrdTransf *ptrTrf)
67  {
68  ELEM *retval= new ELEM(tag_elem,ptrMat,ptrTrf); //Lo creamos.
69  return retval;
70  }
71 
72 template <typename ELEM>
73 ELEM *new_element_dim_gen_mat_crd(int tag_elem,int dime, Material *ptrMat, CrdTransf *ptrTrf)
74  {
75  ELEM *retval= new ELEM(tag_elem,dime,ptrMat,ptrTrf); //Lo creamos.
76  return retval;
77  }
78 
79 template <typename ELEM>
80 ELEM *new_element_ns_gen_mat_crd(int tag_elem, Material *ptrMat, int ns, CrdTransf *ptrTrf)
81  {
82  ELEM *retval= new ELEM(tag_elem,ns,ptrMat,ptrTrf); //Lo creamos.
83  return retval;
84  }
85 
86 template <typename ELEM>
87 ELEM *new_element_ns_gen_mat_crd_integ(int tag_elem, Material *ptrMat, int ns, CrdTransf *ptrTrf,BeamIntegration *ptrInteg)
88  {
89  ELEM *retval= new ELEM(tag_elem,ns,ptrMat,ptrTrf,ptrInteg); //Lo creamos.
90  return retval;
91  }
92 
93 template <typename ELEM, typename MAT>
94 ELEM *new_element_mat(int tag_elem, Material *ptrMat)
95  {
96  ELEM *retval= nullptr;
97  const MAT *ptr_mat= dynamic_cast<const MAT *>(ptrMat);
98  if(ptr_mat)
99  retval= new ELEM(tag_elem,ptr_mat); //Lo creamos.
100  return retval;
101  }
102 
103 template <typename ELEM>
104 ELEM *new_element_mat_crd(int tag_elem, Material *ptrMat, CrdTransf *ptrTrf)
105  {
106  ELEM *retval= new ELEM(tag_elem,ptrMat,ptrTrf); //Lo creamos.
107  return retval;
108  }
109 } // end of XC namespace
110 
111 #endif
CrdTransf provides the abstraction of a frame coordinate transformation. It is an abstract base class...
Definition: CrdTransf.h:87
Base class for materials.
Definition: Material.h:85
ELEM * new_element_dim_gen_mat(int tag_elem, int dime, Material *ptrMat)
Creates a new element and assigns it a material.
Definition: create_elem.h:52
ELEM * new_element_gen_mat(int tag_elem, Material *ptrMat)
Creates a new element and assigns it a material.
Definition: create_elem.h:44
================================================================================
Definition: ContinuaReprComponent.h:34
Base class for integration on beam elements.
Definition: BeamIntegration.h:73