quadrature_trap_2D.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 
20 // Local includes
22 
23 namespace libMesh
24 {
25 
26 
27 
28 void QTrap::init_2D(const ElemType type_in,
29  unsigned int)
30 {
31 #if LIBMESH_DIM > 1
32 
33  //-----------------------------------------------------------------------
34  // 2D quadrature rules
35  switch (type_in)
36  {
37 
38 
39  //---------------------------------------------
40  // Quadrilateral quadrature rules
41  case QUAD4:
42  case QUAD8:
43  case QUAD9:
44  {
45 
46  // We compute the 2D quadrature rule as a tensor
47  // product of the 1D quadrature rule.
48  QTrap q1D(1);
49  q1D.init(EDGE2);
50 
51  tensor_product_quad( q1D );
52 
53  return;
54  }
55 
56 
57  //---------------------------------------------
58  // Triangle quadrature rules
59  case TRI3:
60  case TRI6:
61  {
62  _points.resize(3);
63  _weights.resize(3);
64 
65  _points[0](0) = 0.;
66  _points[0](1) = 0.;
67 
68  _points[1](0) = 1.;
69  _points[1](1) = 0.;
70 
71  _points[2](0) = 0.;
72  _points[2](1) = 1.;
73 
74 
75  _weights[0] = 1./6.;
76  _weights[1] = 1./6.;
77  _weights[2] = 1./6.;
78 
79  return;
80  }
81 
82 
83  //---------------------------------------------
84  // Unsupported type
85  default:
86  {
87  libMesh::err << "Element type not supported!:" << type_in << std::endl;
88  libmesh_error();
89  }
90  }
91 
92  libmesh_error();
93 
94  return;
95 
96 #endif
97 }
98 
99 } // namespace libMesh

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:07 UTC

Hosted By:
SourceForge.net Logo