SundancePolygonQuadrature.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                              Sundance
00005 //                 Copyright (2005) Sandia Corporation
00006 // 
00007 // Copyright (year first published) Sandia Corporation.  Under the terms 
00008 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government 
00009 // retains certain rights in this software.
00010 // 
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //  
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //                                                                                 
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA                                                                                
00025 // Questions? Contact Kevin Long (krlong@sandia.gov), 
00026 // Sandia National Laboratories, Livermore, California, USA
00027 // 
00028 // ************************************************************************
00029 /* @HEADER@ */
00030 
00031 #ifndef SUNDANCE_POLYGONQUADRATURE_H
00032 #define SUNDANCE_POLYGONQUADRATURE_H
00033 
00034 #include "SundanceDefs.hpp"
00035 #include "Teuchos_RefCountPtr.hpp"
00036 #include "SundanceQuadratureFamilyBase.hpp"
00037 #include "SundanceQuadratureFamily.hpp"
00038 
00039 namespace Sundance
00040 {
00041 using namespace Teuchos;
00042 
00043 
00044 /** 
00045  * Quadrature special for the polygon curve integration <br>.
00046  * There we need for each line segment inside one cell a line integral.
00047  * So for one cell we might need several line quadrature points, and this class
00048  * gives us per cell(line) a constant number of quadrature points for a line,
00049  * so we can integrate along the curve exactly. (each line segment exactly inside one cell) <br>
00050  * As an input we need a quadrature class, and the points of that quadrature rule for a line
00051  * will be used for each line segment of the polygon inside one cell (2D).
00052  */
00053 class PolygonQuadrature : public QuadratureFamilyBase
00054 {
00055 public:
00056   /** */
00057   PolygonQuadrature( const QuadratureFamily& quad );
00058 
00059   /** */
00060   virtual ~PolygonQuadrature(){;}
00061 
00062 
00063   /** */
00064   virtual XMLObject toXML() const ;
00065 
00066   /** Describable interface */
00067   virtual std::string description() const 
00068     {return "PolygonQuadrature[order=" + Teuchos::toString(order())
00069         +  "]";}
00070 
00071   /* handleable boilerplate */
00072   GET_RCP(QuadratureFamilyStub);
00073 
00074   /** method for the user to change this value
00075    * too much line nr is an overhead
00076    * too less will cause error thrown in the code
00077    * @param maxNrLine */
00078   static void setNrMaxLinePerCell( int maxNrLine ) { nrMaxLinePerCell_ = maxNrLine; }
00079 
00080   /** return the maximal number of line segments inside one cell */
00081   static int getNrMaxLinePerCell() { return nrMaxLinePerCell_; }
00082 
00083 protected:
00084 
00085   /** for polygon curve integrals only this method should be used */
00086   virtual void getLineRule(Array<Point>& quadPoints,
00087     Array<double>& quadWeights) const ;
00088 
00089 private:
00090 
00091   /** The quadrature which will be used for the polygon lines integration */
00092   const QuadratureFamily& quad_;
00093 
00094   /** maximum number of lines inside a cell, the default value is 6 but this can be changed
00095    * by the user */
00096   static int nrMaxLinePerCell_;
00097 
00098 };
00099 }
00100 
00101 
00102 #endif

Site Contact