00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 char ope_sec_order_solp_C[] = "$Header: /cvsroot/Lorene/C++/Source/Ope_elementary/Ope_sec_order/ope_sec_order_solp.C,v 1.1 2004/06/22 12:43:58 p_grandclement Exp $" ;
00022
00023
00024
00025
00026
00027
00028 #include <math.h>
00029 #include <stdlib.h>
00030
00031 #include "proto.h"
00032 #include "ope_elementary.h"
00033
00034
00035
00036
00037
00038 Tbl _cl_sec_order_pas_prevu (const Tbl &so) {
00039
00040 cout << "Linear combination for Sec_order not implemented..." << endl ;
00041 abort() ;
00042 exit(-1) ;
00043 return so;
00044 }
00045
00046
00047
00048
00049 Tbl _cl_sec_order_r_cheb (const Tbl& source) {
00050
00051 int n = source.get_dim(0) ;
00052
00053 Tbl barre(source) ;
00054 int dirac = 1 ;
00055 for (int i=0 ; i<n-2 ; i++) {
00056 barre.set(i) = ((1+dirac)*source(i)-source(i+2))
00057 /(i+1) ;
00058 if (i==0) dirac = 0 ;
00059 }
00060
00061 Tbl res(barre) ;
00062 for (int i=0 ; i<n-4 ; i++)
00063 res.set(i) = barre(i)-barre(i+2) ;
00064
00065 return res ;
00066 }
00067
00068
00069
00070
00071
00072
00073 Tbl cl_sec_order (const Tbl &source, int base_r) {
00074
00075
00076 static Tbl (*cl_sec_order[MAX_BASE])(const Tbl &) ;
00077 static int nap = 0 ;
00078
00079
00080 if (nap==0) {
00081 nap = 1 ;
00082 for (int i=0 ; i<MAX_BASE ; i++) {
00083 cl_sec_order[i] = _cl_sec_order_pas_prevu ;
00084 }
00085
00086 cl_sec_order[R_CHEB >> TRA_R] = _cl_sec_order_r_cheb ;
00087 }
00088
00089 Tbl res(cl_sec_order[base_r](source)) ;
00090 return res ;
00091 }
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 Tbl _solp_sec_order_pas_prevu (const Matrice &, const Matrice &,
00102 const Tbl &) {
00103 cout << " Solution particuliere pas prevue in sec_order..... : "<< endl ;
00104 abort() ;
00105 exit(-1) ;
00106 Tbl res(1) ;
00107 return res;
00108 }
00109
00110
00111
00112
00113
00114 Tbl _solp_sec_order_r_cheb (const Matrice &lap, const Matrice &nondege,
00115 const Tbl &source) {
00116
00117 int n = lap.get_dim(0) ;
00118 int dege = n-nondege.get_dim(0) ;
00119 assert (dege ==2) ;
00120
00121 Tbl source_aux (cl_sec_order (source, R_CHEB)) ;
00122
00123 Tbl so(n-dege) ;
00124 so.set_etat_qcq() ;
00125 for (int i=0 ; i<n-dege ; i++)
00126 so.set(i) = source_aux(i) ;
00127
00128 Tbl auxi(nondege.inverse(so)) ;
00129
00130 Tbl res(n) ;
00131 res.set_etat_qcq() ;
00132 for (int i=dege ; i<n ; i++)
00133 res.set(i) = auxi(i-dege) ;
00134
00135 for (int i=0 ; i<dege ; i++)
00136 res.set(i) = 0 ;
00137 return res ;
00138 }
00139
00140
00141
00142 Tbl Ope_sec_order::get_solp (const Tbl& so) const {
00143
00144 if (non_dege == 0x0)
00145 do_non_dege() ;
00146
00147
00148 static Tbl (*solp_sec_order[MAX_BASE]) (const Matrice&, const Matrice&,
00149 const Tbl&) ;
00150 static int nap = 0 ;
00151
00152
00153 if (nap==0) {
00154 nap = 1 ;
00155 for (int i=0 ; i<MAX_BASE ; i++) {
00156 solp_sec_order[i] = _solp_sec_order_pas_prevu ;
00157 }
00158
00159 solp_sec_order[R_CHEB >> TRA_R] = _solp_sec_order_r_cheb ;
00160 }
00161
00162 Tbl res(solp_sec_order[base_r] (*ope_mat, *non_dege, so)) ;
00163
00164 Tbl valeurs (val_solp (res, alpha, base_r)) ;
00165 sp_plus = valeurs(0) ;
00166 sp_minus = valeurs(1) ;
00167 dsp_plus = valeurs(2) / exp(alpha+beta) ;
00168 dsp_minus = valeurs(3) / exp(beta-alpha) ;
00169
00170 return res ;
00171 }