binhor_viriel.C

00001 /*
00002  *   Copyright (c) 2005 Francois Limousin
00003  *                      Jose Luis Jaramillo
00004  *
00005  *   This file is part of LORENE.
00006  *
00007  *   LORENE is free software; you can redistribute it and/or modify
00008  *   it under the terms of the GNU General Public License as published by
00009  *   the Free Software Foundation; either version 2 of the License, or
00010  *   (at your option) any later version.
00011  *
00012  *   LORENE is distributed in the hope that it will be useful,
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *   GNU General Public License for more details.
00016  *
00017  *   You should have received a copy of the GNU General Public License
00018  *   along with LORENE; if not, write to the Free Software
00019  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 
00024 char binhor_viriel_C[] = "$Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_viriel.C,v 1.3 2007/04/13 15:28:55 f_limousin Exp $" ;
00025 
00026 /*
00027  * $Id: binhor_viriel.C,v 1.3 2007/04/13 15:28:55 f_limousin Exp $
00028  * $Log: binhor_viriel.C,v $
00029  * Revision 1.3  2007/04/13 15:28:55  f_limousin
00030  * Lots of improvements, generalisation to an arbitrary state of
00031  * rotation, implementation of the spatial metric given by Samaya.
00032  *
00033  * Revision 1.2  2005/04/08 12:35:07  f_limousin
00034  * Just to avoid warnings...
00035  *
00036  * Revision 1.1  2005/02/11 18:22:06  f_limousin
00037  * First version
00038  *
00039  *
00040  * $Header: /cvsroot/Lorene/C++/Source/Bin_hor/binhor_viriel.C,v 1.3 2007/04/13 15:28:55 f_limousin Exp $
00041  *
00042  */
00043 
00044 #include<math.h>
00045 
00046 // Lorene
00047 #include "tensor.h"
00048 #include "isol_hor.h"
00049 
00050 double Single_hor::viriel_seul () const{
00051     
00052     int nz1 = mp.get_mg()->get_nzone() ;
00053         
00054     Valeur** devel_psi (psi_auto.asymptot(1)) ;
00055     Valeur** devel_n (n_auto.asymptot(1)) ;
00056     
00057     double erreur = (2*(*devel_psi[1])(nz1-1, 0, 0, 0)
00058     + (*devel_n[1])(nz1-1, 0, 0, 0))/fabs ((*devel_n[1])(nz1-1, 0, 0, 0)) ;
00059     
00060    return erreur ;
00061 }
00062 
00063 
00064 double Bin_hor::viriel () const{
00065     
00066     int nz_un = hole1.mp.get_mg()->get_nzone() ;
00067     int nz_deux = hole2.mp.get_mg()->get_nzone() ;
00068     
00069     Valeur** devel_psi_un (hole1.psi_auto.asymptot(1)) ;
00070     Valeur** devel_psi_deux (hole2.psi_auto.asymptot(1)) ;
00071     Valeur** devel_n_un (hole1.n_auto.asymptot(1)) ;
00072     Valeur** devel_n_deux (hole2.n_auto.asymptot(1)) ;
00073     
00074     double res = 
00075     (2*(*devel_psi_un[1])(nz_un-1, 0, 0, 0)+
00076         2*(*devel_psi_deux[1])(nz_deux-1, 0, 0, 0)+
00077         (*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
00078         (*devel_n_un[1])(nz_un-1, 0, 0, 0))
00079     / fabs ((*devel_n_deux[1])(nz_deux-1, 0, 0, 0) +
00080         (*devel_n_un[1])(nz_un-1, 0, 0, 0)) ;
00081     
00082     return res ;
00083 }
00084 

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