$extrastylesheet
quadrature_trap_3D.C
Go to the documentation of this file.
00001 // The libMesh Finite Element Library.
00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
00003 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 
00019 
00020 // Local includes
00021 #include "libmesh/quadrature_trap.h"
00022 
00023 namespace libMesh
00024 {
00025 
00026 
00027 
00028 
00029 
00030 void QTrap::init_3D(const ElemType type_in,
00031                     unsigned int)
00032 {
00033 #if LIBMESH_DIM == 3
00034 
00035   //-----------------------------------------------------------------------
00036   // 3D quadrature rules
00037   switch (type_in)
00038     {
00039       //---------------------------------------------
00040       // Hex quadrature rules
00041     case HEX8:
00042     case HEX20:
00043     case HEX27:
00044       {
00045         // We compute the 3D quadrature rule as a tensor
00046         // product of the 1D quadrature rule.
00047         QTrap q1D(1);
00048         q1D.init(EDGE2);
00049 
00050         tensor_product_hex( q1D );
00051 
00052         return;
00053       }
00054 
00055 
00056 
00057       //---------------------------------------------
00058       // Tetrahedral quadrature rules
00059     case TET4:
00060     case TET10:
00061       {
00062         _points.resize(4);
00063         _weights.resize(4);
00064 
00065         _points[0](0) = 0.;
00066         _points[0](1) = 0.;
00067         _points[0](2) = 0.;
00068 
00069         _points[1](0) = 1.;
00070         _points[1](1) = 0.;
00071         _points[1](2) = 0.;
00072 
00073         _points[2](0) = 0.;
00074         _points[2](1) = 1.;
00075         _points[2](2) = 0.;
00076 
00077         _points[3](0) = 0.;
00078         _points[3](1) = 0.;
00079         _points[3](2) = 1.;
00080 
00081 
00082 
00083         _weights[0] = .0416666666666666666666666666666666666666666667;
00084         _weights[1] = _weights[0];
00085         _weights[2] = _weights[0];
00086         _weights[3] = _weights[0];
00087 
00088         return;
00089       }
00090 
00091 
00092 
00093       //---------------------------------------------
00094       // Prism quadrature rules
00095     case PRISM6:
00096     case PRISM15:
00097     case PRISM18:
00098       {
00099         // We compute the 3D quadrature rule as a tensor
00100         // product of the 1D quadrature rule and a 2D
00101         // triangle quadrature rule
00102 
00103         QTrap q1D(1);
00104         QTrap q2D(2);
00105 
00106         // Initialize
00107         q1D.init(EDGE2);
00108         q2D.init(TRI3);
00109 
00110         tensor_product_prism(q1D, q2D);
00111 
00112         return;
00113       }
00114 
00115 
00116       //---------------------------------------------
00117       // Unsupported type
00118     default:
00119       libmesh_error_msg("ERROR: Unsupported type: " << type_in);
00120     }
00121 #endif
00122 }
00123 
00124 } // namespace libMesh