ESTER
Evolution STEllaire en Rotation
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
numdiff.h
Go to the documentation of this file.
1 #ifndef _NUMDIFF_H
2 #define _NUMDIFF_H
3 
4 #include "ester-config.h"
5 
6 #include "matrix.h"
7 
16 class diff_gl {
17  int ndom,Ntot;
18  void init_1();
19  public:
22  int *npts;
23  double *xif;
24  const int &ndomains,&N;
25 
26  explicit diff_gl(int n=1);
27  ~diff_gl();
28  diff_gl(const diff_gl &);
29  diff_gl &operator=(const diff_gl &);
30  void set_ndomains(int n);
31  void set_xif(double,...);
32  void set_npts(int,...);
33  void init();
34  matrix eval(const matrix &y,const matrix &x,matrix &T) const;
35  matrix eval(const matrix &y,const matrix &x) const;
36  matrix eval(const matrix &y,double x) const;
37  matrix eval(const matrix &y,double x,matrix &T) const;
38 };
39 
48 class diff_leg {
49  matrix Pn(int n,matrix x);
50  matrix dPn(int n,matrix x,matrix p);
51  matrix nodes(int n,matrix &w);
52  public:
53  int npts;
62 
63  diff_leg();
64  ~diff_leg();
65  diff_leg(const diff_leg &);
66  diff_leg &operator=(const diff_leg &);
67  void init();
68  matrix eval_00(const matrix &y,const matrix &thi,matrix &T) const;
69  matrix eval_00(const matrix &y,const matrix &thi) const;
70  matrix eval_00(const matrix &y,double thi) const;
71  matrix eval_00(const matrix &y,double thi,matrix &T) const;
72  matrix eval_01(const matrix &y,const matrix &thi,matrix &T) const;
73  matrix eval_01(const matrix &y,const matrix &thi) const;
74  matrix eval_01(const matrix &y,double thi) const;
75  matrix eval_01(const matrix &y,double thi,matrix &T) const;
76  matrix eval_10(const matrix &y,const matrix &thi,matrix &T) const;
77  matrix eval_10(const matrix &y,const matrix &thi) const;
78  matrix eval_10(const matrix &y,double thi) const;
79  matrix eval_10(const matrix &y,double thi,matrix &T) const;
80  matrix eval_11(const matrix &y,const matrix &thi,matrix &T) const;
81  matrix eval_11(const matrix &y,const matrix &thi) const;
82  matrix eval_11(const matrix &y,double thi) const;
83  matrix eval_11(const matrix &y,double thi,matrix &T) const;
84  matrix eval(const matrix &y,const matrix &thi,matrix &T,int par_pol,int par_eq) const;
85  inline matrix eval(const matrix &y,double thi,matrix &T,int par_pol,int par_eq) const
86  {return eval(y,thi*ones(1,1),T,par_pol,par_eq);}
87  matrix l_00() const;
88  matrix l_01() const;
89  matrix l_10() const;
90  matrix l_11() const;
91 
92 };
93 
94 
95 
96 /*
97 Example:
98 
99 diff_gl gl(3); //Equivalent to: diff_gl gl; gl.set_ndomains(3);
100 gl.set_npts(10,20,15);
101 gl.set_xif(0.,0.2,1.,1.5);
102 gl.init();
103 
104 diff_leg leg;
105 
106 leg.npts=50;
107 leg.init();
108 
109 
110 */
111 
112 
113 
114 #endif
matrix P_00
Definition: numdiff.h:55
diff_gl & operator=(const diff_gl &)
Definition: diff_gl.cpp:40
matrix lap_00
Definition: numdiff.h:61
const int & N
Definition: numdiff.h:24
matrix eval_00(const matrix &y, const matrix &thi, matrix &T) const
Definition: diff_leg.cpp:345
matrix eval_01(const matrix &y, const matrix &thi, matrix &T) const
Definition: diff_leg.cpp:351
diff_leg()
Definition: diff_leg.cpp:14
void set_ndomains(int n)
Definition: diff_gl.cpp:59
matrix eval(const matrix &y, const matrix &thi, matrix &T, int par_pol, int par_eq) const
Definition: diff_leg.cpp:369
matrix lap_11
Definition: numdiff.h:61
matrix P_11
Definition: numdiff.h:55
matrix l_11() const
Definition: diff_leg.cpp:454
matrix D2_10
Definition: numdiff.h:59
matrix l_00() const
Definition: diff_leg.cpp:436
matrix D_01
Definition: numdiff.h:58
matrix eval(const matrix &y, const matrix &x, matrix &T) const
Definition: diff_gl.cpp:186
matrix D2_11
Definition: numdiff.h:59
The matrix class is used to facilitate the work with regular dense matrices.
Definition: matrix.h:9
matrix_block_diag P1
Definition: numdiff.h:21
The matrix_block_diag class is used to store block diagonal matrices.
Definition: matrix.h:202
matrix D2_01
Definition: numdiff.h:59
matrix dP1_01
Definition: numdiff.h:57
int Ntot
Definition: numdiff.h:17
double * xif
Definition: numdiff.h:23
matrix P1_01
Definition: numdiff.h:56
matrix lap_01
Definition: numdiff.h:61
int ndom
Definition: numdiff.h:17
void init()
Definition: diff_leg.cpp:145
matrix P1_10
Definition: numdiff.h:56
matrix eval_11(const matrix &y, const matrix &thi, matrix &T) const
Definition: diff_leg.cpp:363
matrix D_10
Definition: numdiff.h:58
matrix ones(int nfil, int ncol)
Definition: matrix.cpp:1337
matrix D_00
Definition: numdiff.h:58
matrix nodes(int n, matrix &w)
Definition: diff_leg.cpp:116
void init()
Definition: diff_gl.cpp:95
matrix Pn(int n, matrix x)
Definition: diff_leg.cpp:68
matrix D_11
Definition: numdiff.h:58
diff_leg & operator=(const diff_leg &)
Definition: diff_leg.cpp:35
matrix eval(const matrix &y, double thi, matrix &T, int par_pol, int par_eq) const
Definition: numdiff.h:85
matrix eval_10(const matrix &y, const matrix &thi, matrix &T) const
Definition: diff_leg.cpp:357
matrix dP1_10
Definition: numdiff.h:57
void set_xif(double,...)
Definition: diff_gl.cpp:69
matrix I_00
Definition: numdiff.h:60
matrix dP1_11
Definition: numdiff.h:57
matrix P_10
Definition: numdiff.h:55
~diff_leg()
Definition: diff_leg.cpp:17
matrix l_10() const
Definition: diff_leg.cpp:448
matrix lap_10
Definition: numdiff.h:61
diff_gl(int n=1)
Definition: diff_gl.cpp:10
matrix x
Definition: numdiff.h:20
matrix P_01
Definition: numdiff.h:55
matrix P1_11
Definition: numdiff.h:56
matrix dPn(int n, matrix x, matrix p)
Definition: diff_leg.cpp:90
The diff_gl class implements the Gauss-Lobatto (or more properly Gauss-Lobatto-Chebyshev) collocation...
Definition: numdiff.h:16
matrix P1_00
Definition: numdiff.h:56
matrix I
Definition: numdiff.h:20
const int & ndomains
Definition: numdiff.h:24
int npts
Definition: numdiff.h:53
void init_1()
Definition: diff_gl.cpp:126
The diff_leg class implements Legendre numerical differentiation.
Definition: numdiff.h:48
matrix dP1_00
Definition: numdiff.h:57
matrix_block_diag D
Definition: numdiff.h:21
int * npts
Definition: numdiff.h:22
matrix_block_diag P
Definition: numdiff.h:21
matrix th
Definition: numdiff.h:54
~diff_gl()
Definition: diff_gl.cpp:18
void set_npts(int,...)
Definition: diff_gl.cpp:82
matrix D2_00
Definition: numdiff.h:59
matrix l_01() const
Definition: diff_leg.cpp:442