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