XC Open source finite element analysis program
QuadBase9N.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 //QuadBase9N.h
28 
29 #include "ElemPlano.h"
30 
31 #ifndef QuadBase9N_h
32 #define QuadBase9N_h
33 
34 #include "preprocessor/cad/matrices/TritrizPtrElem.h"
35 #include "preprocessor/cad/aux_meshing.h"
36 #include "preprocessor/loaders/LoadLoader.h"
37 #include "domain/load/plane/BidimStrainLoad.h"
38 #include "med.h"
39 #include "vtkCellType.h"
40 
41 namespace XC {
43 //
45 //
48 template <class PhysProp>
49 class QuadBase9N : public ElemPlano<9,PhysProp>
50  {
51  protected:
52  TritrizPtrElem put_on_mesh(const TritrizPtrNod &,meshing_dir dm) const;
53 
54  public:
55 
56  QuadBase9N(int classTag);
57  QuadBase9N(int tag, int classTag,const PhysProp &);
58 
59  Element::NodesEdge getNodesEdge(const size_t &i) const;
60  ID getLocalIndexNodesEdge(const size_t &i) const;
61  int getEdgeNodes(const Node *,const Node *) const;
62  Poligono3d getPoligono(bool initialGeometry= true) const;
63  Segmento3d getLado(const size_t &i,bool initialGeometry= true) const;
64 
65  int getVtkCellType(void) const;
66  int getMEDCellType(void) const;
67 
68  void zeroLoad(void);
69  int addLoad(ElementalLoad *theLoad, double loadFactor);
70  };
71 
73 template <class PhysProp>
75  : ElemPlano<9,PhysProp>(0,classTag) {}
76 
78 template <class PhysProp>
79 XC::QuadBase9N<PhysProp>::QuadBase9N(int tag,int classTag,const PhysProp &pp)
80  :ElemPlano<9,PhysProp>(tag,classTag,pp) {}
81 
82 
84 template <class PhysProp>
86  { return put_quad9N_on_mesh(*this,nodos,dm); }
87 
89 template <class PhysProp>
90 Poligono3d XC::QuadBase9N<PhysProp>::getPoligono(bool initialGeometry) const
91  {
92  Poligono3d retval;
93  std::cerr << "QuadBase9N<PhysProp>::getPoligono not implemented." << std::endl;
94  return retval;
95  }
96 
98 template <class PhysProp>
99 Segmento3d XC::QuadBase9N<PhysProp>::getLado(const size_t &i,bool initialGeometry) const
100  {
101  Segmento3d retval;
102  std::cerr << "QuadBase9N<PhysProp>::getLado not implemented." << std::endl;
103  return retval;
104  }
105 
107 template <class PhysProp>
109  {
110  Element::NodesEdge retval(3,static_cast<Node *>(nullptr));
111  std::cerr << "QuadBase9N<PhysProp>::getNodesEdge not implemented." << std::endl;
112  return retval;
113  }
114 
117 template <class PhysProp>
118 int XC::QuadBase9N<PhysProp>::getEdgeNodes(const Node *n1,const Node *n2) const
119  {
120  int retval= -1;
121  std::cerr << "QuadBase9N<PhysProp>::getEdgeNodes not implemented." << std::endl;
122  return retval;
123  }
124 
126 template <class PhysProp>
128  {
129  ID retval(2);
130  std::cerr << "QuadBase9N<PhysProp>::getEdgeNodes not implemented." << std::endl;
131  return retval;
132  }
133 
135 template <class PhysProp>
137  {
139  this->physicalProperties.getMaterialsVector().zeroInitialGeneralizedStrains(); //Removes initial deformations.
140  return;
141  }
142 
144 template <class PhysProp>
145 int XC::QuadBase9N<PhysProp>::addLoad(ElementalLoad *theLoad, double loadFactor)
146  {
147  if(this->isDead())
148  std::cerr << this->nombre_clase()
149  << "; load over inactive elements: "
150  << this->getTag() << std::endl;
151  else
152  {
153  if(const BidimStrainLoad *strainLoad= dynamic_cast<const BidimStrainLoad *>(theLoad)) //Prescribed strains.
154  {
155  static std::vector<Vector> initStrains;
156  initStrains= strainLoad->getStrains();
157  for(std::vector<Vector>::iterator i= initStrains.begin();i!=initStrains.end();i++)
158  (*i)*= loadFactor;
159  this->physicalProperties.getMaterialsVector().addInitialGeneralizedStrains(initStrains);
160  }
161  else
162  {
163  std::cerr << "QuadBase9N::addLoad -- load type unknown for element with tag: " <<
164  this->getTag() << std::endl;
165  return -1;
166  }
167  }
168  return 0;
169  }
170 
172 template <class PhysProp>
174  { return VTK_QUADRATIC_QUAD; }
175 
177 template <class PhysProp>
179  { return MED_QUAD9; }
180 
181 } // end of XC namespace
182 #endif
Segmento3d getLado(const size_t &i, bool initialGeometry=true) const
Returns a lado of the element.
Definition: QuadBase9N.h:99
"Tritriz" of pointers to elements.
Definition: TritrizPtrElem.h:43
std::vector< const Node * > NodesEdge
Definition: Element.h:108
TritrizPtrElem put_quad9N_on_mesh(const Element &e, const TritrizPtrNod &, meshing_dir dm)
Places the elements on the mesh passed as parameter.
Definition: aux_meshing.cc:252
int getVtkCellType(void) const
Interfaz con Vtk.
Definition: QuadBase9N.h:173
"Tritriz" of pointers to elements.
Definition: TritrizPtrNod.h:51
Element::NodesEdge getNodesEdge(const size_t &i) const
Returns the nodos de un lado of the element.
Definition: QuadBase9N.h:108
void zeroLoad(void)
Zeroes loads on element.
Definition: QuadBase9N.h:136
Mesh node.
Definition: Node.h:99
Load due to restricted material expansion or contraction on bidimensional elements.
Definition: BidimStrainLoad.h:38
Base class for loads over elements.
Definition: ElementalLoad.h:73
Base class for plane elements.
Definition: ElemPlano.h:48
virtual void zeroLoad(void)
Anula el load vector aplicadas of the element.
Definition: Element.cpp:185
PhysProp physicalProperties
pointers to the material objects and physical properties.
Definition: ElemWithMaterial.h:43
Definition: ID.h:77
TritrizPtrElem put_on_mesh(const TritrizPtrNod &, meshing_dir dm) const
Put the element on the mesh being passed as parameter.
Definition: QuadBase9N.h:85
QuadBase9N(int classTag)
Constructor.
Definition: QuadBase9N.h:74
Base class for nine node quads.
Definition: QuadBase9N.h:49
int getMEDCellType(void) const
Interfaz con el formato MED de Salome.
Definition: QuadBase9N.h:178
ID getLocalIndexNodesEdge(const size_t &i) const
Returns the local indexes of the nodes that lie on the i-th edge.
Definition: QuadBase9N.h:127
Poligono3d getPoligono(bool initialGeometry=true) const
Returns the element contour as a polygon.
Definition: QuadBase9N.h:90
int getEdgeNodes(const Node *, const Node *) const
Returns the borde of the element que tiene por extremos los nodos being passed as parameters...
Definition: QuadBase9N.h:118
int addLoad(ElementalLoad *theLoad, double loadFactor)
Adds to the element the load being passed as parameter.
Definition: QuadBase9N.h:145
================================================================================
Definition: ContinuaReprComponent.h:34