% =======================================================================
%  .. Initialisation coefficients schémas différences finies
%  kristof - Juin 2006 / Juin 2008 - version 1.2
% =======================================================================

global cb2 dfc12 dfc10 dfc8 dfc6 dfc4 dfc04 dfc40 
global dfc13 dfc31 dfc2 dfc02 dfc20
global dfcb f12 f10 f8 f6 f4 f2
global nrkopt alphark betark crk
global a11dp d11dp d11dpom

% =======================================================================
%.. coefficients DFC optimisees sur 11 pts Bogey & Bailly (JCP, 2004)
% =======================================================================
cb2(1) =  0.872756993962; 
cb2(2) = -0.286511173973; 
cb2(3) =  0.090320001280; 
cb2(4) = -0.020779405824; 
cb2(5) =  0.002484594688; 

% cb2(1) =  4./5.;
% cb2(2) = -1./5.;
% cb2(3) =  4./105.;
% cb2(4) = -1./280.;
% cb2(5) =  0.;

dfc12(8) = 6./7.;
dfc12(9) = -15./56.;
dfc12(10) = 5./63.;
dfc12(11) = -1./56.;
dfc12(12) = 3./1155.;
dfc12(13) = -1./5544.;
dfc12(7) = 0.;
dfc12(6) = -dfc12(8);
dfc12(5) = -dfc12(9);
dfc12(4) = -dfc12(10);
dfc12(3) = -dfc12(11);
dfc12(2) = -dfc12(12);
dfc12(1) = -dfc12(13);

dfc10(7)  =  5./6.;
dfc10(8)  = -5./21.;
dfc10(9)  =  5./84.;
dfc10(10) = -5./504.;
dfc10(11) =  1./1260.;
dfc10(6) =  0.;
dfc10(5) = -dfc10(7);
dfc10(4) = -dfc10(8);
dfc10(3) = -dfc10(9);
dfc10(2) = -dfc10(10);
dfc10(1) = -dfc10(11);

dfc8(6) =  4./5.;
dfc8(7) = -1./5.;
dfc8(8) =  4./105.;
dfc8(9) = -1./280.;
dfc8(5) =  0.;
dfc8(4) = -dfc8(6);
dfc8(3) = -dfc8(7);
dfc8(2) = -dfc8(8);
dfc8(1) = -dfc8(9);

dfc6(5) =  3./4.;
dfc6(6) = -3./20.;
dfc6(7) =  1./60.;
dfc6(4) =  0.;
dfc6(3) = -dfc6(5);
dfc6(2) = -dfc6(6);
dfc6(1) = -dfc6(7);

dfc4(4) = 2./3.;
dfc4(5) = -1./12.;
dfc4(3) = 0.;
dfc4(2) = -dfc4(4);
dfc4(1) = -dfc4(5);

dfc04(1) = -25./12.;
dfc04(2) = 48./12.;
dfc04(3) = -36./12.;
dfc04(4) = 16./12.;
dfc04(5) = -3./12.;

dfc40(1:5) = -dfc04(6-(1:5));

dfc13(1) = -3./12.;
dfc13(2) = -10./12.;
dfc13(3) = 18./12.;
dfc13(4) = -6./12.;
dfc13(5) = 1./12.;

dfc31(1:5) = -dfc13(6-(1:5));


dfc2(3) = 1./2.;
dfc2(2) = 0.;
dfc2(1) = -dfc2(3);

dfc02(1) = -3./2.;
dfc02(2) = 2.;
dfc02(3) = -1./2.;

dfc20(1) = 1./2.;
dfc20(2) = -2.;
dfc20(3) = 3./2.;

%.. Filtrage sur 11 points de cb2 !
%dfcb(6)  =  0.215044884112; 
%dfcb(7)  = -0.187772883589; 
%dfcb(8)  =  0.123755948787; 
%dfcb(9)  = -0.059227575576; 
%dfcb(10) =  0.018721609157; 
%dfcb(11) = -0.002999540835; 

%.. Filtrage sur 11 points cb2 - AIAA Paper 2008-2968
dfcb(6)  =  0.234810479761700;
dfcb(7)  = -0.199250131285813;
dfcb(8)  =  0.120198310245186;
dfcb(9)  = -0.049303775636020;
dfcb(10) =  0.012396449873964;
dfcb(11) = -0.001446093078167;

%.. filtrage ordre 12
f12(7) = 793./1024.; 
f12(8) = 99./512.;
f12(9) = -495./4096.;
f12(10) = 55./1024.;
f12(11) = -33./2048.;
f12(12) = 3./1024.;
f12(13) = -1./4096.;

%.. filtrage ordre 10
f10(6) = 193./256.;
f10(7) = 105./512.;
f10(8) =-15./128.;
f10(9) = 45./1024.;
f10(10) = -5./512.;
f10(11) = 1./1024.;

