Debian Codegraph @

School05/Thursday/Sol_one_grid/sphere.C

raw
1 #include "type_parite.h"
2 #include "nbr_spx.h"
3 #include "grilles.h"
4 #include "map.h"
5 #include "graphique.h"
6 #include "monopole.h"
7 #include "utilitaires.h"
8
9 int main() {
10
11 // THE GRID
12 int nz = 4 ;
13 int nt = 1 ;
14 int np = 1 ;
15 int nr = 33 ;
16 int typet = SYM ;
17 int typep = SYM ;
18
19 bool compact = true ;
20 Mg3d grid (nz, nr, nt, np, typet, typep, compact) ;
21
22 // THE MAPPING AFFINE
23 double r_lim = 1. ;
24 double* bounds = new double[nz+1] ;
25
26 bounds[0] = 0 ;
27 bounds[1] = r_lim ;
28 for (int i=2 ; i<nz ; i++)
29 bounds[i] = 2*bounds[i-1] ;
30 bounds[nz] = __infinity ;
31
32 Map_af mp (grid, bounds) ;
33 delete [] bounds ;
34
35 double beta ;
36 cout << "Beta ? " << endl ;
37 cin >> beta ;
38
39 // The Monopole :
40 double precis = 1e-10 ;
41 int itemax = 200 ;
42 double relax = 0.5 ;
43
44 Monopole champs(mp, beta) ;
45 champs.solve_config(precis, itemax, relax) ;
46
47 cout << "Parameter a = " << champs.give_a() << endl ;
48 cout << "Parameter b = " << champs.give_b() << endl ;
49
50 // Some plots
51
52 des_profile (champs.get_big_W(), 0, 5, 0, 0, "W") ;
53 des_profile (champs.get_small_w(), 0, 5, 0, 0, "w") ;
54 des_profile (champs.get_big_H(), 0, 5, 0, 0, "H") ;
55 des_profile (champs.get_small_h(), 0, 5, 0, 0, "h") ;
56
57 return 0 ;
58 }