map_et_resize_extr.C

00001 /*
00002  *  Method of the class Map_et to compute the rescale of the outermost domain
00003  *  in the case of non-compactified external domain.
00004  *
00005  *    (see file map.h for documentation).
00006  *
00007  */
00008 
00009 /*
00010  *   Copyright (c) 2004 Keisuke Taniguchi
00011  *
00012  *   This file is part of LORENE.
00013  *
00014  *   LORENE is free software; you can redistribute it and/or modify
00015  *   it under the terms of the GNU General Public License version 2
00016  *   as published by the Free Software Foundation.
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 char map_et_resize_extr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_et_resize_extr.C,v 1.1 2004/11/30 20:54:24 k_taniguchi Exp $" ;
00030 
00031 /*
00032  * $Id: map_et_resize_extr.C,v 1.1 2004/11/30 20:54:24 k_taniguchi Exp $
00033  * $Log: map_et_resize_extr.C,v $
00034  * Revision 1.1  2004/11/30 20:54:24  k_taniguchi
00035  * *** empty log message ***
00036  *
00037  *
00038  * $Header: /cvsroot/Lorene/C++/Source/Map/map_et_resize_extr.C,v 1.1 2004/11/30 20:54:24 k_taniguchi Exp $
00039  *
00040  */
00041 
00042 // C headers
00043 #include <assert.h>
00044 
00045 // Lorene headers
00046 #include "map.h"
00047 
00048 void Map_et::resize_extr(double lambda) {
00049 
00050     // Protections
00051     // -----------
00052     int l = mg->get_nzone() - 1 ;
00053 
00054     if (mg->get_type_r(l) != FIN) {
00055         cout << "Map_et::resize_extr can be applied only to a shell !"
00056          << endl ;
00057     abort() ;
00058     }
00059 
00060     // Assertion
00061     // ---------
00062     assert(mg->get_nzone() >= 3) ;  // The outermost domain should be
00063                                     //  a spherical shell in this method.
00064 
00065     // New values of alpha and beta in the outermost domain :
00066     // ----------------------------------------------------
00067     double n_alpha = 0.5 * ( (lambda + 1.) * alpha[l]
00068                  + (lambda - 1.) * beta[l] ) ;
00069 
00070     double n_beta = 0.5 * ( (lambda - 1.) * alpha[l]
00071                 + (lambda + 1.) * beta[l] ) ;
00072 
00073     alpha[l] = n_alpha ;
00074     beta[l] = n_beta ;
00075 
00076     // The coords are no longer up to date :
00077     reset_coord() ;
00078 
00079 }

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