SundanceCurveIntegralCalc.hpp
Go to the documentation of this file.
00001 /* @HEADER@ */
00002 // ************************************************************************
00003 // 
00004 //                             Sundance
00005 //                 Copyright 2011 Sandia Corporation
00006 // 
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Kevin Long (kevin.long@ttu.edu)
00038 // 
00039 
00040 /* @HEADER@ */
00041 
00042 
00043 /*
00044  * SundanceCurveIntagralCalc.hpp
00045  *
00046  *  Created on: Sep 2, 2010
00047  *      Author: benk
00048  */
00049 
00050 #ifndef SUNDANCECURVEINTEGRALCALC_HPP_
00051 #define SUNDANCECURVEINTEGRALCALC_HPP_
00052 
00053 #include "SundanceParametrizedCurve.hpp"
00054 #include "SundanceOut.hpp"
00055 #include "SundancePoint.hpp"
00056 #include "SundanceQuadratureFamily.hpp"
00057 #include "SundanceCellType.hpp"
00058 #include "SundanceMesh.hpp"
00059 
00060 namespace Sundance {
00061 
00062 /** Class to compute the intersection/quadrature points of a cell with a curve in 2/3D */
00063 class CurveIntegralCalc {
00064 public:
00065 
00066   /** Empty Ctor*/
00067   CurveIntegralCalc();
00068 
00069   virtual ~CurveIntegralCalc() {;}
00070 
00071     /**
00072          [in]  maxCellType <br>
00073          [in]  const Array<Point>& cellPoints (the physical points of the cell) <br>
00074          [in]  paramCurve <br>
00075          [in]  Quadraturefamily , quadrature 1D for curve, or 2D for surface <br>
00076          [out] Array<Point>& curvePoints <br>
00077          [out] Array<Point>& curveDerivs  <br>
00078          [out] Array<Point>& curveNormals <br> */
00079 
00080     static void getCurveQuadPoints(CellType  maxCellType ,
00081                                int maxCellLID ,
00082                                const Mesh& mesh ,
00083                    const ParametrizedCurve& paramCurve,
00084                    const QuadratureFamily& quad ,
00085                    Array<Point>& curvePoints ,
00086                    Array<Point>& curveDerivs ,
00087                    Array<Point>& curveNormals );
00088 
00089     /** this method shows if special methods for polygon can be used */
00090     static bool usePolygoneCurveQuadrature(
00091         const CellType& cellType ,
00092         const Mesh& mesh ,
00093         const ParametrizedCurve& paramCurve);
00094 
00095     /** test if we are in 3D for the Brick surface quadrature */
00096     static bool use3DSurfQuadrature(
00097         const CellType& cellType ,
00098         const Mesh& mesh ){
00099       if ( (mesh.cellType(mesh.spatialDim()) == BrickCell) && (cellType == BrickCell) ) { return true; }
00100       else {return false;}
00101     }
00102 
00103 private :
00104 
00105     /** the simplest method which considers only the intersection points on the
00106      * facets, and inside the element we use */
00107     static void getCurveQuadPoints_line(
00108                                    int  maxCellLID ,
00109                                    CellType  maxCellType ,
00110                                    const Mesh& mesh ,
00111                                    const Array<Point>& cellPoints,
00112                    const ParametrizedCurve& paramCurve,
00113                    const QuadratureFamily& quad ,
00114                    Array<Point>& curvePoints ,
00115                    Array<Point>& curveDerivs ,
00116                    Array<Point>& curveNormals );
00117 
00118     /** projects the point from 2D surf to 3D points of the element (needed for surf integrals)*/
00119     static void get3DRealCoordsOnSurf(const Point &refP ,
00120                                   const Array<Point>& cellPoints,
00121                                   const Array<int> &triangles ,
00122                                   const int nrTriag ,
00123                                   const Array<Point> edgeIntersectPoint,
00124                                   int &triagIndex ,
00125                                   Point &realPoint);
00126 
00127 
00128     /** polygons in 1D curves, uses the information from the polygon */
00129     static void getCurveQuadPoints_polygon(
00130                                    int  maxCellLID ,
00131                                    CellType  maxCellType ,
00132                                    const Mesh& mesh ,
00133                                    const Array<Point>& cellPoints,
00134                    const ParametrizedCurve& paramCurve,
00135                    const QuadratureFamily& quad ,
00136                    Array<Point>& curvePoints ,
00137                    Array<Point>& curveDerivs ,
00138                    Array<Point>& curveNormals );
00139 
00140     /** special method for 3D surface quadrature similar to the one in getCurveQuadPoints_line ,
00141      * but it uses special Quadrature class, up to 4 triangles per brick cell*/
00142     static void getSurfQuadPoints(
00143                                    int  maxCellLID ,
00144                                    CellType  maxCellType ,
00145                                    const Mesh& mesh ,
00146                                    const Array<Point>& cellPoints,
00147                    const ParametrizedCurve& paramCurve,
00148                    const QuadratureFamily& quad ,
00149                    Array<Point>& curvePoints ,
00150                    Array<Point>& curveDerivs ,
00151                    Array<Point>& curveNormals );
00152 };
00153 
00154 }
00155 
00156 #endif /* SUNDANCECURVEINTEGRALCALC_HPP_ */

Site Contact