📄 quadrature_jacobi_1d.c
字号:
// $Id: quadrature_jacobi_1D.C 2948 2008-07-31 16:04:51Z jwpeterson $// The libMesh Finite Element Library.// Copyright (C) 2002-2007 Benjamin S. Kirk, John W. Peterson // This library is free software; you can redistribute it and/or// modify it under the terms of the GNU Lesser General Public// License as published by the Free Software Foundation; either// version 2.1 of the License, or (at your option) any later version. // This library is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU// Lesser General Public License for more details. // You should have received a copy of the GNU Lesser General Public// License along with this library; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA// Local includes#include "quadrature_jacobi.h" void QJacobi::init_1D(const ElemType, unsigned int p){ //---------------------------------------------------------------------- // 1D quadrature rules // Note that we need to check _alpha and _beta // to determine which quadrature rule to implement. // These rules have been pre-scaled based on their // intended use. The weights of the (alpha=1,beta=0) // rule sum to 0.5. The weights of the (alpha=2,beta=0) // rule sum to 0.333333333333. if ((_alpha == 1) && (_beta == 0)) { switch(_order + 2*p) { case CONSTANT: case FIRST: { _points.resize (1); _weights.resize(1); _points[0](0) = 1./3.; _weights[0] = 0.5; return; } case SECOND: case THIRD: { _points.resize (2); _weights.resize(2); _points[ 0](0)=1.5505102572168219018027159252941e-01L; _weights[ 0]=3.1804138174397716939436900207516e-01L; _points[ 1](0)=6.4494897427831780981972840747059e-01L; _weights[ 1]=1.8195861825602283060563099792484e-01L; return; } case FOURTH: case FIFTH: { _points.resize (3); _weights.resize(3); _points[ 0](0)=8.8587959512703947395546143769456e-02L; _weights[ 0]=2.0093191373895963077219813326460e-01L; _points[ 1](0)=4.0946686444073471086492625206883e-01L; _weights[ 1]=2.2924110635958624669392059455632e-01L; _points[ 2](0)=7.8765946176084705602524188987600e-01L; _weights[ 2]=6.9826979901454122533881272179077e-02L; return; } case SIXTH: case SEVENTH: { _points.resize (4); _weights.resize(4); _points[ 0](0)=5.7104196114517682193121192554116e-02L; _weights[ 0]=1.3550691343148811620826417407794e-01L; _points[ 1](0)=2.7684301363812382768004599768563e-01L; _weights[ 1]=2.0346456801027136079140447593585e-01L; _points[ 2](0)=5.8359043236891682005669766866292e-01L; _weights[ 2]=1.2984754760823244082645620288963e-01L; _points[ 3](0)=8.6024013565621944784791291887512e-01L; _weights[ 3]=3.1180970950008082173875147096575e-02L; return; } case EIGHTH: case NINTH: { _points.resize (5); _weights.resize(5); _points[ 0](0)=3.9809857051468742340806690093333e-02L; _weights[ 0]=9.6781590226651679274360971636151e-02L; _points[ 1](0)=1.9801341787360817253579213679530e-01L; _weights[ 1]=1.6717463809436956549167562309770e-01L; _points[ 2](0)=4.3797481024738614400501252000523e-01L; _weights[ 2]=1.4638698708466980869803786935596e-01L; _points[ 3](0)=6.9546427335363609451461482372117e-01L; _weights[ 3]=7.3908870072616670350633219341704e-02L; _points[ 4](0)=9.0146491420117357387650110211225e-01L; _weights[ 4]=1.5747914521692276185292316568488e-02L; return; } case TENTH: case ELEVENTH: { _points.resize (6); _weights.resize(6); _points[ 0](0)=2.9316427159784891972050276913165e-02L; _weights[ 0]=7.2310330725508683655454326124832e-02L; _points[ 1](0)=1.4807859966848429184997685249598e-01L; _weights[ 1]=1.3554249723151861684069039663805e-01L; _points[ 2](0)=3.3698469028115429909705297208078e-01L; _weights[ 2]=1.4079255378819892811907683907093e-01L; _points[ 3](0)=5.5867151877155013208139334180552e-01L; _weights[ 3]=9.8661150890655264120584510548360e-02L; _points[ 4](0)=7.6923386203005450091688336011565e-01L; _weights[ 4]=4.3955165550508975508176624305430e-02L; _points[ 5](0)=9.2694567131974111485187396581968e-01L; _weights[ 5]=8.7383018136095317560173033123989e-03L; return; } case TWELFTH: case THIRTEENTH: { _points.resize (7); _weights.resize(7); _points[ 0](0)=2.2479386438712498108825499570845e-02L; _weights[ 0]=5.5967363423491051151562113429926e-02L; _points[ 1](0)=1.1467905316090423190964023706751e-01L; _weights[ 1]=1.1050925819087460242112073636961e-01L; _points[ 2](0)=2.6578982278458946847678939169339e-01L; _weights[ 2]=1.2739089729958832691873448577496e-01L; _points[ 3](0)=4.5284637366944461699855144234765e-01L; _weights[ 3]=1.0712506569587366999091225299986e-01L; _points[ 4](0)=6.4737528288683036262609222982876e-01L; _weights[ 4]=6.6384696465491469983647988763640e-02L; _points[ 5](0)=8.1975930826310763501242005719082e-01L; _weights[ 5]=2.7408356721873475444331048358226e-02L; _points[ 6](0)=9.4373743946307785353434780896769e-01L; _weights[ 6]=5.2143622028074040896913743037830e-03L; return; } case FOURTEENTH: case FIFTEENTH: { _points.resize (8); _weights.resize(8); _points[ 0](0)=1.7779915147363451813205101037679e-02L; _weights[ 0]=4.4550804361555931326215619533963e-02L; _points[ 1](0)=9.1323607899793956003741458074541e-02L; _weights[ 1]=9.1119023636373626345722461782880e-02L; _points[ 2](0)=2.1430847939563075835754126758167e-01L; _weights[ 2]=1.1250579947088736617177209860428e-01L; _points[ 3](0)=3.7193216458327230243085396048263e-01L; _weights[ 3]=1.0604735943593001070453109641116e-01L; _points[ 4](0)=5.4518668480342664903227222995321e-01L; _weights[ 4]=7.9199599492319160120408189359892e-02L; _points[ 5](0)=7.1317524285556948105131376025091e-01L; _weights[ 5]=4.5439319504698898083055421095694e-02L; _points[ 6](0)=8.5563374295785442851478147977179e-01L; _weights[ 6]=1.7842902655986208393552797201042e-02L; _points[ 7](0)=9.5536604471003014926687897814169e-01L; _weights[ 7]=3.2951914422487988547423160110891e-03L; return; } case SIXTEENTH: case SEVENTEENTH: { _points.resize (9); _weights.resize(9); _points[ 0](0)=1.4412409648876548632826740810813e-02L; _weights[ 0]=3.6278003523279871459649597941160e-02L; _points[ 1](0)=7.4387389709196044635918185955999e-02L; _weights[ 1]=7.6074255109308162580079303753964e-02L; _points[ 2](0)=1.7611665616299528186317574607257e-01L; _weights[ 2]=9.8533742172345705160173020369274e-02L; _points[ 3](0)=3.0966757992763781705962046722948e-01L; _weights[ 3]=1.0030880919336828965415022473259e-01L; _points[ 4](0)=4.6197040108101093488314310868056e-01L; _weights[ 4]=8.4358321844920349394250019958587e-02L; _points[ 5](0)=6.1811723469529402463922975160350e-01L; _weights[ 5]=5.8401195295165110565731522901640e-02L; _points[ 6](0)=7.6282301518503961468269330714673e-01L; _weights[ 6]=3.1804821491054001261690106935870e-02L; _points[ 7](0)=8.8192102121000129980771488800526e-01L; _weights[ 7]=1.2060004284785379051727152286900e-02L; _points[ 8](0)=9.6374218711679053905883569923192e-01L; _weights[ 8]=2.1808470857731308725490511200170e-03L; return; } case EIGHTTEENTH: case NINTEENTH: { _points.resize (10); _weights.resize(10); _points[ 0](0)=1.1917613432415596909745586958986e-02L; _weights[ 0]=3.0099508024037023300654755523879e-02L; _points[ 1](0)=6.1732071877148125522629367194250e-02L; _weights[ 1]=6.4287154509082572874826538628865e-02L; _points[ 2](0)=1.4711144964307024042759943557982e-01L; _weights[ 2]=8.6211300289176036428333360711914e-02L; _points[ 3](0)=2.6115967600845624026605165805485e-01L; _weights[ 3]=9.2696893677723415844756991929711e-02L; _points[ 4](0)=3.9463984688578684296195210507761e-01L; _weights[ 4]=8.4557109690827332430645582165501e-02L; _points[ 5](0)=5.3673876571566063287309517771189e-01L; _weights[ 5]=6.6053075563350379166074502504878e-02L; _points[ 6](0)=6.7594446167666510735715050893476e-01L; _weights[ 6]=4.3401906407150625922456117586384e-02L; _points[ 7](0)=8.0097892103689884513794630161724e-01L; _weights[ 7]=2.2774591453263032586487649426060e-02L; _points[ 8](0)=9.0171098779014677034879897840977e-01L; _weights[ 8]=8.4193197829831874175163655187011e-03L; _points[ 9](0)=9.6997096783851350295693564236559e-01L; _weights[ 9]=1.4991406024063940282481360041064e-03L; return; } case TWENTIETH: case TWENTYFIRST: { _points.resize (11); _weights.resize(11); _points[ 0](0)=1.0018280461680405843024729867805e-02L; _weights[ 0]=2.5367340688141426184944658517383e-02L; _points[ 1](0)=5.2035451127180552583542695772964e-02L; _weights[ 1]=5.4938091132871498258746681665651e-02L; _points[ 2](0)=1.2461922514444307373529958726391e-01L; _weights[ 2]=7.5620048057186998321377054841660e-02L; _points[ 3](0)=2.2284060704383785550783145345736e-01L; _weights[ 3]=8.4659422884017621219239388551910e-02L; _points[ 4](0)=3.4000815791466518823360523389702e-01L; _weights[ 4]=8.1879102988063470389586851943461e-02L; _points[ 5](0)=4.6813761308958404208311038075775e-01L; _weights[ 5]=6.9531875158183049799050889633934e-02L; _points[ 6](0)=5.9849727976713918322772071367304e-01L; _weights[ 6]=5.1591360672297580193086641744608e-02L; _points[ 7](0)=7.2220328489096792556332130780461e-01L; _weights[ 7]=3.2641546713833346017953865389764e-02L; _points[ 8](0)=8.3082489962281857403056654390566e-01L; _weights[ 8]=1.6663623451680692415747124573826e-02L;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -