vector_divfree_aux.C

00001 /*
00002  *  Methods of class Vector related to eta and mu
00003  *
00004  *   (see file vector.h for documentation)
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Eric Gourgoulhon & Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 char vector_divfree_aux[] = "$Header: /cvsroot/Lorene/C++/Source/Tensor/vector_divfree_aux.C,v 1.1 2008/08/27 09:01:27 jl_cornou Exp $" ;
00031 
00032 /*
00033  * $Id: vector_divfree_aux.C,v 1.1 2008/08/27 09:01:27 jl_cornou Exp $
00034  * $Log: vector_divfree_aux.C,v $
00035  * Revision 1.1  2008/08/27 09:01:27  jl_cornou
00036  * Methods for solving Dirac systems for divergence free vectors
00037  *
00038  * Revision 1.1  2005/02/14 13:01:50  j_novak
00039  * p_eta and p_mu are members of the class Vector. Most of associated functions
00040  * have been moved from the class Vector_divfree to the class Vector.
00041  *
00042  *
00043  * $Header: /cvsroot/Lorene/C++/Source/Tensor/vector_divfree_aux.C,v 1.1 2008/08/27 09:01:27 jl_cornou Exp $
00044  *
00045  */
00046 
00047 // C++ headers
00048 #include "headcpp.h"
00049 
00050 // C headers
00051 #include <stdlib.h>
00052 
00053 // Lorene headers
00054 #include "metric.h"
00055 #include "nbr_spx.h"
00056 #include "utilitaires.h"
00057 
00058 // Headers C
00059 #include <stdlib.h>
00060 #include <assert.h>
00061 
00062 // Headers Lorene
00063 #include "tensor.h"
00064 
00065             //----------------//
00066             //  update_etavr  //
00067             //----------------//
00068 
00069 void Vector_divfree::update_etavr() {
00070 
00071     assert(p_A != 0x0) ;
00072 
00073     Scalar eta_tilde(*mp) ;
00074     Scalar vr(*mp) ;
00075     sol_Dirac_A(*p_A, eta_tilde, vr, 0x0) ;
00076 
00077     *cmp[0] = vr ;
00078     p_eta = &eta_tilde ;
00079 
00080     Scalar* p_eta_tmp = p_eta ;  //## in order not to delete p_eta
00081         p_eta = 0x0 ;
00082         Vector::del_deriv() ;
00083     
00084         p_eta = p_eta_tmp ;
00085     
00086 }
00087 
00088             //---------------//
00089             // set_vr_eta_mu //
00090             //---------------//
00091 
00092  void Vector_divfree::set_vr_eta_mu(const Scalar& vr_i, const Scalar& eta_i,
00093                const Scalar& mu_i) {
00094      
00095      // All this has a meaning only for spherical components:
00096      assert( dynamic_cast<const Base_vect_spher*>(triad) != 0x0 ) ; 
00097      assert(&vr_i.get_mp() == &eta_i.get_mp()) ; 
00098  
00099      // V^r
00100      *cmp[0] = vr_i ; 
00101      
00102      p_eta = new Scalar( eta_i ) ;  // eta
00103      
00104      p_mu = new Scalar( mu_i ) ;    // mu 
00105         
00106      update_vtvp() ;
00107  
00108      return ;
00109  }
00110 
00111 
00112             //--------------//
00113             //   set_A_mu   //
00114             //--------------//
00115 
00116 void Vector_divfree::set_A_mu(const Scalar& A_i, const  Scalar& mu_i, const Param* par_bc) {
00117 
00118     // All this has a meaning only for spherical components:
00119     assert( dynamic_cast<const Base_vect_spher*>(triad) != 0x0 ) ; 
00120     assert(&A_i.get_mp() == &mu_i.get_mp()) ; 
00121 
00122     del_deriv() ; 
00123     
00124 
00125     p_A = new Scalar (A_i) ;
00126     p_mu = new Scalar (mu_i) ;
00127     
00128     Scalar eta_tilde(*mp) ;
00129     Scalar vr(*mp) ;
00130     sol_Dirac_A(*p_A, vr, eta_tilde, par_bc) ;
00131     *cmp[0] = vr ;
00132     p_eta = new Scalar(eta_tilde) ;
00133     p_eta->set_dzpuis(2);
00134     
00135 //update_etavr();
00136 //set_vr_eta_mu(*cmp[0], *p_eta, *p_mu) ;
00137     
00138     update_vtvp();  
00139 
00140     return ;
00141 } 
00142 

Generated on Tue Feb 7 01:35:21 2012 for LORENE by  doxygen 1.4.6