00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 char vector_etamu_C[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/vector_etamu.C,v 1.2 2008/08/27 08:52:23 jl_cornou Exp $" ;
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #include <stdlib.h>
00049 #include <assert.h>
00050
00051
00052 #include "tensor.h"
00053
00054
00055
00056
00057
00058
00059 const Scalar& Vector::eta() const {
00060
00061
00062 if (p_eta == 0x0) {
00063
00064
00065 #ifndef NDEBUG
00066 const Base_vect_spher* bvs = dynamic_cast<const Base_vect_spher*>(triad) ;
00067 assert(bvs != 0x0) ;
00068 #endif
00069
00070
00071 Scalar sou_eta = *cmp[1] ;
00072 sou_eta.div_tant() ;
00073 sou_eta += cmp[1]->dsdt() + cmp[2]->stdsdp();
00074
00075
00076
00077 p_eta = new Scalar( sou_eta.poisson_angu() ) ;
00078
00079 }
00080
00081 return *p_eta ;
00082
00083 }
00084
00085
00086
00087
00088
00089
00090
00091 const Scalar& Vector::mu() const {
00092
00093
00094 if (p_mu == 0x0) {
00095
00096
00097 #ifndef NDEBUG
00098 const Base_vect_spher* bvs = dynamic_cast<const Base_vect_spher*>(triad) ;
00099 assert(bvs != 0x0) ;
00100 #endif
00101
00102 Scalar tmp = *cmp[2] ;
00103 tmp.div_tant() ;
00104
00105
00106 tmp += cmp[2]->dsdt() - cmp[1]->stdsdp() ;
00107
00108
00109
00110 p_mu = new Scalar( tmp.poisson_angu() ) ;
00111
00112 }
00113
00114 return *p_mu ;
00115
00116 }
00117
00118
00119
00120
00121
00122 const Scalar& Vector::A() const {
00123
00124
00125 if (p_A == 0x0) {
00126
00127
00128 #ifndef NDEBUG
00129 const Base_vect_spher* bvs = dynamic_cast<const Base_vect_spher*>(triad) ;
00130 assert(bvs != 0x0) ;
00131 #endif
00132
00133
00134 if (p_eta == 0x0) { Scalar etatmp = this->eta(); }
00135
00136 Scalar tmp = -*cmp[0] ;
00137 tmp.div_r_dzpuis(2);
00138
00139 Scalar eta_tilde = *p_eta ;
00140 Scalar etad = eta_tilde.dsdr() ;
00141 eta_tilde.div_r_dzpuis(2);
00142 etad.set_dzpuis(2);
00143 tmp += etad + eta_tilde ;
00144
00145 p_A = new Scalar (tmp) ;
00146 }
00147
00148 return *p_A ;
00149 }
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160 void Vector::update_vtvp() {
00161
00162 assert( (p_eta != 0x0) && (p_mu != 0x0) ) ;
00163
00164
00165 *cmp[1] = p_eta->dsdt() - p_mu->stdsdp() ;
00166
00167
00168 *cmp[2] = p_eta->stdsdp() + p_mu->dsdt() ;
00169
00170 Scalar* p_eta_tmp = p_eta ;
00171 p_eta = 0x0 ;
00172 Scalar* p_mu_tmp = p_mu ;
00173 p_mu = 0x0 ;
00174 Vector::del_deriv() ;
00175
00176 p_eta = p_eta_tmp ;
00177 p_mu = p_mu_tmp ;
00178
00179 }
00180
00181
00182 void Vector::set_vr_eta_mu(const Scalar& vr_i, const Scalar& eta_i,
00183 const Scalar& mu_i) {
00184
00185
00186 assert( dynamic_cast<const Base_vect_spher*>(triad) != 0x0 ) ;
00187 assert(&vr_i.get_mp() == &eta_i.get_mp()) ;
00188
00189 del_deriv() ;
00190
00191
00192 *cmp[0] = vr_i ;
00193
00194 p_eta = new Scalar( eta_i ) ;
00195
00196 p_mu = new Scalar( mu_i ) ;
00197
00198 update_vtvp() ;
00199
00200 return ;
00201 }
00202
00203
00204
00205
00206