| 1 |
/* |
| 2 |
* Plots the coefficients of the functions F_l(theta', phi') and |
| 3 |
* G_l(theta', phi') which define a mapping of the class Map_et. |
| 4 |
* |
| 5 |
* (see file graphique.h for the documentation). |
| 6 |
* |
| 7 |
*/ |
| 8 |
|
| 9 |
/* |
| 10 |
* Copyright (c) 1999-2001 Eric Gourgoulhon |
| 11 |
* |
| 12 |
* This file is part of LORENE. |
| 13 |
* |
| 14 |
* LORENE is free software; you can redistribute it and/or modify |
| 15 |
* it under the terms of the GNU General Public License as published by |
| 16 |
* the Free Software Foundation; either version 2 of the License, or |
| 17 |
* (at your option) any later version. |
| 18 |
* |
| 19 |
* LORENE is distributed in the hope that it will be useful, |
| 20 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
* GNU General Public License for more details. |
| 23 |
* |
| 24 |
* You should have received a copy of the GNU General Public License |
| 25 |
* along with LORENE; if not, write to the Free Software |
| 26 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 27 |
* |
| 28 |
*/ |
| 29 |
|
| 30 |
|
| 31 |
char des_map_et_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_map_et.C,v 1.4 2014/10/13 08:53:22 j_novak Exp $" ; |
| 32 |
|
| 33 |
/* |
| 34 |
* $Id: des_map_et.C,v 1.4 2014/10/13 08:53:22 j_novak Exp $ |
| 35 |
* $Log: des_map_et.C,v $ |
| 36 |
* Revision 1.4 2014/10/13 08:53:22 j_novak |
| 37 |
* Lorene classes and functions now belong to the namespace Lorene. |
| 38 |
* |
| 39 |
* Revision 1.3 2014/10/06 15:16:05 j_novak |
| 40 |
* Modified #include directives to use c++ syntax. |
| 41 |
* |
| 42 |
* Revision 1.2 2008/08/19 06:42:00 j_novak |
| 43 |
* Minor modifications to avoid warnings with gcc 4.3. Most of them concern |
| 44 |
* cast-type operations, and constant strings that must be defined as const char* |
| 45 |
* |
| 46 |
* Revision 1.1.1.1 2001/11/20 15:19:29 e_gourgoulhon |
| 47 |
* LORENE |
| 48 |
* |
| 49 |
* Revision 2.4 2000/11/20 21:43:57 eric |
| 50 |
* Correction erreur affichage k=3 --> k=4 pour G. |
| 51 |
* |
| 52 |
* Revision 1.3 2000/11/14 15:12:27 eric |
| 53 |
* Traitement du cas np=1 |
| 54 |
* |
| 55 |
* Revision 1.2 1999/12/20 14:48:42 eric |
| 56 |
* *** empty log message *** |
| 57 |
* |
| 58 |
* Revision 1.1 1999/12/20 14:27:36 eric |
| 59 |
* Initial revision |
| 60 |
* |
| 61 |
* |
| 62 |
* $Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_map_et.C,v 1.4 2014/10/13 08:53:22 j_novak Exp $ |
| 63 |
* |
| 64 |
*/ |
| 65 |
|
| 66 |
// Header C |
| 67 |
#include <cstdio> |
| 68 |
#include <cstring> |
| 69 |
|
| 70 |
// Headers Lorene |
| 71 |
#include "map.h" |
| 72 |
#include "graphique.h" |
| 73 |
|
| 74 |
namespace Lorene { |
| 75 |
void des_map_et(const Map_et& mp, int lz) { |
| 76 |
|
| 77 |
double pzero = 1.e-14 ; |
| 78 |
|
| 79 |
char nom_zone[3] ; |
| 80 |
sprintf(nom_zone, "%d", lz) ; |
| 81 |
|
| 82 |
char title[50] ; |
| 83 |
char nomy[50] ; |
| 84 |
char nom_k[4] ; |
| 85 |
|
| 86 |
char bslash[2] = {92, '\0'} ; // 92 is the ASCII code for the backslash |
| 87 |
// character |
| 88 |
|
| 89 |
strcpy(nomy, "log(abs( c" ) ; |
| 90 |
strcat(nomy, bslash) ; |
| 91 |
strcat(nomy, "dkj" ) ; |
| 92 |
strcat(nomy, bslash) ; |
| 93 |
strcat(nomy, "u ))" ) ; |
| 94 |
|
| 95 |
const char* device = 0x0 ; |
| 96 |
int newgraph = 1 ; // to open the graphic device |
| 97 |
int nxpage = 2 ; |
| 98 |
int nypage = 2 ; |
| 99 |
|
| 100 |
int np = mp.get_mg()->get_np(lz) ; |
| 101 |
|
| 102 |
int k ; |
| 103 |
if ( (lz == 0) && (np > 1) ) { |
| 104 |
k = 2 ; |
| 105 |
} |
| 106 |
else { |
| 107 |
k = 0 ; |
| 108 |
} |
| 109 |
sprintf(nom_k, "%d", k) ; |
| 110 |
|
| 111 |
strcpy(title, " ") ; |
| 112 |
strcat(title, "Theta coef. of F for k=" ) ; |
| 113 |
strcat(title, nom_k) ; |
| 114 |
strcat(title, " (domain ") ; |
| 115 |
strcat(title, nom_zone) ; |
| 116 |
strcat(title, ")") ; |
| 117 |
|
| 118 |
des_coef_theta(mp.get_ff(), lz, k, 0, pzero, nomy, title, device, |
| 119 |
newgraph, nxpage, nypage) ; |
| 120 |
|
| 121 |
k = 0 ; |
| 122 |
sprintf(nom_k, "%d", k) ; |
| 123 |
strcpy(title, " ") ; |
| 124 |
strcat(title, "Theta coef. of G for k=" ) ; |
| 125 |
strcat(title, nom_k) ; |
| 126 |
strcat(title, " (domain ") ; |
| 127 |
strcat(title, nom_zone) ; |
| 128 |
strcat(title, ")") ; |
| 129 |
|
| 130 |
newgraph = 0 ; // graphic device already opened |
| 131 |
if (np == 1) newgraph = 2 ; |
| 132 |
des_coef_theta(mp.get_gg(), lz, k, 0, pzero, nomy, title, device, |
| 133 |
newgraph, nxpage, nypage) ; |
| 134 |
|
| 135 |
if (np > 1) { |
| 136 |
|
| 137 |
k = (lz == 0) ? 3 : 2 ; |
| 138 |
|
| 139 |
sprintf(nom_k, "%d", k) ; |
| 140 |
|
| 141 |
strcpy(title, " ") ; |
| 142 |
strcat(title, "Theta coef. of F for k=" ) ; |
| 143 |
strcat(title, nom_k) ; |
| 144 |
strcat(title, " (domain ") ; |
| 145 |
strcat(title, nom_zone) ; |
| 146 |
strcat(title, ")") ; |
| 147 |
des_coef_theta(mp.get_ff(), lz, k, 0, pzero, nomy, title, device, |
| 148 |
newgraph, nxpage, nypage) ; |
| 149 |
|
| 150 |
|
| 151 |
k = (lz == 0) ? 4 : 2 ; |
| 152 |
|
| 153 |
sprintf(nom_k, "%d", k) ; |
| 154 |
|
| 155 |
strcpy(title, " ") ; |
| 156 |
strcat(title, "Theta coef. of G for k=" ) ; |
| 157 |
strcat(title, nom_k) ; |
| 158 |
strcat(title, " (domain ") ; |
| 159 |
strcat(title, nom_zone) ; |
| 160 |
strcat(title, ")") ; |
| 161 |
|
| 162 |
newgraph = 2 ; // closes the graphic device |
| 163 |
des_coef_theta(mp.get_gg(), lz, k, 0, pzero, nomy, title, device, |
| 164 |
newgraph, nxpage, nypage) ; |
| 165 |
|
| 166 |
int j = 0 ; |
| 167 |
|
| 168 |
strcpy(title, " ") ; |
| 169 |
strcat(title, "Phi coef. of F for j=0 (domain ") ; |
| 170 |
strcat(title, nom_zone) ; |
| 171 |
strcat(title, ")") ; |
| 172 |
|
| 173 |
newgraph = 1 ; |
| 174 |
nxpage = 2 ; |
| 175 |
nypage = 1 ; |
| 176 |
des_coef_phi(mp.get_ff(), lz, j, 0, pzero, nomy, title, device, |
| 177 |
newgraph, nxpage, nypage) ; |
| 178 |
|
| 179 |
strcpy(title, " ") ; |
| 180 |
strcat(title, "Phi coef. of G for j=0 (domain ") ; |
| 181 |
strcat(title, nom_zone) ; |
| 182 |
strcat(title, ")") ; |
| 183 |
|
| 184 |
newgraph = 2 ; |
| 185 |
des_coef_phi(mp.get_gg(), lz, j, 0, pzero, nomy, title, device, |
| 186 |
newgraph, nxpage, nypage) ; |
| 187 |
|
| 188 |
} |
| 189 |
|
| 190 |
} |
| 191 |
} |