/* * Computation of primitive in a single domain * * */ /* * Copyright (c) 2004 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 version 2 * as published by the Free Software Foundation. * * 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 op_primr_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_primr.C,v 1.10 2014/10/13 08:53:26 j_novak Exp $" ; /* * $Id: op_primr.C,v 1.10 2014/10/13 08:53:26 j_novak Exp $ * $Log: op_primr.C,v $ * Revision 1.10 2014/10/13 08:53:26 j_novak * Lorene classes and functions now belong to the namespace Lorene. * * Revision 1.9 2014/10/06 15:16:06 j_novak * Modified #include directives to use c++ syntax. * * Revision 1.8 2013/04/25 15:46:06 j_novak * Added special treatment in the case np = 1, for type_p = NONSYM. * * Revision 1.7 2007/12/21 13:59:02 j_novak * Suppression of call to pow(-1, something). * * Revision 1.6 2007/12/11 15:28:18 jl_cornou * Jacobi(0,2) polynomials partially implemented * * Revision 1.5 2006/05/17 15:01:16 j_novak * Treatment of the case nr = 1 and R_CHEB * * Revision 1.4 2004/11/23 15:16:01 m_forot * * Added the bases for the cases without any equatorial symmetry * (T_COSSIN_C, T_COSSIN_S, T_LEG, R_CHEBPI_P, R_CHEBPI_I). * * Revision 1.3 2004/10/12 09:58:24 j_novak * Better memory management. * * Revision 1.2 2004/06/14 15:24:57 e_gourgoulhon * First operationnal version (tested). * * Revision 1.1 2004/06/13 21:33:13 e_gourgoulhon * First version. * * * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Operators/op_primr.C,v 1.10 2014/10/13 08:53:26 j_novak Exp $ * */ // C headers #include #include // Lorene headers #include "tbl.h" // Unexpected case //---------------- namespace Lorene { void _primr_pas_prevu(const Tbl&, int bin, const Tbl&, Tbl&, int&, Tbl& ) { cout << "Unexpected basis in primr : basis = " << hex << bin << endl ; abort() ; } // case R_CHEB //------------ void _primr_r_cheb(const Tbl& tin, int bin, const Tbl& valm1, Tbl& tout, int& bout, Tbl& valp1) { assert(tin.dim == tout.dim) ; // Output spectral basis bout = bin ; // Number of coefficients int nr = tin.get_dim(0) ; int nt = tin.get_dim(1) ; int np = tin.get_dim(2) - 2 ; int borne_phi = np + 1 ; if (np == 1) borne_phi = 1 ; // Case of a zero input or pure angular grid // ----------------------------------------- if ((tin.get_etat() == ETATZERO)||(nr == 1)) { if (valm1.get_etat() == ETATZERO) { tout.set_etat_zero() ; valp1.set_etat_zero() ; return ; } else { assert(valm1.get_etat() == ETATQCQ) ; tout.set_etat_qcq() ; valp1.set_etat_qcq() ; double* xco = tout.t ; for (int k=0 ; k< borne_phi ; k++) { if (k==1) { // jump over the coefficient of sin(0*phi) xco += nr*nt ; } else { for (int j=0 ; j