des_evolution.C

00001 /*
00002  *  Plot of time evolution
00003  *
00004  *    (see file graphique.h for documentation).
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2004  Eric Gourgoulhon. 
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 des_evolution_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_evolution.C,v 1.4 2008/08/19 06:42:00 j_novak Exp $" ;
00029 
00030 /*
00031  * $Id: des_evolution.C,v 1.4 2008/08/19 06:42:00 j_novak Exp $
00032  * $Log: des_evolution.C,v $
00033  * Revision 1.4  2008/08/19 06:42:00  j_novak
00034  * Minor modifications to avoid warnings with gcc 4.3. Most of them concern
00035  * cast-type operations, and constant strings that must be defined as const char*
00036  *
00037  * Revision 1.3  2004/05/20 20:29:31  e_gourgoulhon
00038  * Added argument 'device'.
00039  *
00040  * Revision 1.2  2004/05/11 20:09:47  e_gourgoulhon
00041  * Corrected bug when j_min != 0.
00042  * Added version of des_evol for plot on the whole Evolution's time range.
00043  *
00044  * Revision 1.1  2004/02/17 22:16:08  e_gourgoulhon
00045  * First version
00046  *
00047  *
00048  * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_evolution.C,v 1.4 2008/08/19 06:42:00 j_novak Exp $
00049  *
00050  */
00051 
00052 
00053 // Lorene headers
00054 #include "graphique.h"
00055 #include "evolution.h"
00056 
00057 // Plot on  the whole time range
00058 //------------------------------
00059 
00060 void des_evol(const Evolution<double>& uu, const char* nomy, 
00061     const char* title, int ngraph, const char* device,
00062     bool closeit, bool show_time, const char* nomx) {
00063     
00064     int jmin = uu.j_min() ; 
00065     int jmax = uu.j_max() ; 
00066 
00067     des_evol(uu, jmin, jmax, nomy, title, ngraph, device, closeit,
00068              show_time, nomx) ; 
00069 }
00070 
00071 
00072 // Plot within a specified time range
00073 //------------------------------------
00074 
00075 void des_evol(const Evolution<double>& uu, int j_min, int j_max, 
00076     const char* nomy, const char* title, int ngraph, const char* device,
00077     bool closeit, bool show_time, const char* nomx) {
00078 
00079     // Special case of no graphical output:
00080     if (device != 0x0) {
00081         if ((device[0] == '/') && (device[1] == 'n')) return ; 
00082     }
00083 
00084     int npt = j_max - j_min + 1 ; 
00085 
00086     float* uutab = new float[npt] ;     // Values of uu at the npt points
00087     float* xtab = new float[npt] ;      // Values of t at the npt points
00088     
00089     for (int j=j_min; j<=j_max; j++) {
00090     uutab[j-j_min] = float(uu[j]) ; 
00091     }
00092 
00093     if (show_time) {
00094         for (int j=j_min; j<=j_max; j++) {
00095             xtab[j-j_min] = float(uu.get_time(j)) ; 
00096         }
00097     }
00098     else{
00099         for (int j=j_min; j<=j_max; j++) {
00100             xtab[j-j_min] = float(j) ; 
00101         }
00102     }
00103         
00104     if (nomx == 0x0) nomx = (show_time) ? "t" : "j" ;
00105 
00106     if (nomy == 0x0) nomy = "" ;
00107 
00108     if (title == 0x0) title = "" ;
00109    
00110     des_profile_mult(uutab, 1, npt, xtab, nomx, nomy, title, 0x0, ngraph,
00111         closeit, device) ; 
00112     
00113     delete [] uutab ; 
00114     
00115 }
00116 

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