%.. filtrage ordre 8
f8(5) = 93./128.;
f8(6) = 7./32.;
f8(7) = -7./64.;
f8(8) = 1./32.;
f8(9) = -1./256.;
f8(1) = f8(9);
f8(2) = f8(8);
f8(3) = f8(7);
f8(4) = f8(6);

%.. filtrage ordre 6
f6(4) = 11./16.;
f6(5) = 15./64.;
f6(6) = -3./32.;
f6(7) = 1./64.;
f6(1) = f6(7);
f6(2) = f6(6);
f6(3) = f6(5);

%.. filtrage ordre 4
f4(3) = 5./8.;
f4(4) = 1./4.;
f4(5) = -1./16.;
f4(1) = f4(5);
f4(2) = f4(4);

%.. filtrage ordre 2
f2(1) = 1./4.;
f2(2) = 1./2.;
f2(3) = 1./4.;

% =======================================================================
%.. Schema optimisé Runge-Kutta ordre 4 non linéaire / Julien Berland
% =======================================================================

nrkopt = 6;

betark(1) = 0.03291860514560166;
betark(2) = 0.823256998199009;
betark(3) = 0.381530948900243;
betark(4) = 0.200092213184021;
betark(5) = 1.71858104271450;
betark(6) = 0.27;

alphark(1) = 0.0;
alphark(2) = -0.737101392795946;
alphark(3) = -1.63474079434100;
alphark(4) = -0.744739003780028;
alphark(5) = -1.46989735152196;
alphark(6) = -2.81397138803532;

crk(1) = 0.0;
crk(2) = 0.03291860514560166;
crk(3) = 0.249351723343111;
crk(4) = 0.466911705054856;
crk(5) = 0.582030414043922;
crk(6) = 0.847252983782695;


% =======================================================================
%.. Berland et al. 11-pts non-centered schemes (JCP 2007)
% =======================================================================

a11dp(1,1) = -2.391602219538;
a11dp(1,2) =  5.832490322294;
a11dp(1,3) = -7.650218001182;
a11dp(1,4) =  7.907810563576;
a11dp(1,5) = -5.922599052629;
a11dp(1,6) =  3.071037015445;
a11dp(1,7) = -1.014956769726;
a11dp(1,8) =  0.170022256519;
a11dp(1,9) =  0.002819958377;
a11dp(1,10)= -0.004791009708;
a11dp(1,11)= -0.000013063429;

a11dp(1,3) = -7.650218001182 + 0.000000000001;

a11dp(2,1) = -0.180022054228;
a11dp(2,2) = -1.237550583044;
a11dp(2,3) =  2.484731692990;
a11dp(2,4) = -1.810320814061;
a11dp(2,5) =  1.112990048440;
a11dp(2,6) = -0.481086916514;
a11dp(2,7) =  0.126598690230;
a11dp(2,8) = -0.015510730165;
a11dp(2,9) =  0.000024609059;
a11dp(2,10)=  0.000156447571;
a11dp(2,11)= -0.000007390277;

a11dp(2,9) =  0.000024609059 - 0.000003;
a11dp(2,10)=  0.000156447571 - 0.000000000001;

a11dp(3,1) =  0.057982271137;
a11dp(3,2) = -0.536135360383;
a11dp(3,3) = -0.264089548967;
a11dp(3,4) =  0.917445877606;
a11dp(3,5) = -0.169688364841;
a11dp(3,6) = -0.029716326170;
a11dp(3,7) =  0.029681617641;
a11dp(3,8) = -0.005222483773;
a11dp(3,9) = -0.000118806260;
a11dp(3,10)= -0.000118806260;
a11dp(3,11)= -0.000020069730;

a11dp(3,3) = -0.264089548967 + 0.000000000002;
a11dp(3,4) =  0.917445877606 - 0.000000000002;

a11dp(4,1) = -0.013277273810;
a11dp(4,2) =  0.115976072920;
a11dp(4,3) = -0.617479187931;
a11dp(4,4) = -0.274113948206;
a11dp(4,5) =  1.086208764655;
a11dp(4,6) = -0.402951626982;
a11dp(4,7) =  0.131066986242;
a11dp(4,8) = -0.028154858354;
a11dp(4,9) =  0.002596328316;
a11dp(4,10)=  0.000128743150;
a11dp(4,11)=  0.;

a11dp(4,4) = -0.274113948206 + 0.000000000002;
a11dp(4,5) =  1.086208764655 - 0.000000000002;

a11dp(5,1) =  0.016756572303;
a11dp(5,2) = -0.117478455239;
a11dp(5,3) =  0.411034935097;
a11dp(5,4) = -1.130286765151;
a11dp(5,5) =  0.341435872100;
a11dp(5,6) =  0.556396830543;
a11dp(5,7) = -0.082525734207;
a11dp(5,8) =  0.003565834658;
a11dp(5,9) =  0.001173034777;
a11dp(5,10)= -0.000071772671;
a11dp(5,11)= -0.000000352273;

a11dp(5,5) =  0.341435872100 - 0.000000000001;
a11dp(5,10)= -0.000071772671 + 0.000000000064;

