diff.C

00001 /*
00002  *  Methods for the Diff class.
00003  *
00004  *    (see file diff.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2005 Jerome Novak
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License version 2
00015  *   as published by the Free Software Foundation.
00016  *
00017  *   LORENE is distributed in the hope that it will be useful,
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *   GNU General Public License for more details.
00021  *
00022  *   You should have received a copy of the GNU General Public License
00023  *   along with LORENE; if not, write to the Free Software
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025  *
00026  */
00027 
00028 char diff_C[] = "$Header: /cvsroot/Lorene/C++/Source/Diff/diff.C,v 1.3 2007/12/11 15:28:11 jl_cornou Exp $" ;
00029 
00030 /*
00031  * $Id: diff.C,v 1.3 2007/12/11 15:28:11 jl_cornou Exp $
00032  * $Log: diff.C,v $
00033  * Revision 1.3  2007/12/11 15:28:11  jl_cornou
00034  * Jacobi(0,2) polynomials partially implemented
00035  *
00036  * Revision 1.2  2005/02/09 09:53:24  j_novak
00037  * Removed irrelevant asserts on number of points.
00038  *
00039  * Revision 1.1  2005/01/10 16:34:52  j_novak
00040  * New class for 1D mono-domain differential operators.
00041  *
00042  *
00043  * $Header: /cvsroot/Lorene/C++/Source/Diff/diff.C,v 1.3 2007/12/11 15:28:11 jl_cornou Exp $
00044  *
00045  */
00046 
00047 // C headers
00048 #include <assert.h>
00049 
00050 // Lorene headers
00051 #include "diff.h"
00052 
00053 
00054 Diff::Diff(int base_r, int nr) : base(base_r >> TRA_R), npoints(nr) {
00055 
00056     assert (base < MAX_BASE) ;
00057 
00058 }
00059 
00060 Diff::Diff(const Diff& diff_in) : base(diff_in.base), 
00061                   npoints(diff_in.npoints) {
00062     assert (base < MAX_BASE) ;
00063 
00064 }    
00065 
00066 Diff::~Diff() {}
00067 
00068 void Diff::operator=(const Diff& diff_in) {
00069 
00070     base = diff_in.base ;
00071     npoints = diff_in.npoints ;
00072     assert (base < MAX_BASE) ;
00073 
00074 }
00075 
00076 ostream& operator<<(ostream& ost, const Diff& ope) {
00077 
00078     ost << "Differential operator : " ;
00079     
00080     ope >> ost ;
00081 
00082     ost << "Radial base: " ;
00083 
00084     switch (ope.base) {
00085 
00086     case R_CHEB >> TRA_R :
00087         ost << "Chebyshev polynomials (R_CHEB)"  ;
00088         break ;
00089 
00090     case R_JACO02 >> TRA_R :
00091         ost << "Jacobi(0,2) polynomials (R_JACO02)" ;
00092         break ;
00093 
00094     case R_CHEBP >> TRA_R :
00095         ost << "Even Chebyshev polynomials (R_CHEBP)" ;
00096         break ;
00097 
00098     case R_CHEBI >> TRA_R :
00099         ost << "Odd Chebyshev polynomials (R_CHEBI)"  ;
00100         break ;
00101 
00102     case R_CHEBU >> TRA_R :
00103         ost << "Chebyshev polynomials / compactified domain (R_CHEBU)" ;
00104         break ;
00105 
00106     default:
00107         ost << "unknown!" << endl ;
00108     }
00109 
00110     ost << " with " << ope.npoints << " coefficients." << endl ;
00111     ost << endl ;
00112 
00113     return ost ;
00114 }

Generated on Tue Feb 7 01:35:16 2012 for LORENE by  doxygen 1.4.6