| 1 |
/* |
| 2 |
* Copyright (c) 1999-2001 Eric Gourgoulhon |
| 3 |
* |
| 4 |
* This file is part of LORENE. |
| 5 |
* |
| 6 |
* LORENE is free software; you can redistribute it and/or modify |
| 7 |
* it under the terms of the GNU General Public License as published by |
| 8 |
* the Free Software Foundation; either version 2 of the License, or |
| 9 |
* (at your option) any later version. |
| 10 |
* |
| 11 |
* LORENE is distributed in the hope that it will be useful, |
| 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
* GNU General Public License for more details. |
| 15 |
* |
| 16 |
* You should have received a copy of the GNU General Public License |
| 17 |
* along with LORENE; if not, write to the Free Software |
| 18 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
|
| 23 |
char op_mult_xm1_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_mult_xm1.C,v 1.2 2014/10/13 08:53:26 j_novak Exp $" ; |
| 24 |
|
| 25 |
/* |
| 26 |
* $Id: op_mult_xm1.C,v 1.2 2014/10/13 08:53:26 j_novak Exp $ |
| 27 |
* $Log: op_mult_xm1.C,v $ |
| 28 |
* Revision 1.2 2014/10/13 08:53:26 j_novak |
| 29 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 30 |
* |
| 31 |
* Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon |
| 32 |
* LORENE |
| 33 |
* |
| 34 |
* Revision 2.2 1999/11/15 16:38:48 eric |
| 35 |
* Tbl::dim est desormais un Dim_tbl et non plus un Dim_tbl*. |
| 36 |
* |
| 37 |
* Revision 2.1 1999/04/26 16:19:38 phil |
| 38 |
* changement commentaire |
| 39 |
* |
| 40 |
* Revision 2.0 1999/04/26 16:16:24 phil |
| 41 |
* *** empty log message *** |
| 42 |
* |
| 43 |
* |
| 44 |
* $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_mult_xm1.C,v 1.2 2014/10/13 08:53:26 j_novak Exp $ |
| 45 |
* |
| 46 |
*/ |
| 47 |
|
| 48 |
/* |
| 49 |
* Ensemble des routines de base pour l'operateur (x-1) Id |
| 50 |
* (Utilisation interne) |
| 51 |
* |
| 52 |
* Prototype : |
| 53 |
* --------- |
| 54 |
* void _mult_xm1_XXXX(Tbl * tb, int& base) |
| 55 |
* |
| 56 |
* Entree/Sortie : |
| 57 |
* ------------- |
| 58 |
* tb pointeur sur le Tbl d'entree-sortie |
| 59 |
* |
| 60 |
* Entree : |
| 61 |
* ------ |
| 62 |
* base base de travail |
| 63 |
* |
| 64 |
*/ |
| 65 |
|
| 66 |
|
| 67 |
//Lorene |
| 68 |
#include "tbl.h" |
| 69 |
#include "type_parite.h" |
| 70 |
|
| 71 |
// Prototypage |
| 72 |
#include "proto.h" |
| 73 |
|
| 74 |
|
| 75 |
//------------------------------------ |
| 76 |
// Routine qui ne fait rien --- |
| 77 |
//------------------------------------ |
| 78 |
|
| 79 |
namespace Lorene { |
| 80 |
void _mult_xm1_identite(Tbl* , int& ) { |
| 81 |
return ; |
| 82 |
} |
| 83 |
|
| 84 |
//------------------------- |
| 85 |
// cas R_CHEB et R_CHEBU -- |
| 86 |
//------------------------- |
| 87 |
|
| 88 |
void _mult_xm1_cheb(Tbl *tb, int& ) |
| 89 |
{ |
| 90 |
|
| 91 |
// Peut-etre rien a faire ? |
| 92 |
if (tb->get_etat() == ETATZERO) { |
| 93 |
return ; |
| 94 |
} |
| 95 |
|
| 96 |
// Pour le confort |
| 97 |
int nr = (tb->dim).dim[0] ; // Nombre |
| 98 |
int nt = (tb->dim).dim[1] ; // de points |
| 99 |
int np = (tb->dim).dim[2] ; // physiques REELS |
| 100 |
np = np - 2 ; // Nombre de points physiques |
| 101 |
|
| 102 |
int ntnr = nt*nr ; |
| 103 |
|
| 104 |
double* trav = new double[nr] ; |
| 105 |
|
| 106 |
int k, j, i ; |
| 107 |
for (k=0 ; k<np+1 ; k++) { |
| 108 |
if (k==1) continue ; // On ne traite pas le coefficient de sin(0*phi) |
| 109 |
for (j=0 ; j<nt ; j++) { |
| 110 |
|
| 111 |
double* cf = tb->t + k*ntnr + j*nr ; |
| 112 |
|
| 113 |
mult_xm1_1d_cheb(nr, cf, trav) ; // multiplication par (x-1) |
| 114 |
|
| 115 |
for (i=0; i<nr; i++) { |
| 116 |
cf[i] = trav[i] ; |
| 117 |
} |
| 118 |
|
| 119 |
} // Fin de la boucle sur theta |
| 120 |
} // Fin de la boucle sur phi |
| 121 |
|
| 122 |
delete [] trav ; |
| 123 |
|
| 124 |
// base de developpement |
| 125 |
// inchangee |
| 126 |
} |
| 127 |
|
| 128 |
} |