| 1 |
/* |
| 2 |
* Method of the class Map_et to compute the rescale of the outermost domain |
| 3 |
* in the case of non-compactified external domain. |
| 4 |
* |
| 5 |
* (see file map.h for documentation). |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
/* |
| 10 |
* Copyright (c) 2004 Keisuke Taniguchi |
| 11 |
* |
| 12 |
* This file is part of LORENE. |
| 13 |
* |
| 14 |
* LORENE is free software; you can redistribute it and/or modify |
| 15 |
* it under the terms of the GNU General Public License version 2 |
| 16 |
* as published by the Free Software Foundation. |
| 17 |
* |
| 18 |
* LORENE is distributed in the hope that it will be useful, |
| 19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 |
* GNU General Public License for more details. |
| 22 |
* |
| 23 |
* You should have received a copy of the GNU General Public License |
| 24 |
* along with LORENE; if not, write to the Free Software |
| 25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 26 |
* |
| 27 |
*/ |
| 28 |
|
| 29 |
char map_et_resize_extr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Map/map_et_resize_extr.C,v 1.3 2014/10/13 08:53:05 j_novak Exp $" ; |
| 30 |
|
| 31 |
/* |
| 32 |
* $Id: map_et_resize_extr.C,v 1.3 2014/10/13 08:53:05 j_novak Exp $ |
| 33 |
* $Log: map_et_resize_extr.C,v $ |
| 34 |
* Revision 1.3 2014/10/13 08:53:05 j_novak |
| 35 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 36 |
* |
| 37 |
* Revision 1.2 2014/10/06 15:13:13 j_novak |
| 38 |
* Modified #include directives to use c++ syntax. |
| 39 |
* |
| 40 |
* Revision 1.1 2004/11/30 20:54:24 k_taniguchi |
| 41 |
* *** empty log message *** |
| 42 |
* |
| 43 |
* |
| 44 |
* $Header: /cvsroot/Lorene/C++/Source/Map/map_et_resize_extr.C,v 1.3 2014/10/13 08:53:05 j_novak Exp $ |
| 45 |
* |
| 46 |
*/ |
| 47 |
|
| 48 |
// C headers |
| 49 |
#include <cassert> |
| 50 |
|
| 51 |
// Lorene headers |
| 52 |
#include "map.h" |
| 53 |
|
| 54 |
namespace Lorene { |
| 55 |
void Map_et::resize_extr(double lambda) { |
| 56 |
|
| 57 |
// Protections |
| 58 |
// ----------- |
| 59 |
int l = mg->get_nzone() - 1 ; |
| 60 |
|
| 61 |
if (mg->get_type_r(l) != FIN) { |
| 62 |
cout << "Map_et::resize_extr can be applied only to a shell !" |
| 63 |
<< endl ; |
| 64 |
abort() ; |
| 65 |
} |
| 66 |
|
| 67 |
// Assertion |
| 68 |
// --------- |
| 69 |
assert(mg->get_nzone() >= 3) ; // The outermost domain should be |
| 70 |
// a spherical shell in this method. |
| 71 |
|
| 72 |
// New values of alpha and beta in the outermost domain : |
| 73 |
// ---------------------------------------------------- |
| 74 |
double n_alpha = 0.5 * ( (lambda + 1.) * alpha[l] |
| 75 |
+ (lambda - 1.) * beta[l] ) ; |
| 76 |
|
| 77 |
double n_beta = 0.5 * ( (lambda - 1.) * alpha[l] |
| 78 |
+ (lambda + 1.) * beta[l] ) ; |
| 79 |
|
| 80 |
alpha[l] = n_alpha ; |
| 81 |
beta[l] = n_beta ; |
| 82 |
|
| 83 |
// The coords are no longer up to date : |
| 84 |
reset_coord() ; |
| 85 |
|
| 86 |
} |
| 87 |
} |