KADATH
domain_spheric_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 "spheric_periodic.hpp"
21 #include "val_domain.hpp"
22 #include "array_math.hpp"
23 namespace Kadath {
24 int div_x_1d (int, Array<double>&) ;
25 int mult_x_1d (int, Array<double>&) ;
26 
28  so.coef() ;
29  Val_domain res(this) ;
30 
31  res.base= so.base ;
32 
33  res.cf = new Array<double> (so.base.ope_1d(div_x_1d, 0, *so.cf, res.base)) ;
34  res.in_coef = true ;
35  return res ;
36 }
37 
39  so.coef() ;
40  Val_domain res(this) ;
41 
42  res.base= so.base ;
43 
44  res.cf = new Array<double> (so.base.ope_1d(mult_x_1d, 0, *so.cf, res.base)) ;
45  *res.cf *= alpha ;
46  res.in_coef = true ;
47  return res ;
48 }
49 
51  so.coef() ;
52  Val_domain res(this) ;
53 
54  res.base= so.base ;
55 
56  res.cf = new Array<double> (so.base.ope_1d(div_x_1d, 0, *so.cf, res.base)) ;
57  *res.cf /= alpha ;
58  res.in_coef = true ;
59  return res ;
60 }
61 
63  return (so.der_var(1)/alpha) ;
64 }
65 
66 
68  return (div_x(so.der_var(1)) / alpha / alpha) ;
69 }
70 
72  return (so.der_var(2).der_var(2)*ome*ome) ;
73 }
74 
76  return (so.der_var(2)*ome) ;
77 }
78 
79 
81  if (m!=0) {
82  cerr << "Laplacian only defiend for m=0 for Domain_spheric_nucleus" << endl ;
83  abort() ;
84  }
85  Val_domain dr (so.der_var(1)/alpha) ;
86  Val_domain res (dr.der_var(1)/alpha + div_r(2*dr)) ;
87  return res ;
88 }
89 }
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 srdr(const Val_domain &) const
Compute the of a scalar field .
virtual Val_domain div_x(const Val_domain &) const
Division by .
double ome
Relates the numerical time to the physical one.
double alpha
Relates the numerical radius to the physical one.
virtual Val_domain der_r(const Val_domain &) const
Compute the radial derivative of a scalar field.
virtual Val_domain mult_r(const Val_domain &) const
Multiplication by .
virtual Val_domain ddtime(const Val_domain &) const
Computes the second time derivative of a field.
virtual Val_domain laplacian(const Val_domain &, int) const
Computes the ordinary flat Laplacian for a scalar field with an harmonic index m.
virtual Val_domain div_r(const Val_domain &) const
Division by .
virtual Val_domain dtime(const Val_domain &) const
Computes the time derivative of a field.
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