SundanceGaussLobattoQuadrature.cpp
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  * SundanceGaussLobattoQuadrature.cpp
00045  *
00046  *  Created on: Jan 20, 2011
00047  *      Author: benk
00048  */
00049 
00050 #include "SundanceGaussLobattoQuadrature.hpp"
00051 #include "SundanceCurveIntegralCalc.hpp"
00052 #include "SundancePolygon2D.hpp"
00053 #include "SundanceSurf3DCalc.hpp"
00054 #include "PlayaTabs.hpp"
00055 
00056 using namespace Sundance;
00057 
00058 
00059 int const GaussLobattoQuadrature::quadsEdgesPoints[4][2] = { {0,1} , {0,2} , {1,3} , {2,3} };
00060                                                        //  0   1   2   3   4   5   6   7   8   9  10  11
00061 int const GaussLobattoQuadrature::edge3DProjection[12] = { 0 , 1 , 2 , 1 , 2 , 0 , 2 , 2 , 0 , 1 , 1 , 0};
00062 
00063 
00064 GaussLobattoQuadrature::GaussLobattoQuadrature(int order) :
00065    QuadratureFamilyBase(order) {
00066   nrPointin1D_ = order+1;
00067   verb_ = 0;
00068 }
00069 
00070 XMLObject GaussLobattoQuadrature::toXML() const
00071 {
00072   XMLObject rtn("GaussLobattoQuadrature");
00073   rtn.addAttribute("order", Teuchos::toString(order()));
00074   return rtn;
00075 }
00076 
00077 
00078 void GaussLobattoQuadrature::getTriangleRule(
00079     Array<Point>& quadPoints,
00080     Array<double>& quadWeights) const {
00081     // todo: implement this
00082   SUNDANCE_ERROR("Triangle rule not available for " << toXML());
00083 }
00084 
00085 void GaussLobattoQuadrature::getQuadRule(
00086     Array<Point>& quadPoints,
00087     Array<double>& quadWeights) const {
00088   Array<Point> quadPointsLine;
00089   Array<double> quadWeightsLine;
00090   // get the line rule
00091     this->getLineRule( quadPointsLine, quadWeightsLine );
00092 
00093     int nrPointPerAxis = quadPointsLine.size();
00094     // we simply take the tensor product
00095     quadPoints.resize(nrPointPerAxis*nrPointPerAxis);
00096     quadWeights.resize(nrPointPerAxis*nrPointPerAxis);
00097 
00098     int pcount = 0;
00099     for (int ix = 0 ; ix < nrPointPerAxis ; ix ++){
00100       for (int iy = 0 ; iy < nrPointPerAxis ; iy ++){
00101         // here we take the tensor product of the
00102         quadPoints[pcount] = Point( quadPointsLine[ix][0] , quadPointsLine[iy][0] );
00103         quadWeights[pcount] = quadWeightsLine[ix] * quadWeightsLine[iy];
00104         pcount++;
00105       }
00106     }
00107 }
00108 
00109 
00110 void GaussLobattoQuadrature::getTetRule(
00111     Array<Point>& quadPoints,
00112     Array<double>& quadWeights) const {
00113    // todo: implement this
00114    SUNDANCE_ERROR("Tet rule not available for " << toXML());
00115 }
00116 
00117 
00118 void GaussLobattoQuadrature::getBrickRule(
00119     Array<Point>& quadPoints,
00120     Array<double>& quadWeights) const {
00121   Array<Point> quadPointsLine;
00122   Array<double> quadWeightsLine;
00123   // get the line rule
00124     this->getLineRule( quadPointsLine, quadWeightsLine );
00125 
00126     int nrPointPerAxis = quadPointsLine.size();
00127     // we simply take the tensor product
00128     quadPoints.resize(nrPointPerAxis*nrPointPerAxis*nrPointPerAxis);
00129     quadWeights.resize(nrPointPerAxis*nrPointPerAxis*nrPointPerAxis);
00130 
00131     int pcount = 0;
00132     for (int iz = 0 ; iz < nrPointPerAxis ; iz ++){
00133     for (int iy = 0 ; iy < nrPointPerAxis ; iy ++){
00134         for (int ix = 0 ; ix < nrPointPerAxis ; ix ++){
00135         // here we take the tensor product of the
00136         quadPoints[pcount] = Point( quadPointsLine[ix][0] , quadPointsLine[iy][0] , quadPointsLine[iz][0]);
00137         quadWeights[pcount] = quadWeightsLine[ix] * quadWeightsLine[iy] * quadWeightsLine[iz];
00138         pcount++;
00139       }
00140       }
00141     }
00142 }
00143 
00144 
00145 void GaussLobattoQuadrature::getAdaptedWeights(
00146     const CellType& cellType, int cellDim,
00147     int cellLID, int facetIndex, const Mesh& mesh,
00148     const ParametrizedCurve& globalCurve,
00149     Array<Point>& quadPoints, Array<double>& quadWeights,
00150     bool &weightsChanged) const {
00151 
00152   Tabs tabs;
00153 
00154   weightsChanged = true; // todo: this not always might be true to save computations we might test if this is the case
00155   if (mesh.IsSpecialWeightValid() && mesh.hasSpecialWeight(cellDim, cellLID))
00156   {
00157     mesh.getSpecialWeight(cellDim, cellLID, quadWeights);
00158     //SUNDANCE_MSG3(verb, tabs << "GaussianQuadrature::getAdaptedWeights Found cached weights for cell LID " << cellLID)
00159     return;
00160   }
00161   // if we have no quad points then get them
00162   if (quadPoints.size() <= 1) getPoints(cellType,  quadPoints, quadWeights);
00163 
00164   // Maximal cell type
00165   CellType maxCellType = mesh.cellType(mesh.spatialDim());
00166 
00167   switch (maxCellType)
00168   {
00169   // We have a triangle based mesh
00170   case TriangleCell:
00171   {
00172     switch (cellType)
00173     {
00174     case TriangleCell:
00175     {
00176       // todo: implement this
00177       break;
00178     }
00179     default:
00180 #ifndef TRILINOS_7
00181       SUNDANCE_ERROR ("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for submaximal cell " << maxCellType << " in a triangle mesh")
00182       ;
00183 #else
00184       SUNDANCE_ERROR7("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for submaximal cell " << maxCellType << " in a triangle mesh");
00185 #endif
00186     }
00187     break;
00188   }
00189   case QuadCell:
00190   {
00191     switch(cellType)
00192     {
00193     case QuadCell:
00194     {
00195       // call the method to integrate the Quad
00196 
00197       if (CurveIntegralCalc::usePolygoneCurveQuadrature( cellType , mesh , globalCurve)){
00198         // if the curve is a polygon then use a different
00199         getAdaptedQuadWeights_polygon(cellLID, mesh, globalCurve, quadPoints, quadWeights, weightsChanged);
00200       }
00201       else
00202       {
00203         getAdaptedQuadWeights(cellLID, mesh, globalCurve, quadPoints, quadWeights, weightsChanged);
00204       }
00205       break;
00206     }
00207     default:
00208 #ifndef TRILINOS_7
00209     SUNDANCE_ERROR ("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for submaximal cell " << maxCellType << " in a triangle mesh")
00210     ;
00211 #else
00212     SUNDANCE_ERROR7("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for submaximal cell " << maxCellType << " in a triangle mesh");
00213 #endif
00214     }
00215     break;
00216   }
00217   case BrickCell:
00218   {
00219     switch(cellType)
00220     {
00221     case BrickCell:
00222     {
00223       // call the method which does the job for 3D
00224       getAdaptedQuadWeights_surf(cellLID, mesh, globalCurve, quadPoints, quadWeights, weightsChanged);
00225       break;
00226     }
00227     default: {}
00228       }
00229     break;
00230   }
00231   default:
00232 #ifndef TRILINOS_7
00233     SUNDANCE_ERROR("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for cell type " << cellType)
00234     ;
00235 #else
00236     SUNDANCE_ERROR7("getAdaptedWeights rule for ACI(Adaptive Cell Integration) not available for cell type " << cellType);
00237 #endif
00238   }
00239 
00240   //store the weights in the mesh
00241   mesh.setSpecialWeight(cellDim, cellLID, quadWeights);
00242 }
00243 
00244 
00245 
00246 void GaussLobattoQuadrature::getAdaptedQuadWeights_polygon(int cellLID, const Mesh& mesh,
00247     const ParametrizedCurve& globalCurve, Array<Point>& quadPoints,
00248     Array<double>& quadWeights, bool& weightsChanged) const {
00249 
00250   // this works only in 2D for polygons, it is important that we ask the underlying object and not the object itself
00251   const Polygon2D* poly = dynamic_cast<const Polygon2D* > ( globalCurve.ptr().get()->getUnderlyingCurveObj() );
00252   if ( poly == 0 ) {
00253     TEUCHOS_TEST_FOR_EXCEPTION( true , std::runtime_error , " getAdaptedQuadWeights_polygon , paramCurve must be a Polygon and the cell must be a quad" );
00254     return;
00255   }
00256 
00257   // the main idea of the algorithm is to get a raw of points
00258   // (P1,P2,P3,P4,P5) and (alpha1,aplpha2), the coefficients
00259   // this raw of points must be ordered correctly and contains intersection and polygon points
00260   // by integrating the left side of this curve we can calculate the exact integral
00261 
00262   // - get the intersection points
00263   // - get the polygon points
00264   // form out of these points a row of points with the shortest distance
00265   // choose as starting point the one with the smallest x and y coordinate
00266 
00267   // use this raw of points for quadrature
00268   //  - see in which direction is always increasing the coordinate
00269   //  - choose one direction (x or y) to parse the raw of points (if not always increasing then take the sign in consideration)
00270 
00271   Array<Point> quadOfPoints(4);
00272   Array<Point> intesectPoints(8);
00273   Array<Point> pointStack(0);
00274   Array<bool>  isInnerPoint(0);
00275   Array<Point> pointStackTmp(0);
00276   Array<Point> allPolygonPoints(0);
00277   int nrIPoints , pointsNr , polyNrPoint ;
00278   double eps = 1e-14;
00279 
00280   SUNDANCE_MSG3(verb_, " ---------- START METHOD -----------  ");
00281 
00282   // get the points of the quad
00283   for (int i = 0 ; i < 4 ; i++){
00284     quadOfPoints[i] = mesh.nodePosition( mesh.facetLID(2,cellLID , 0 , i , nrIPoints ) );
00285   }
00286 
00287   // get all the intersection points
00288   pointsNr = 0;
00289   for (int i = 0 ; i < 4 ; i++)
00290   {
00291     // for each edge test intersection point
00292     globalCurve.returnIntersectPoints( quadOfPoints[quadsEdgesPoints[i][0]] , quadOfPoints[quadsEdgesPoints[i][1]],
00293          nrIPoints , intesectPoints );
00294     //SUNDANCE_MSG3(verb_, " Test edge: "<< quadOfPoints[quadsEdgesPoints[i][0]] << " -- " << quadOfPoints[quadsEdgesPoints[i][1]] );
00295     for (int j = 0 ; j < nrIPoints ; j++){
00296       bool addThisPoint = true;
00297       // add these points only when they are not duplicate
00298       for (int tmpP = 0 ; tmpP < pointsNr ; tmpP++){
00299         double dist = ::sqrt( (pointStackTmp[tmpP] - intesectPoints[j])*(pointStackTmp[tmpP] - intesectPoints[j]) );
00300         if ( dist < eps) addThisPoint = false;
00301       }
00302       // if the point is not a duplicate then add
00303       if (addThisPoint) {
00304         pointStack.resize( pointsNr + 1  );
00305         pointStackTmp.resize( pointsNr + 1 );
00306         isInnerPoint.resize( pointsNr + 1 );
00307         // transform to reference coordinates back
00308         pointStack[pointsNr] = Point( ( intesectPoints[j][0] - quadOfPoints[0][0])/( quadOfPoints[3][0]-quadOfPoints[0][0] ) ,
00309                                 ( intesectPoints[j][1] - quadOfPoints[0][1])/( quadOfPoints[3][1]-quadOfPoints[0][1] )  );
00310         // we store the intersection point also in real coordinates
00311         pointStackTmp[pointsNr] = intesectPoints[j];
00312         isInnerPoint[pointsNr] = false;
00313         //SUNDANCE_MSG3(verb_, " adding Ints Points:"<< pointsNr << " P:"
00314         //    << pointStack[pointsNr] << " Real P:" << intesectPoints[j] );
00315         pointsNr = pointsNr + 1;
00316       }
00317     }
00318   }
00319 
00320   // get the point
00321   poly->getCellsPolygonesPoint( cellLID ,allPolygonPoints);
00322   polyNrPoint = allPolygonPoints.size();
00323   //SUNDANCE_MSG3(verb_, " Polygon has :"<< polyNrPoint << " points inside the cell");
00324   // add also the points which come from the polygon
00325   for (int j = 0 ; j < polyNrPoint ; j++){
00326     bool addThisPoint = true;
00327     // add these points only when they are not duplicate
00328     for (int tmpP = 0 ; tmpP < pointsNr ; tmpP++){
00329       double dist = ::sqrt( (pointStackTmp[tmpP] - allPolygonPoints[j])*(pointStackTmp[tmpP] - allPolygonPoints[j]) );
00330       if ( dist < eps) addThisPoint = false;
00331     }
00332     // if the point is not a duplicate then add
00333     if (addThisPoint) {
00334       pointStack.resize( pointsNr + 1  );
00335       pointStackTmp.resize( pointsNr + 1 );
00336       isInnerPoint.resize( pointsNr + 1 );
00337       // transform to reference coordinates back
00338       pointStack[pointsNr] = Point( ( allPolygonPoints[j][0] - quadOfPoints[0][0])/( quadOfPoints[3][0]-quadOfPoints[0][0] ) ,
00339                               ( allPolygonPoints[j][1] - quadOfPoints[0][1])/( quadOfPoints[3][1]-quadOfPoints[0][1] )  );
00340       // we store the intersection point also in real coordinates
00341       pointStackTmp[pointsNr] = allPolygonPoints[j];
00342       isInnerPoint[pointsNr] = true;
00343       //SUNDANCE_MSG3(verb_, " adding Polygon Points:"<< pointsNr << " P:"
00344       //    << pointStack[pointsNr] << " Real P:" << allPolygonPoints[j] );
00345       pointsNr = pointsNr + 1;
00346     }
00347   }
00348 
00349   // now we have all the points we just need to get them in a sorted way, after distance (Manhattan distance)
00350   // first we select the point which is closes to the (0,0) Point and is an intersection point of the edges
00351   double dist = 1e+100 , firstind = -1;
00352   for (int tmpP = 0 ; tmpP < pointsNr ; tmpP++){
00353     // we look only for intersection points to have as starting point
00354     if ( (pointStack[tmpP][0] + pointStack[tmpP][1] < dist) && (!isInnerPoint[tmpP])){
00355       dist = pointStack[tmpP][0] + pointStack[tmpP][1];
00356       firstind = tmpP;
00357     }
00358   }
00359 
00360   Array<Point> orderedPoints(1);
00361   Array<Point> orderedPointsRealCoords(1);
00362   Array<bool> orderedPointsIsIntersection(1);
00363   orderedPoints[0] = pointStack[firstind];
00364   orderedPointsRealCoords[0] = pointStackTmp[firstind];
00365   orderedPointsIsIntersection[0] = (!isInnerPoint[firstind]);
00366   //SUNDANCE_MSG3(verb_, "Add first point to position 0  from firstind:"<< firstind << " , P:" << orderedPoints[0]);
00367 
00368   int orderedP = 1;
00369 
00370   // with this for loop we create an X or Y ordered list of points, we take the
00371   // first point and insert the next one there, where the distance to the neughbors is minimal
00372   for (int tmpP = 0 ; tmpP < pointsNr ; tmpP++){
00373     // the first point which we added we do not want to add again
00374     if (tmpP == firstind) continue;
00375 
00376     // add all the 1..pointsNr points to the ordered list
00377     double dist = 1e+100 , dist_tmp;
00378     int ind = -1;
00379     //SUNDANCE_MSG3(verb_, " Trying to insert: "<< tmpP << " out of " << pointsNr);
00380     for (int p = 0 ; p <= orderedP ; p++){
00381       dist_tmp = dist;
00382       //SUNDANCE_MSG3(verb_, " probe position " << p << " , orderedP:"<<orderedP);
00383       if (( p == orderedP ) || (p == 0) ){
00384         if (!isInnerPoint[tmpP]){
00385           Point poin = orderedPoints[(p == orderedP)?p-1:p] - pointStack[tmpP];
00386           // check this, what kind of distance * 1.0 should be here added
00387           dist_tmp = 1.0 * ::sqrt(poin*poin);
00388         }
00389       }
00390       else {
00391         Point poin1 = orderedPoints[p-1] - pointStack[tmpP];
00392         Point poin2 = orderedPoints[p] - pointStack[tmpP];
00393         Point prev_dist = orderedPoints[p] - orderedPoints[p-1];
00394         dist_tmp = ::sqrt(poin1*poin1) + ::sqrt(poin2*poin2) - ::sqrt(prev_dist*prev_dist);
00395       }
00396       //SUNDANCE_MSG3(verb_, " dist_tmp: " << dist_tmp << " , dist:" << dist );
00397       // if this distance is shorter than mark this position
00398       if (dist_tmp < dist){
00399         dist = dist_tmp;
00400         ind = p;
00401       }
00402     }
00403 
00404     // the first point should be inserted always to the back
00405     if ( (ind == 0) && ( orderedP <= 1) ){ ind = 1;}
00406 
00407     // if "ind"
00408     TEUCHOS_TEST_FOR_EXCEPTION( ind < 0 , std::runtime_error , " GaussLobattoQuadrature::getAdaptedQuadWeights_polygon ind < 0 ind:"<<ind );
00409     // insert the point to the "ind" position
00410     orderedPoints.resize(orderedP+1);
00411     orderedPointsRealCoords.resize(orderedP+1);
00412     orderedPointsIsIntersection.resize(orderedP+1);
00413     for (int p = orderedP-1 ; p >= ind ; p--){
00414       orderedPoints[p+1] = orderedPoints[p];
00415       orderedPointsRealCoords[p+1] = orderedPointsRealCoords[p];
00416       orderedPointsIsIntersection[p+1] = orderedPointsIsIntersection[p];
00417     }
00418     //SUNDANCE_MSG3(verb_, "Add point to position ind:"<< ind <<  " , tmpP:" << tmpP << " , orderedP:" << orderedP );
00419     //SUNDANCE_MSG3(verb_, "pointStack[tmpP]:"<< pointStack[tmpP] <<  " , pointStackTmp[tmpP]:" << pointStackTmp[tmpP] );
00420     orderedPoints[ind] = pointStack[tmpP];
00421     orderedPointsRealCoords[ind] = pointStackTmp[tmpP];
00422     orderedPointsIsIntersection[ind] = (!isInnerPoint[tmpP]);
00423     orderedP = orderedP + 1;
00424   }
00425 
00426   // at this stage we have the ordered raw of point we just have to use it
00427   // the ordered
00428   bool increaseX = true;
00429   bool increaseY = true;
00430   double minX = orderedPoints[0][0], maxX = orderedPoints[0][0], minY = orderedPoints[0][1], maxY = orderedPoints[0][1];
00431   for (int p = 1 ; p < orderedP ; p++){
00432     if ( orderedPoints[p-1][0] - eps > orderedPoints[p][0]) increaseX = false;
00433     if ( orderedPoints[p-1][1] - eps > orderedPoints[p][1]) increaseY = false;
00434     minX = (orderedPoints[p][0] < minX) ? orderedPoints[p][0] : minX;
00435     maxX = (orderedPoints[p][0] > maxX) ? orderedPoints[p][0] : maxX;
00436     minY = (orderedPoints[p][1] < minY) ? orderedPoints[p][1] : minY;
00437     maxY = (orderedPoints[p][1] > maxY) ? orderedPoints[p][1] : maxY;
00438   }
00439 
00440   // at this point we know in which dimension we are going to parse the points (X or Y)
00441   // we have to make sure that the points are incrementally ordered with respect to this dimension
00442   //(or at least the with respect to the first and last element)
00443   if ( (increaseX) || (increaseY == false)) { // ordered in X direction
00444     if ( orderedPoints[0][0] > orderedPoints[orderedP-1][0]+eps) {
00445       SUNDANCE_MSG3(verb_, " Order in X direction ");
00446       for (int p = 0 ; p < (orderedP/2) ; p++){ // swap the three elements
00447         Point tmp_pp = orderedPoints[p];    orderedPoints[p] = orderedPoints[orderedP-1-p];
00448         orderedPoints[orderedP-1-p] = tmp_pp;
00449         tmp_pp = orderedPointsRealCoords[p];   orderedPointsRealCoords[p] = orderedPointsRealCoords[orderedP-1-p];
00450         orderedPointsRealCoords[orderedP-1-p] = tmp_pp;
00451         bool tmp_bb = orderedPointsIsIntersection[p];  orderedPointsIsIntersection[p] = orderedPointsIsIntersection[orderedP-1-p];
00452         orderedPointsIsIntersection[orderedP-1-p] = tmp_bb;
00453       }
00454     }
00455   } else {
00456     // ordered in Y direction
00457     if ( orderedPoints[0][1] > orderedPoints[orderedP-1][1]+eps) {
00458       SUNDANCE_MSG3(verb_, " Order in Y direction ");
00459       for (int p = 0 ; p < (orderedP/2) ; p++){  // swap the three elements
00460         Point tmp_pp = orderedPoints[p];    orderedPoints[p] = orderedPoints[orderedP-1-p];
00461         orderedPoints[orderedP-1-p] = tmp_pp;
00462         tmp_pp = orderedPointsRealCoords[p];   orderedPointsRealCoords[p] = orderedPointsRealCoords[orderedP-1-p];
00463         orderedPointsRealCoords[orderedP-1-p] = tmp_pp;
00464         bool tmp_bb = orderedPointsIsIntersection[p];   orderedPointsIsIntersection[p] = orderedPointsIsIntersection[orderedP-1-p];
00465         orderedPointsIsIntersection[orderedP-1-p] = tmp_bb;
00466       }
00467     }
00468   }
00469 
00470   // print the points which were ordered
00471   for (int pi = 0 ; pi < orderedP ; pi++){
00472     //SUNDANCE_MSG3(verb_, "Ordered Points pi:"<< pi << " P:" << orderedPoints[pi] );
00473   }
00474 
00475 
00476   // get all the possible weights and quadrature points
00477   Array<Point> linePoints;
00478   Array<double> lineWeights;
00479   getLineRule( linePoints , lineWeights);
00480   int nr1DPoints = linePoints.size();
00481   int nr2DPoints = nr1DPoints * nr1DPoints;
00482   Array<Point> quadQuadPoints;
00483   Array<double> quadQuadWeights;
00484   getQuadRule( quadQuadPoints , quadQuadWeights);
00485   Array<Point> trianglePoints;
00486   Array<double> triangleWeights;
00487   getTriangleQuadPoints( trianglePoints , triangleWeights);
00488 
00489   // the integration coefficients , we get the coefficient left from the curve and right from the curve
00490   double alphaLeft , alphaRight;
00491   Point curvderi = orderedPointsRealCoords[0] - orderedPointsRealCoords[1];
00492   Point norm_vec = Point( -curvderi[1] , curvderi[0] );
00493   norm_vec = norm_vec / ::sqrt(norm_vec*norm_vec);
00494   double relative_length = 1e-2 * ::sqrt(curvderi*curvderi);
00495   //SUNDANCE_MSG3(verb_, " First segment P0: " << orderedPointsRealCoords[0] << " , P1:" <<orderedPointsRealCoords[1]);
00496   //SUNDANCE_MSG3(verb_, " Alpha left P: " << (0.5*orderedPointsRealCoords[0] + 0.5*orderedPointsRealCoords[1]) + relative_length*norm_vec );
00497   //SUNDANCE_MSG3(verb_, " Alpha right P: " << (0.5*orderedPointsRealCoords[0] + 0.5*orderedPointsRealCoords[1]) - relative_length*norm_vec );
00498   alphaLeft = globalCurve.integrationParameter( (0.5*orderedPointsRealCoords[0] + 0.5*orderedPointsRealCoords[1]) + relative_length*norm_vec );
00499   alphaRight = globalCurve.integrationParameter( (0.5*orderedPointsRealCoords[0] + 0.5*orderedPointsRealCoords[1]) - relative_length*norm_vec );
00500 
00501   //SUNDANCE_MSG3(verb_, "minX:"<< minX << " , maxX:" << maxX << " , minY:" << minY << " , maxY:" << maxY <<
00502   //    " , alphaLeft:" << alphaLeft << " , alphaRight:" << alphaRight);
00503   //SUNDANCE_MSG3(verb_, "increaseX:"<< increaseX << " , increaseY:" << increaseY );
00504 
00505   // first quadrate the whole quad
00506   Array<double> wholeWeightsQuad( quadWeights.size() , 0.0 );
00507     makeInterpolantQuad( 0.0, 0.0 , 1.0 , 1.0, nr1DPoints , nr2DPoints ,linePoints ,
00508                      quadQuadPoints , quadQuadWeights ,wholeWeightsQuad , 1.0 );
00509 
00510   Array<double> leftWeightsQuad( quadWeights.size() , 0.0 );
00511   // here we have a big branch, eighter to parse in the X direction or in the Y direction
00512   if ( (increaseX) || (increaseY == false)){
00513     // quadrate in the X direction
00514     // first make a quadrature from 0 to MinX
00515     SUNDANCE_MSG3(verb_, " Increase X , integrate initial quad");
00516       makeInterpolantQuad( 0.0, orderedPoints[0][1] ,
00517                        minX , 1.0-orderedPoints[0][1],
00518                        nr1DPoints , nr2DPoints ,linePoints ,
00519                        quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00520 
00521       // for each segment make a triangle and quad quadrature
00522       for (int seg = 1 ; seg < orderedP ; seg++){
00523         //SUNDANCE_MSG3(verb_, " Integrate segment : " << seg );
00524         Point p0 = orderedPoints[seg-1];
00525         Point p1 = orderedPoints[seg];
00526         if (p0[0] < p1[0] ){
00527           // X is increasing
00528           if (p0[1] < p1[1]){
00529             // Y increasing
00530               makeInterpolantQuad( p0[0] , p1[1] ,
00531                                p1[0] - p0[0] , 1.0-p1[1] ,
00532                                nr1DPoints , nr2DPoints ,linePoints ,
00533                                quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00534               makeInterpolantQuad( p0[0] , p1[1] ,
00535                                    p1[0] - p0[0] , p0[1] - p1[1] ,
00536                                nr1DPoints , nr2DPoints ,linePoints ,
00537                                trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00538           }else{
00539             // Y decreasing
00540               makeInterpolantQuad( p0[0] , p0[1] ,
00541                                p1[0] - p0[0] , 1.0-p0[1] ,
00542                                nr1DPoints , nr2DPoints ,linePoints ,
00543                                quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00544               makeInterpolantQuad( p1[0] , p0[1] ,
00545                                    p0[0] - p1[0] , p1[1] - p0[1] ,
00546                                nr1DPoints , nr2DPoints ,linePoints ,
00547                                trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00548           }
00549         }
00550         else{
00551           // X is decreasing (this should happen rather seldom)
00552           SUNDANCE_MSG3(verb_, " Decrease X ");
00553           if (p0[1] < p1[1]){
00554             // Y increasing
00555               makeInterpolantQuad( p1[0] , 0.0 ,
00556                                p1[0] - p0[0] , p0[1] ,
00557                                nr1DPoints , nr2DPoints ,linePoints ,
00558                                quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00559               makeInterpolantQuad( p1[0] , p0[1] ,
00560                                    p0[0] - p1[0] , p1[1] - p0[1] ,
00561                                nr1DPoints , nr2DPoints ,linePoints ,
00562                                trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00563           }else{
00564             // Y decreasing
00565               makeInterpolantQuad( p1[0] , 0.0 ,
00566                                p0[0] - p1[0] , p1[1] ,
00567                                nr1DPoints , nr2DPoints ,linePoints ,
00568                                quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00569               makeInterpolantQuad( p0[0] , p1[1] ,
00570                                    p1[0] - p0[0] , p0[1] - p1[1] ,
00571                                nr1DPoints , nr2DPoints ,linePoints ,
00572                                trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00573           }
00574         }
00575       }
00576 
00577       //SUNDANCE_MSG3(verb_, " Integrate rest of the quad ");
00578       // quadrate the rest of the quad
00579       makeInterpolantQuad( maxX , orderedPoints[orderedP-1][1] ,
00580                        1.0-maxX , 1.0-orderedPoints[orderedP-1][1] ,
00581                            nr1DPoints , nr2DPoints ,linePoints ,
00582                        quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00583   }
00584   else{
00585     SUNDANCE_MSG3(verb_, " Increase Y , integrate initial quad");
00586     // quadrate in Y direction
00587     // first make a quadrature from 0 to MinY
00588       makeInterpolantQuad( 0.0 , 0.0 ,
00589                        orderedPoints[0][0] , minY,
00590                        nr1DPoints , nr2DPoints ,linePoints ,
00591                        quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00592 
00593       // for each segment make a triangle and quad quadrature
00594       for (int seg = 1 ; seg < orderedP ; seg++){
00595         //SUNDANCE_MSG3(verb_, " Integrate segment : " << seg );
00596         Point p0 = orderedPoints[seg-1];
00597         Point p1 = orderedPoints[seg];
00598         // Y must be always increasing !!!
00599         if (p0[0] < p1[0]){
00600           // X increasing
00601             makeInterpolantQuad( 0.0 , p0[1] ,
00602                              p0[0] , p1[1]-p0[1] ,
00603                              nr1DPoints , nr2DPoints ,linePoints ,
00604                              quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00605             makeInterpolantQuad( p0[0] , p1[1] ,
00606                                  p1[0] - p0[0] , p0[1] - p1[1] ,
00607                              nr1DPoints , nr2DPoints ,linePoints ,
00608                              trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00609         }else{
00610           // X decreasing
00611             makeInterpolantQuad( 0.0 , p0[1] ,
00612                              p1[0] , p1[1]-p0[1] ,
00613                              nr1DPoints , nr2DPoints ,linePoints ,
00614                              quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00615             makeInterpolantQuad( p1[0] , p0[1] ,
00616                                  p0[0] - p1[0] , p1[1] - p0[1] ,
00617                              nr1DPoints , nr2DPoints ,linePoints ,
00618                              trianglePoints , triangleWeights ,leftWeightsQuad , 2.0  );
00619         }
00620       }
00621 
00622       //SUNDANCE_MSG3(verb_, " Integrate rest of the quad ");
00623       // quadrate the rest of the quad
00624       makeInterpolantQuad( 0.0 , maxY ,
00625                        orderedPoints[orderedP-1][0] , 1.0-maxY ,
00626                            nr1DPoints , nr2DPoints ,linePoints ,
00627                        quadQuadPoints , quadQuadWeights ,leftWeightsQuad , 1.0 );
00628   }
00629 
00630 
00631   // here just add up   W(i) = alphaLeft*leftW(i) + alphaRight*(wholeW(i)-leftW(i))
00632   double sumWeights = 0.0;
00633   for (int q = 0 ; q < quadPoints.size() ; q++ ){
00634     quadWeights[q] = alphaLeft * leftWeightsQuad[q] + alphaRight*( wholeWeightsQuad[q]- leftWeightsQuad[q] );
00635     sumWeights = sumWeights + quadWeights[q];
00636   }
00637   SUNDANCE_MSG3(verb_, " ---------- END METHOD -----------  sum weights = " << sumWeights
00638       << "   area:" << sumWeights*(quadOfPoints[3][0]-quadOfPoints[0][0])*(quadOfPoints[3][1]-quadOfPoints[0][1]));
00639 }
00640 
00641 
00642 
00643 void GaussLobattoQuadrature::getAdaptedQuadWeights(int cellLID, const Mesh& mesh,
00644     const ParametrizedCurve& globalCurve, Array<Point>& quadPoints,
00645     Array<double>& quadWeights, bool& weightsChanged) const{
00646 
00647   int maxStack = 1000;
00648   //int maxLevel = 5;
00649   int stackIndex = 0;
00650   Tabs tabs;
00651 
00652   Array< Array<Point> > pointStack(maxStack);     // -> the intersection points of each quad cell in the stack (in ref coords)
00653   Array< Array<Point> > quadPointStack(maxStack); // -> the points which form the quad cell (in ref coords)
00654   Array< Array<int> > intersectionPointStack(maxStack); // -> which edges are intersected for the actual quad cell
00655   Array<int> levelStack(maxStack);                      // -> the refinement level of the actual quad cell
00656   Array<int> refinedStack(maxStack,-1);                 // -> if a quad cell has been replaced then this will be > 0 , -1 otherwise
00657   Array<int> intersectioncaseStack(maxStack,-1);        // -> the intersection case can be from 0,..,6 , if it is something else then refine
00658   Array<double> alpha1(maxStack);                       // -> the integration coefficient for the first part of the integral
00659   Array<double> alpha2(maxStack);                       // -> the integration coefficient for the second part of the integral
00660   // the actual points of the quad cell and the actual intersection points in real coords
00661   Array<Point> quadOfPoints(4);
00662   Array<Point> intesectPoints(8);
00663   int nrIPoints , tmp;
00664 
00665   // first add the initial quad to the quad stack
00666   for (int i = 0 ; i < 4 ; i++){
00667     quadOfPoints[i] = mesh.nodePosition( mesh.facetLID(2,cellLID , 0 , i , nrIPoints ) );
00668   }
00669 
00670   // first divide the parent cells in smaller quads ,
00671   pointStack[0].resize(0);
00672   quadPointStack[0].resize(4);
00673   quadPointStack[0][0] = Point(0.0,0.0); quadPointStack[0][1] = Point(1.0,0.0);
00674   quadPointStack[0][2] = Point(0.0,1.0); quadPointStack[0][3] = Point(1.0,1.0);
00675   intersectionPointStack[0].resize(0);
00676   levelStack[0] = 0;
00677   tmp = 0;
00678   // for each edge test for intersection
00679   for (int i = 0 ; i < 4 ; i++)
00680   {
00681     // for each edge test intersection point
00682     globalCurve.returnIntersectPoints( quadOfPoints[quadsEdgesPoints[i][0]] , quadOfPoints[quadsEdgesPoints[i][1]],
00683          nrIPoints , intesectPoints );
00684     SUNDANCE_MSG3(verb_, " Test edge: "<< quadOfPoints[quadsEdgesPoints[i][0]] << " -- " << quadOfPoints[quadsEdgesPoints[i][1]] );
00685     pointStack[0].resize( tmp + nrIPoints );
00686     intersectionPointStack[0].resize( tmp + nrIPoints );
00687     for (int j = 0 ; j < nrIPoints ; j++){
00688       // transform to reference coordinates back
00689       pointStack[0][tmp+j] = Point( ( intesectPoints[j][0] - quadOfPoints[0][0])/( quadOfPoints[3][0]-quadOfPoints[0][0] ) ,
00690                                 ( intesectPoints[j][1] - quadOfPoints[0][1])/( quadOfPoints[3][1]-quadOfPoints[0][1] )  );
00691       intersectionPointStack[0][tmp+j] = i;
00692       SUNDANCE_MSG3(verb_, " adding Ints Points:"<< tmp+j << " edge:" << intersectionPointStack[0][tmp+j] << " P:"
00693           << pointStack[0][tmp+j] << " Real P:" << intesectPoints[j] );
00694     }
00695     tmp = tmp + nrIPoints;
00696   }
00697 
00698   // select the correct case
00699   intersectioncaseStack[0] = -1;
00700   if (intersectionPointStack[0].size() == 0){
00701     intersectioncaseStack[0] = 6; // no intersection point
00702     alpha1[0] = alpha2[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00703   }
00704   if (intersectionPointStack[0].size() == 2){
00705        if ((intersectionPointStack[0][0] == 0 ) && (intersectionPointStack[0][1] == 1 )) {
00706          intersectioncaseStack[0] = 0;
00707          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00708          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[3]);
00709        }
00710        if ((intersectionPointStack[0][0] == 0 ) && (intersectionPointStack[0][1] == 2 )) {
00711          intersectioncaseStack[0] = 2;
00712          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00713          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[1]);
00714        }
00715        if ((intersectionPointStack[0][0] == 0 ) && (intersectionPointStack[0][1] == 3 )) {
00716          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00717          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[3]);
00718          if (pointStack[0][0][0] > pointStack[0][1][0]) intersectioncaseStack[0] = 41;
00719          else intersectioncaseStack[0] = 42;
00720        }
00721        if ((intersectionPointStack[0][0] == 1 ) && (intersectionPointStack[0][1] == 2 )) {
00722          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00723          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[3]);
00724          if (pointStack[0][0][1] > pointStack[0][1][1]) intersectioncaseStack[0] = 51;
00725          else intersectioncaseStack[0] = 52;
00726        }
00727        if ((intersectionPointStack[0][0] == 1 ) && (intersectionPointStack[0][1] == 3 )) {
00728          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00729          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[2]);
00730          intersectioncaseStack[0] = 1;
00731        }
00732        if ((intersectionPointStack[0][0] == 2 ) && (intersectionPointStack[0][1] == 3 )) {
00733          alpha1[0] = globalCurve.integrationParameter(quadOfPoints[0]);
00734          alpha2[0] = globalCurve.integrationParameter(quadOfPoints[3]);
00735          intersectioncaseStack[0] = 3;
00736        }
00737   }
00738   SUNDANCE_MSG3(verb_, " intersectioncaseStack[0]:"<< intersectioncaseStack[0] << " , alpha1[0]:" << alpha1[0]
00739                          << " , alpha2[0]" << alpha2[0]);
00740   stackIndex = 1;
00741   //quadsEdgesPoints
00742 
00743 
00744   // the criterion for division is if the are after the refinement is different significantly
00745   // then before the division
00746   // put these quads with the intersection points in one list
00747   // todo: here we make no while loop since then also the curve integrals should be adaptive
00748 
00749 
00750   // get all the possible weights and quadrature points
00751   Array<Point> linePoints;
00752   Array<double> lineWeights;
00753   getLineRule( linePoints , lineWeights);
00754   Array<Point> quadQuadPoints;
00755   Array<double> quadQuadWeights;
00756   getQuadRule( quadQuadPoints , quadQuadWeights);
00757   Array<Point> trianglePoints;
00758   Array<double> triangleWeights;
00759   getTriangleQuadPoints( trianglePoints , triangleWeights);
00760   double summWeights = 0.0;
00761 
00762   int nr1DPoints = linePoints.size();
00763   int nr2DPoints = quadQuadPoints.size();
00764 
00765   //those must be equal
00766   TEUCHOS_TEST_FOR_EXCEPTION( quadPoints.size() != quadQuadPoints.size() , std::runtime_error ,
00767       "quadPoints.size() != quadQuadPoints.size() , size1:" << quadPoints.size() << " , size2:" << quadQuadPoints.size());
00768   for (int q = 0; q < nr2DPoints; q++) {
00769     SUNDANCE_MSG3(verb_, " Quad point quadWeights["<<q<<"]="<<quadWeights[q]);
00770     summWeights = summWeights + quadWeights[q];
00771     quadWeights[q] = 0.0;
00772   }
00773   SUNDANCE_MSG3(verb_, " Summ old weights = " << summWeights );
00774 
00775     // for all elements in the list make the quadrature
00776   for (int listI = 0 ; listI < stackIndex ; listI++){
00777     // look at this quad only when it is not refined
00778     if (refinedStack[listI] < 0 ){
00779       SUNDANCE_MSG3(verb_, tabs << "getAdaptedQuadWeights Integrate quad listI:" << listI <<
00780           ",intersectioncaseStack[listI]:" << intersectioncaseStack[listI]);
00781       // ========== calculate first the integral over the whole quad
00782       Array<double> tmpWeightsQuad( quadWeights.size() , 0.0 );
00783       double  ofx , ofy , px , py;
00784       // integrate the whole quad, which result will be later used
00785             ofx = (quadPointStack[listI][1][0] - quadPointStack[listI][0][0]);
00786             ofy = (quadPointStack[listI][2][1] - quadPointStack[listI][0][1]);
00787             px = quadPointStack[listI][0][0]; py = quadPointStack[listI][0][1];
00788             // call the function which makes the quadrature
00789             makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00790                              quadQuadPoints , quadQuadWeights ,tmpWeightsQuad , 1.0 );
00791             SUNDANCE_MSG3(verb_, tabs << " end quadring the whole quad, now quadring the remaining parts " );
00792       switch (intersectioncaseStack[listI]){
00793       // =================================================================================================================
00794       case 0:{
00795         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00796         // integrate the triangle
00797                 ofx = (pointStack[listI][0][0] - quadPointStack[listI][0][0]);
00798                 ofy = (pointStack[listI][1][1] - quadPointStack[listI][0][1]);
00799                 px = quadPointStack[listI][0][0]; py = quadPointStack[listI][0][1];
00800                 // call the function which makes the quadrature
00801               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00802                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00803         // now add up the two diferent arreas
00804         for (int i = 0 ; i < nr2DPoints ; i++){
00805           SUNDANCE_MSG3(verb_, tabs << "i=" << i << ",Wquad[i]:" << tmpWeightsQuad[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00806           quadWeights[i] = alpha1[listI]*tmpWeightsTriangle[i] + alpha2[listI]*( tmpWeightsQuad[i] - tmpWeightsTriangle[i] );
00807         }
00808           break;}
00809       // =================================================================================================================
00810       case 1:{
00811         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00812         // integrate the triangle
00813                 ofx = (pointStack[listI][1][0] - quadPointStack[listI][0][0]);
00814                 ofy = (pointStack[listI][0][1] - quadPointStack[listI][2][1]);
00815                 px = quadPointStack[listI][2][0]; py = quadPointStack[listI][2][1];
00816                 // call the function which makes the quadrature
00817               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00818                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00819         // now add up the two different areas
00820         for (int i = 0 ; i < nr2DPoints ; i++){
00821           SUNDANCE_MSG3(verb_, tabs << "i=" << i << ",Wquad[i]:" << tmpWeightsQuad[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00822           quadWeights[i] = alpha2[listI]*tmpWeightsTriangle[i] + alpha1[listI]*( tmpWeightsQuad[i] - tmpWeightsTriangle[i] );
00823         }
00824           break;}
00825       // =================================================================================================================
00826       case 2:{
00827         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00828         // integrate the triangle
00829                 ofx = (pointStack[listI][0][0] - quadPointStack[listI][1][0]);
00830                 ofy = (pointStack[listI][1][1] - quadPointStack[listI][1][1]);
00831                 px = quadPointStack[listI][1][0]; py = quadPointStack[listI][1][1];
00832                 // call the function which makes the quadrature
00833               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00834                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00835         // now add up the two diferent arreas
00836         for (int i = 0 ; i < nr2DPoints ; i++){
00837           SUNDANCE_MSG3(verb_, tabs << "i=" << i << ",Wquad[i]:" << tmpWeightsQuad[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00838           quadWeights[i] = alpha2[listI]*tmpWeightsTriangle[i] + alpha1[listI]*( tmpWeightsQuad[i] - tmpWeightsTriangle[i] );
00839         }
00840           break;}
00841       // =================================================================================================================
00842       case 3:{
00843         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00844         // integrate the triangle
00845                 ofx = (pointStack[listI][1][0] - quadPointStack[listI][3][0]);
00846                 ofy = (pointStack[listI][0][1] - quadPointStack[listI][3][1]);
00847                 px = quadPointStack[listI][3][0]; py = quadPointStack[listI][3][1];
00848                 // call the function which makes the quadrature
00849               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00850                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00851         // now add up the two diferent arreas
00852         for (int i = 0 ; i < nr2DPoints ; i++){
00853           SUNDANCE_MSG3(verb_, tabs << "i=" << i << ",Wquad[i]:" << tmpWeightsQuad[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00854           quadWeights[i] = alpha2[listI]*tmpWeightsTriangle[i] + alpha1[listI]*( tmpWeightsQuad[i] - tmpWeightsTriangle[i] );
00855         }
00856           break;}
00857       // =================================================================================================================
00858       case 41: case 42:{
00859         // integrate the quad
00860         Array<double> tmpWeightsQuad2( quadWeights.size() , 0.0 );
00861         if (intersectioncaseStack[listI] == 41){
00862           ofx = ( pointStack[listI][1][0] - quadPointStack[listI][0][0]);
00863         } else {
00864           ofx = ( pointStack[listI][0][0] - quadPointStack[listI][0][0]);
00865         }
00866               ofy = (quadPointStack[listI][2][1] - quadPointStack[listI][0][1]);
00867               px = quadPointStack[listI][0][0]; py = quadPointStack[listI][0][1];
00868               // call the function which makes the quadrature
00869               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00870                   quadQuadPoints , quadQuadWeights ,tmpWeightsQuad2 , 1.0 );
00871         // integrate the triangle
00872         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00873         if (intersectioncaseStack[listI] == 41){
00874           ofx = ( pointStack[listI][0][0] - pointStack[listI][1][0]);
00875                   ofy = ( quadPointStack[listI][3][1] - quadPointStack[listI][0][1] );
00876           px = pointStack[listI][1][0]; py = pointStack[listI][0][1];
00877         } else {
00878           ofx = ( pointStack[listI][1][0] - pointStack[listI][0][0]);
00879           ofy = -( quadPointStack[listI][3][1] - quadPointStack[listI][0][1] );
00880           px = pointStack[listI][0][0]; py = pointStack[listI][1][1];
00881         }
00882         // call the function which makes the quadrature
00883               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00884                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00885         // now add up the two different areas
00886         for (int i = 0 ; i < nr2DPoints ; i++){
00887           SUNDANCE_MSG3(verb_, tabs << "i=" << i << " , Wquad[i]:" << tmpWeightsQuad[i] <<
00888               " , Wquad2[i]:" << tmpWeightsQuad2[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00889           quadWeights[i] = alpha1[listI]*( tmpWeightsQuad2[i] + tmpWeightsTriangle[i] ) +
00890                        alpha2[listI]*( tmpWeightsQuad[i] - tmpWeightsQuad2[i] - tmpWeightsTriangle[i]);
00891         }
00892           break;}
00893       // =================================================================================================================
00894       case 51: case 52:{
00895         // integrate the quad
00896         Array<double> tmpWeightsQuad2( quadWeights.size() , 0.0 );
00897         if (intersectioncaseStack[listI] == 52){
00898           ofy = ( pointStack[listI][0][1] - quadPointStack[listI][0][1]);
00899         } else {
00900           ofy = ( pointStack[listI][1][1] - quadPointStack[listI][0][1]);
00901         }
00902               ofx = (quadPointStack[listI][1][0] - quadPointStack[listI][0][0]);
00903               px = quadPointStack[listI][0][0]; py = quadPointStack[listI][0][1];
00904               // call the function which makes the quadrature
00905               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00906                   quadQuadPoints , quadQuadWeights ,tmpWeightsQuad2 , 1.0 );
00907         // integrate the triangle
00908         Array<double> tmpWeightsTriangle( quadWeights.size() , 0.0 );
00909         if (intersectioncaseStack[listI] == 51){
00910                   ofx = ( quadPointStack[listI][3][0] - quadPointStack[listI][0][0] );
00911           ofy = ( pointStack[listI][0][1] - pointStack[listI][1][1]);
00912           px = pointStack[listI][0][0]; py = pointStack[listI][1][1];
00913         } else {
00914           ofx = -( quadPointStack[listI][3][0] - quadPointStack[listI][0][0] );
00915           ofy = ( pointStack[listI][1][1] - pointStack[listI][0][1]);
00916           px = pointStack[listI][1][0]; py = pointStack[listI][0][1];
00917         }
00918         // call the function which makes the quadrature
00919               makeInterpolantQuad( px, py, ofx, ofy, nr1DPoints , nr2DPoints ,linePoints ,
00920                   trianglePoints , triangleWeights ,tmpWeightsTriangle , 2.0 );
00921         // now add up the two different areas
00922         for (int i = 0 ; i < nr2DPoints ; i++){
00923           SUNDANCE_MSG3(verb_, tabs << "i=" << i << " , Wquad[i]:" << tmpWeightsQuad[i] <<
00924               " , Wquad2[i]:" << tmpWeightsQuad2[i] << " , Wtriag[i]:"<< tmpWeightsTriangle[i] );
00925           quadWeights[i] = alpha1[listI]*(tmpWeightsQuad2[i]+tmpWeightsTriangle[i]) +
00926                        alpha2[listI]*(tmpWeightsQuad[i] - tmpWeightsQuad2[i] - tmpWeightsTriangle[i]);
00927         }
00928           break;}
00929       // =================================================================================================================
00930       case 6:{
00931         // no intersection point just integrate the quad elem
00932         for (int i = 0 ; i < nr2DPoints ; i++){
00933            SUNDANCE_MSG3(verb_, tabs << "i=" << i << " , Wquad[i]:" << tmpWeightsQuad[i] );
00934                    quadWeights[i] = quadWeights[i] + alpha1[listI]*tmpWeightsQuad[i];
00935         }
00936           break;}
00937       default:{
00938         // throw error
00939         TEUCHOS_TEST_FOR_EXCEPTION( true , std::runtime_error  , "Quad cell not integrable:" << intersectioncaseStack[listI]);
00940           break; }
00941       }
00942     }
00943   }
00944   // just print the weights
00945   summWeights = 0.0;
00946   for (int q = 0; q < nr2DPoints; q++) {
00947     summWeights = summWeights + quadWeights[q];
00948     SUNDANCE_MSG3(verb_, " New weights quadWeights["<<q<<"]="<<quadWeights[q]);
00949   }
00950   SUNDANCE_MSG3(verb_, " Summ new weights = " << summWeights );
00951 }
00952 
00953 
00954 // =========================================================================================================================
00955 
00956 void GaussLobattoQuadrature::getAdaptedQuadWeights_surf(
00957         int cellLID, const Mesh& mesh,
00958       const ParametrizedCurve& globalCurve, Array<Point>& quadPoints,
00959       Array<double>& quadWeights, bool& weightsChanged) const {
00960 
00961 
00962   int verb = 1;
00963   int nr_point = mesh.numFacets( mesh.spatialDim() , 0 , 0);
00964   Array<Point> maxCellsPoints(nr_point);
00965   int tmp_i , point_LID;
00966   weightsChanged = true;
00967 
00968   // - get all the brick cells point
00969   SUNDANCE_MSG3(verb, "CurveIntegralCalc::getCurveQuadPoints nr points per cell: " << nr_point)
00970   for (int jj = 0 ; jj < nr_point ; jj++){
00971     point_LID = mesh.facetLID( mesh.spatialDim() , cellLID , 0 , jj , tmp_i );
00972     maxCellsPoints[jj] = mesh.nodePosition(point_LID);
00973     SUNDANCE_MSG3(verb, " max cell point p[" << jj << "]:"<< maxCellsPoints[jj]);
00974   }
00975 
00976   // - use the existing method to get the triangles
00977   Array<Point> intersectPoints;
00978   Array<int> edgeIndex;
00979   Array<int> triangleIndex;
00980     // the results in this form will be in physical coordinates
00981   SundanceSurf3DCalc::getCurveQuadPoints( BrickCell , cellLID , mesh , globalCurve, maxCellsPoints,
00982              intersectPoints ,  edgeIndex , triangleIndex );
00983 
00984   // initialize the output variables
00985   getBrickRule(quadPoints,quadWeights);
00986 
00987   // if the cell has no intersection points then just return the standard weights
00988   if (intersectPoints.size() < 1){
00989     double intCoeff = globalCurve.integrationParameter( 0.5*(maxCellsPoints[0]+maxCellsPoints[7]) );
00990     SUNDANCE_MSG1(verb, " WARNING cel has not been intersected , alpha = " << intCoeff );
00991     for (int ii = 0 ; ii < quadWeights.size() ; ii++ ) { quadWeights[ii] = quadWeights[ii] * intCoeff;}
00992     return;
00993   }
00994 
00995   // - determine the projection direction , and the points which overlap with the projected quad cell
00996   int nrIntPoint = intersectPoints.size() , projDir = -1 , tmpI , coveredNodes = 0 , firstCoveredNode = -1;
00997   int possibleProject[3] = { -1 , -1 , -1};
00998   int otherDims[2] = {-1,-1};
00999   int projectedEdgeCovered[4] = { -1 , -1 , -1 , -1 };
01000   double dist_tmp = 1e+100;
01001 
01002   // find out the possible projections (there is only three possible projections)
01003   for (int ii = 0 ; ii < nrIntPoint ; ii++){
01004     // for each edge index we set the projection directory to one
01005     possibleProject[ edge3DProjection[ edgeIndex[ii] ] ] = 1;
01006   }
01007   // here we find the projection directory
01008   for (int ii = 0 ; ii < 3 ; ii++){
01009     if (possibleProject[ii] > 0) {
01010       SUNDANCE_MSG3(verb, " Projected dir = " << ii);
01011       projDir = ii; break;
01012     }
01013   }
01014   // here we store the two other directions which are not projected
01015   tmpI = 0;
01016   for (int ii = 0 ; ii < 3 ; ii++){
01017     if ( ii != projDir ) {
01018       SUNDANCE_MSG3(verb, " otherDims["<< tmpI << "] = " << ii);
01019       otherDims[tmpI] = ii; tmpI++;
01020     }
01021   }
01022 
01023   // - transform all intersection points to reference coordinates
01024   for (int ii = 0 ; ii < nrIntPoint ; ii++){
01025     intersectPoints[ii] = Point( (intersectPoints[ii][0] - maxCellsPoints[0][0])/(maxCellsPoints[7][0] - maxCellsPoints[0][0]) ,
01026          (intersectPoints[ii][1] - maxCellsPoints[0][1])/(maxCellsPoints[7][1] - maxCellsPoints[0][1]) ,
01027          (intersectPoints[ii][2] - maxCellsPoints[0][2])/(maxCellsPoints[7][2] - maxCellsPoints[0][2]));
01028     SUNDANCE_MSG3(verb, "REF intersectPoints[" << ii << "] = "<< intersectPoints[ii]);
01029   }
01030 
01031   // - the quad points on the projected
01032   Array<Point> quadProjectPoints(4);
01033   quadProjectPoints[0] = Point(0.0,0.0); quadProjectPoints[1] = Point(1.0,0.0);
01034   quadProjectPoints[2] = Point(0.0,1.0); quadProjectPoints[3] = Point(1.0,1.0);
01035 
01036   // - determine which out of the 4 nodes has been covered
01037   coveredNodes = 0;
01038   for (int ii = 0 ; ii < nrIntPoint ; ii++) {
01039     Point tmpP( intersectPoints[ii][otherDims[0]] , intersectPoints[ii][otherDims[1]] );
01040     for (int tt = 0 ; tt < 4 ; tt++ ) {
01041       if ( ((tmpP-quadProjectPoints[tt])*(tmpP-quadProjectPoints[tt]) < 1e-12) && (projectedEdgeCovered[tt] < 0) )
01042       {
01043         projectedEdgeCovered[tt] = 1; // this node is covered
01044         //SUNDANCE_MSG3(verb, "COVERED node[" << tt << "] = "<< quadProjectPoints[tt]);
01045         coveredNodes++;
01046         // to store the first node which is covered is important to measure the integration coefficient
01047         if (firstCoveredNode < 0) { firstCoveredNode = tt; }
01048       }
01049     }
01050   }
01051   SUNDANCE_MSG3( verb , "covered nodes = "<< coveredNodes );
01052 
01053   // if not all nodes in the projected quad are covered then we have to add them
01054   // so we loop as long this is done
01055   while (coveredNodes < 4) {
01056       // - look for one edge, which has at least one neighbor which is covered
01057     int foundEdgeIndex[3] = {-1,-1,-1} , foundI = 0 , pF = -1 , pL = -1;
01058     int neighbourNodes[4][2] = { {1,2} , {0,3} , {0,3} , {1,2} };
01059     for (int ii = 0 ; ii < 4 ; ii++){
01060       //SUNDANCE_MSG3( verb , "test node = "<< ii << " , projectedEdgeCovered[ii]=" << projectedEdgeCovered[ii] <<
01061       //    " , N1=" << projectedEdgeCovered[ neighbourNodes[ii][0] ] << " , N2=" << projectedEdgeCovered[ neighbourNodes[ii][1] ]);
01062       // look for uncovered nodes, which have one neighbor which is covered
01063       if ( (projectedEdgeCovered[ii] < 0) &&
01064          ((projectedEdgeCovered[ neighbourNodes[ii][0] ] > 0) || (projectedEdgeCovered[ neighbourNodes[ii][1] ] > 0)) ){
01065         //SUNDANCE_MSG3( verb , "found node = "<< ii );
01066         foundEdgeIndex[foundI] = ii;
01067         projectedEdgeCovered[ii] = 1;
01068         coveredNodes++;
01069         break;
01070       }
01071     }
01072     foundI = 0;
01073     // look for the nearest point, with respect to the found node
01074     dist_tmp = 1e+100;
01075     for (int ii = 0 ; ii < nrIntPoint ; ii++){
01076       Point tmpP( intersectPoints[ii][otherDims[0]] , intersectPoints[ii][otherDims[1]] );
01077       double dist_tmp_tmp = ::sqrt( (tmpP-quadProjectPoints[foundEdgeIndex[foundI]])*(tmpP-quadProjectPoints[foundEdgeIndex[foundI]]) );
01078       //SUNDANCE_MSG3( verb , "test projected Int Point = "<< tmpP << " , dist = " << dist_tmp_tmp);
01079       if ( dist_tmp_tmp < dist_tmp) { pF = ii; dist_tmp = dist_tmp_tmp;}
01080     }
01081     SUNDANCE_MSG3( verb , "pF = "<< pF );
01082 
01083     // loop as long all the neighbors of the neighbors are covered
01084     while ( (projectedEdgeCovered[ neighbourNodes[foundEdgeIndex[foundI]][0] ] < 0) ||
01085           (projectedEdgeCovered[ neighbourNodes[foundEdgeIndex[foundI]][1] ] < 0) ) {
01086       int tmp_next_Neighbor = -1;
01087       // only one can be true
01088       if (projectedEdgeCovered[ neighbourNodes[foundEdgeIndex[foundI]][0] ] < 0) { tmp_next_Neighbor = neighbourNodes[foundEdgeIndex[foundI]][0]; }
01089       if (projectedEdgeCovered[ neighbourNodes[foundEdgeIndex[foundI]][1] ] < 0) { tmp_next_Neighbor = neighbourNodes[foundEdgeIndex[foundI]][1]; }
01090       //SUNDANCE_MSG3( verb , "tmp_next_Neighbor = "<< tmp_next_Neighbor );
01091       foundEdgeIndex[foundI+1] = tmp_next_Neighbor;
01092       projectedEdgeCovered[tmp_next_Neighbor] = 1;
01093       foundI++;
01094       coveredNodes++;
01095     }
01096     // once we finish the loop we look for a next intersection point which is closer to the last node and is different from "pF"
01097     dist_tmp = 1e+100;
01098     for (int ii = 0 ; ii < nrIntPoint ; ii++){
01099       Point tmpP( intersectPoints[ii][otherDims[0]] , intersectPoints[ii][otherDims[1]] );
01100       double dist_tmp_tmp = ::sqrt((tmpP-quadProjectPoints[foundEdgeIndex[foundI]])*(tmpP-quadProjectPoints[foundEdgeIndex[foundI]]));
01101       if ( (dist_tmp_tmp < dist_tmp) && (ii != pF ) ) { pL = ii; dist_tmp = dist_tmp_tmp; }
01102     }
01103     SUNDANCE_MSG3( verb , "pL = "<< pF );
01104 
01105     // - now we have a list of the nodes of the projected quad, which need to be added
01106     for (int nn = 0 ; nn <= foundI ; nn = nn + 1)
01107     {
01108       int firstI_Tri = pF, secondI_Tri = -1 , thirdI_Tri = -1;
01109       intersectPoints.resize( nrIntPoint + 1);
01110       nrIntPoint++;
01111       //  check if one point will not be added twice ... on the other side this is not a problem for the integration
01112       Point ptmp( 0 , 0 , 0 );
01113       ptmp[otherDims[0]] = quadProjectPoints[foundEdgeIndex[nn]][0];
01114       ptmp[otherDims[1]] = quadProjectPoints[foundEdgeIndex[nn]][1];
01115       ptmp[projDir] = intersectPoints[pF][projDir];
01116       //SUNDANCE_MSG3( verb , "Add Point 2D " << quadProjectPoints[foundEdgeIndex[nn]] << " , P:" << ptmp);
01117       intersectPoints[nrIntPoint-1] = ptmp;
01118       secondI_Tri = nrIntPoint -1;
01119       Point nextP( 0 , 0 , 0 );
01120       if (nn < foundI ){
01121         nextP[otherDims[0]] = quadProjectPoints[foundEdgeIndex[nn+1]][0];
01122         nextP[otherDims[1]] = quadProjectPoints[foundEdgeIndex[nn+1]][1];
01123         nextP[projDir] = intersectPoints[pF][projDir];
01124         //SUNDANCE_MSG3( verb , "Add Point 2D " << quadProjectPoints[foundEdgeIndex[nn+1]] );
01125         intersectPoints.resize( nrIntPoint + 1);
01126         nrIntPoint++;
01127         thirdI_Tri = nrIntPoint - 1;
01128         intersectPoints[nrIntPoint-1] = nextP;
01129       } else {
01130         // the last point is "pL"
01131         nextP = intersectPoints[pL];
01132         thirdI_Tri = pL;
01133       }
01134       int triagSize = triangleIndex.size();
01135       triangleIndex.resize(triagSize + 3);
01136       triangleIndex[triagSize] = firstI_Tri;
01137       triangleIndex[triagSize+1] = secondI_Tri;
01138       triangleIndex[triagSize+2] = thirdI_Tri;
01139       SUNDANCE_MSG3( verb , "Add triangle [ "<< firstI_Tri << " , " <<  secondI_Tri << " , " << thirdI_Tri << " ]");
01140       SUNDANCE_MSG3( verb , "Added triangle's points [ "<< intersectPoints[firstI_Tri] << " , "
01141           <<  intersectPoints[secondI_Tri] << " , " << intersectPoints[thirdI_Tri] << " ]");
01142     }
01143 
01144     SUNDANCE_MSG3( verb , "covered nodes = "<< coveredNodes );
01145   } //end from the while which makes sure that each nodes are covered
01146 
01147 
01148   // - first get the quadrature points for the whole quad
01149   Array<Point> wholeQuadPoints;
01150   Array<double> wholeQuadweights;
01151   getBrickRule(wholeQuadPoints,wholeQuadweights);
01152   Array<Point> linePoints;
01153   Array<double> lineWeights;
01154   getLineRule(linePoints,lineWeights);
01155   int nrLinePoints = linePoints.size() , nr3DPoints = wholeQuadPoints.size();
01156   // this will be the output of the quadrature
01157   Array<double> computedWeights(nr3DPoints,0.0);
01158 
01159   // compute the quadrature points and weights for the prism elements
01160   Array<Point> triagPoints;
01161   Array<double> triagWeights;
01162   getTriangleQuadPoints( triagPoints , triagWeights );
01163   int nrQuadTriagPoints = triagPoints.size();
01164   int nrQuadPrism = triagPoints.size() * linePoints.size();
01165   Array<Point> prismPoints(nrQuadPrism);
01166   Array<double> prismWeights(nrQuadPrism);
01167 
01168   // - integrate all the prism elements, if the heights are different then zero
01169   int nr_prism = triangleIndex.size()/3;
01170   for (int p = 0 ; p < nr_prism ; p++ ){
01171     Point p0 = intersectPoints[ triangleIndex[3*p] ];
01172     Point p1 = intersectPoints[ triangleIndex[3*p + 1] ];
01173     Point p2 = intersectPoints[ triangleIndex[3*p + 2] ];
01174     Point p0L = p0;
01175     Point p1L = p1;
01176     Point p2L = p2;
01177     p0L[projDir] = 0.0; p1L[projDir] = 0.0; p2L[projDir] = 0.0;
01178     //SUNDANCE_MSG3( verb , " Triangle [ " << p0 << " , "  << p1 << " , " << p2 << "]");
01179     //SUNDANCE_MSG3( verb , " Triangle bottom [ " << p0L << " , "  << p1L << " , " << p2L << "]");
01180 
01181     // only integrate the prism when there is a measurable height
01182     if ( (::fabs(p0[projDir]-p0L[projDir]) + ::fabs(p1[projDir]-p1L[projDir])+ ::fabs(p2[projDir]-p2L[projDir]) ) > 1e-12 ){
01183       Point normAreaVect = cross(p1L-p0L ,p2L-p0L);
01184       Point triagPointTmp;
01185       double areaTriag = 0.5*::sqrt(normAreaVect*normAreaVect) , Zc = 0.0;
01186       int quadPIndex = 0;
01187       // compute the quadrature points for this prism
01188       for (int triagQIndex = 0 ; triagQIndex < nrQuadTriagPoints ; triagQIndex++)
01189       {
01190         // Zc is the height of the prism at the quadrature position
01191           Zc = (1.0 - triagPoints[triagQIndex][0] - triagPoints[triagQIndex][1]) * ( p0[projDir] - p0L[projDir] );
01192         Zc = Zc + triagPoints[triagQIndex][0]*( p1[projDir] - p1L[projDir] );
01193         Zc = Zc + triagPoints[triagQIndex][1]*( p2[projDir] - p2L[projDir] );
01194         triagPointTmp = p0L + triagPoints[triagQIndex][0]*(p1L-p0L) + triagPoints[triagQIndex][1]*(p2L-p0L);
01195         //SUNDANCE_MSG3( verb , " areaTriag = " << areaTriag << " , Zc = "  << Zc <<
01196         //    " , triagWeights[triagQIndex] = " << triagWeights[triagQIndex] << " , lineWeights[0]" << lineWeights[0]);
01197         for (int lineQIndex = 0 ; lineQIndex < nrLinePoints ; lineQIndex++ , quadPIndex++)
01198         {
01199           // take the tensor product of the triangle and the line quadrature points
01200           // it is important that we compute correctly the weights and the quadrature points positions
01201           prismPoints[quadPIndex] = triagPointTmp;
01202           prismPoints[quadPIndex][projDir] = Zc * linePoints[lineQIndex][0];
01203           prismWeights[quadPIndex] = Zc*areaTriag*triagWeights[triagQIndex]*lineWeights[lineQIndex];
01204         }
01205       }
01206       // call the method to integrate the Lagrange polynoms
01207       makeInterpolantBrick( nrLinePoints , nr3DPoints , linePoints ,
01208           prismPoints , prismWeights , computedWeights , 1.0);
01209     }
01210   }
01211 
01212   // - determine the integration coefficient , use "firstCoveredNode" with "0" and "1" offset
01213   Point tmpPointIntCoeff = intersectPoints[firstCoveredNode];
01214   tmpPointIntCoeff[projDir] = -0.001;
01215   Point tmpPointIntCoeff1 = Point( maxCellsPoints[0][0] + tmpPointIntCoeff[0]*(maxCellsPoints[7][0]-maxCellsPoints[0][0]) ,
01216                                maxCellsPoints[0][1] + tmpPointIntCoeff[1]*(maxCellsPoints[7][1]-maxCellsPoints[0][1]) ,
01217                                maxCellsPoints[0][2] + tmpPointIntCoeff[2]*(maxCellsPoints[7][2]-maxCellsPoints[0][2]) );
01218   double zeroIntCoeff = globalCurve.integrationParameter( tmpPointIntCoeff1 );
01219   tmpPointIntCoeff[projDir] = 1.001;
01220   tmpPointIntCoeff1 = Point( maxCellsPoints[0][0] + tmpPointIntCoeff[0]*(maxCellsPoints[7][0]-maxCellsPoints[0][0]) ,
01221                        maxCellsPoints[0][1] + tmpPointIntCoeff[1]*(maxCellsPoints[7][1]-maxCellsPoints[0][1]) ,
01222                        maxCellsPoints[0][2] + tmpPointIntCoeff[2]*(maxCellsPoints[7][2]-maxCellsPoints[0][2]) );
01223   double oneIntCoeff = globalCurve.integrationParameter( tmpPointIntCoeff1 );
01224 
01225   SUNDANCE_MSG3( verb , " alpha1 = " << zeroIntCoeff << " , alpha2 = "  << oneIntCoeff );
01226 
01227   // at the end just compute the weights, by simply taking the difference of the whole and the computed weights
01228   double sumWeights = 0.0;
01229   for (int q = 0 ; q < computedWeights.size() ; q++ ){
01230     quadWeights[q] = zeroIntCoeff * computedWeights[q] + oneIntCoeff*( wholeQuadweights[q]- computedWeights[q]);
01231     sumWeights = sumWeights + quadWeights[q];
01232   }
01233 
01234   SUNDANCE_MSG3(verb , " ---------- END METHOD -----------  sum weights = " << sumWeights);
01235 
01236 }
01237 
01238 
01239 // ======================================================================================================
01240 
01241 
01242 
01243 
01244 void GaussLobattoQuadrature::getLineRule(
01245     Array<Point>& quadPointsL,
01246     Array<double>& quadWeights) const {
01247 
01248   int n = order()+1; //this is correct m points for a basis of order m-1
01249 
01250   Array<double> quadPoints;
01251   quadPoints.resize(n);
01252   quadPointsL.resize(n);
01253   quadWeights.resize(n);
01254 
01255   // ================== QUAD POINTS ========================
01256   switch (n) {
01257   case 2: { quadPoints[0]=0.0; quadPoints[1] = 1; break; }
01258   case 3: { quadPoints[0]=0.0; quadPoints[1] = 0.5; quadPoints[2] = 1.0; break; }
01259   case 4: { quadPoints[0]=0.0; quadPoints[1] = 0.5-0.5/::sqrt(5.0); quadPoints[2] = 0.5+0.5/::sqrt(5.0); quadPoints[3] = 1.0; break; }
01260   case 5: { quadPoints[0]=0.0; quadPoints[1] = 0.5-0.5*::sqrt(3.0/7.0); quadPoints[2] = 0.5;
01261           quadPoints[3] = 0.5+0.5*::sqrt(3.0/7.0); quadPoints[4] = 1.0; break; }
01262   case 6: { double t0=::sqrt(7.0);
01263           double t1=(7.0+2.0*t0)/21.0;
01264           double t2=(7.0-2.0*t0)/21.0;
01265           quadPoints[0] = 0; quadPoints[1] = 0.5-0.5*::sqrt(t1); quadPoints[2] = 0.5-0.5*::sqrt(t2);
01266           quadPoints[3] = 0.5+0.5*::sqrt(t2); quadPoints[4] = 0.5+0.5*::sqrt(t1); quadPoints[5] = 1.0; break; }
01267   case 7: {
01268     quadPoints[0] = 0.00000000000000000000e+00;
01269     quadPoints[1] = 8.48880518607165179823e-02;
01270     quadPoints[2] = 2.65575603264642912116e-01;
01271     quadPoints[3] = 5.00000000000000000000e-01;
01272     quadPoints[4] = 7.34424396735357087884e-01;
01273     quadPoints[5] = 9.15111948139283537529e-01;
01274     quadPoints[6] = 1.00000000000000000000e+00;
01275       break; }
01276   case 8: {
01277     quadPoints[0] = 0.00000000000000000000e+00;
01278     quadPoints[1] = 6.41299257451967141819e-02;
01279     quadPoints[2] = 2.04149909283428854234e-01;
01280     quadPoints[3] = 3.95350391048760574364e-01;
01281     quadPoints[4] = 6.04649608951239425636e-01;
01282     quadPoints[5] = 7.95850090716571090255e-01;
01283     quadPoints[6] = 9.35870074254803285818e-01;
01284     quadPoints[7] = 1.00000000000000000000e+00;
01285     break; }
01286   case 9: {
01287     quadPoints[0] = 0.00000000000000000000e+00;
01288     quadPoints[1] = 5.01210022942699118254e-02;
01289     quadPoints[2] = 1.61406860244631134016e-01;
01290     quadPoints[3] = 3.18441268086910922452e-01;
01291     quadPoints[4] = 5.00000000000000000000e-01;
01292     quadPoints[5] = 6.81558731913089133059e-01;
01293     quadPoints[6] = 8.38593139755368865984e-01;
01294     quadPoints[7] = 9.49878997705730032663e-01;
01295     quadPoints[8] = 1.00000000000000000000e+00;
01296       break; }
01297   case 10: {
01298     quadPoints[0] = 0.00000000000000000000e+00;
01299     quadPoints[1] = 4.02330459167705711820e-02;
01300     quadPoints[2] = 1.30613067447247432895e-01;
01301     quadPoints[3] = 2.61037525094777733692e-01;
01302     quadPoints[4] = 4.17360521166806497373e-01;
01303     quadPoints[5] = 5.82639478833193447116e-01;
01304     quadPoints[6] = 7.38962474905222266308e-01;
01305     quadPoints[7] = 8.69386932552752567105e-01;
01306     quadPoints[8] = 9.59766954083229428818e-01;
01307     quadPoints[9] = 1.00000000000000000000e+00;
01308     break; }
01309    case 11: {
01310     quadPoints[0] = 0.00000000000000000000e+00;
01311     quadPoints[1] = 3.29992847959704183047e-02;
01312     quadPoints[2] = 1.07758263168427792511e-01;
01313     quadPoints[3] = 2.17382336501897477365e-01;
01314     quadPoints[4] = 3.52120932206530290465e-01;
01315     quadPoints[5] = 5.00000000000000000000e-01;
01316     quadPoints[6] = 6.47879067793469709535e-01;
01317     quadPoints[7] = 7.82617663498102578146e-01;
01318     quadPoints[8] = 8.92241736831572263000e-01;
01319     quadPoints[9] = 9.67000715204029637206e-01;
01320     quadPoints[10] = 1.00000000000000000000e+00;
01321       break; }
01322    case 12: {
01323     quadPoints[0] = 0.00000000000000000000e+00;
01324     quadPoints[1] = 2.75503638885589152707e-02;
01325     quadPoints[2] = 9.03603391779966846897e-02;
01326     quadPoints[3] = 1.83561923484069688950e-01;
01327     quadPoints[4] = 3.00234529517325543502e-01;
01328     quadPoints[5] = 4.31723533572536233294e-01;
01329     quadPoints[6] = 5.68276466427463766706e-01;
01330     quadPoints[7] = 6.99765470482674456498e-01;
01331     quadPoints[8] = 8.16438076515930255539e-01;
01332     quadPoints[9] = 9.09639660822003315310e-01;
01333     quadPoints[10] = 9.72449636111441084729e-01;
01334     quadPoints[11] = 1.00000000000000000000e+00;
01335       break; }
01336   }
01337 
01338   // transform the array of doubles into an array of Points
01339   for (int i = 0 ; i < n ; i++){
01340     quadPointsL[i] = Point(quadPoints[i]);
01341   }
01342 
01343   // ================== WEIGHTS ========================
01344   switch (n) {
01345   case 2:{
01346     quadWeights[0] = 0.5;
01347     quadWeights[1] = 0.5;
01348       break; }
01349   case 3:{
01350     quadWeights[0] = 1.0/6.0; quadWeights[1] = 2.0/3.0; quadWeights[2] = 1.0/6.0;
01351     break;}
01352   case 4:{
01353     quadWeights[0] = 1.0/12.0; quadWeights[1] = 5.0/12.0; quadWeights[2] = 5.0/12.0; quadWeights[3] = 1.0/12.0;
01354     break;}
01355   case 5:{
01356     quadWeights[0] = 0.05; quadWeights[1] = 49.0/180.0; quadWeights[2] = 32.0/90.0; quadWeights[3] = 49.0/180.0; quadWeights[4] = 0.05;
01357     break;}
01358   case 6:{
01359       double t0=::sqrt(7.0);
01360       double t1=(7.0+2.0*t0)/21.0;
01361       double t2=(7.0-2.0*t0)/21.0;
01362       double k1=(1.0-t0)*(1.0-t0);
01363       double k2=(1.0+t0)*(1.0+t0);
01364       quadWeights[0] = 1.0/30.0; quadWeights[1] = 0.3/(t1*k1); quadWeights[2] = 0.3/(t2*k2); quadWeights[3] = 0.3/(t2*k2);
01365       quadWeights[4] = 0.3/(t1*k1); quadWeights[5] = 1.0/30.0;
01366       break;}
01367   case 7:{
01368     quadWeights[0] = 2.38095238095238082021e-02;
01369     quadWeights[1] = 1.38413023680782953928e-01;
01370     quadWeights[2] = 2.15872690604931305458e-01;
01371     quadWeights[3] = 2.43809523809523809312e-01;
01372     quadWeights[4] = 2.15872690604931305458e-01;
01373     quadWeights[5] = 1.38413023680782953928e-01;
01374     quadWeights[6] = 2.38095238095238082021e-02;
01375       break;}
01376   case 8:{
01377     quadWeights[0] = 1.78571428571428561516e-02;
01378     quadWeights[1] = 1.05352113571753072674e-01;
01379     quadWeights[2] = 1.70561346241752204156e-01;
01380     quadWeights[3] = 2.06229397329351860080e-01;
01381     quadWeights[4] = 2.06229397329351860080e-01;
01382     quadWeights[5] = 1.70561346241752204156e-01;
01383     quadWeights[6] = 1.05352113571753072674e-01;
01384     quadWeights[7] = 1.78571428571428561516e-02;
01385       break;}
01386   case 9:{
01387     quadWeights[0] = 1.38888888888888881179e-02;
01388     quadWeights[1] = 8.27476807804027880699e-02;
01389     quadWeights[2] = 1.37269356250080826198e-01;
01390     quadWeights[3] = 1.73214255486523083238e-01;
01391     quadWeights[4] = 1.85759637188208620584e-01;
01392     quadWeights[5] = 1.73214255486523083238e-01;
01393     quadWeights[6] = 1.37269356250080826198e-01;
01394     quadWeights[7] = 8.27476807804027880699e-02;
01395     quadWeights[8] = 1.38888888888888881179e-02;
01396       break;}
01397   case 10:{
01398     quadWeights[0] = 1.11111111111111115352e-02;
01399     quadWeights[1] = 6.66529954255350304271e-02;
01400     quadWeights[2] = 1.12444671031563220298e-01;
01401     quadWeights[3] = 1.46021341839841889421e-01;
01402     quadWeights[4] = 1.63769880591948718829e-01;
01403     quadWeights[5] = 1.63769880591948718829e-01;
01404     quadWeights[6] = 1.46021341839841889421e-01;
01405     quadWeights[7] = 1.12444671031563220298e-01;
01406     quadWeights[8] = 6.66529954255350304271e-02;
01407     quadWeights[9] = 1.11111111111111115352e-02;
01408       break;}
01409   case 11:{
01410     quadWeights[0] = 9.09090909090909046752e-03;
01411     quadWeights[1] = 5.48061366334974126024e-02;
01412     quadWeights[2] = 9.35849408901525958715e-02;
01413     quadWeights[3] = 1.24024052132014145355e-01;
01414     quadWeights[4] = 1.43439562389503921791e-01;
01415     quadWeights[5] = 1.50108797727845355574e-01;
01416     quadWeights[6] = 1.43439562389503921791e-01;
01417     quadWeights[7] = 1.24024052132014145355e-01;
01418     quadWeights[8] = 9.35849408901525958715e-02;
01419     quadWeights[9] = 5.48061366334974126024e-02;
01420     quadWeights[10] = 9.09090909090909046752e-03;
01421       break;}
01422   case 12:{
01423     quadWeights[0] = 7.57575757575757596785e-03;
01424     quadWeights[1] = 4.58422587065981240739e-02;
01425     quadWeights[2] = 7.89873527821850218711e-02;
01426     quadWeights[3] = 1.06254208880510653268e-01;
01427     quadWeights[4] = 1.25637801599600640312e-01;
01428     quadWeights[5] = 1.35702620455348088591e-01;
01429     quadWeights[6] = 1.35702620455348088591e-01;
01430     quadWeights[7] = 1.25637801599600640312e-01;
01431     quadWeights[8] = 1.06254208880510653268e-01;
01432     quadWeights[9] = 7.89873527821850218711e-02;
01433     quadWeights[10] = 4.58422587065981240739e-02;
01434     quadWeights[11] = 7.57575757575757596785e-03;
01435       break;}
01436    }
01437 }
01438 
01439 
01440 void GaussLobattoQuadrature::getTriangleQuadPoints(Array<Point>& pnt  ,Array<double>& weight ) const{
01441   // we took this directly from the Matlab code of Prof.Ulbrich
01442   int deg = nrPointin1D_ + nrPointin1D_ - 2;
01443   if (deg==2){
01444     pnt.resize(3); weight.resize(3);
01445     pnt[0] = Point(0.50000000000000000000 , 0.00000000000000000000);
01446     pnt[1] = Point(0.50000000000000000000 , 0.50000000000000000000);
01447     pnt[2] = Point(0.00000000000000000000 , 0.50000000000000000000);
01448     weight[0] = 0.33333333333333333333;
01449     weight[1] = 0.33333333333333333333;
01450     weight[2] = 0.33333333333333333333;
01451   } else if (deg==3){
01452     pnt.resize(4); weight.resize(4);
01453     pnt[0] = Point(0.33333333333333333333 , 0.33333333333333333333);
01454     pnt[1] = Point(0.60000000000000000000 , 0.20000000000000000000);
01455     pnt[2] = Point(0.20000000000000000000 , 0.60000000000000000000);
01456     pnt[3] = Point(0.20000000000000000000 , 0.20000000000000000000);
01457     weight[0] = -0.56250000000000000000;
01458     weight[1] = 0.52083333333333333333;
01459     weight[2] = 0.52083333333333333333;
01460     weight[3] = 0.52083333333333333333;
01461   } else if (deg==4) {
01462     pnt.resize(6); weight.resize(6);
01463     pnt[0] = Point(0.816847572980459 , 0.091576213509771);
01464     pnt[1] = Point(0.091576213509771 , 0.816847572980459);
01465     pnt[2] = Point(0.091576213509771 , 0.091576213509771);
01466     pnt[3] = Point(0.108103018168070 , 0.445948490915965);
01467     pnt[4] = Point(0.445948490915965 , 0.108103018168070);
01468     pnt[5] = Point(0.445948490915965 , 0.445948490915965);
01469     weight[0] = 0.109951743655322;
01470     weight[1] = 0.109951743655322;
01471     weight[2] = 0.109951743655322;
01472     weight[3] = 0.223381589678011;
01473     weight[4] = 0.223381589678011;
01474     weight[5] = 0.223381589678011;
01475   } else if (deg==5) {
01476     pnt.resize(7); weight.resize(7);
01477     pnt[0] = Point(0.33333333333333333 , 0.33333333333333333);
01478     pnt[1] = Point(0.79742698535308720 , 0.10128650732345633);
01479     pnt[2] = Point(0.10128650732345633 , 0.79742698535308720);
01480     pnt[3] = Point(0.10128650732345633 , 0.10128650732345633);
01481     pnt[4] = Point(0.05971587178976981 , 0.47014206410511505);
01482     pnt[5] = Point(0.47014206410511505 , 0.05971587178976981);
01483     pnt[6] = Point(0.47014206410511505 , 0.47014206410511505);
01484     weight[0] = 0.22500000000000000;
01485     weight[1] = 0.12593918054482717;
01486     weight[2] = 0.12593918054482717;
01487     weight[3] = 0.12593918054482717;
01488     weight[4] = 0.13239415278850616;
01489     weight[5] = 0.13239415278850616;
01490     weight[6] = 0.13239415278850616;
01491   } else if (deg==6) {
01492     pnt.resize(9); weight.resize(9);
01493     pnt[0] = Point(0.124949503233232 , 0.437525248383384);
01494     pnt[1] = Point(0.437525248383384 , 0.124949503233232);
01495     pnt[2] = Point(0.437525248383384 , 0.437525248383384);
01496     pnt[3] = Point(0.797112651860071 , 0.165409927389841);
01497     pnt[4] = Point(0.797112651860071 , 0.037477420750088);
01498     pnt[5] = Point(0.165409927389841 , 0.797112651860071);
01499     pnt[6] = Point(0.165409927389841 , 0.037477420750088);
01500     pnt[7] = Point(0.037477420750088 , 0.797112651860071);
01501     pnt[8] = Point(0.037477420750088 , 0.165409927389841);
01502     weight[0] = 0.205950504760887;
01503     weight[1] = 0.205950504760887;
01504     weight[2] = 0.205950504760887;
01505     weight[3] = 0.063691414286223;
01506     weight[4] = 0.063691414286223;
01507     weight[5] = 0.063691414286223;
01508     weight[6] = 0.063691414286223;
01509     weight[7] = 0.063691414286223;
01510     weight[8] = 0.063691414286223;
01511   } else if (deg==7) {
01512     pnt.resize(13); weight.resize(13);
01513     pnt[0] = Point(0.333333333333333 , 0.333333333333333);
01514     pnt[1] = Point(0.479308067841923 , 0.260345966079038);
01515     pnt[2] = Point(0.260345966079038 , 0.479308067841923);
01516     pnt[3] = Point(0.260345966079038 , 0.260345966079038);
01517     pnt[4] = Point(0.869739794195568 , 0.065130102902216);
01518     pnt[5] = Point(0.065130102902216 , 0.869739794195568);
01519     pnt[6] = Point(0.065130102902216  ,0.065130102902216);
01520     pnt[7] = Point(0.638444188569809 , 0.312865496004875);
01521     pnt[8] = Point(0.638444188569809 , 0.048690315425316);
01522     pnt[9] = Point(0.312865496004875 , 0.638444188569809);
01523     pnt[10] = Point(0.312865496004875 , 0.048690315425316);
01524     pnt[11] = Point(0.048690315425316 , 0.638444188569809);
01525     pnt[12] = Point(0.048690315425316 , 0.312865496004875);
01526     weight[0] = -0.149570044467670;
01527     weight[1] = 0.175615257433204;
01528     weight[2] = 0.175615257433204;
01529     weight[3] = 0.175615257433204;
01530     weight[4] = 0.053347235608839;
01531     weight[5] = 0.053347235608839;
01532     weight[6] = 0.053347235608839;
01533     weight[7] = 0.077113760890257;
01534     weight[8] = 0.077113760890257;
01535     weight[9] = 0.077113760890257;
01536     weight[10] = 0.077113760890257;
01537     weight[11] = 0.077113760890257;
01538     weight[12] = 0.077113760890257;
01539     } else if (deg==8) {
01540     pnt.resize(19); weight.resize(19);
01541     pnt[0] = Point(0.3333333333333333 , 0.3333333333333333);
01542     pnt[1] = Point(0.7974269853530872 , 0.1012865073234563);
01543     pnt[2] = Point(0.1012865073234563 , 0.7974269853530872);
01544     pnt[3] = Point(0.1012865073234563 , 0.1012865073234563);
01545     pnt[4] = Point(0.0597158717897698 , 0.4701420641051151);
01546     pnt[5] = Point(0.4701420641051151 , 0.0597158717897698);
01547     pnt[6] = Point(0.4701420641051151 , 0.4701420641051151);
01548     pnt[7] = Point(0.5357953464498992 , 0.2321023267750504);
01549     pnt[8] = Point(0.2321023267750504 , 0.5357953464498992);
01550     pnt[9] = Point(0.2321023267750504 , 0.2321023267750504);
01551     pnt[10] = Point(0.9410382782311209 , 0.0294808608844396);
01552     pnt[11] = Point(0.0294808608844396 , 0.9410382782311209);
01553     pnt[12] = Point(0.0294808608844396 , 0.0294808608844396);
01554     pnt[13] = Point(0.7384168123405100 , 0.2321023267750504);
01555     pnt[14] = Point(0.7384168123405100 , 0.0294808608844396);
01556     pnt[15] = Point(0.2321023267750504 , 0.7384168123405100);
01557     pnt[16] = Point(0.2321023267750504 , 0.0294808608844396);
01558     pnt[17] = Point(0.0294808608844396 , 0.7384168123405100);
01559     pnt[18] = Point(0.0294808608844396 , 0.2321023267750504);
01560     weight[0] = 0.0378610912003147;
01561     weight[1] = 0.0376204254131829;
01562     weight[2] = 0.0376204254131829;
01563     weight[3] = 0.0376204254131829;
01564     weight[4] = 0.0783573522441174;
01565     weight[5] = 0.0783573522441174;
01566     weight[6] = 0.0783573522441174;
01567     weight[7] = 0.1162714796569659;
01568     weight[8] = 0.1162714796569659;
01569     weight[9] = 0.1162714796569659;
01570     weight[10] = 0.0134442673751655;
01571     weight[11] = 0.0134442673751655;
01572     weight[12] = 0.0134442673751655;
01573     weight[13] = 0.0375097224552317;
01574     weight[14] = 0.0375097224552317;
01575     weight[15] = 0.0375097224552317;
01576     weight[16] = 0.0375097224552317;
01577     weight[17] = 0.0375097224552317;
01578     weight[18] = 0.0375097224552317;
01579     } else if (deg == 9) {
01580     pnt.resize(19); weight.resize(19);
01581     pnt[0] = Point(0.33333333333333331     ,  0.33333333333333331);
01582     pnt[1] = Point(2.06349616025259287E-002,  0.48968251919873701);
01583     pnt[2] = Point(0.48968251919873701     ,  2.06349616025259287E-002);
01584     pnt[3] = Point(0.48968251919873701      , 0.48968251919873701);
01585     pnt[4] = Point(0.12582081701412900     ,  0.43708959149293553);
01586     pnt[5] = Point(0.43708959149293553     ,  0.12582081701412900);
01587     pnt[6] = Point(0.43708959149293553     ,  0.43708959149293553);
01588     pnt[7] = Point(0.62359292876193562     ,  0.18820353561903219);
01589     pnt[8] = Point(0.18820353561903219     ,  0.62359292876193562);
01590     pnt[9] = Point(0.18820353561903219     ,  0.18820353561903219);
01591     pnt[10] = Point(0.91054097321109406     ,  4.47295133944529688E-002);
01592     pnt[11] = Point(4.47295133944529688E-002,  0.91054097321109406);
01593     pnt[12] = Point(4.47295133944529688E-002,  4.47295133944529688E-002);
01594     pnt[13] = Point(0.74119859878449801     ,  3.68384120547362581E-002);
01595     pnt[14] = Point(0.74119859878449801     ,  0.22196298916076573);
01596     pnt[15] = Point(3.68384120547362581E-002,  0.74119859878449801);
01597     pnt[16] = Point(3.68384120547362581E-002,  0.22196298916076573);
01598     pnt[17] = Point(0.22196298916076573     ,  0.74119859878449801);
01599     pnt[18] = Point(0.22196298916076573     ,  3.68384120547362581E-002 );
01600     weight[0] = 9.71357962827961025E-002;
01601     weight[1] = 3.13347002271398278E-002;
01602     weight[2] = 3.13347002271398278E-002;
01603     weight[3] = 3.13347002271398278E-002;
01604     weight[4] = 7.78275410047754301E-002;
01605     weight[5] = 7.78275410047754301E-002;
01606     weight[6] = 7.78275410047754301E-002;
01607     weight[7] = 7.96477389272090969E-002;
01608     weight[8] = 7.96477389272090969E-002;
01609     weight[9] = 7.96477389272090969E-002;
01610     weight[10] = 2.55776756586981006E-002;
01611     weight[11] = 2.55776756586981006E-002;
01612     weight[12] = 2.55776756586981006E-002;
01613     weight[13] = 4.32835393772893970E-002;
01614     weight[14] = 4.32835393772893970E-002;
01615     weight[15] = 4.32835393772893970E-002;
01616     weight[16] = 4.32835393772893970E-002;
01617     weight[17] = 4.32835393772893970E-002;
01618     weight[18] = 4.32835393772893970E-002;
01619     } else if (deg<=11) {
01620     pnt.resize(28); weight.resize(28);
01621     pnt[0] = Point(0.33333333333333333 , 0.333333333333333333);
01622     pnt[1] = Point(0.9480217181434233  , 0.02598914092828833);
01623     pnt[2] = Point(0.02598914092828833 , 0.9480217181434233);
01624     pnt[3] = Point(0.02598914092828833 , 0.02598914092828833);
01625     pnt[4] = Point(0.8114249947041546  , 0.09428750264792270);
01626     pnt[5] = Point(0.09428750264792270 , 0.8114249947041546);
01627     pnt[6] = Point(0.09428750264792270 , 0.09428750264792270);
01628     pnt[7] = Point(0.01072644996557060 , 0.4946367750172147);
01629     pnt[8] = Point(0.4946367750172147  , 0.01072644996557060);
01630     pnt[9] = Point(0.4946367750172147  , 0.4946367750172147);
01631     pnt[10] = Point(0.5853132347709715  , 0.2073433826145142);
01632     pnt[11] = Point(0.2073433826145142  , 0.5853132347709715);
01633     pnt[12] = Point(0.2073433826145142  , 0.2073433826145142);
01634     pnt[13] = Point(0.1221843885990187  , 0.4389078057004907);
01635     pnt[14] = Point(0.4389078057004907  , 0.1221843885990187);
01636     pnt[15] = Point(0.4389078057004907  , 0.4389078057004907);
01637     pnt[16] = Point(0.6779376548825902  , 0.04484167758913055);
01638     pnt[17] = Point(0.6779376548825902  , 0.27722066752827925);
01639     pnt[18] = Point(0.04484167758913055 , 0.6779376548825902);
01640     pnt[19] = Point(0.04484167758913055 , 0.27722066752827925);
01641     pnt[20] = Point(0.27722066752827925 , 0.6779376548825902);
01642     pnt[21] = Point(0.27722066752827925 , 0.04484167758913055);
01643     pnt[22] = Point(0.8588702812826364  , 0.00000000000000000);
01644     pnt[23] = Point(0.8588702812826364  , 0.1411297187173636);
01645     pnt[24] = Point(0.0000000000000000  , 0.8588702812826364);
01646     pnt[25] = Point(0.0000000000000000  , 0.1411297187173636);
01647     pnt[26] = Point(0.1411297187173636  , 0.8588702812826364);
01648     pnt[27] = Point(0.1411297187173636  , 0.0000000000000000);
01649     weight[0] = 0.08797730116222190;
01650     weight[1] = 0.008744311553736190;
01651     weight[2] = 0.008744311553736190;
01652     weight[3] = 0.008744311553736190;
01653     weight[4] = 0.03808157199393533;
01654     weight[5] = 0.03808157199393533;
01655     weight[6] = 0.03808157199393533;
01656     weight[7] = 0.01885544805613125;
01657     weight[8] = 0.01885544805613125;
01658     weight[9] = 0.01885544805613125;
01659     weight[10] = 0.07215969754474100;
01660     weight[11] = 0.07215969754474100;
01661     weight[12] = 0.07215969754474100;
01662     weight[13] = 0.06932913870553720;
01663     weight[14] = 0.06932913870553720;
01664     weight[15] = 0.06932913870553720;
01665     weight[16] = 0.04105631542928860;
01666     weight[17] = 0.04105631542928860;
01667     weight[18] = 0.04105631542928860;
01668     weight[19] = 0.04105631542928860;
01669     weight[20] = 0.04105631542928860;
01670     weight[21] = 0.04105631542928860;
01671     weight[22] = 0.007362383783300573;
01672     weight[23] = 0.007362383783300573;
01673     weight[24] = 0.007362383783300573;
01674     weight[25] = 0.007362383783300573;
01675     weight[26] = 0.007362383783300573;
01676     weight[27] = 0.007362383783300573;
01677     } else if (deg<=13) {
01678       pnt.resize(37); weight.resize(37);
01679       pnt[0] = Point(0.333333333333333333333333333333,  0.333333333333333333333333333333);
01680       pnt[1] = Point(0.950275662924105565450352089520,  0.024862168537947217274823955239);
01681       pnt[2] = Point(0.024862168537947217274823955239,  0.950275662924105565450352089520);
01682       pnt[3] = Point(0.024862168537947217274823955239,  0.024862168537947217274823955239);
01683       pnt[4] = Point(0.171614914923835347556304795551,  0.414192542538082326221847602214);
01684       pnt[5] = Point(0.414192542538082326221847602214,  0.171614914923835347556304795551);
01685       pnt[6] = Point(0.414192542538082326221847602214,  0.414192542538082326221847602214);
01686       pnt[7] = Point(0.539412243677190440263092985511,  0.230293878161404779868453507244);
01687       pnt[8] = Point(0.230293878161404779868453507244,  0.539412243677190440263092985511);
01688       pnt[9] = Point(0.230293878161404779868453507244,  0.230293878161404779868453507244);
01689       pnt[10] = Point(0.772160036676532561750285570113,  0.113919981661733719124857214943);
01690       pnt[11] = Point(0.113919981661733719124857214943,  0.772160036676532561750285570113);
01691       pnt[12] = Point(0.113919981661733719124857214943,  0.113919981661733719124857214943);
01692       pnt[13] = Point(0.009085399949835353883572964740,  0.495457300025082323058213517632);
01693       pnt[14] = Point(0.495457300025082323058213517632,  0.009085399949835353883572964740);
01694       pnt[15] = Point(0.495457300025082323058213517632,  0.495457300025082323058213517632);
01695       pnt[16] = Point(0.062277290305886993497083640527,  0.468861354847056503251458179727);
01696       pnt[17] = Point(0.468861354847056503251458179727,  0.062277290305886993497083640527);
01697       pnt[18] = Point(0.468861354847056503251458179727,  0.468861354847056503251458179727);
01698       pnt[19] = Point(0.022076289653624405142446876931,  0.851306504174348550389457672223);
01699       pnt[20] = Point(0.022076289653624405142446876931,  0.126617206172027096933163647918);
01700       pnt[21] = Point(0.851306504174348550389457672223,  0.022076289653624405142446876931);
01701       pnt[22] = Point(0.851306504174348550389457672223,  0.126617206172027096933163647918);
01702       pnt[23] = Point(0.126617206172027096933163647918,  0.022076289653624405142446876931);
01703       pnt[24] = Point(0.126617206172027096933163647918,  0.851306504174348550389457672223);
01704       pnt[25] = Point(0.018620522802520968955913511549,  0.689441970728591295496647976487);
01705       pnt[26] = Point(0.018620522802520968955913511549,  0.291937506468887771754472382212);
01706       pnt[27] = Point(0.689441970728591295496647976487,  0.018620522802520968955913511549);
01707       pnt[28] = Point(0.689441970728591295496647976487,  0.291937506468887771754472382212);
01708       pnt[29] = Point(0.291937506468887771754472382212,  0.018620522802520968955913511549);
01709       pnt[30] = Point(0.291937506468887771754472382212,  0.689441970728591295496647976487);
01710       pnt[31] = Point(0.096506481292159228736516560903,  0.635867859433872768286976979827);
01711       pnt[32] = Point(0.096506481292159228736516560903,  0.267625659273967961282458816185);
01712       pnt[33] = Point(0.635867859433872768286976979827,  0.096506481292159228736516560903);
01713       pnt[34] = Point(0.635867859433872768286976979827,  0.267625659273967961282458816185);
01714       pnt[35] = Point(0.267625659273967961282458816185,  0.096506481292159228736516560903);
01715       pnt[36] = Point(0.267625659273967961282458816185,  0.635867859433872768286976979827);
01716 
01717         weight[0] = 0.051739766065744133555179145422;
01718         weight[1] = 0.008007799555564801597804123460;
01719         weight[2] = 0.008007799555564801597804123460;
01720         weight[3] = 0.008007799555564801597804123460;
01721         weight[4] = 0.046868898981821644823226732071;
01722         weight[5] = 0.046868898981821644823226732071;
01723         weight[6] = 0.046868898981821644823226732071;
01724         weight[7] = 0.046590940183976487960361770070;
01725         weight[8] = 0.046590940183976487960361770070;
01726         weight[9] = 0.046590940183976487960361770070;
01727         weight[10] = 0.031016943313796381407646220131;
01728         weight[11] = 0.031016943313796381407646220131;
01729         weight[12] = 0.031016943313796381407646220131;
01730         weight[13] = 0.010791612736631273623178240136;
01731         weight[14] = 0.010791612736631273623178240136;
01732         weight[15] = 0.010791612736631273623178240136;
01733         weight[16] = 0.032195534242431618819414482205;
01734         weight[17] = 0.032195534242431618819414482205;
01735         weight[18] = 0.032195534242431618819414482205;
01736         weight[19] = 0.015445834210701583817692900053;
01737         weight[20] = 0.015445834210701583817692900053;
01738         weight[21] = 0.015445834210701583817692900053;
01739         weight[22] = 0.015445834210701583817692900053;
01740         weight[23] = 0.015445834210701583817692900053;
01741         weight[24] = 0.015445834210701583817692900053;
01742         weight[25] = 0.017822989923178661888748319485;
01743         weight[26] = 0.017822989923178661888748319485;
01744         weight[27] = 0.017822989923178661888748319485;
01745         weight[28] = 0.017822989923178661888748319485;
01746         weight[29] = 0.017822989923178661888748319485;
01747         weight[30] = 0.017822989923178661888748319485;
01748         weight[31] = 0.037038683681384627918546472190;
01749         weight[32] = 0.037038683681384627918546472190;
01750         weight[33] = 0.037038683681384627918546472190;
01751         weight[34] = 0.037038683681384627918546472190;
01752         weight[35] = 0.037038683681384627918546472190;
01753         weight[36] = 0.037038683681384627918546472190;
01754     } else if (deg<=14) {
01755       pnt.resize(46); weight.resize(46);
01756         pnt[0] = Point(0.33333333333333331000 , 0.33333333333333331000);
01757         pnt[1] = Point(0.00997976080645843200 , 0.00997976080645843200);
01758         pnt[2] = Point(0.00997976080645843200 , 0.98004047838708308000);
01759         pnt[3] = Point(0.98004047838708308000 , 0.00997976080645843200);
01760         pnt[4] = Point(0.47997789352118841000 , 0.47997789352118841000);
01761         pnt[5] = Point(0.47997789352118841000 , 0.04004421295762317100);
01762         pnt[6] = Point(0.04004421295762317100 , 0.47997789352118841000);
01763         pnt[7] = Point(0.15381195917696691000 , 0.15381195917696691000);
01764         pnt[8] = Point(0.15381195917696691000 , 0.69237608164606623000);
01765         pnt[9] = Point(0.69237608164606623000 , 0.15381195917696691000);
01766         pnt[10] = Point(0.07402347711698781300 , 0.07402347711698781300);
01767         pnt[11] = Point(0.07402347711698781300 , 0.85195304576602437000);
01768         pnt[12] = Point(0.85195304576602437000 , 0.07402347711698781300);
01769         pnt[13] = Point(0.13035468250332999000 , 0.13035468250332999000);
01770         pnt[14] = Point(0.13035468250332999000 , 0.73929063499334002000);
01771         pnt[15] = Point(0.73929063499334002000 , 0.13035468250332999000);
01772         pnt[16] = Point(0.23061722602665313000 , 0.23061722602665313000);
01773         pnt[17] = Point(0.23061722602665313000 , 0.53876554794669373000);
01774         pnt[18] = Point(0.53876554794669373000 , 0.23061722602665313000);
01775         pnt[19] = Point(0.42233208341914780000 , 0.42233208341914780000);
01776         pnt[20] = Point(0.42233208341914780000 , 0.15533583316170441000);
01777         pnt[21] = Point(0.15533583316170441000 , 0.42233208341914780000);
01778         pnt[22] = Point(0.78623738593466097000 , 0.19061636003190091000);
01779         pnt[23] = Point(0.78623738593466097000 , 0.02314625403343817400);
01780         pnt[24] = Point(0.19061636003190091000 , 0.78623738593466097000);
01781         pnt[25] = Point(0.19061636003190091000 , 0.02314625403343817400);
01782         pnt[26] = Point(0.02314625403343817400 , 0.78623738593466097000);
01783         pnt[27] = Point(0.02314625403343817400 , 0.19061636003190091000);
01784         pnt[28] = Point(0.63055214366060741000 , 0.36232313774354713000);
01785         pnt[29] = Point(0.63055214366060741000 , 0.00712471859584540290);
01786         pnt[30] = Point(0.36232313774354713000 , 0.63055214366060741000);
01787         pnt[31] = Point(0.36232313774354713000 , 0.00712471859584540290);
01788         pnt[32] = Point(0.00712471859584540290 , 0.63055214366060741000);
01789         pnt[33] = Point(0.00712471859584540290 , 0.36232313774354713000);
01790         pnt[34] = Point(0.62657732985630632000 , 0.29077120588366739000);
01791         pnt[35] = Point(0.62657732985630632000 , 0.08265146426002623100);
01792         pnt[36] = Point(0.29077120588366739000 , 0.62657732985630632000);
01793         pnt[37] = Point(0.29077120588366739000 , 0.08265146426002623100);
01794         pnt[38] = Point(0.08265146426002623100 , 0.62657732985630632000);
01795         pnt[39] = Point(0.08265146426002623100 , 0.29077120588366739000);
01796         pnt[40] = Point(0.91420998492962546000 , 0.07116571087775076800);
01797         pnt[41] = Point(0.91420998492962546000 , 0.01462430419262372700);
01798         pnt[42] = Point(0.07116571087775076800 , 0.91420998492962546000);
01799         pnt[43] = Point(0.07116571087775076800 , 0.01462430419262372700);
01800         pnt[44] = Point(0.01462430419262372700 , 0.91420998492962546000);
01801         pnt[45] = Point(0.01462430419262372700 , 0.07116571087775076800);
01802 
01803         weight[0] = 0.05859628522602859700;
01804         weight[1] = 0.00173515122972526760;
01805         weight[2] = 0.00173515122972526760;
01806         weight[3] = 0.00173515122972526760;
01807         weight[4] = 0.02616378255861452300;
01808         weight[5] = 0.02616378255861452300;
01809         weight[6] = 0.02616378255861452300;
01810         weight[7] = 0.00391972924240182890;
01811         weight[8] = 0.00391972924240182890;
01812         weight[9] = 0.00391972924240182890;
01813         weight[10] = 0.01224735975694086700;
01814         weight[11] = 0.01224735975694086700;
01815         weight[12] = 0.01224735975694086700;
01816         weight[13] = 0.02819962850325796000;
01817         weight[14] = 0.02819962850325796000;
01818         weight[15] = 0.02819962850325796000;
01819         weight[16] = 0.05088708718595948800;
01820         weight[17] = 0.05088708718595948800;
01821         weight[18] = 0.05088708718595948800;
01822         weight[19] = 0.05045343990160360000;
01823         weight[20] = 0.05045343990160360000;
01824         weight[21] = 0.05045343990160360000;
01825         weight[22] = 0.01706364421223345200;
01826         weight[23] = 0.01706364421223345200;
01827         weight[24] = 0.01706364421223345200;
01828         weight[25] = 0.01706364421223345200;
01829         weight[26] = 0.01706364421223345200;
01830         weight[27] = 0.01706364421223345200;
01831         weight[28] = 0.00968346642550660040;
01832         weight[29] = 0.00968346642550660040;
01833         weight[30] = 0.00968346642550660040;
01834         weight[31] = 0.00968346642550660040;
01835         weight[32] = 0.00968346642550660040;
01836         weight[33] = 0.00968346642550660040;
01837         weight[34] = 0.03638575592848500300;
01838         weight[35] = 0.03638575592848500300;
01839         weight[36] = 0.03638575592848500300;
01840         weight[37] = 0.03638575592848500300;
01841         weight[38] = 0.03638575592848500300;
01842         weight[39] = 0.03638575592848500300;
01843         weight[40] = 0.00696466337351841270;
01844         weight[41] = 0.00696466337351841270;
01845         weight[42] = 0.00696466337351841270;
01846         weight[43] = 0.00696466337351841270;
01847         weight[44] = 0.00696466337351841270;
01848         weight[45] = 0.00696466337351841270;
01849     } else if (deg<=20) {
01850       pnt.resize(88); weight.resize(88);
01851         pnt[0] = Point(0.33333333333333331000 , 0.33333333333333331000);
01852         pnt[1] = Point(0.21587430593299198000 , 0.21587430593299198000);
01853         pnt[2] = Point(0.21587430593299198000 , 0.56825138813401610000);
01854         pnt[3] = Point(0.56825138813401610000 , 0.21587430593299198000);
01855         pnt[4] = Point(0.07537676652974727200 , 0.07537676652974727200);
01856         pnt[5] = Point(0.07537676652974727200 , 0.84924646694050543000);
01857         pnt[6] = Point(0.84924646694050543000 , 0.07537676652974727200);
01858         pnt[7] = Point(0.01030082813722179300 , 0.01030082813722179300);
01859         pnt[8] = Point(0.01030082813722179300 , 0.97939834372555645000);
01860         pnt[9] = Point(0.97939834372555645000 , 0.01030082813722179300);
01861         pnt[10] = Point(0.49360221129870019000 , 0.49360221129870019000);
01862         pnt[11] = Point(0.49360221129870019000 , 0.01279557740259962300);
01863         pnt[12] = Point(0.01279557740259962300 , 0.49360221129870019000);
01864         pnt[13] = Point(0.46155093810692532000 , 0.46155093810692532000);
01865         pnt[14] = Point(0.46155093810692532000 , 0.07689812378614935300);
01866         pnt[15] = Point(0.07689812378614935300 , 0.46155093810692532000);
01867         pnt[16] = Point(0.32862140642423698000 , 0.42934057025821037000);
01868         pnt[17] = Point(0.32862140642423698000 , 0.24203802331755264000);
01869         pnt[18] = Point(0.42934057025821037000 , 0.32862140642423698000);
01870         pnt[19] = Point(0.42934057025821037000 , 0.24203802331755264000);
01871         pnt[20] = Point(0.24203802331755264000 , 0.32862140642423698000);
01872         pnt[21] = Point(0.24203802331755264000 , 0.42934057025821037000);
01873         pnt[22] = Point(0.26048036178656875000 , 0.10157753428096944000);
01874         pnt[23] = Point(0.26048036178656875000 , 0.63794210393246176000);
01875         pnt[24] = Point(0.10157753428096944000 , 0.26048036178656875000);
01876         pnt[25] = Point(0.10157753428096944000 , 0.63794210393246176000);
01877         pnt[26] = Point(0.63794210393246176000 , 0.26048036178656875000);
01878         pnt[27] = Point(0.63794210393246176000 , 0.10157753428096944000);
01879         pnt[28] = Point(0.13707423584645531000 , 0.71006597300113017000);
01880         pnt[29] = Point(0.13707423584645531000 , 0.15285979115241455000);
01881         pnt[30] = Point(0.71006597300113017000 , 0.13707423584645531000);
01882         pnt[31] = Point(0.71006597300113017000 , 0.15285979115241455000);
01883         pnt[32] = Point(0.15285979115241455000 , 0.13707423584645531000);
01884         pnt[33] = Point(0.15285979115241455000 , 0.71006597300113017000);
01885         pnt[34] = Point(0.14672694587229979000 , 0.49854547767841484000);
01886         pnt[35] = Point(0.14672694587229979000 , 0.35472757644928543000);
01887         pnt[36] = Point(0.49854547767841484000 , 0.14672694587229979000);
01888         pnt[37] = Point(0.49854547767841484000 , 0.35472757644928543000);
01889         pnt[38] = Point(0.35472757644928543000 , 0.14672694587229979000);
01890         pnt[39] = Point(0.35472757644928543000 , 0.49854547767841484000);
01891         pnt[40] = Point(0.02699897774255329000 , 0.04918672267258199900);
01892         pnt[41] = Point(0.02699897774255329000 , 0.92381429958486472000);
01893         pnt[42] = Point(0.04918672267258199900 , 0.02699897774255329000);
01894         pnt[43] = Point(0.04918672267258199900 , 0.92381429958486472000);
01895         pnt[44] = Point(0.92381429958486472000 , 0.02699897774255329000);
01896         pnt[45] = Point(0.92381429958486472000 , 0.04918672267258199900);
01897         pnt[46] = Point(0.06187178593361702900 , 0.77966014654056937000);
01898         pnt[47] = Point(0.06187178593361702900 , 0.15846806752581366000);
01899         pnt[48] = Point(0.77966014654056937000 , 0.06187178593361702900);
01900         pnt[49] = Point(0.77966014654056937000 , 0.15846806752581366000);
01901         pnt[50] = Point(0.15846806752581366000 , 0.06187178593361702900);
01902         pnt[51] = Point(0.15846806752581366000 , 0.77966014654056937000);
01903         pnt[52] = Point(0.04772436742762199700 , 0.37049153914954763000);
01904         pnt[53] = Point(0.04772436742762199700 , 0.58178409342283044000);
01905         pnt[54] = Point(0.37049153914954763000 , 0.04772436742762199700);
01906         pnt[55] = Point(0.37049153914954763000 , 0.58178409342283044000);
01907         pnt[56] = Point(0.58178409342283044000 , 0.04772436742762199700);
01908         pnt[57] = Point(0.58178409342283044000 , 0.37049153914954763000);
01909         pnt[58] = Point(0.12060051518636437000 , 0.86334694875475260000);
01910         pnt[59] = Point(0.12060051518636437000 , 0.01605253605888301600);
01911         pnt[60] = Point(0.86334694875475260000 , 0.12060051518636437000);
01912         pnt[61] = Point(0.86334694875475260000 , 0.01605253605888301600);
01913         pnt[62] = Point(0.01605253605888301600 , 0.12060051518636437000);
01914         pnt[63] = Point(0.01605253605888301600 , 0.86334694875475260000);
01915         pnt[64] = Point(0.00269714779670978760 , 0.05619493818774550000);
01916         pnt[65] = Point(0.00269714779670978760 , 0.94110791401554472000);
01917         pnt[66] = Point(0.05619493818774550000 , 0.00269714779670978760);
01918         pnt[67] = Point(0.05619493818774550000 , 0.94110791401554472000);
01919         pnt[68] = Point(0.94110791401554472000 , 0.00269714779670978760);
01920         pnt[69] = Point(0.94110791401554472000 , 0.05619493818774550000);
01921         pnt[70] = Point(0.00301563327794236250 , 0.20867500674842135000);
01922         pnt[71] = Point(0.00301563327794236250 , 0.78830935997363627000);
01923         pnt[72] = Point(0.20867500674842135000 , 0.00301563327794236250);
01924         pnt[73] = Point(0.20867500674842135000 , 0.78830935997363627000);
01925         pnt[74] = Point(0.78830935997363627000 , 0.00301563327794236250);
01926         pnt[75] = Point(0.78830935997363627000 , 0.20867500674842135000);
01927         pnt[76] = Point(0.02990537578845702000 , 0.72115124091203409000);
01928         pnt[77] = Point(0.02990537578845702000 , 0.24894338329950894000);
01929         pnt[78] = Point(0.72115124091203409000 , 0.02990537578845702000);
01930         pnt[79] = Point(0.72115124091203409000 , 0.24894338329950894000);
01931         pnt[80] = Point(0.24894338329950894000 , 0.02990537578845702000);
01932         pnt[81] = Point(0.24894338329950894000 , 0.72115124091203409000);
01933         pnt[82] = Point(0.00675665422246098880 , 0.64005544194054187000);
01934         pnt[83] = Point(0.00675665422246098880 , 0.35318790383699716000);
01935         pnt[84] = Point(0.64005544194054187000 , 0.00675665422246098880);
01936         pnt[85] = Point(0.64005544194054187000 , 0.35318790383699716000);
01937         pnt[86] = Point(0.35318790383699716000 , 0.00675665422246098880);
01938         pnt[87] = Point(0.35318790383699716000 , 0.64005544194054187000);
01939 
01940         weight[0] = 0.01253760799449665600;
01941         weight[1] = 0.02747186987642421400;
01942         weight[2] = 0.02747186987642421400;
01943         weight[3] = 0.02747186987642421400;
01944         weight[4] = 0.00976527227705142370;
01945         weight[5] = 0.00976527227705142370;
01946         weight[6] = 0.00976527227705142370;
01947         weight[7] = 0.00139841953539182350;
01948         weight[8] = 0.00139841953539182350;
01949         weight[9] = 0.00139841953539182350;
01950         weight[10] = 0.00929210262518518310;
01951         weight[11] = 0.00929210262518518310;
01952         weight[12] = 0.00929210262518518310;
01953         weight[13] = 0.01657787603236692700;
01954         weight[14] = 0.01657787603236692700;
01955         weight[15] = 0.01657787603236692700;
01956         weight[16] = 0.02066776234866507900;
01957         weight[17] = 0.02066776234866507900;
01958         weight[18] = 0.02066776234866507900;
01959         weight[19] = 0.02066776234866507900;
01960         weight[20] = 0.02066776234866507900;
01961         weight[21] = 0.02066776234866507900;
01962         weight[22] = 0.02082223552115450600;
01963         weight[23] = 0.02082223552115450600;
01964         weight[24] = 0.02082223552115450600;
01965         weight[25] = 0.02082223552115450600;
01966         weight[26] = 0.02082223552115450600;
01967         weight[27] = 0.02082223552115450600;
01968         weight[28] = 0.00956863841984906090;
01969         weight[29] = 0.00956863841984906090;
01970         weight[30] = 0.00956863841984906090;
01971         weight[31] = 0.00956863841984906090;
01972         weight[32] = 0.00956863841984906090;
01973         weight[33] = 0.00956863841984906090;
01974         weight[34] = 0.02445277096897246300;
01975         weight[35] = 0.02445277096897246300;
01976         weight[36] = 0.02445277096897246300;
01977         weight[37] = 0.02445277096897246300;
01978         weight[38] = 0.02445277096897246300;
01979         weight[39] = 0.02445277096897246300;
01980         weight[40] = 0.00315573063063053420;
01981         weight[41] = 0.00315573063063053420;
01982         weight[42] = 0.00315573063063053420;
01983         weight[43] = 0.00315573063063053420;
01984         weight[44] = 0.00315573063063053420;
01985         weight[45] = 0.00315573063063053420;
01986         weight[46] = 0.01213679636532129800;
01987         weight[47] = 0.01213679636532129800;
01988         weight[48] = 0.01213679636532129800;
01989         weight[49] = 0.01213679636532129800;
01990         weight[50] = 0.01213679636532129800;
01991         weight[51] = 0.01213679636532129800;
01992         weight[52] = 0.01496648014388644900;
01993         weight[53] = 0.01496648014388644900;
01994         weight[54] = 0.01496648014388644900;
01995         weight[55] = 0.01496648014388644900;
01996         weight[56] = 0.01496648014388644900;
01997         weight[57] = 0.01496648014388644900;
01998         weight[58] = 0.00632759332177773930;
01999         weight[59] = 0.00632759332177773930;
02000         weight[60] = 0.00632759332177773930;
02001         weight[61] = 0.00632759332177773930;
02002         weight[62] = 0.00632759332177773930;
02003         weight[63] = 0.00632759332177773930;
02004         weight[64] = 0.00134256031206369590;
02005         weight[65] = 0.00134256031206369590;
02006         weight[66] = 0.00134256031206369590;
02007         weight[67] = 0.00134256031206369590;
02008         weight[68] = 0.00134256031206369590;
02009         weight[69] = 0.00134256031206369590;
02010         weight[70] = 0.00277607691634755400;
02011         weight[71] = 0.00277607691634755400;
02012         weight[72] = 0.00277607691634755400;
02013         weight[73] = 0.00277607691634755400;
02014         weight[74] = 0.00277607691634755400;
02015         weight[75] = 0.00277607691634755400;
02016         weight[76] = 0.01073984447418494100;
02017         weight[77] = 0.01073984447418494100;
02018         weight[78] = 0.01073984447418494100;
02019         weight[79] = 0.01073984447418494100;
02020         weight[80] = 0.01073984447418494100;
02021         weight[81] = 0.01073984447418494100;
02022         weight[82] = 0.00536780573818745280;
02023         weight[83] = 0.00536780573818745280;
02024         weight[84] = 0.00536780573818745280;
02025         weight[85] = 0.00536780573818745280;
02026         weight[86] = 0.00536780573818745280;
02027         weight[87] = 0.00536780573818745280;
02028     } else if (deg<=25) {
02029       pnt.resize(126); weight.resize(126);
02030         pnt[0] = Point(0.02794648307316999900 , 0.48602675846340998000);
02031         pnt[1] = Point(0.48602675846340998000 , 0.48602675846340998000);
02032         pnt[2] = Point(0.48602675846340998000 , 0.02794648307316999900);
02033         pnt[3] = Point(0.13117860132765000000 , 0.43441069933616999000);
02034         pnt[4] = Point(0.43441069933616999000 , 0.43441069933616999000);
02035         pnt[5] = Point(0.43441069933616999000 , 0.13117860132765000000);
02036         pnt[6] = Point(0.22022172951207000000 , 0.38988913524396002000);
02037         pnt[7] = Point(0.38988913524396002000 , 0.38988913524396002000);
02038         pnt[8] = Point(0.38988913524396002000 , 0.22022172951207000000);
02039         pnt[9] = Point(0.40311353196039001000 , 0.29844323401980000000);
02040         pnt[10] = Point(0.29844323401980000000 , 0.29844323401980000000);
02041         pnt[11] = Point(0.29844323401980000000 , 0.40311353196039001000);
02042         pnt[12] = Point(0.53191165532525997000 , 0.23404417233736999000);
02043         pnt[13] = Point(0.23404417233736999000 , 0.23404417233736999000);
02044         pnt[14] = Point(0.23404417233736999000 , 0.53191165532525997000);
02045         pnt[15] = Point(0.69706333078196003000 , 0.15146833460902001000);
02046         pnt[16] = Point(0.15146833460902001000 , 0.15146833460902001000);
02047         pnt[17] = Point(0.15146833460902001000 , 0.69706333078196003000);
02048         pnt[18] = Point(0.77453221290801000000 , 0.11273389354599000000);
02049         pnt[19] = Point(0.11273389354599000000 , 0.11273389354599000000);
02050         pnt[20] = Point(0.11273389354599000000 , 0.77453221290801000000);
02051         pnt[21] = Point(0.84456861581694997000 , 0.07771569209152999500);
02052         pnt[22] = Point(0.07771569209152999500 , 0.07771569209152999500);
02053         pnt[23] = Point(0.07771569209152999500 , 0.84456861581694997000);
02054         pnt[24] = Point(0.93021381277141002000 , 0.03489309361430000000);
02055         pnt[25] = Point(0.03489309361430000000 , 0.03489309361430000000);
02056         pnt[26] = Point(0.03489309361430000000 , 0.93021381277141002000);
02057         pnt[27] = Point(0.98548363075812995000 , 0.00725818462093000010);
02058         pnt[28] = Point(0.00725818462093000010 , 0.00725818462093000010);
02059         pnt[29] = Point(0.00725818462093000010 , 0.98548363075812995000);
02060         pnt[30] = Point(0.00129235270443999990 , 0.22721445215336000000);
02061         pnt[31] = Point(0.22721445215336000000 , 0.77149319514218995000);
02062         pnt[32] = Point(0.77149319514218995000 , 0.00129235270443999990);
02063         pnt[33] = Point(0.22721445215336000000 , 0.00129235270443999990);
02064         pnt[34] = Point(0.77149319514218995000 , 0.22721445215336000000);
02065         pnt[35] = Point(0.00129235270443999990 , 0.77149319514218995000);
02066         pnt[36] = Point(0.00539970127212000000 , 0.43501055485356999000);
02067         pnt[37] = Point(0.43501055485356999000 , 0.55958974387431004000);
02068         pnt[38] = Point(0.55958974387431004000 , 0.00539970127212000000);
02069         pnt[39] = Point(0.43501055485356999000 , 0.00539970127212000000);
02070         pnt[40] = Point(0.55958974387431004000 , 0.43501055485356999000);
02071         pnt[41] = Point(0.00539970127212000000 , 0.55958974387431004000);
02072         pnt[42] = Point(0.00638400303398000030 , 0.32030959927219999000);
02073         pnt[43] = Point(0.32030959927219999000 , 0.67330639769381995000);
02074         pnt[44] = Point(0.67330639769381995000 , 0.00638400303398000030);
02075         pnt[45] = Point(0.32030959927219999000 , 0.00638400303398000030);
02076         pnt[46] = Point(0.67330639769381995000 , 0.32030959927219999000);
02077         pnt[47] = Point(0.00638400303398000030 , 0.67330639769381995000);
02078         pnt[48] = Point(0.00502821150199000020 , 0.09175032228000999700);
02079         pnt[49] = Point(0.09175032228000999700 , 0.90322146621800004000);
02080         pnt[50] = Point(0.90322146621800004000 , 0.00502821150199000020);
02081         pnt[51] = Point(0.09175032228000999700 , 0.00502821150199000020);
02082         pnt[52] = Point(0.90322146621800004000 , 0.09175032228000999700);
02083         pnt[53] = Point(0.00502821150199000020 , 0.90322146621800004000);
02084         pnt[54] = Point(0.00682675862178000040 , 0.03801083585871999800);
02085         pnt[55] = Point(0.03801083585871999800 , 0.95516240551949005000);
02086         pnt[56] = Point(0.95516240551949005000 , 0.00682675862178000040);
02087         pnt[57] = Point(0.03801083585871999800 , 0.00682675862178000040);
02088         pnt[58] = Point(0.95516240551949005000 , 0.03801083585871999800);
02089         pnt[59] = Point(0.00682675862178000040 , 0.95516240551949005000);
02090         pnt[60] = Point(0.01001619963993000000 , 0.15742521848530999000);
02091         pnt[61] = Point(0.15742521848530999000 , 0.83255858187475995000);
02092         pnt[62] = Point(0.83255858187475995000 , 0.01001619963993000000);
02093         pnt[63] = Point(0.15742521848530999000 , 0.01001619963993000000);
02094         pnt[64] = Point(0.83255858187475995000 , 0.15742521848530999000);
02095         pnt[65] = Point(0.01001619963993000000 , 0.83255858187475995000);
02096         pnt[66] = Point(0.02575781317339000100 , 0.23988965977853000000);
02097         pnt[67] = Point(0.23988965977853000000 , 0.73435252704807996000);
02098         pnt[68] = Point(0.73435252704807996000 , 0.02575781317339000100);
02099         pnt[69] = Point(0.23988965977853000000 , 0.02575781317339000100);
02100         pnt[70] = Point(0.73435252704807996000 , 0.23988965977853000000);
02101         pnt[71] = Point(0.02575781317339000100 , 0.73435252704807996000);
02102         pnt[72] = Point(0.03022789811992000100 , 0.36194311812606000000);
02103         pnt[73] = Point(0.36194311812606000000 , 0.60782898375401995000);
02104         pnt[74] = Point(0.60782898375401995000 , 0.03022789811992000100);
02105         pnt[75] = Point(0.36194311812606000000 , 0.03022789811992000100);
02106         pnt[76] = Point(0.60782898375401995000 , 0.36194311812606000000);
02107         pnt[77] = Point(0.03022789811992000100 , 0.60782898375401995000);
02108         pnt[78] = Point(0.03050499010715999900 , 0.08355196095483000100);
02109         pnt[79] = Point(0.08355196095483000100 , 0.88594304893801001000);
02110         pnt[80] = Point(0.88594304893801001000 , 0.03050499010715999900);
02111         pnt[81] = Point(0.08355196095483000100 , 0.03050499010715999900);
02112         pnt[82] = Point(0.88594304893801001000 , 0.08355196095483000100);
02113         pnt[83] = Point(0.03050499010715999900 , 0.88594304893801001000);
02114         pnt[84] = Point(0.04595654736257000200 , 0.14844322073242000000);
02115         pnt[85] = Point(0.14844322073242000000 , 0.80560023190500996000);
02116         pnt[86] = Point(0.80560023190500996000 , 0.04595654736257000200);
02117         pnt[87] = Point(0.14844322073242000000 , 0.04595654736257000200);
02118         pnt[88] = Point(0.80560023190500996000 , 0.14844322073242000000);
02119         pnt[89] = Point(0.04595654736257000200 , 0.80560023190500996000);
02120         pnt[90] = Point(0.06744280054027999800 , 0.28373970872753002000);
02121         pnt[91] = Point(0.28373970872753002000 , 0.64881749073218997000);
02122         pnt[92] = Point(0.64881749073218997000 , 0.06744280054027999800);
02123         pnt[93] = Point(0.28373970872753002000 , 0.06744280054027999800);
02124         pnt[94] = Point(0.64881749073218997000 , 0.28373970872753002000);
02125         pnt[95] = Point(0.06744280054027999800 , 0.64881749073218997000);
02126         pnt[96] = Point(0.07004509141591000500 , 0.40689937511878999000);
02127         pnt[97] = Point(0.40689937511878999000 , 0.52305553346529998000);
02128         pnt[98] = Point(0.52305553346529998000 , 0.07004509141591000500);
02129         pnt[99] = Point(0.40689937511878999000 , 0.07004509141591000500);
02130         pnt[100] = Point(0.52305553346529998000 , 0.40689937511878999000);
02131         pnt[101] = Point(0.07004509141591000500 , 0.52305553346529998000);
02132         pnt[102] = Point(0.08391152464012000000 , 0.19411398702488999000);
02133         pnt[103] = Point(0.19411398702488999000 , 0.72197448833499001000);
02134         pnt[104] = Point(0.72197448833499001000 , 0.08391152464012000000);
02135         pnt[105] = Point(0.19411398702488999000 , 0.08391152464012000000);
02136         pnt[106] = Point(0.72197448833499001000 , 0.19411398702488999000);
02137         pnt[107] = Point(0.08391152464012000000 , 0.72197448833499001000);
02138         pnt[108] = Point(0.12037553567714999000 , 0.32413434700069998000);
02139         pnt[109] = Point(0.32413434700069998000 , 0.55549011732214004000);
02140         pnt[110] = Point(0.55549011732214004000 , 0.12037553567714999000);
02141         pnt[111] = Point(0.32413434700069998000 , 0.12037553567714999000);
02142         pnt[112] = Point(0.55549011732214004000 , 0.32413434700069998000);
02143         pnt[113] = Point(0.12037553567714999000 , 0.55549011732214004000);
02144         pnt[114] = Point(0.14806689915737001000 , 0.22927748355597999000);
02145         pnt[115] = Point(0.22927748355597999000 , 0.62265561728664998000);
02146         pnt[116] = Point(0.62265561728664998000 , 0.14806689915737001000);
02147         pnt[117] = Point(0.22927748355597999000 , 0.14806689915737001000);
02148         pnt[118] = Point(0.62265561728664998000 , 0.22927748355597999000);
02149         pnt[119] = Point(0.14806689915737001000 , 0.62265561728664998000);
02150         pnt[120] = Point(0.19177186586733000000 , 0.32561812259598000000);
02151         pnt[121] = Point(0.32561812259598000000 , 0.48261001153668998000);
02152         pnt[122] = Point(0.48261001153668998000 , 0.19177186586733000000);
02153         pnt[123] = Point(0.32561812259598000000 , 0.19177186586733000000);
02154         pnt[124] = Point(0.48261001153668998000 , 0.32561812259598000000);
02155         pnt[125] = Point(0.19177186586733000000 , 0.48261001153668998000);
02156         weight[0] = 0.00800558188002041710;
02157         weight[1] = 0.00800558188002041710;
02158         weight[2] = 0.00800558188002041710;
02159         weight[3] = 0.01594707683239050100;
02160         weight[4] = 0.01594707683239050100;
02161         weight[5] = 0.01594707683239050100;
02162         weight[6] = 0.01310914123079553000;
02163         weight[7] = 0.01310914123079553000;
02164         weight[8] = 0.01310914123079553000;
02165         weight[9] = 0.01958300096563562000;
02166         weight[10] = 0.01958300096563562000;
02167         weight[11] = 0.01958300096563562000;
02168         weight[12] = 0.01647088544153727000;
02169         weight[13] = 0.01647088544153727000;
02170         weight[14] = 0.01647088544153727000;
02171         weight[15] = 0.00854727907409210020;
02172         weight[16] = 0.00854727907409210020;
02173         weight[17] = 0.00854727907409210020;
02174         weight[18] = 0.00816188585722649180;
02175         weight[19] = 0.00816188585722649180;
02176         weight[20] = 0.00816188585722649180;
02177         weight[21] = 0.00612114653998377910;
02178         weight[22] = 0.00612114653998377910;
02179         weight[23] = 0.00612114653998377910;
02180         weight[24] = 0.00290849826493666490;
02181         weight[25] = 0.00290849826493666490;
02182         weight[26] = 0.00290849826493666490;
02183         weight[27] = 0.00069227524566199629;
02184         weight[28] = 0.00069227524566199629;
02185         weight[29] = 0.00069227524566199629;
02186         weight[30] = 0.00124828919927739700;
02187         weight[31] = 0.00124828919927739700;
02188         weight[32] = 0.00124828919927739700;
02189         weight[33] = 0.00124828919927739700;
02190         weight[34] = 0.00124828919927739700;
02191         weight[35] = 0.00124828919927739700;
02192         weight[36] = 0.00340475290880302200;
02193         weight[37] = 0.00340475290880302200;
02194         weight[38] = 0.00340475290880302200;
02195         weight[39] = 0.00340475290880302200;
02196         weight[40] = 0.00340475290880302200;
02197         weight[41] = 0.00340475290880302200;
02198         weight[42] = 0.00335965432606405090;
02199         weight[43] = 0.00335965432606405090;
02200         weight[44] = 0.00335965432606405090;
02201         weight[45] = 0.00335965432606405090;
02202         weight[46] = 0.00335965432606405090;
02203         weight[47] = 0.00335965432606405090;
02204         weight[48] = 0.00171615653949675410;
02205         weight[49] = 0.00171615653949675410;
02206         weight[50] = 0.00171615653949675410;
02207         weight[51] = 0.00171615653949675410;
02208         weight[52] = 0.00171615653949675410;
02209         weight[53] = 0.00171615653949675410;
02210         weight[54] = 0.00148085631671560600;
02211         weight[55] = 0.00148085631671560600;
02212         weight[56] = 0.00148085631671560600;
02213         weight[57] = 0.00148085631671560600;
02214         weight[58] = 0.00148085631671560600;
02215         weight[59] = 0.00148085631671560600;
02216         weight[60] = 0.00351131261072868500;
02217         weight[61] = 0.00351131261072868500;
02218         weight[62] = 0.00351131261072868500;
02219         weight[63] = 0.00351131261072868500;
02220         weight[64] = 0.00351131261072868500;
02221         weight[65] = 0.00351131261072868500;
02222         weight[66] = 0.00739355014970648380;
02223         weight[67] = 0.00739355014970648380;
02224         weight[68] = 0.00739355014970648380;
02225         weight[69] = 0.00739355014970648380;
02226         weight[70] = 0.00739355014970648380;
02227         weight[71] = 0.00739355014970648380;
02228         weight[72] = 0.00798308747737655820;
02229         weight[73] = 0.00798308747737655820;
02230         weight[74] = 0.00798308747737655820;
02231         weight[75] = 0.00798308747737655820;
02232         weight[76] = 0.00798308747737655820;
02233         weight[77] = 0.00798308747737655820;
02234         weight[78] = 0.00435596261315804140;
02235         weight[79] = 0.00435596261315804140;
02236         weight[80] = 0.00435596261315804140;
02237         weight[81] = 0.00435596261315804140;
02238         weight[82] = 0.00435596261315804140;
02239         weight[83] = 0.00435596261315804140;
02240         weight[84] = 0.00736505670141783180;
02241         weight[85] = 0.00736505670141783180;
02242         weight[86] = 0.00736505670141783180;
02243         weight[87] = 0.00736505670141783180;
02244         weight[88] = 0.00736505670141783180;
02245         weight[89] = 0.00736505670141783180;
02246         weight[90] = 0.01096357284641955000;
02247         weight[91] = 0.01096357284641955000;
02248         weight[92] = 0.01096357284641955000;
02249         weight[93] = 0.01096357284641955000;
02250         weight[94] = 0.01096357284641955000;
02251         weight[95] = 0.01096357284641955000;
02252         weight[96] = 0.01174996174354112100;
02253         weight[97] = 0.01174996174354112100;
02254         weight[98] = 0.01174996174354112100;
02255         weight[99] = 0.01174996174354112100;
02256         weight[100] = 0.01174996174354112100;
02257         weight[101] = 0.01174996174354112100;
02258         weight[102] = 0.01001560071379857000;
02259         weight[103] = 0.01001560071379857000;
02260         weight[104] = 0.01001560071379857000;
02261         weight[105] = 0.01001560071379857000;
02262         weight[106] = 0.01001560071379857000;
02263         weight[107] = 0.01001560071379857000;
02264         weight[108] = 0.01330964078762868000;
02265         weight[109] = 0.01330964078762868000;
02266         weight[110] = 0.01330964078762868000;
02267         weight[111] = 0.01330964078762868000;
02268         weight[112] = 0.01330964078762868000;
02269         weight[113] = 0.01330964078762868000;
02270         weight[114] = 0.01415444650522614000;
02271         weight[115] = 0.01415444650522614000;
02272         weight[116] = 0.01415444650522614000;
02273         weight[117] = 0.01415444650522614000;
02274         weight[118] = 0.01415444650522614000;
02275         weight[119] = 0.01415444650522614000;
02276         weight[120] = 0.01488137956116801000;
02277         weight[121] = 0.01488137956116801000;
02278         weight[122] = 0.01488137956116801000;
02279         weight[123] = 0.01488137956116801000;
02280         weight[124] = 0.01488137956116801000;
02281         weight[125] = 0.01488137956116801000;
02282     } else if (deg<=30) {
02283       pnt.resize(175); weight.resize(175);
02284         pnt[0] = Point(0.33333333333332998000 , 0.33333333333332998000);
02285         pnt[1] = Point(0.00733011643276999980 , 0.49633494178361998000);
02286         pnt[2] = Point(0.49633494178361998000 , 0.49633494178361998000);
02287         pnt[3] = Point(0.49633494178361998000 , 0.00733011643276999980);
02288         pnt[4] = Point(0.08299567580295999500 , 0.45850216209852002000);
02289         pnt[5] = Point(0.45850216209852002000 , 0.45850216209852002000);
02290         pnt[6] = Point(0.45850216209852002000 , 0.08299567580295999500);
02291         pnt[7] = Point(0.15098095612540999000 , 0.42450952193729002000);
02292         pnt[8] = Point(0.42450952193729002000 , 0.42450952193729002000);
02293         pnt[9] = Point(0.42450952193729002000 , 0.15098095612540999000);
02294         pnt[10] = Point(0.23590585989217000000 , 0.38204707005392002000);
02295         pnt[11] = Point(0.38204707005392002000 , 0.38204707005392002000);
02296         pnt[12] = Point(0.38204707005392002000 , 0.23590585989217000000);
02297         pnt[13] = Point(0.43802430840785000000 , 0.28098784579607999000);
02298         pnt[14] = Point(0.28098784579607999000 , 0.28098784579607999000);
02299         pnt[15] = Point(0.28098784579607999000 , 0.43802430840785000000);
02300         pnt[16] = Point(0.54530204829192996000 , 0.22734897585402999000);
02301         pnt[17] = Point(0.22734897585402999000 , 0.22734897585402999000);
02302         pnt[18] = Point(0.22734897585402999000 , 0.54530204829192996000);
02303         pnt[19] = Point(0.65088177698254002000 , 0.17455911150872999000);
02304         pnt[20] = Point(0.17455911150872999000 , 0.17455911150872999000);
02305         pnt[21] = Point(0.17455911150872999000 , 0.65088177698254002000);
02306         pnt[22] = Point(0.75348314559713003000 , 0.12325842720143999000);
02307         pnt[23] = Point(0.12325842720143999000 , 0.12325842720143999000);
02308         pnt[24] = Point(0.12325842720143999000 , 0.75348314559713003000);
02309         pnt[25] = Point(0.83983154221560996000 , 0.08008422889220000200);
02310         pnt[26] = Point(0.08008422889220000200 , 0.08008422889220000200);
02311         pnt[27] = Point(0.08008422889220000200 , 0.83983154221560996000);
02312         pnt[28] = Point(0.90445106518420004000 , 0.04777446740790000000);
02313         pnt[29] = Point(0.04777446740790000000 , 0.04777446740790000000);
02314         pnt[30] = Point(0.04777446740790000000 , 0.90445106518420004000);
02315         pnt[31] = Point(0.95655897063971995000 , 0.02172051468014000000);
02316         pnt[32] = Point(0.02172051468014000000 , 0.02172051468014000000);
02317         pnt[33] = Point(0.02172051468014000000 , 0.95655897063971995000);
02318         pnt[34] = Point(0.99047064476913005000 , 0.00476467761544000030);
02319         pnt[35] = Point(0.00476467761544000030 , 0.00476467761544000030);
02320         pnt[36] = Point(0.00476467761544000030 , 0.99047064476913005000);
02321         pnt[37] = Point(0.00092537119334999999 , 0.41529527091330998000);
02322         pnt[38] = Point(0.41529527091330998000 , 0.58377935789334001000);
02323         pnt[39] = Point(0.58377935789334001000 , 0.00092537119334999999);
02324         pnt[40] = Point(0.41529527091330998000 , 0.00092537119334999999);
02325         pnt[41] = Point(0.58377935789334001000 , 0.41529527091330998000);
02326         pnt[42] = Point(0.00092537119334999999 , 0.58377935789334001000);
02327         pnt[43] = Point(0.00138592585556000010 , 0.06118990978535000100);
02328         pnt[44] = Point(0.06118990978535000100 , 0.93742416435909004000);
02329         pnt[45] = Point(0.93742416435909004000 , 0.00138592585556000010);
02330         pnt[46] = Point(0.06118990978535000100 , 0.00138592585556000010);
02331         pnt[47] = Point(0.93742416435909004000 , 0.06118990978535000100);
02332         pnt[48] = Point(0.00138592585556000010 , 0.93742416435909004000);
02333         pnt[49] = Point(0.00368241545590999990 , 0.16490869013691001000);
02334         pnt[50] = Point(0.16490869013691001000 , 0.83140889440718002000);
02335         pnt[51] = Point(0.83140889440718002000 , 0.00368241545590999990);
02336         pnt[52] = Point(0.16490869013691001000 , 0.00368241545590999990);
02337         pnt[53] = Point(0.83140889440718002000 , 0.16490869013691001000);
02338         pnt[54] = Point(0.00368241545590999990 , 0.83140889440718002000);
02339         pnt[55] = Point(0.00390322342416000000 , 0.02503506223199999900);
02340         pnt[56] = Point(0.02503506223199999900 , 0.97106171434384003000);
02341         pnt[57] = Point(0.97106171434384003000 , 0.00390322342416000000);
02342         pnt[58] = Point(0.02503506223199999900 , 0.00390322342416000000);
02343         pnt[59] = Point(0.97106171434384003000 , 0.02503506223199999900);
02344         pnt[60] = Point(0.00390322342416000000 , 0.97106171434384003000);
02345         pnt[61] = Point(0.00323324815500999980 , 0.30606446515109997000);
02346         pnt[62] = Point(0.30606446515109997000 , 0.69070228669389000000);
02347         pnt[63] = Point(0.69070228669389000000 , 0.00323324815500999980);
02348         pnt[64] = Point(0.30606446515109997000 , 0.00323324815500999980);
02349         pnt[65] = Point(0.69070228669389000000 , 0.30606446515109997000);
02350         pnt[66] = Point(0.00323324815500999980 , 0.69070228669389000000);
02351         pnt[67] = Point(0.00646743211223999980 , 0.10707328373022000000);
02352         pnt[68] = Point(0.10707328373022000000 , 0.88645928415754005000);
02353         pnt[69] = Point(0.88645928415754005000 , 0.00646743211223999980);
02354         pnt[70] = Point(0.10707328373022000000 , 0.00646743211223999980);
02355         pnt[71] = Point(0.88645928415754005000 , 0.10707328373022000000);
02356         pnt[72] = Point(0.00646743211223999980 , 0.88645928415754005000);
02357         pnt[73] = Point(0.00324747549132999980 , 0.22995754934557999000);
02358         pnt[74] = Point(0.22995754934557999000 , 0.76679497516308004000);
02359         pnt[75] = Point(0.76679497516308004000 , 0.00324747549132999980);
02360         pnt[76] = Point(0.22995754934557999000 , 0.00324747549132999980);
02361         pnt[77] = Point(0.76679497516308004000 , 0.22995754934557999000);
02362         pnt[78] = Point(0.00324747549132999980 , 0.76679497516308004000);
02363         pnt[79] = Point(0.00867509080675000000 , 0.33703663330577999000);
02364         pnt[80] = Point(0.33703663330577999000 , 0.65428827588745997000);
02365         pnt[81] = Point(0.65428827588745997000 , 0.00867509080675000000);
02366         pnt[82] = Point(0.33703663330577999000 , 0.00867509080675000000);
02367         pnt[83] = Point(0.65428827588745997000 , 0.33703663330577999000);
02368         pnt[84] = Point(0.00867509080675000000 , 0.65428827588745997000);
02369         pnt[85] = Point(0.01559702646731000000 , 0.05625657618206000200);
02370         pnt[86] = Point(0.05625657618206000200 , 0.92814639735062998000);
02371         pnt[87] = Point(0.92814639735062998000 , 0.01559702646731000000);
02372         pnt[88] = Point(0.05625657618206000200 , 0.01559702646731000000);
02373         pnt[89] = Point(0.92814639735062998000 , 0.05625657618206000200);
02374         pnt[90] = Point(0.01559702646731000000 , 0.92814639735062998000);
02375         pnt[91] = Point(0.01797672125369000100 , 0.40245137521239999000);
02376         pnt[92] = Point(0.40245137521239999000 , 0.57957190353390997000);
02377         pnt[93] = Point(0.57957190353390997000 , 0.01797672125369000100);
02378         pnt[94] = Point(0.40245137521239999000 , 0.01797672125369000100);
02379         pnt[95] = Point(0.57957190353390997000 , 0.40245137521239999000);
02380         pnt[96] = Point(0.01797672125369000100 , 0.57957190353390997000);
02381         pnt[97] = Point(0.01712424535389000000 , 0.24365470201083000000);
02382         pnt[98] = Point(0.24365470201083000000 , 0.73922105263528004000);
02383         pnt[99] = Point(0.73922105263528004000 , 0.01712424535389000000);
02384         pnt[100] = Point(0.24365470201083000000 , 0.01712424535389000000);
02385         pnt[101] = Point(0.73922105263528004000 , 0.24365470201083000000);
02386         pnt[102] = Point(0.01712424535389000000 , 0.73922105263528004000);
02387         pnt[103] = Point(0.02288340534658000000 , 0.16538958561452999000);
02388         pnt[104] = Point(0.16538958561452999000 , 0.81172700903887995000);
02389         pnt[105] = Point(0.81172700903887995000 , 0.02288340534658000000);
02390         pnt[106] = Point(0.16538958561452999000 , 0.02288340534658000000);
02391         pnt[107] = Point(0.81172700903887995000 , 0.16538958561452999000);
02392         pnt[108] = Point(0.02288340534658000000 , 0.81172700903887995000);
02393         pnt[109] = Point(0.03273759728777000200 , 0.09930187449584999800);
02394         pnt[110] = Point(0.09930187449584999800 , 0.86796052821639003000);
02395         pnt[111] = Point(0.86796052821639003000 , 0.03273759728777000200);
02396         pnt[112] = Point(0.09930187449584999800 , 0.03273759728777000200);
02397         pnt[113] = Point(0.86796052821639003000 , 0.09930187449584999800);
02398         pnt[114] = Point(0.03273759728777000200 , 0.86796052821639003000);
02399         pnt[115] = Point(0.03382101234234000100 , 0.30847833306904998000);
02400         pnt[116] = Point(0.30847833306904998000 , 0.65770065458860005000);
02401         pnt[117] = Point(0.65770065458860005000 , 0.03382101234234000100);
02402         pnt[118] = Point(0.30847833306904998000 , 0.03382101234234000100);
02403         pnt[119] = Point(0.65770065458860005000 , 0.30847833306904998000);
02404         pnt[120] = Point(0.03382101234234000100 , 0.65770065458860005000);
02405         pnt[121] = Point(0.03554761446001999900 , 0.46066831859210999000);
02406         pnt[122] = Point(0.46066831859210999000 , 0.50378406694787004000);
02407         pnt[123] = Point(0.50378406694787004000 , 0.03554761446001999900);
02408         pnt[124] = Point(0.46066831859210999000 , 0.03554761446001999900);
02409         pnt[125] = Point(0.50378406694787004000 , 0.46066831859210999000);
02410         pnt[126] = Point(0.03554761446001999900 , 0.50378406694787004000);
02411         pnt[127] = Point(0.05053979030687000300 , 0.21881529945393000000);
02412         pnt[128] = Point(0.21881529945393000000 , 0.73064491023919997000);
02413         pnt[129] = Point(0.73064491023919997000 , 0.05053979030687000300);
02414         pnt[130] = Point(0.21881529945393000000 , 0.05053979030687000300);
02415         pnt[131] = Point(0.73064491023919997000 , 0.21881529945393000000);
02416         pnt[132] = Point(0.05053979030687000300 , 0.73064491023919997000);
02417         pnt[133] = Point(0.05701471491573000000 , 0.37920955156026998000);
02418         pnt[134] = Point(0.37920955156026998000 , 0.56377573352399002000);
02419         pnt[135] = Point(0.56377573352399002000 , 0.05701471491573000000);
02420         pnt[136] = Point(0.37920955156026998000 , 0.05701471491573000000);
02421         pnt[137] = Point(0.56377573352399002000 , 0.37920955156026998000);
02422         pnt[138] = Point(0.05701471491573000000 , 0.56377573352399002000);
02423         pnt[139] = Point(0.06415280642119999800 , 0.14296081941819000000);
02424         pnt[140] = Point(0.14296081941819000000 , 0.79288637416061003000);
02425         pnt[141] = Point(0.79288637416061003000 , 0.06415280642119999800);
02426         pnt[142] = Point(0.14296081941819000000 , 0.06415280642119999800);
02427         pnt[143] = Point(0.79288637416061003000 , 0.14296081941819000000);
02428         pnt[144] = Point(0.06415280642119999800 , 0.79288637416061003000);
02429         pnt[145] = Point(0.08050114828762999800 , 0.28373128210592002000);
02430         pnt[146] = Point(0.28373128210592002000 , 0.63576756960644998000);
02431         pnt[147] = Point(0.63576756960644998000 , 0.08050114828762999800);
02432         pnt[148] = Point(0.28373128210592002000 , 0.08050114828762999800);
02433         pnt[149] = Point(0.63576756960644998000 , 0.28373128210592002000);
02434         pnt[150] = Point(0.08050114828762999800 , 0.63576756960644998000);
02435         pnt[151] = Point(0.10436706813453001000 , 0.19673744100443999000);
02436         pnt[152] = Point(0.19673744100443999000 , 0.69889549086102998000);
02437         pnt[153] = Point(0.69889549086102998000 , 0.10436706813453001000);
02438         pnt[154] = Point(0.19673744100443999000 , 0.10436706813453001000);
02439         pnt[155] = Point(0.69889549086102998000 , 0.19673744100443999000);
02440         pnt[156] = Point(0.10436706813453001000 , 0.69889549086102998000);
02441         pnt[157] = Point(0.11384489442875000000 , 0.35588914121165999000);
02442         pnt[158] = Point(0.35588914121165999000 , 0.53026596435958995000);
02443         pnt[159] = Point(0.53026596435958995000 , 0.11384489442875000000);
02444         pnt[160] = Point(0.35588914121165999000 , 0.11384489442875000000);
02445         pnt[161] = Point(0.53026596435958995000 , 0.35588914121165999000);
02446         pnt[162] = Point(0.11384489442875000000 , 0.53026596435958995000);
02447         pnt[163] = Point(0.14536348771551999000 , 0.25981868535190999000);
02448         pnt[164] = Point(0.25981868535190999000 , 0.59481782693256002000);
02449         pnt[165] = Point(0.59481782693256002000 , 0.14536348771551999000);
02450         pnt[166] = Point(0.25981868535190999000 , 0.14536348771551999000);
02451         pnt[167] = Point(0.59481782693256002000 , 0.25981868535190999000);
02452         pnt[168] = Point(0.14536348771551999000 , 0.59481782693256002000);
02453         pnt[169] = Point(0.18994565282198000000 , 0.32192318123129998000);
02454         pnt[170] = Point(0.32192318123129998000 , 0.48813116594672001000);
02455         pnt[171] = Point(0.48813116594672001000 , 0.18994565282198000000);
02456         pnt[172] = Point(0.32192318123129998000 , 0.18994565282198000000);
02457         pnt[173] = Point(0.48813116594672001000 , 0.32192318123129998000);
02458         pnt[174] = Point(0.18994565282198000000 , 0.48813116594672001000);
02459 
02460         weight[0] = 0.01557996020289920000;
02461         weight[1] = 0.00317723370053413400;
02462         weight[2] = 0.00317723370053413400;
02463         weight[3] = 0.00317723370053413400;
02464         weight[4] = 0.01048342663573077100;
02465         weight[5] = 0.01048342663573077100;
02466         weight[6] = 0.01048342663573077100;
02467         weight[7] = 0.01320945957774363000;
02468         weight[8] = 0.01320945957774363000;
02469         weight[9] = 0.01320945957774363000;
02470         weight[10] = 0.01497500696627149900;
02471         weight[11] = 0.01497500696627149900;
02472         weight[12] = 0.01497500696627149900;
02473         weight[13] = 0.01498790444338419000;
02474         weight[14] = 0.01498790444338419000;
02475         weight[15] = 0.01498790444338419000;
02476         weight[16] = 0.01333886474102166000;
02477         weight[17] = 0.01333886474102166000;
02478         weight[18] = 0.01333886474102166000;
02479         weight[19] = 0.01088917111390201100;
02480         weight[20] = 0.01088917111390201100;
02481         weight[21] = 0.01088917111390201100;
02482         weight[22] = 0.00818944066089346070;
02483         weight[23] = 0.00818944066089346070;
02484         weight[24] = 0.00818944066089346070;
02485         weight[25] = 0.00557538758860778510;
02486         weight[26] = 0.00557538758860778510;
02487         weight[27] = 0.00557538758860778510;
02488         weight[28] = 0.00319121647341197600;
02489         weight[29] = 0.00319121647341197600;
02490         weight[30] = 0.00319121647341197600;
02491         weight[31] = 0.00129671514432704500;
02492         weight[32] = 0.00129671514432704500;
02493         weight[33] = 0.00129671514432704500;
02494         weight[34] = 0.00029826282613491719;
02495         weight[35] = 0.00029826282613491719;
02496         weight[36] = 0.00029826282613491719;
02497         weight[37] = 0.00099890568507889641;
02498         weight[38] = 0.00099890568507889641;
02499         weight[39] = 0.00099890568507889641;
02500         weight[40] = 0.00099890568507889641;
02501         weight[41] = 0.00099890568507889641;
02502         weight[42] = 0.00099890568507889641;
02503         weight[43] = 0.00046285084917325331;
02504         weight[44] = 0.00046285084917325331;
02505         weight[45] = 0.00046285084917325331;
02506         weight[46] = 0.00046285084917325331;
02507         weight[47] = 0.00046285084917325331;
02508         weight[48] = 0.00046285084917325331;
02509         weight[49] = 0.00123445133638241290;
02510         weight[50] = 0.00123445133638241290;
02511         weight[51] = 0.00123445133638241290;
02512         weight[52] = 0.00123445133638241290;
02513         weight[53] = 0.00123445133638241290;
02514         weight[54] = 0.00123445133638241290;
02515         weight[55] = 0.00057071985224320615;
02516         weight[56] = 0.00057071985224320615;
02517         weight[57] = 0.00057071985224320615;
02518         weight[58] = 0.00057071985224320615;
02519         weight[59] = 0.00057071985224320615;
02520         weight[60] = 0.00057071985224320615;
02521         weight[61] = 0.00112694612587762410;
02522         weight[62] = 0.00112694612587762410;
02523         weight[63] = 0.00112694612587762410;
02524         weight[64] = 0.00112694612587762410;
02525         weight[65] = 0.00112694612587762410;
02526         weight[66] = 0.00112694612587762410;
02527         weight[67] = 0.00174786694940733710;
02528         weight[68] = 0.00174786694940733710;
02529         weight[69] = 0.00174786694940733710;
02530         weight[70] = 0.00174786694940733710;
02531         weight[71] = 0.00174786694940733710;
02532         weight[72] = 0.00174786694940733710;
02533         weight[73] = 0.00118281881503165690;
02534         weight[74] = 0.00118281881503165690;
02535         weight[75] = 0.00118281881503165690;
02536         weight[76] = 0.00118281881503165690;
02537         weight[77] = 0.00118281881503165690;
02538         weight[78] = 0.00118281881503165690;
02539         weight[79] = 0.00199083929467503380;
02540         weight[80] = 0.00199083929467503380;
02541         weight[81] = 0.00199083929467503380;
02542         weight[82] = 0.00199083929467503380;
02543         weight[83] = 0.00199083929467503380;
02544         weight[84] = 0.00199083929467503380;
02545         weight[85] = 0.00190041279503598000;
02546         weight[86] = 0.00190041279503598000;
02547         weight[87] = 0.00190041279503598000;
02548         weight[88] = 0.00190041279503598000;
02549         weight[89] = 0.00190041279503598000;
02550         weight[90] = 0.00190041279503598000;
02551         weight[91] = 0.00449836580881745120;
02552         weight[92] = 0.00449836580881745120;
02553         weight[93] = 0.00449836580881745120;
02554         weight[94] = 0.00449836580881745120;
02555         weight[95] = 0.00449836580881745120;
02556         weight[96] = 0.00449836580881745120;
02557         weight[97] = 0.00347871946027471890;
02558         weight[98] = 0.00347871946027471890;
02559         weight[99] = 0.00347871946027471890;
02560         weight[100] = 0.00347871946027471890;
02561         weight[101] = 0.00347871946027471890;
02562         weight[102] = 0.00347871946027471890;
02563         weight[103] = 0.00410239903672395340;
02564         weight[104] = 0.00410239903672395340;
02565         weight[105] = 0.00410239903672395340;
02566         weight[106] = 0.00410239903672395340;
02567         weight[107] = 0.00410239903672395340;
02568         weight[108] = 0.00410239903672395340;
02569         weight[109] = 0.00402176154974416210;
02570         weight[110] = 0.00402176154974416210;
02571         weight[111] = 0.00402176154974416210;
02572         weight[112] = 0.00402176154974416210;
02573         weight[113] = 0.00402176154974416210;
02574         weight[114] = 0.00402176154974416210;
02575         weight[115] = 0.00603316466079506590;
02576         weight[116] = 0.00603316466079506590;
02577         weight[117] = 0.00603316466079506590;
02578         weight[118] = 0.00603316466079506590;
02579         weight[119] = 0.00603316466079506590;
02580         weight[120] = 0.00603316466079506590;
02581         weight[121] = 0.00394629030212959810;
02582         weight[122] = 0.00394629030212959810;
02583         weight[123] = 0.00394629030212959810;
02584         weight[124] = 0.00394629030212959810;
02585         weight[125] = 0.00394629030212959810;
02586         weight[126] = 0.00394629030212959810;
02587         weight[127] = 0.00664404453768026840;
02588         weight[128] = 0.00664404453768026840;
02589         weight[129] = 0.00664404453768026840;
02590         weight[130] = 0.00664404453768026840;
02591         weight[131] = 0.00664404453768026840;
02592         weight[132] = 0.00664404453768026840;
02593         weight[133] = 0.00825430585607845810;
02594         weight[134] = 0.00825430585607845810;
02595         weight[135] = 0.00825430585607845810;
02596         weight[136] = 0.00825430585607845810;
02597         weight[137] = 0.00825430585607845810;
02598         weight[138] = 0.00825430585607845810;
02599         weight[139] = 0.00649605663340641070;
02600         weight[140] = 0.00649605663340641070;
02601         weight[141] = 0.00649605663340641070;
02602         weight[142] = 0.00649605663340641070;
02603         weight[143] = 0.00649605663340641070;
02604         weight[144] = 0.00649605663340641070;
02605         weight[145] = 0.00925277814414660230;
02606         weight[146] = 0.00925277814414660230;
02607         weight[147] = 0.00925277814414660230;
02608         weight[148] = 0.00925277814414660230;
02609         weight[149] = 0.00925277814414660230;
02610         weight[150] = 0.00925277814414660230;
02611         weight[151] = 0.00916492072629427990;
02612         weight[152] = 0.00916492072629427990;
02613         weight[153] = 0.00916492072629427990;
02614         weight[154] = 0.00916492072629427990;
02615         weight[155] = 0.00916492072629427990;
02616         weight[156] = 0.00916492072629427990;
02617         weight[157] = 0.01156952462809767100;
02618         weight[158] = 0.01156952462809767100;
02619         weight[159] = 0.01156952462809767100;
02620         weight[160] = 0.01156952462809767100;
02621         weight[161] = 0.01156952462809767100;
02622         weight[162] = 0.01156952462809767100;
02623         weight[163] = 0.01176111646760917000;
02624         weight[164] = 0.01176111646760917000;
02625         weight[165] = 0.01176111646760917000;
02626         weight[166] = 0.01176111646760917000;
02627         weight[167] = 0.01176111646760917000;
02628         weight[168] = 0.01176111646760917000;
02629         weight[169] = 0.01382470218216540000;
02630         weight[170] = 0.01382470218216540000;
02631         weight[171] = 0.01382470218216540000;
02632         weight[172] = 0.01382470218216540000;
02633         weight[173] = 0.01382470218216540000;
02634         weight[174] = 0.01382470218216540000;
02635     }
02636     else {
02637       // throw error , we do not have have the required order
02638       TEUCHOS_TEST_FOR_EXCEPTION( true , std::runtime_error  , " GaussLobattoQuadrature::getTriangleQuadPoints order of the quadrature to high !!! ");
02639     }
02640 }

Site Contact