KADATH
domain_polar_periodic_nucleus_ope.cpp
1 /*
2  Copyright 2017 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include "headcpp.hpp"
21 #include "polar_periodic.hpp"
22 #include "val_domain.hpp"
23 #include "array_math.hpp"
24 
25 namespace Kadath {
26 int mult_cos_1d (int, Array<double>&) ;
27 int mult_sin_1d (int, Array<double>&) ;
28 int div_sin_1d (int, Array<double>&) ;
29 int div_x_1d (int, Array<double>&) ;
30 int mult_x_1d (int, Array<double>&) ;
31 
33  so.coef() ;
34  Val_domain res(this) ;
35  res.base = so.base ;
36  res.cf = new Array<double> (so.base.ope_1d(mult_cos_1d, 1, *so.cf, res.base)) ;
37  res.in_coef = true ;
38  return res ;
39 }
40 
42 
43  so.coef() ;
44  Val_domain res(this) ;
45 
46  res.base= so.base ;
47  res.cf = new Array<double> (so.base.ope_1d(mult_sin_1d, 1, *so.cf, res.base)) ;
48  res.in_coef = true ;
49  return res ;
50 }
51 
53  so.coef() ;
54  Val_domain res(this) ;
55 
56  res.base = so.base ;
57 
58  res.cf = new Array<double> (so.base.ope_1d(div_sin_1d, 1, *so.cf, res.base)) ;
59  res.in_coef = true ;
60  return res ;
61 }
62 
64  so.coef() ;
65  Val_domain res(this) ;
66 
67  res.base= so.base ;
68 
69  res.cf = new Array<double> (so.base.ope_1d(div_x_1d, 0, *so.cf, res.base)) ;
70  res.in_coef = true ;
71  return res ;
72 }
73 
75  so.coef() ;
76  Val_domain res(this) ;
77 
78  res.base= so.base ;
79 
80  res.cf = new Array<double> (so.base.ope_1d(mult_x_1d, 0, *so.cf, res.base)) ;
81  *res.cf *= alpha ;
82  res.in_coef = true ;
83  return res ;
84 }
85 
87  so.coef() ;
88  Val_domain res(this) ;
89 
90  res.base= so.base ;
91 
92  res.cf = new Array<double> (so.base.ope_1d(div_x_1d, 0, *so.cf, res.base)) ;
93  *res.cf /= alpha ;
94  res.in_coef = true ;
95  return res ;
96 }
97 
99  return (div_x(so.der_var(1)) / alpha / alpha) ;
100 }
101 
103  return (so.der_var(1)/alpha) ;
104 }
105 
107  return (so.der_var(2)) ;
108 }
109 
111  return (so.der_var(3)*ome) ;
112 }
113 
114 
116  so.coef() ;
117  Val_domain res(this) ;
118  res.base = so.base ;
119  res.cf = new Array<double> (so.base.ope_1d(mult_cos_1d, 2, *so.cf, res.base)) ;
120  res.in_coef = true ;
121  return res ;
122 }
123 
125 
126  so.coef() ;
127  Val_domain res(this) ;
128 
129  res.base= so.base ;
130  res.cf = new Array<double> (so.base.ope_1d(mult_sin_1d, 2, *so.cf, res.base)) ;
131  res.in_coef = true ;
132  return res ;
133 }
134 }
135 
Array< double > ope_1d(int(*function)(int, Array< double > &), int var, const Array< double > &so, Base_spectral &base) const
One-dimensional operator acting in the coefficient space.
Definition: ope_1d.cpp:26
virtual Val_domain div_r(const Val_domain &) const
Division by .
virtual Val_domain mult_cos_theta(const Val_domain &) const
Multiplication by .
virtual Val_domain dtime(const Val_domain &) const
Computes the time derivative of a field.
virtual Val_domain mult_cos_time(const Val_domain &) const
Multiplication by .
virtual Val_domain div_x(const Val_domain &) const
Division by .
virtual Val_domain dt(const Val_domain &) const
Compute the derivative with respect to of a scalar field.
virtual Val_domain div_sin_theta(const Val_domain &) const
Division by .
virtual Val_domain mult_sin_theta(const Val_domain &) const
Multiplication by .
virtual Val_domain srdr(const Val_domain &) const
Compute the of a scalar field .
virtual Val_domain mult_r(const Val_domain &) const
Multiplication by .
virtual Val_domain der_r(const Val_domain &) const
Compute the radial derivative of a scalar field.
virtual Val_domain mult_sin_time(const Val_domain &) const
Multiplication by .
double alpha
Relates the numerical radius to the physical one.
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69
Base_spectral base
Spectral basis of the field.
Definition: val_domain.hpp:72
Array< double > * cf
Pointer on the Array of the values in the coefficients space.
Definition: val_domain.hpp:77
bool in_coef
Is the field known in the coefficient space ?
Definition: val_domain.hpp:79
void coef() const
Computes the coefficients.
Definition: val_domain.cpp:622
Val_domain der_var(int i) const
Computes the derivative with respect to a numerical coordinate.
Definition: val_domain.cpp:670