% =======================================================================
%.. Berland et al. 11-pts non-centered selective filters (JCP 2007)
% =======================================================================

d11dp(1,1) =  0.320882352941;
d11dp(1,2) = -0.465;
d11dp(1,3) =  0.179117647059;
d11dp(1,4) = -0.035;
d11dp(1,5) =  0.;
d11dp(1,6) =  0.;
d11dp(1,7) =  0.;
d11dp(1,8) =  0.;
d11dp(1,9) =  0.;
d11dp(1,10)=  0.;
d11dp(1,11)=  0.;

d11dp(2,1) = -0.085777408970;
d11dp(2,2) =  0.277628171524;
d11dp(2,3) = -0.356848072173;
d11dp(2,4) =  0.223119093072;
d11dp(2,5) = -0.057347064865;
d11dp(2,6) = -0.000747264596;
d11dp(2,7) = -0.000027453993;
d11dp(2,8) =  0.;
d11dp(2,9) =  0.;
d11dp(2,10)=  0.;
d11dp(2,11)=  0.;

d11dp(2,1) = -0.085777408970 + 0.000000000001;

d11dp(3,1) =  0.0307159855992469;
d11dp(3,2) = -0.148395705486028; 
d11dp(3,3) =  0.312055385963757; 
d11dp(3,4) = -0.363202245195514; 
d11dp(3,5) =  0.230145457063431; 
d11dp(3,6) = -0.0412316564605079;
d11dp(3,7) = -0.0531024700805787;
d11dp(3,8) =  0.0494343261171287;
d11dp(3,9) = -0.0198143585458560;
d11dp(3,10)=  0.00339528102492129;
d11dp(3,11)=  0.;

d11dp(4,1) = -0.000054596010;
d11dp(4,2) =  0.042124772446;
d11dp(4,3) = -0.173103107841;
d11dp(4,4) =  0.299615871352;
d11dp(4,5) = -0.276543612935;
d11dp(4,6) =  0.131223506571;
d11dp(4,7) = -0.023424966418;
d11dp(4,8) =  0.013937561779;
d11dp(4,9) = -0.024565095706;
d11dp(4,10)=  0.013098287852;
d11dp(4,11)= -0.002308621090;

d11dp(5,1) =  0.008391235145;
d11dp(5,2) = -0.047402506444;
d11dp(5,3) =  0.121438547725;
d11dp(5,4) = -0.200063042812;
d11dp(5,5) =  0.240069047836;
d11dp(5,6) = -0.207269200140;
d11dp(5,7) =  0.122263107844;
d11dp(5,8) = -0.047121062819;
d11dp(5,9) =  0.009014891495;
d11dp(5,10)=  0.001855812216;
d11dp(5,11)= -0.001176830044;

d11dp(5,6) = -0.207269200140 - 0.000000000001;
d11dp(5,7) =  0.122263107844 - 0.000000000001;

% =======================================================================
%.. Olivier Marsden 11-pts non-centered selective filters (exclusivite !)
% =======================================================================

%.. wall - 9 pts
d11dpom(1,1) =  0.295407862862532    ;
d11dpom(1,2) = -0.458292248139179    ;
d11dpom(1,3) =  0.222474459467433    ;
d11dpom(1,4) = -0.0640049781319869   ;
d11dpom(1,5) = -0.00659131673237188  ;
d11dpom(1,6) =  0.0190412192247889   ; 
d11dpom(1,7) = -0.0108425138230102   ;
d11dpom(1,8) =  0.00325600704637703  ;
d11dpom(1,9) = -0.000448491774582707 ;
d11dpom(1,10)=  0.;
d11dpom(1,11)=  0.;

%.. wall+1 - 9 pts
d11dpom(2,1) = -0.0704966749128320   ;
d11dpom(2,2) =  0.253629635956750    ;
d11dpom(2,3) = -0.355465051418679    ;
d11dpom(2,4) =  0.246584100544511    ;
d11dpom(2,5) = -0.0872510633978572   ;
d11dpom(2,6) =  0.00650178971964532  ;
d11dpom(2,7) =  0.0118653270602584   ;
d11dpom(2,8) = -0.00671552622090628  ;
d11dpom(2,9) =  0.00134746266910992  ;
d11dpom(2,10)=  0.;
d11dpom(2,11)=  0.;

%.. wall+2 - 11pts
d11dpom(3,1) =  0.0232856680590653   ;
d11dpom(3,2) = -0.115904839805642    ;
d11dpom(3,3) =  0.254778651282633    ;
d11dpom(3,4) = -0.320040364080913    ;
d11dpom(3,5) =  0.241010936336792    ;
d11dpom(3,6) = -0.0958796015854177   ;
d11dpom(3,7) = -0.000901156032519810 ;
d11dpom(3,8) =  0.0260386374315484   ;
d11dpom(3,9) = -0.0173124251665987   ;
d11dpom(3,10)=  0.00578616804042421  ;
d11dpom(3,11)= -0.000861674479370924 ;


% =======================================================================
% =======================================================================

