GaussianQuadratureRule.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 
00029 #include <cmath>
00030 
00031 #include "GaussianQuadratureRule.hpp"
00032 #include "Exception.hpp"
00033 #include "UblasCustomFunctions.hpp"
00034 
00035 template<unsigned ELEMENT_DIM>
00036 const ChastePoint<ELEMENT_DIM>& GaussianQuadratureRule<ELEMENT_DIM>::rGetQuadPoint(unsigned index) const
00037 {
00038     assert(index < mNumQuadPoints);
00039     return mPoints[index];
00040 }
00041 
00042 template<unsigned ELEMENT_DIM>
00043 double GaussianQuadratureRule<ELEMENT_DIM>::GetWeight(unsigned index) const
00044 {
00045     assert(index < mNumQuadPoints);
00046     return mWeights[index];
00047 }
00048 
00049 template<unsigned ELEMENT_DIM>
00050 unsigned GaussianQuadratureRule<ELEMENT_DIM>::GetNumQuadPoints() const
00051 {
00052     return mNumQuadPoints;
00053 }
00054 
00059 template<>
00060 GaussianQuadratureRule<0>::GaussianQuadratureRule(unsigned numPointsInEachDimension)
00061 {
00062     mNumQuadPoints = 1; // numPointsInEachDimension^0
00063     mWeights.reserve(mNumQuadPoints);
00064     mPoints.reserve(mNumQuadPoints);
00065     mWeights.push_back(1);
00066     mPoints.push_back(ChastePoint<0>());
00067 }
00068 
00073 template<>
00074 GaussianQuadratureRule<1>::GaussianQuadratureRule(unsigned numPointsInEachDimension)
00075 {
00076     mNumQuadPoints = numPointsInEachDimension;
00077 
00078     mWeights.reserve(mNumQuadPoints);
00079     mPoints.reserve(mNumQuadPoints);
00080     switch (numPointsInEachDimension)
00081     {
00082         case 1: // 1d, 1 point
00083             mWeights.push_back(1);
00084             mPoints.push_back(ChastePoint<1>(0.5));
00085             break;
00086         case 2: // 1d, 2 points
00087             mWeights.push_back(0.5);
00088             mWeights.push_back(0.5);
00089 
00090             mPoints.push_back(ChastePoint<1>(0.21132486540519));
00091             mPoints.push_back(ChastePoint<1>(0.78867513459481));
00092             break;
00093         case 3: // 1d, 3 points
00094             mWeights.push_back(5.0/18.0);
00095             mWeights.push_back(4.0/9.0);
00096             mWeights.push_back(5.0/18.0);
00097             mPoints.push_back(ChastePoint<1>(0.1127016654));
00098             mPoints.push_back(ChastePoint<1>(0.5));
00099             mPoints.push_back(ChastePoint<1>(0.8872983346));
00100             break;
00102 //        case 4: // 1d, 4 points
00103 //            mWeights.push_back(  0.17392732255);
00104 //            mWeights.push_back(  0.32607267745);
00105 //            mWeights.push_back(  0.32607267745);
00106 //            mWeights.push_back(  0.17392732255);
00107 //            mPoints.push_back(ChastePoint<1>(   0.0694318417));
00108 //            mPoints.push_back(ChastePoint<1>(   0.3300094782));
00109 //            mPoints.push_back(ChastePoint<1>(   0.6699905218));
00110 //            mPoints.push_back(ChastePoint<1>(   0.9305681583));
00111 //            break;
00112 //        case 5: // 1d, 5 points
00113 //            mWeights.push_back(   0.1184634425);
00114 //            mWeights.push_back(  0.23931433525);
00115 //            mWeights.push_back(  0.28444444445);
00116 //            mWeights.push_back(  0.23931433525);
00117 //            mWeights.push_back(   0.1184634425);
00118 //            mPoints.push_back(ChastePoint<1>(  0.04691007705));
00119 //            mPoints.push_back(ChastePoint<1>(  0.23076534495));
00120 //            mPoints.push_back(ChastePoint<1>(            0.5));
00121 //            mPoints.push_back(ChastePoint<1>(  0.76923465505));
00122 //            mPoints.push_back(ChastePoint<1>(  0.95308992295));
00123 //            break;
00124 //        case 8: // 1d, 8 points
00125 //            mWeights.push_back(  0.05061426815);
00126 //            mWeights.push_back(  0.11119051725);
00127 //            mWeights.push_back(  0.15685332295);
00128 //            mWeights.push_back(   0.1813418917);
00129 //            mWeights.push_back(   0.1813418917);
00130 //            mWeights.push_back(  0.15685332295);
00131 //            mWeights.push_back(  0.11119051725);
00132 //            mWeights.push_back(  0.05061426815);
00133 //            mPoints.push_back(ChastePoint<1>(  0.01985507175));
00134 //            mPoints.push_back(ChastePoint<1>(   0.1016667613));
00135 //            mPoints.push_back(ChastePoint<1>(  0.23723379505));
00136 //            mPoints.push_back(ChastePoint<1>(  0.40828267875));
00137 //            mPoints.push_back(ChastePoint<1>(  0.59171732125));
00138 //            mPoints.push_back(ChastePoint<1>(  0.76276620495));
00139 //            mPoints.push_back(ChastePoint<1>(   0.8983332387));
00140 //            mPoints.push_back(ChastePoint<1>(  0.98014492825));
00141 //            break;
00142          default:
00143             EXCEPTION("Number of gauss points per dimension not supported.");
00144     }
00145 }
00146 
00151 template<>
00152 GaussianQuadratureRule<2>::GaussianQuadratureRule(unsigned numPointsInEachDimension)
00153 {
00154     mNumQuadPoints = numPointsInEachDimension * numPointsInEachDimension;
00155 
00156     mWeights.reserve(mNumQuadPoints);
00157     mPoints.reserve(mNumQuadPoints);
00158 
00159     switch (numPointsInEachDimension)
00160     {
00161         case 1: // 2d, 1 point per dimension
00162             mWeights.push_back(0.5);
00163             mPoints.push_back(ChastePoint<2>(0.25,0.5));
00164             break;
00165 
00166         case 2: // 2d, 2 points per dimension
00167             mWeights.push_back(0.19716878364870);
00168             mWeights.push_back(0.19716878364870);
00169             mWeights.push_back(0.05283121635130);
00170             mWeights.push_back(0.05283121635130);
00171 
00172             mPoints.push_back(ChastePoint<2>(0.16666666666667,0.21132486540519));
00173             mPoints.push_back(ChastePoint<2>(0.62200846792815,0.21132486540519));
00174             mPoints.push_back(ChastePoint<2>(0.04465819873852,0.78867513459481));
00175             mPoints.push_back(ChastePoint<2>(0.16666666666667,0.78867513459481));
00176             break;
00177 
00178         case 3: // 2d, 3 points per dimension
00179             mWeights.push_back(0.06846437766975);
00180             mWeights.push_back(0.10954300427160);
00181             mWeights.push_back(0.06846437766975);
00182             mWeights.push_back(0.06172839506173);
00183             mWeights.push_back(0.09876543209877);
00184             mWeights.push_back(0.06172839506173);
00185             mWeights.push_back(0.00869611615741);
00186             mWeights.push_back(0.01391378585185);
00187             mWeights.push_back(0.00869611615741);
00188 
00189             mPoints.push_back(ChastePoint<2>(0.10000000001607,0.11270166540000));
00190             mPoints.push_back(ChastePoint<2>(0.44364916730000,0.11270166540000));
00191             mPoints.push_back(ChastePoint<2>(0.78729833458393,0.11270166540000));
00192             mPoints.push_back(ChastePoint<2>(0.05635083270000,0.50000000000000));
00193             mPoints.push_back(ChastePoint<2>(0.25000000000000,0.50000000000000));
00194             mPoints.push_back(ChastePoint<2>(0.44364916730000,0.50000000000000));
00195             mPoints.push_back(ChastePoint<2>(0.01270166538393,0.88729833460000));
00196             mPoints.push_back(ChastePoint<2>(0.05635083270000,0.88729833460000));
00197             mPoints.push_back(ChastePoint<2>(0.10000000001607,0.88729833460000));
00198             break;
00200 //        case 4: // 2d, 4 points per dimension
00201 //            mWeights.push_back(0.0281503507763256);
00202 //            mWeights.push_back(0.0527752633353762);
00203 //            mWeights.push_back(0.0527752633353762);
00204 //            mWeights.push_back(0.0281503507763256);
00205 //            mWeights.push_back(0.0379971374528828);
00206 //            mWeights.push_back(0.0712356642018415);
00207 //            mWeights.push_back(0.0712356642018415);
00208 //            mWeights.push_back(0.0379971374528828);
00209 //            mWeights.push_back(0.0187158102927055);
00210 //            mWeights.push_back(0.0350877267775703);
00211 //            mWeights.push_back(0.0350877267775703);
00212 //            mWeights.push_back(0.0187158102927055);
00213 //            mWeights.push_back(0.00210036275308617);
00214 //            mWeights.push_back(0.00393768441021206);
00215 //            mWeights.push_back(0.00393768441021206);
00216 //            mWeights.push_back(0.00210036275308617);
00217 //            mPoints.push_back(ChastePoint<2>(0.0646110610581461,   0.0694318417));
00218 //            mPoints.push_back(ChastePoint<2>(0.307096312350118,    0.0694318417));
00219 //            mPoints.push_back(ChastePoint<2>(0.623471845949882,    0.0694318417));
00220 //            mPoints.push_back(ChastePoint<2>(0.865957097241854,    0.0694318417));
00221 //            mPoints.push_back(ChastePoint<2>(0.046518675850118,    0.3300094782));
00222 //            mPoints.push_back(ChastePoint<2>(0.221103222498164,    0.3300094782));
00223 //            mPoints.push_back(ChastePoint<2>(0.448887299301836,    0.3300094782));
00224 //            mPoints.push_back(ChastePoint<2>(0.623471845949882,    0.3300094782));
00225 //            mPoints.push_back(ChastePoint<2>(0.022913165849882,    0.6699905218));
00226 //            mPoints.push_back(ChastePoint<2>(0.108906255701836,    0.6699905218));
00227 //            mPoints.push_back(ChastePoint<2>(0.221103222498164,    0.6699905218));
00228 //            mPoints.push_back(ChastePoint<2>(0.307096312350118,    0.6699905218));
00229 //            mPoints.push_back(ChastePoint<2>(0.00482078064185386,  0.9305681583));
00230 //            mPoints.push_back(ChastePoint<2>(0.022913165849882,    0.9305681583));
00231 //            mPoints.push_back(ChastePoint<2>(0.046518675850118,    0.9305681583));
00232 //            mPoints.push_back(ChastePoint<2>(0.0646110610581462,   0.9305681583));
00233 //            break;
00234 //        case 5:
00235 //            mWeights.push_back(0.013375270551691);
00236 //            mWeights.push_back(0.0270200993092602);
00237 //            mWeights.push_back(0.0321155735571689);
00238 //            mWeights.push_back(0.0270200993092602);
00239 //            mWeights.push_back(0.013375270551691);
00240 //            mWeights.push_back(0.0218078024655245);
00241 //            mWeights.push_back(0.0440551079739245);
00242 //            mWeights.push_back(0.0523630592364514);
00243 //            mWeights.push_back(0.0440551079739245);
00244 //            mWeights.push_back(0.0218078024655245);
00245 //            mWeights.push_back(0.0168481340447735);
00246 //            mWeights.push_back(0.0340358165695537);
00247 //            mWeights.push_back(0.0404543209892346);
00248 //            mWeights.push_back(0.0340358165695537);
00249 //            mWeights.push_back(0.0168481340447735);
00250 //            mWeights.push_back(0.00654219752778963);
00251 //            mWeights.push_back(0.0132162430822249);
00252 //            mWeights.push_back(0.0157085739026559);
00253 //            mWeights.push_back(0.0132162430822249);
00254 //            mWeights.push_back(0.00654219752778963);
00255 //            mWeights.push_back(0.000658316657259778);
00256 //            mWeights.push_back(0.00132990068405387);
00257 //            mWeights.push_back(0.00158069453237811);
00258 //            mWeights.push_back(0.00132990068405387);
00259 //            mWeights.push_back(0.000658316657259778);
00260 //            mPoints.push_back(ChastePoint<2>(0.0447095217211631,  0.04691007705));
00261 //            mPoints.push_back(ChastePoint<2>( 0.219940124837926,  0.04691007705));
00262 //            mPoints.push_back(ChastePoint<2>(    0.476544961475,  0.04691007705));
00263 //            mPoints.push_back(ChastePoint<2>( 0.733149798112074,  0.04691007705));
00264 //            mPoints.push_back(ChastePoint<2>( 0.908380401228837,  0.04691007705));
00265 //            mPoints.push_back(ChastePoint<2>(0.0360848569379257,  0.23076534495));
00266 //            mPoints.push_back(ChastePoint<2>( 0.177512700520108,  0.23076534495));
00267 //            mPoints.push_back(ChastePoint<2>(    0.384617327525,  0.23076534495));
00268 //            mPoints.push_back(ChastePoint<2>( 0.591721954529893,  0.23076534495));
00269 //            mPoints.push_back(ChastePoint<2>( 0.733149798112074,  0.23076534495));
00270 //            mPoints.push_back(ChastePoint<2>(    0.023455038525,            0.5));
00271 //            mPoints.push_back(ChastePoint<2>(    0.115382672475,            0.5));
00272 //            mPoints.push_back(ChastePoint<2>(              0.25,            0.5));
00273 //            mPoints.push_back(ChastePoint<2>(    0.384617327525,            0.5));
00274 //            mPoints.push_back(ChastePoint<2>(    0.476544961475,            0.5));
00275 //            mPoints.push_back(ChastePoint<2>(0.0108252201120743,  0.76923465505));
00276 //            mPoints.push_back(ChastePoint<2>(0.0532526444298925,  0.76923465505));
00277 //            mPoints.push_back(ChastePoint<2>(    0.115382672475,  0.76923465505));
00278 //            mPoints.push_back(ChastePoint<2>( 0.177512700520108,  0.76923465505));
00279 //            mPoints.push_back(ChastePoint<2>( 0.219940124837926,  0.76923465505));
00280 //            mPoints.push_back(ChastePoint<2>(0.00220055532883694,  0.95308992295));
00281 //            mPoints.push_back(ChastePoint<2>(0.0108252201120743,  0.95308992295));
00282 //            mPoints.push_back(ChastePoint<2>(    0.023455038525,  0.95308992295));
00283 //            mPoints.push_back(ChastePoint<2>(0.0360848569379257,  0.95308992295));
00284 //            mPoints.push_back(ChastePoint<2>(0.0447095217211631,  0.95308992295));
00285 //            break;
00286 //        case 8:
00287 //            mWeights.push_back(0.00251093933534381);
00288 //            mWeights.push_back(0.00551608575378066);
00289 //            mWeights.push_back(0.0077813864127667);
00290 //            mWeights.push_back(0.0089962476127433);
00291 //            mWeights.push_back(0.0089962476127433);
00292 //            mWeights.push_back(0.0077813864127667);
00293 //            mWeights.push_back(0.00551608575378066);
00294 //            mWeights.push_back(0.00251093933534381);
00295 //            mWeights.push_back(0.00505566374657279);
00296 //            mWeights.push_back(0.0111063912918299);
00297 //            mWeights.push_back(0.015667472579425);
00298 //            mWeights.push_back(0.018113541124127);
00299 //            mWeights.push_back(0.018113541124127);
00300 //            mWeights.push_back(0.015667472579425);
00301 //            mWeights.push_back(0.0111063912918299);
00302 //            mWeights.push_back(0.00505566374657279);
00303 //            mWeights.push_back(0.00605561321825424);
00304 //            mWeights.push_back(0.0133031018843967);
00305 //            mWeights.push_back(0.018766310182895);
00306 //            mWeights.push_back(0.0216961816606203);
00307 //            mWeights.push_back(0.0216961816606203);
00308 //            mWeights.push_back(0.018766310182895);
00309 //            mWeights.push_back(0.0133031018843967);
00310 //            mWeights.push_back(0.00605561321825424);
00311 //            mWeights.push_back(0.00543106981966284);
00312 //            mWeights.push_back(0.0119310914598135);
00313 //            mWeights.push_back(0.0168308538189853);
00314 //            mWeights.push_back(0.0194585541004693);
00315 //            mWeights.push_back(0.0194585541004693);
00316 //            mWeights.push_back(0.0168308538189853);
00317 //            mWeights.push_back(0.0119310914598135);
00318 //            mWeights.push_back(0.00543106981966284);
00319 //            mWeights.push_back(0.00374741731366922);
00320 //            mWeights.push_back(0.00823240727740299);
00321 //            mWeights.push_back(0.0116132244841987);
00322 //            mWeights.push_back(0.0134263275848652);
00323 //            mWeights.push_back(0.0134263275848652);
00324 //            mWeights.push_back(0.0116132244841987);
00325 //            mWeights.push_back(0.00823240727740299);
00326 //            mWeights.push_back(0.00374741731366922);
00327 //            mWeights.push_back(0.00188340292975561);
00328 //            mWeights.push_back(0.00413750022679507);
00329 //            mWeights.push_back(0.00583665473756204);
00330 //            mWeights.push_back(0.00674789664256371);
00331 //            mWeights.push_back(0.00674789664256371);
00332 //            mWeights.push_back(0.00583665473756204);
00333 //            mWeights.push_back(0.00413750022679507);
00334 //            mWeights.push_back(0.00188340292975561);
00335 //            mWeights.push_back(0.000572162909255913);
00336 //            mWeights.push_back(0.00125693983449269);
00337 //            mWeights.push_back(0.00177312953176681);
00338 //            mWeights.push_back(0.00204995761308944);
00339 //            mWeights.push_back(0.00204995761308944);
00340 //            mWeights.push_back(0.00177312953176681);
00341 //            mWeights.push_back(0.00125693983449269);
00342 //            mWeights.push_back(0.000572162909255913);
00343 //            mWeights.push_back(5.0864805016297e-05);
00344 //            mWeights.push_back(0.000111740902048041);
00345 //            mWeights.push_back(0.000157629735243144);
00346 //            mWeights.push_back(0.00018223952058876);
00347 //            mWeights.push_back(0.00018223952058876);
00348 //            mWeights.push_back(0.000157629735243144);
00349 //            mWeights.push_back(0.000111740902048041);
00350 //            mWeights.push_back(5.0864805016297e-05);
00351 //            mPoints.push_back(ChastePoint<2>(0.0194608478758024,  0.01985507175));
00352 //            mPoints.push_back(ChastePoint<2>(0.0996481604597984,  0.01985507175));
00353 //            mPoints.push_back(ChastePoint<2>(0.232523501027757,  0.01985507175));
00354 //            mPoints.push_back(ChastePoint<2>(0.400176196869137,  0.01985507175));
00355 //            mPoints.push_back(ChastePoint<2>(0.579968731380863,  0.01985507175));
00356 //            mPoints.push_back(ChastePoint<2>(0.747621427222243,  0.01985507175));
00357 //            mPoints.push_back(ChastePoint<2>(0.880496767790202,  0.01985507175));
00358 //            mPoints.push_back(ChastePoint<2>(0.960684080374198,  0.01985507175));
00359 //            mPoints.push_back(ChastePoint<2>(0.0178364709097984,   0.1016667613));
00360 //            mPoints.push_back(ChastePoint<2>(0.0913306309467688,   0.1016667613));
00361 //            mPoints.push_back(ChastePoint<2>(0.213115003436359,   0.1016667613));
00362 //            mPoints.push_back(ChastePoint<2>(0.366773901106599,   0.1016667613));
00363 //            mPoints.push_back(ChastePoint<2>(0.531559337593401,   0.1016667613));
00364 //            mPoints.push_back(ChastePoint<2>(0.685218235263642,   0.1016667613));
00365 //            mPoints.push_back(ChastePoint<2>(0.807002607753231,   0.1016667613));
00366 //            mPoints.push_back(ChastePoint<2>(0.880496767790202,   0.1016667613));
00367 //            mPoints.push_back(ChastePoint<2>(0.0151447777277575,  0.23723379505));
00368 //            mPoints.push_back(ChastePoint<2>(0.0775479696863585,  0.23723379505));
00369 //            mPoints.push_back(ChastePoint<2>(0.180953921536175,  0.23723379505));
00370 //            mPoints.push_back(ChastePoint<2>(0.311424229416958,  0.23723379505));
00371 //            mPoints.push_back(ChastePoint<2>(0.451341975533043,  0.23723379505));
00372 //            mPoints.push_back(ChastePoint<2>(0.581812283413825,  0.23723379505));
00373 //            mPoints.push_back(ChastePoint<2>(0.685218235263642,  0.23723379505));
00374 //            mPoints.push_back(ChastePoint<2>(0.747621427222243,  0.23723379505));
00375 //            mPoints.push_back(ChastePoint<2>(0.0117485898691365,  0.40828267875));
00376 //            mPoints.push_back(ChastePoint<2>(0.0601579836565992,  0.40828267875));
00377 //            mPoints.push_back(ChastePoint<2>(0.140375345716958,  0.40828267875));
00378 //            mPoints.push_back(ChastePoint<2>(0.241587932982724,  0.40828267875));
00379 //            mPoints.push_back(ChastePoint<2>(0.350129388267276,  0.40828267875));
00380 //            mPoints.push_back(ChastePoint<2>(0.451341975533043,  0.40828267875));
00381 //            mPoints.push_back(ChastePoint<2>(0.531559337593401,  0.40828267875));
00382 //            mPoints.push_back(ChastePoint<2>(0.579968731380863,  0.40828267875));
00383 //            mPoints.push_back(ChastePoint<2>(0.00810648188086345,  0.59171732125));
00384 //            mPoints.push_back(ChastePoint<2>(0.0415087776434008,  0.59171732125));
00385 //            mPoints.push_back(ChastePoint<2>(0.0968584493330425,  0.59171732125));
00386 //            mPoints.push_back(ChastePoint<2>(0.166694745767276,  0.59171732125));
00387 //            mPoints.push_back(ChastePoint<2>(0.241587932982724,  0.59171732125));
00388 //            mPoints.push_back(ChastePoint<2>(0.311424229416958,  0.59171732125));
00389 //            mPoints.push_back(ChastePoint<2>(0.366773901106599,  0.59171732125));
00390 //            mPoints.push_back(ChastePoint<2>(0.400176196869137,  0.59171732125));
00391 //            mPoints.push_back(ChastePoint<2>(0.00471029402224254,  0.76276620495));
00392 //            mPoints.push_back(ChastePoint<2>(0.0241187916136415,  0.76276620495));
00393 //            mPoints.push_back(ChastePoint<2>(0.0562798735138254,  0.76276620495));
00394 //            mPoints.push_back(ChastePoint<2>(0.0968584493330425,  0.76276620495));
00395 //            mPoints.push_back(ChastePoint<2>(0.140375345716957,  0.76276620495));
00396 //            mPoints.push_back(ChastePoint<2>(0.180953921536175,  0.76276620495));
00397 //            mPoints.push_back(ChastePoint<2>(0.213115003436359,  0.76276620495));
00398 //            mPoints.push_back(ChastePoint<2>(0.232523501027757,  0.76276620495));
00399 //            mPoints.push_back(ChastePoint<2>(0.00201860084020162,   0.8983332387));
00400 //            mPoints.push_back(ChastePoint<2>(0.0103361303532312,   0.8983332387));
00401 //            mPoints.push_back(ChastePoint<2>(0.0241187916136415,   0.8983332387));
00402 //            mPoints.push_back(ChastePoint<2>(0.0415087776434008,   0.8983332387));
00403 //            mPoints.push_back(ChastePoint<2>(0.0601579836565991,   0.8983332387));
00404 //            mPoints.push_back(ChastePoint<2>(0.0775479696863585,   0.8983332387));
00405 //            mPoints.push_back(ChastePoint<2>(0.0913306309467688,   0.8983332387));
00406 //            mPoints.push_back(ChastePoint<2>(0.0996481604597983,   0.8983332387));
00407 //            mPoints.push_back(ChastePoint<2>(0.000394223874197648,  0.98014492825));
00408 //            mPoints.push_back(ChastePoint<2>(0.00201860084020162,  0.98014492825));
00409 //            mPoints.push_back(ChastePoint<2>(0.00471029402224255,  0.98014492825));
00410 //            mPoints.push_back(ChastePoint<2>(0.00810648188086345,  0.98014492825));
00411 //            mPoints.push_back(ChastePoint<2>(0.0117485898691366,  0.98014492825));
00412 //            mPoints.push_back(ChastePoint<2>(0.0151447777277575,  0.98014492825));
00413 //            mPoints.push_back(ChastePoint<2>(0.0178364709097984,  0.98014492825));
00414 //            mPoints.push_back(ChastePoint<2>(0.0194608478758024,  0.98014492825));
00415 //            break;
00416         default:
00417             EXCEPTION("Number of gauss points per dimension not supported.");
00418     }
00419 }
00420 
00425 template<>
00426 GaussianQuadratureRule<3>::GaussianQuadratureRule(unsigned numPointsInEachDimension)
00427 {
00428     mNumQuadPoints = numPointsInEachDimension * numPointsInEachDimension * numPointsInEachDimension;
00429 
00430     mWeights.reserve(mNumQuadPoints);
00431     mPoints.reserve(mNumQuadPoints);
00432 
00433     switch (numPointsInEachDimension)
00434     {
00435         case 1: //3d, 1 point per dimension
00436             mWeights.push_back(0.12500000000000);
00437             mPoints.push_back(ChastePoint<3>(0.25000000000000,0.50000000000000,0.12500000000000));
00438             break;
00439 
00440         case 2: //3d, 2 points per dimension
00441             mWeights.push_back(0.06132032652029);
00442             mWeights.push_back(0.01643073197073);
00443             mWeights.push_back(0.00440260136261);
00444             mWeights.push_back(0.00117967347971);
00445             mWeights.push_back(0.06132032652029);
00446             mWeights.push_back(0.01643073197073);
00447             mWeights.push_back(0.00440260136261);
00448             mWeights.push_back(0.00117967347971);
00449 
00450             mPoints.push_back(ChastePoint<3>(0.16666666666667,   0.21132486540519,   0.13144585576580));
00451             mPoints.push_back(ChastePoint<3>(0.62200846792815,   0.21132486540519,   0.03522081090086));
00452             mPoints.push_back(ChastePoint<3>(0.04465819873852,   0.78867513459481,   0.03522081090086));
00453             mPoints.push_back(ChastePoint<3>(0.16666666666667,   0.78867513459481,   0.00943738783766));
00454             mPoints.push_back(ChastePoint<3>(0.16666666666667,   0.21132486540519,   0.49056261216234));
00455             mPoints.push_back(ChastePoint<3>(0.62200846792815,   0.21132486540519,   0.13144585576580));
00456             mPoints.push_back(ChastePoint<3>(0.04465819873852,   0.78867513459481,   0.13144585576580));
00457             mPoints.push_back(ChastePoint<3>(0.16666666666667,   0.78867513459481,   0.03522081090086));
00458             break;
00459 
00460         case 3: //3d, 3 points per dimension
00461             mWeights.push_back(0.01497274736603);
00462             mWeights.push_back(0.01349962850795);
00463             mWeights.push_back(0.00190178826891);
00464             mWeights.push_back(0.00760715307442);
00465             mWeights.push_back(0.00685871056241);
00466             mWeights.push_back(0.00096623512860);
00467             mWeights.push_back(0.00024155878219);
00468             mWeights.push_back(0.00021779261632);
00469             mWeights.push_back(0.00003068198821);
00470             mWeights.push_back(0.02395639578565);
00471             mWeights.push_back(0.02159940561273);
00472             mWeights.push_back(0.00304286123026);
00473             mWeights.push_back(0.01217144491907);
00474             mWeights.push_back(0.01097393689986);
00475             mWeights.push_back(0.00154597620576);
00476             mWeights.push_back(0.00038649405150);
00477             mWeights.push_back(0.00034846818612);
00478             mWeights.push_back(0.00004909118114);
00479             mWeights.push_back(0.01497274736603);
00480             mWeights.push_back(0.01349962850795);
00481             mWeights.push_back(0.00190178826891);
00482             mWeights.push_back(0.00760715307442);
00483             mWeights.push_back(0.00685871056241);
00484             mWeights.push_back(0.00096623512860);
00485             mWeights.push_back(0.00024155878219);
00486             mWeights.push_back(0.00021779261632);
00487             mWeights.push_back(0.00003068198821);
00488 
00489             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.11270166540000,   0.08872983347426));
00490             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.11270166540000,   0.05000000000803));
00491             mPoints.push_back(ChastePoint<3>(0.78729833458393,   0.11270166540000,   0.01127016654181));
00492             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.50000000000000,   0.05000000000803));
00493             mPoints.push_back(ChastePoint<3>(0.25000000000000,   0.50000000000000,   0.02817541635000));
00494             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.50000000000000,   0.00635083269197));
00495             mPoints.push_back(ChastePoint<3>(0.01270166538393,   0.88729833460000,   0.01127016654181));
00496             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.88729833460000,   0.00635083269197));
00497             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.88729833460000,   0.00143149884212));
00498             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.11270166540000,   0.39364916729197));
00499             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.11270166540000,   0.22182458365000));
00500             mPoints.push_back(ChastePoint<3>(0.78729833458393,   0.11270166540000,   0.05000000000803));
00501             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.50000000000000,   0.22182458365000));
00502             mPoints.push_back(ChastePoint<3>(0.25000000000000,   0.50000000000000,   0.12500000000000));
00503             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.50000000000000,   0.02817541635000));
00504             mPoints.push_back(ChastePoint<3>(0.01270166538393,   0.88729833460000,   0.05000000000803));
00505             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.88729833460000,   0.02817541635000));
00506             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.88729833460000,   0.00635083269197));
00507             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.11270166540000,   0.69856850110968));
00508             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.11270166540000,   0.39364916729197));
00509             mPoints.push_back(ChastePoint<3>(0.78729833458393,   0.11270166540000,   0.08872983347426));
00510             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.50000000000000,   0.39364916729197));
00511             mPoints.push_back(ChastePoint<3>(0.25000000000000,   0.50000000000000,   0.22182458365000));
00512             mPoints.push_back(ChastePoint<3>(0.44364916730000,   0.50000000000000,   0.05000000000803));
00513             mPoints.push_back(ChastePoint<3>(0.01270166538393,   0.88729833460000,   0.08872983347426));
00514             mPoints.push_back(ChastePoint<3>(0.05635083270000,   0.88729833460000,   0.05000000000803));
00515             mPoints.push_back(ChastePoint<3>(0.10000000001607,   0.88729833460000,   0.01127016654181));
00516             break;
00517 
00518         case 4: //3d, 4 points per dimension
00519             mWeights.push_back(0.00423982561968);
00520             mWeights.push_back(0.00572288385156);
00521             mWeights.push_back(0.00281885467361);
00522             mWeights.push_back(0.00031634320391);
00523             mWeights.push_back(0.00412036229051);
00524             mWeights.push_back(0.00556163317318);
00525             mWeights.push_back(0.00273942929295);
00526             mWeights.push_back(0.00030742976838);
00527             mWeights.push_back(0.00099965677330);
00528             mWeights.push_back(0.00134932898618);
00529             mWeights.push_back(0.00066462336430);
00530             mWeights.push_back(0.00007458670588);
00531             mWeights.push_back(0.00002360309872);
00532             mWeights.push_back(0.00003185928022);
00533             mWeights.push_back(0.00001569255698);
00534             mWeights.push_back(0.00000176108183);
00535             mWeights.push_back(0.00794866986669);
00536             mWeights.push_back(0.01072905315027);
00537             mWeights.push_back(0.00528468555374);
00538             mWeights.push_back(0.00059306865848);
00539             mWeights.push_back(0.00772470439029);
00540             mWeights.push_back(0.01042674628127);
00541             mWeights.push_back(0.00513578175757);
00542             mWeights.push_back(0.00057635807584);
00543             mWeights.push_back(0.00187411992466);
00544             mWeights.push_back(0.00252967258912);
00545             mWeights.push_back(0.00124601155388);
00546             mWeights.push_back(0.00013983242583);
00547             mWeights.push_back(0.00004425022545);
00548             mWeights.push_back(0.00005972861231);
00549             mWeights.push_back(0.00002941983138);
00550             mWeights.push_back(0.00000330161175);
00551             mWeights.push_back(0.00794866986669);
00552             mWeights.push_back(0.01072905315027);
00553             mWeights.push_back(0.00528468555374);
00554             mWeights.push_back(0.00059306865848);
00555             mWeights.push_back(0.00772470439029);
00556             mWeights.push_back(0.01042674628127);
00557             mWeights.push_back(0.00513578175757);
00558             mWeights.push_back(0.00057635807584);
00559             mWeights.push_back(0.00187411992466);
00560             mWeights.push_back(0.00252967258912);
00561             mWeights.push_back(0.00124601155388);
00562             mWeights.push_back(0.00013983242583);
00563             mWeights.push_back(0.00004425022545);
00564             mWeights.push_back(0.00005972861231);
00565             mWeights.push_back(0.00002941983138);
00566             mWeights.push_back(0.00000330161175);
00567             mWeights.push_back(0.00423982561968);
00568             mWeights.push_back(0.00572288385156);
00569             mWeights.push_back(0.00281885467361);
00570             mWeights.push_back(0.00031634320391);
00571             mWeights.push_back(0.00412036229051);
00572             mWeights.push_back(0.00556163317318);
00573             mWeights.push_back(0.00273942929295);
00574             mWeights.push_back(0.00030742976838);
00575             mWeights.push_back(0.00099965677330);
00576             mWeights.push_back(0.00134932898618);
00577             mWeights.push_back(0.00066462336430);
00578             mWeights.push_back(0.00007458670588);
00579             mWeights.push_back(0.00002360309872);
00580             mWeights.push_back(0.00003185928022);
00581             mWeights.push_back(0.00001569255698);
00582             mWeights.push_back(0.00000176108183);
00583 
00584             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.06943184420000,   0.06012499793653));
00585             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.06943184420000,   0.04328879995478));
00586             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.06943184420000,   0.02132226325621));
00587             mPoints.push_back(ChastePoint<3>(0.86595709258901,   0.06943184420000,   0.00448606527446));
00588             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.33000947820000,   0.04328879995478));
00589             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.33000947820000,   0.03116707302848));
00590             mPoints.push_back(ChastePoint<3>(0.44888729930184,   0.33000947820000,   0.01535160449661));
00591             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.33000947820000,   0.00322987757031));
00592             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.66999052180000,   0.02132226325621));
00593             mPoints.push_back(ChastePoint<3>(0.10890625570184,   0.66999052180000,   0.01535160449661));
00594             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.66999052180000,   0.00756156217830));
00595             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.66999052180000,   0.00159090341870));
00596             mPoints.push_back(ChastePoint<3>(0.00482078098901,   0.93056815580000,   0.00448606527446));
00597             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.93056815580000,   0.00322987757031));
00598             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.93056815580000,   0.00159090341870));
00599             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.93056815580000,   0.00033471571455));
00600             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.06943184420000,   0.28577404826889));
00601             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.06943184420000,   0.20575161800155));
00602             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.06943184420000,   0.10134469352354));
00603             mPoints.push_back(ChastePoint<3>(0.86595709258901,   0.06943184420000,   0.02132226325621));
00604             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.33000947820000,   0.20575161800155));
00605             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.33000947820000,   0.14813706341321));
00606             mPoints.push_back(ChastePoint<3>(0.44888729930184,   0.33000947820000,   0.07296615908496));
00607             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.33000947820000,   0.01535160449661));
00608             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.66999052180000,   0.10134469352354));
00609             mPoints.push_back(ChastePoint<3>(0.10890625570184,   0.66999052180000,   0.07296615908496));
00610             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.66999052180000,   0.03594009661688));
00611             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.66999052180000,   0.00756156217830));
00612             mPoints.push_back(ChastePoint<3>(0.00482078098901,   0.93056815580000,   0.02132226325621));
00613             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.93056815580000,   0.01535160449661));
00614             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.93056815580000,   0.00756156217830));
00615             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.93056815580000,   0.00159090341870));
00616             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.06943184420000,   0.58018304432012));
00617             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.06943184420000,   0.41772022627335));
00618             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.06943184420000,   0.20575161800155));
00619             mPoints.push_back(ChastePoint<3>(0.86595709258901,   0.06943184420000,   0.04328879995478));
00620             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.33000947820000,   0.41772022627335));
00621             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.33000947820000,   0.30075023588863));
00622             mPoints.push_back(ChastePoint<3>(0.44888729930184,   0.33000947820000,   0.14813706341321));
00623             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.33000947820000,   0.03116707302848));
00624             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.66999052180000,   0.20575161800155));
00625             mPoints.push_back(ChastePoint<3>(0.10890625570184,   0.66999052180000,   0.14813706341321));
00626             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.66999052180000,   0.07296615908496));
00627             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.66999052180000,   0.01535160449661));
00628             mPoints.push_back(ChastePoint<3>(0.00482078098901,   0.93056815580000,   0.04328879995478));
00629             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.93056815580000,   0.03116707302848));
00630             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.93056815580000,   0.01535160449661));
00631             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.93056815580000,   0.00322987757031));
00632             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.06943184420000,   0.80583209465249));
00633             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.06943184420000,   0.58018304432012));
00634             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.06943184420000,   0.28577404826889));
00635             mPoints.push_back(ChastePoint<3>(0.86595709258901,   0.06943184420000,   0.06012499793653));
00636             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.33000947820000,   0.58018304432012));
00637             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.33000947820000,   0.41772022627335));
00638             mPoints.push_back(ChastePoint<3>(0.44888729930184,   0.33000947820000,   0.20575161800155));
00639             mPoints.push_back(ChastePoint<3>(0.62347184427491,   0.33000947820000,   0.04328879995478));
00640             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.66999052180000,   0.28577404826889));
00641             mPoints.push_back(ChastePoint<3>(0.10890625570184,   0.66999052180000,   0.20575161800155));
00642             mPoints.push_back(ChastePoint<3>(0.22110322249816,   0.66999052180000,   0.10134469352354));
00643             mPoints.push_back(ChastePoint<3>(0.30709631152509,   0.66999052180000,   0.02132226325621));
00644             mPoints.push_back(ChastePoint<3>(0.00482078098901,   0.93056815580000,   0.06012499793653));
00645             mPoints.push_back(ChastePoint<3>(0.02291316667491,   0.93056815580000,   0.04328879995478));
00646             mPoints.push_back(ChastePoint<3>(0.04651867752509,   0.93056815580000,   0.02132226325621));
00647             mPoints.push_back(ChastePoint<3>(0.06461106321099,   0.93056815580000,   0.00448606527446));
00648             break;
00649 
00650         default:
00651             EXCEPTION("Number of gauss points per dimension not supported.");
00652     }
00653 }
00654 
00655 template<unsigned ELEMENT_DIM>
00656 GaussianQuadratureRule<ELEMENT_DIM>::GaussianQuadratureRule(unsigned numPointsInEachDimension)
00657 {
00658     EXCEPTION("Gauss points not available for this dimension.");
00659 }
00660 
00661 
00663 // Explicit instantiation
00665 
00666 template class GaussianQuadratureRule<0>;
00667 template class GaussianQuadratureRule<1>;
00668 template class GaussianQuadratureRule<2>;
00669 template class GaussianQuadratureRule<3>;
00670 template class GaussianQuadratureRule<4>;

Generated on Mon Apr 18 11:35:36 2011 for Chaste by  doxygen 1.5.5