LORENE
des_evolution.C
1/*
2 * Plot of time evolution
3 *
4 * (see file graphique.h for documentation).
5 *
6 */
7
8/*
9 * Copyright (c) 2004 Eric Gourgoulhon.
10 *
11 * This file is part of LORENE.
12 *
13 * LORENE is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2
15 * as published by the Free Software Foundation.
16 *
17 * LORENE is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with LORENE; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 *
26 */
27
28char des_evolution_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_evolution.C,v 1.5 2014/10/13 08:53:22 j_novak Exp $" ;
29
30/*
31 * $Id: des_evolution.C,v 1.5 2014/10/13 08:53:22 j_novak Exp $
32 * $Log: des_evolution.C,v $
33 * Revision 1.5 2014/10/13 08:53:22 j_novak
34 * Lorene classes and functions now belong to the namespace Lorene.
35 *
36 * Revision 1.4 2008/08/19 06:42:00 j_novak
37 * Minor modifications to avoid warnings with gcc 4.3. Most of them concern
38 * cast-type operations, and constant strings that must be defined as const char*
39 *
40 * Revision 1.3 2004/05/20 20:29:31 e_gourgoulhon
41 * Added argument 'device'.
42 *
43 * Revision 1.2 2004/05/11 20:09:47 e_gourgoulhon
44 * Corrected bug when j_min != 0.
45 * Added version of des_evol for plot on the whole Evolution's time range.
46 *
47 * Revision 1.1 2004/02/17 22:16:08 e_gourgoulhon
48 * First version
49 *
50 *
51 * $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_evolution.C,v 1.5 2014/10/13 08:53:22 j_novak Exp $
52 *
53 */
54
55
56// Lorene headers
57#include "graphique.h"
58#include "evolution.h"
59
60// Plot on the whole time range
61//------------------------------
62
63namespace Lorene {
64void des_evol(const Evolution<double>& uu, const char* nomy,
65 const char* title, int ngraph, const char* device,
66 bool closeit, bool show_time, const char* nomx) {
67
68 int jmin = uu.j_min() ;
69 int jmax = uu.j_max() ;
70
71 des_evol(uu, jmin, jmax, nomy, title, ngraph, device, closeit,
72 show_time, nomx) ;
73}
74
75
76// Plot within a specified time range
77//------------------------------------
78
79void des_evol(const Evolution<double>& uu, int j_min, int j_max,
80 const char* nomy, const char* title, int ngraph, const char* device,
81 bool closeit, bool show_time, const char* nomx) {
82
83 // Special case of no graphical output:
84 if (device != 0x0) {
85 if ((device[0] == '/') && (device[1] == 'n')) return ;
86 }
87
88 int npt = j_max - j_min + 1 ;
89
90 float* uutab = new float[npt] ; // Values of uu at the npt points
91 float* xtab = new float[npt] ; // Values of t at the npt points
92
93 for (int j=j_min; j<=j_max; j++) {
94 uutab[j-j_min] = float(uu[j]) ;
95 }
96
97 if (show_time) {
98 for (int j=j_min; j<=j_max; j++) {
99 xtab[j-j_min] = float(uu.get_time(j)) ;
100 }
101 }
102 else{
103 for (int j=j_min; j<=j_max; j++) {
104 xtab[j-j_min] = float(j) ;
105 }
106 }
107
108 if (nomx == 0x0) nomx = (show_time) ? "t" : "j" ;
109
110 if (nomy == 0x0) nomy = "" ;
111
112 if (title == 0x0) title = "" ;
113
114 des_profile_mult(uutab, 1, npt, xtab, nomx, nomy, title, 0x0, ngraph,
115 closeit, device) ;
116
117 delete [] uutab ;
118
119}
120
121}
void des_profile_mult(const float *uutab, int nprof, int nx, float xmin, float xmax, const char *nomx, const char *nomy, const char *title, const int *line_style, int ngraph, bool closeit, const char *device=0x0, int nbound=0, float *xbound=0x0)
Basic routine for drawing multiple profiles with uniform x sampling.
void des_evol(const Evolution< double > &uu, const char *nomy=0x0, const char *title=0x0, int ngraph=0, const char *device=0x0, bool closeit=false, bool show_time=true, const char *nomx=0x0)
Plots the variation of some quantity against time.
Lorene prototypes.
Definition app_hor.h:64