/* * Copyright (c) 2000-2001 Philippe Grandclement * * This file is part of LORENE. * * LORENE is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * LORENE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LORENE; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ char lap_cpt_mat_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/lap_cpt_mat.C,v 1.5 2014/10/13 08:53:29 j_novak Exp $" ; /* * $Id: lap_cpt_mat.C,v 1.5 2014/10/13 08:53:29 j_novak Exp $ * $Log: lap_cpt_mat.C,v $ * Revision 1.5 2014/10/13 08:53:29 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.4 2014/10/06 15:16:08 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.3 2007/06/21 20:06:31 k_taniguchi * nmax increased to 200 * * Revision 1.2 2002/10/16 14:37:11 j_novak * Reorganization of #include instructions of standard C++, in order to * use experimental version 3 of gcc. * * Revision 1.1.1.1 2001/11/20 15:19:28 e_gourgoulhon * LORENE * * Revision 2.0 2000/03/16 16:23:08 phil * *** empty log message *** * * * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/PDE/lap_cpt_mat.C,v 1.5 2014/10/13 08:53:29 j_novak Exp $ * */ //fichiers includes #include #include #include "matrice.h" #include "type_parite.h" #include "proto.h" /* * Routine renvoyant la matrice de l'operateur (1-x^2)*Laplacien f = s * Pour l != 1 le resultat est donne en s est donne en Chebyshev et * f en Gelerkin (T_i + T_{i+1} pour l pair et (2*i+3)T_i + (2*i+1)T_{i+1} pour * l impair. * Pour l=1 pas de probleme de singularite on reste donc en Chebyshev. */ //----------------------------------- // Routine pour les cas non prevus -- //----------------------------------- namespace Lorene { Matrice _lap_cpt_mat_pas_prevu(int n, int l) { cout << "laplacien * (1-r^2/R_0^2) pas prevu..." << endl ; cout << "n : " << n << endl ; cout << "l : " << l << endl ; abort() ; exit(-1) ; Matrice res(1, 1) ; // On ne passe jamais ici de toute facon ! return res; } //------------------------- //-- CAS R_CHEBP ----- //-------------------------- Matrice _lap_cpt_mat_r_chebp (int n, int l) { const int nmax = 200 ;// Nombre de Matrices stockees static Matrice* tab[nmax] ; // les matrices calculees static int nb_dejafait = 0 ; // nbre de matrices calculees static int l_dejafait[nmax] ; static int nr_dejafait[nmax] ; int indice = -1 ; // On determine si la matrice a deja ete calculee : for (int conte=0 ; conte= nmax) { cout << "_laplacien_nul_mat_r_chebp : trop de matrices" << endl ; abort() ; exit (-1) ; } l_dejafait[nb_dejafait] = l ; nr_dejafait[nb_dejafait] = n ; Matrice res(n-1, n-1) ; res.set_etat_qcq() ; double* xdsdx = new double[n] ; double* x2d2sdx2 = new double[n] ; double* d2sdx2 = new double[n] ; double* sxdsdx = new double[n] ; double* sx2 = new double [n] ; for (int i=0 ; i< n-1 ; i++) { for (int j=0 ; j= nmax) { cout << "_laplacien_nul_mat_r_chebp : trop de matrices" << endl ; abort() ; exit (-1) ; } l_dejafait[nb_dejafait] = l ; nr_dejafait[nb_dejafait] = n ; // Non degenere si l = 1 int taille = (l == 1) ? n : n-1 ; Matrice res(taille, taille) ; res.set_etat_qcq() ; double* xdsdx = new double[n] ; double* x2d2sdx2 = new double[n] ; double* d2sdx2 = new double[n] ; double* sxdsdx = new double[n] ; double* sx2 = new double [n] ; int f_un, f_deux ; for (int i=0 ; i> TRA_R] = _lap_cpt_mat_r_chebp ; lap_cpt_mat[R_CHEBI >> TRA_R] = _lap_cpt_mat_r_chebi ; } Matrice res(lap_cpt_mat[base_r](n, l)) ; return res ; } }