XC Open source finite element analysis program
GaussModel.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 #ifndef GAUSSMODEL_H
28 #define GAUSSMODEL_H
29 
30 #include "GaussPoint.h"
31 #include "xc_utils/src/geom/pos_vec/Pos2d.h"
32 #include "xc_utils/src/geom/pos_vec/Pos3d.h"
33 #include <deque>
34 
35 namespace XC {
36 
38 //
41  {
42  protected:
43  std::deque<Pos3d> coo_ref_nodes;
44  std::deque<GaussPoint> gauss_points;
45  public:
46  GaussModel(void);
47  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,
48  const GaussPoint &p);
49  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,
50  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3);
51  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,const Pos2d &n4,
52  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3,const GaussPoint &p4);
53  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,const Pos2d &n4,
54  const Pos2d &n5,const Pos2d &n6,const Pos2d &n7,const Pos2d &n8,const Pos2d &n9,
55  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3,const GaussPoint &p4,
56  const GaussPoint &p5,const GaussPoint &p6,const GaussPoint &p7,const GaussPoint &p8,const GaussPoint &p9);
57 
58  inline size_t getNumberOfReferenceNodes(void) const
59  { return coo_ref_nodes.size(); }
60  const std::deque<Pos3d> &getReferenceNodesPositions(void) const
61  { return coo_ref_nodes; }
62  inline size_t getNumGaussPoints(void) const
63  { return gauss_points.size(); }
64  const std::deque<GaussPoint> &getPuntosGauss(void) const
65  { return gauss_points; }
66 
67  };
68 
69 const GaussModel gauss_model_empty;
70 const GaussModel gauss_model_tria1(Pos2d(0,0),Pos2d(1,0),Pos2d(0,1),
71  GaussPoint(Pos2d(0.333333333333333,0.333333333333333),0.5));
72 
73 const GaussModel gauss_model_tria3(Pos2d(0,0),Pos2d(1,0),Pos2d(0,1),
74  GaussPoint(Pos2d(0.2,0.2),0.3334),
75  GaussPoint(Pos2d(0.8,0.1),0.3334),
76  GaussPoint(Pos2d(0.1,0.8),0.3334));
77 const double root3= sqrt(3.0);
78 const double one_over_root3= 1.0/root3;
79 const GaussModel gauss_model_quad4(Pos2d(-1,-1),Pos2d(1,-1),Pos2d(1,1),Pos2d(-1,1),
80  GaussPoint(Pos2d(-one_over_root3,-one_over_root3),1),
81  GaussPoint(Pos2d(one_over_root3,-one_over_root3),1),
82  GaussPoint(Pos2d(one_over_root3,one_over_root3),1),
83  GaussPoint(Pos2d(-one_over_root3,one_over_root3),1));
84 
85 const double root5= sqrt(5.0);
86 const double root3_over_root5= root3/root5;
87 
88 //Gauss model for nine node quads.
89 //
90 // 6----5----4
91 // | |
92 // 7 8 3
93 // | |
94 // 0----1----2
95 //
96 const GaussModel gauss_model_quad9(Pos2d(-1,-1),Pos2d(0,-1),Pos2d(1,-1),Pos2d(1,0),
97  Pos2d(1,1),Pos2d(0,1),Pos2d(-1,1),Pos2d(-1,0),Pos2d(0,0),
98  GaussPoint(Pos2d(-root3_over_root5,-root3_over_root5),25.0/81.0),
99  GaussPoint(Pos2d(0,-root3_over_root5),40.0/81.0),
100  GaussPoint(Pos2d(root3_over_root5,-root3_over_root5),25.0/81.0),
101  GaussPoint(Pos2d(root3_over_root5,0),40.0 / 81.0),
102  GaussPoint(Pos2d(root3_over_root5,root3_over_root5),25.0 / 81.0),
103  GaussPoint(Pos2d(0,root3_over_root5),40.0 / 81.0),
104  GaussPoint(Pos2d(-root3_over_root5,root3_over_root5),25.0 / 81.0),
105  GaussPoint(Pos2d(-root3_over_root5,0),40.0 / 81.0),
106  GaussPoint(Pos2d(0,0),64.0 / 81.0));
107 } // end of XC namespace
108 
109 #endif
110 //
Base class for Gauss integration models.
Definition: GaussModel.h:40
3D position of Gauss points.
Definition: GaussPoint.h:37
std::deque< GaussPoint > gauss_points
Gauss points.
Definition: GaussModel.h:44
std::deque< Pos3d > coo_ref_nodes
Coordinates of the reference nodes.
Definition: GaussModel.h:43
================================================================================
Definition: ContinuaReprComponent.h:34
GaussModel(void)
Constructor.
Definition: GaussModel.cc:31