/* * Methods of class Mg3d * */ /* * Copyright (c) 1999-2000 Jean-Alain Marck * Copyright (c) 1999-2001 Eric Gourgoulhon * * 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 mg3d_C[] = "$Header: /cvsroot/Lorene/C++/Source/Mg3d/mg3d.C,v 1.18 2014/10/13 08:53:07 j_novak Exp $" ; /* * $Id: mg3d.C,v 1.18 2014/10/13 08:53:07 j_novak Exp $ * $Log: mg3d.C,v $ * Revision 1.18 2014/10/13 08:53:07 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.17 2014/10/06 15:13:14 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.16 2013/06/05 15:00:26 j_novak * Suppression of all classes derived from Grille3d. Now Grille3d is no * longer an abstract class. r-samplings are only one of RARE, FIN or * UNSURR (FINJAC has been removed). Instead, Mg3d possesses a new member * colloc_r[nzone] defining the type of collocation points (spectral * bases) in each domain. * * Revision 1.15 2012/01/17 10:37:42 j_penner * added a constructor that treats all domains as type FIN * * Revision 1.14 2008/08/19 06:42:00 j_novak * Minor modifications to avoid warnings with gcc 4.3. Most of them concern * cast-type operations, and constant strings that must be defined as const char* * * Revision 1.13 2007/12/11 15:28:15 jl_cornou * Jacobi(0,2) polynomials partially implemented * * Revision 1.12 2006/05/17 13:17:03 j_novak * New member g_angu_1dom, the one-domain angular grid associated with the * current grid. * * Revision 1.11 2005/10/07 08:47:21 j_novak * Addition of the pointer g_non_axi on a grid, with at least 5 points in the * theta direction and 4 in the phi one (for tensor rotations). * * Revision 1.10 2004/07/06 13:36:29 j_novak * Added methods for desaliased product (operator |) only in r direction. * * Revision 1.9 2003/10/27 16:21:54 e_gourgoulhon * Treated the special case nz=1 in the simplified constructor. * * Revision 1.8 2003/06/20 14:50:15 f_limousin * Add the operator== * * Revision 1.7 2003/06/18 08:45:27 j_novak * In class Mg3d: added the member get_radial, returning only a radial grid * For dAlembert solver: the way the coefficients of the operator are defined has been changed. * * Revision 1.6 2002/10/16 14:36:42 j_novak * Reorganization of #include instructions of standard C++, in order to * use experimental version 3 of gcc. * * Revision 1.5 2002/05/07 07:36:03 e_gourgoulhon * Compatibilty with xlC compiler on IBM SP2: * suppressed the parentheses around argument of instruction new: * e.g. t = new (Tbl *[nzone]) --> t = new Tbl*[nzone] * * Revision 1.4 2001/12/12 09:23:46 e_gourgoulhon * Parameter compact added to the simplified constructor of class Mg3d * * Revision 1.3 2001/12/11 06:48:30 e_gourgoulhon * Addition of the simplified constructor * * Revision 1.2 2001/12/04 21:27:54 e_gourgoulhon * * All writing/reading to a binary file are now performed according to * the big endian convention, whatever the system is big endian or * small endian, thanks to the functions fwrite_be and fread_be * * Revision 1.1.1.1 2001/11/20 15:19:27 e_gourgoulhon * LORENE * * Revision 2.10 2001/05/26 14:50:46 eric * *** empty log message *** * * Revision 2.9 2001/05/26 13:25:59 eric * Ajout du membre g_twice (grille double pour le desaliasing) * Modif de la declaration de g_angu (pointeur mutable) * g_twice et g_angu ne sont calcules que si necessaire (cad si * on appelle la fonction get_twice() ou get_angu()). * * Revision 2.8 2000/03/22 13:38:51 eric * Remplacement des iendl par endl dans << * * Revision 2.7 1999/10/12 15:04:29 eric * *** empty log message *** * * Revision 2.6 1999/10/12 15:03:30 eric * *** empty log message *** * * Revision 2.5 1999/09/30 14:58:16 eric * Operator!= declare const * * Revision 2.4 1999/09/30 14:12:04 eric * sauve declaree const. * * Revision 2.3 1999/09/30 12:52:52 eric * Depoussierage. * Documentation. * * Revision 2.2 1999/03/01 14:35:21 eric * Modif affichage (operator<<) * * * $Header: /cvsroot/Lorene/C++/Source/Mg3d/mg3d.C,v 1.18 2014/10/13 08:53:07 j_novak Exp $ * */ // C Headers #include #include // Lorene headers #include "grilles.h" #include "type_parite.h" #include "utilitaires.h" //--------------// // Multi-grille // //--------------// //============================================================================= // General constructor //============================================================================= namespace Lorene { Mg3d::Mg3d(int nz, int nbr[], int typr[], int nbt[], int typt, int nbp[], int typp, int* base_r) : nzone(nz), type_t(typt), type_p(typp) { // Type d'echantillonnage dans chaque zone type_r = new int[nz]; colloc_r = new int[nz] ; bool cheb = (base_r == 0x0) ; for (int i=0 ; i 1) { if (compact) { type_r[nz-1] = UNSURR ; colloc_r[nz-1] = BASE_CHEB ; } else { type_r[nz-1] = FIN ; colloc_r[nz-1] = leg ? BASE_LEG : BASE_CHEB ; } } // Same number of points in all domains: nr = new int[nz]; nt = new int[nz]; np = new int[nz]; for (int l=0 ; l