xc
GaussModel.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //
28 #ifndef GAUSSMODEL_H
29 #define GAUSSMODEL_H
30 
31 #include "GaussPoint.h"
32 #include "utility/geom/pos_vec/Pos2d.h"
33 #include "utility/geom/pos_vec/Pos3d.h"
34 #include <deque>
35 
36 namespace XC {
37 
39 //
42  {
43  protected:
44  std::deque<Pos3d> coo_ref_nodes;
45  std::deque<GaussPoint> gauss_points;
46  public:
47  GaussModel(void);
48  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,
49  const GaussPoint &p);
50  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,
51  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3);
52  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,const Pos2d &n4,
53  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3,const GaussPoint &p4);
54  GaussModel(const Pos2d &n1,const Pos2d &n2,const Pos2d &n3,const Pos2d &n4,
55  const Pos2d &n5,const Pos2d &n6,const Pos2d &n7,const Pos2d &n8,const Pos2d &n9,
56  const GaussPoint &p1,const GaussPoint &p2,const GaussPoint &p3,const GaussPoint &p4,
57  const GaussPoint &p5,const GaussPoint &p6,const GaussPoint &p7,const GaussPoint &p8,const GaussPoint &p9);
58 
59  inline size_t getNumberOfReferenceNodes(void) const
60  { return coo_ref_nodes.size(); }
61  const std::deque<Pos3d> &getReferenceNodesPositions(void) const
62  { return coo_ref_nodes; }
63  inline size_t getNumGaussPoints(void) const
64  { return gauss_points.size(); }
65  const std::deque<GaussPoint> &getGaussPoints(void) const
66  { return gauss_points; }
67 
68  };
69 
70 const GaussModel gauss_model_empty;
71 const GaussModel gauss_model_tria1(Pos2d(0,0),Pos2d(1,0),Pos2d(0,1),
72  GaussPoint(Pos2d(0.333333333333333,0.333333333333333),0.5));
73 
74 const GaussModel gauss_model_tria3(Pos2d(0,0),Pos2d(1,0),Pos2d(0,1),
75  GaussPoint(Pos2d(0.2,0.2),0.3334),
76  GaussPoint(Pos2d(0.8,0.1),0.3334),
77  GaussPoint(Pos2d(0.1,0.8),0.3334));
78 //Gauss model for nine node quads.
79 //
80 // 3---------2
81 // | |
82 // | |
83 // | |
84 // 0---------1
85 //
86 const double root3= sqrt(3.0);
87 const double one_over_root3= 1.0/root3;
88 const GaussModel gauss_model_quad4(Pos2d(-1,-1),Pos2d(1,-1),Pos2d(1,1),Pos2d(-1,1),
89  GaussPoint(Pos2d(-one_over_root3,-one_over_root3),1),
90  GaussPoint(Pos2d(one_over_root3,-one_over_root3),1),
91  GaussPoint(Pos2d(one_over_root3,one_over_root3),1),
92  GaussPoint(Pos2d(-one_over_root3,one_over_root3),1));
93 
94 const double root5= sqrt(5.0);
95 const double root3_over_root5= root3/root5;
96 
97 //Gauss model for nine node quads.
98 //
99 // 6----5----4
100 // | |
101 // 7 8 3
102 // | |
103 // 0----1----2
104 //
105 const GaussModel gauss_model_quad9(Pos2d(-1,-1),Pos2d(0,-1),Pos2d(1,-1),Pos2d(1,0),
106  Pos2d(1,1),Pos2d(0,1),Pos2d(-1,1),Pos2d(-1,0),Pos2d(0,0),
107  GaussPoint(Pos2d(-root3_over_root5,-root3_over_root5),25.0/81.0),
108  GaussPoint(Pos2d(0,-root3_over_root5),40.0/81.0),
109  GaussPoint(Pos2d(root3_over_root5,-root3_over_root5),25.0/81.0),
110  GaussPoint(Pos2d(root3_over_root5,0),40.0 / 81.0),
111  GaussPoint(Pos2d(root3_over_root5,root3_over_root5),25.0 / 81.0),
112  GaussPoint(Pos2d(0,root3_over_root5),40.0 / 81.0),
113  GaussPoint(Pos2d(-root3_over_root5,root3_over_root5),25.0 / 81.0),
114  GaussPoint(Pos2d(-root3_over_root5,0),40.0 / 81.0),
115  GaussPoint(Pos2d(0,0),64.0 / 81.0));
116 } // end of XC namespace
117 
118 #endif
119 //
Posición en dos dimensiones.
Definition: Pos2d.h:41
GaussModel(void)
Constructor.
Definition: GaussModel.cc:31
3D position of Gauss points.
Definition: GaussPoint.h:38
std::deque< GaussPoint > gauss_points
Gauss points.
Definition: GaussModel.h:45
Base class for Gauss integration models.
Definition: GaussModel.h:41
std::deque< Pos3d > coo_ref_nodes
Coordinates of the reference nodes.
Definition: GaussModel.h:44
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35