KADATH
fourD_periodic.hpp
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 #ifndef __fourD_PERIODIC_HPP_
21 #define __fourD_PERIODIC_HPP_
22 
23 #include "space.hpp"
24 
25 #define TO_PI 0
26 namespace Kadath {
27 
56 
57  private:
58  double alpha ;
59 
60  double ome ;
61 
66  int type_time ;
67  double maxt ;
68 
69  public:
78  Domain_fourD_periodic_nucleus (int num, int ttype, double radius, double ome, const Dim_array& nbr) ;
85  Domain_fourD_periodic_nucleus (int num, FILE* ff) ;
86 
88  virtual void save (FILE*) const ;
89 
90  private:
91  virtual void do_absol () const ;
92  virtual void do_coloc () ;
93  virtual void do_radius () const ;
94 
95  public:
96  virtual bool is_in(const Point&xx, double prec=1e-13) const ;
97  virtual const Point absol_to_num(const Point&) const;
98  virtual void do_der_abs_from_der_var(const Val_domain *const *const der_var, Val_domain **const der_abs) const ;
99  virtual Base_spectral mult (const Base_spectral&, const Base_spectral&) const ;
103  double get_ome() const {return ome ;} ;
104 
105  virtual Val_domain mult_cos_phi (const Val_domain&) const ;
106  virtual Val_domain mult_sin_phi (const Val_domain&) const ;
107  virtual Val_domain mult_cos_theta (const Val_domain&) const ;
108  virtual Val_domain mult_sin_theta (const Val_domain&) const ;
109  virtual Val_domain div_sin_theta (const Val_domain&) const ;
110  virtual Val_domain div_x (const Val_domain&) const ;
111 
112 
118  Val_domain translate (const Val_domain& so) const ;
119 
120  virtual Tensor change_basis_spher_to_cart (int dd, const Tensor&) const ;
121 public:
122  virtual ostream& print (ostream& o) const ;
123 } ;
124 
125 
155 
156  private:
157  double alpha ;
158  double beta ;
159 
160 
161  double ome ;
162 
167  int type_time ;
168  double maxt ;
169 
170  public:
180  Domain_fourD_periodic_shell (int num, int ttype, double rin, double rout, double ome, const Dim_array& nbr) ;
187  Domain_fourD_periodic_shell (int num, FILE* ff) ;
188 
189  virtual ~Domain_fourD_periodic_shell() ;
190  virtual void save (FILE*) const ;
191 
192  private:
193  virtual void do_absol () const ;
194  virtual void do_coloc () ;
195  virtual void do_radius () const ;
196  virtual void do_cart () const ;
197 
198  virtual void set_cheb_base_x_cart(Base_spectral& so) const ;
199  virtual void set_cheb_base_y_cart(Base_spectral& so) const ;
200  virtual void set_legendre_base_x_cart(Base_spectral& so) const ;
201  virtual void set_legendre_base_y_cart(Base_spectral& so) const ;
202 
203 
204  public:
205  virtual bool is_in(const Point&xx, double prec=1e-13) const ;
206  virtual const Point absol_to_num(const Point&) const;
207  virtual void do_der_abs_from_der_var(const Val_domain *const *const der_var, Val_domain **const der_abs) const ;
208  virtual Base_spectral mult (const Base_spectral&, const Base_spectral&) const ;
209 
210  virtual Val_domain mult_cos_phi (const Val_domain&) const ;
211  virtual Val_domain mult_sin_phi (const Val_domain&) const ;
212  virtual Val_domain mult_cos_theta (const Val_domain&) const ;
213  virtual Val_domain mult_sin_theta (const Val_domain&) const ;
214  virtual Val_domain div_sin_theta (const Val_domain&) const ;
215  virtual Val_domain div_xm1 (const Val_domain&) const ;
216 
222  Val_domain translate (const Val_domain& so) const ;
223  virtual Tensor change_basis_spher_to_cart (int dd, const Tensor&) const ;
224 
230  Array<double> integ_outer_boundary (const Val_domain& so) const ;
231 public:
232  virtual ostream& print (ostream& o) const ;
233 } ;
234 
239 class Space_fourD_periodic : public Space {
240  public:
248  Space_fourD_periodic (int tt, double omega, const Dim_array& nbr, const Array<double>& bounds) ;
249 
250  Space_fourD_periodic (FILE*) ;
251  virtual ~Space_fourD_periodic() ;
252  virtual void save(FILE*) const ;
254  double get_omega() const ;
255 } ;
256 
257 }
258 #endif
Class for storing the basis of decompositions of a field.
Class for storing the dimensions of an array.
Definition: dim_array.hpp:34
Class for a spherical nucleus.
virtual void save(FILE *) const
Saving function.
double maxt
Upper bound of which is or .
virtual Val_domain mult_cos_phi(const Val_domain &) const
Multiplication by .
virtual ostream & print(ostream &o) const
Delegate function to virtualize the << operator.
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
Val_domain translate(const Val_domain &so) const
Generates a Val_domain, from another one assumed to be on a Polar_periodic_nucleus.
double get_ome() const
Returns omega.
virtual Val_domain mult_sin_phi(const Val_domain &) const
Multiplication by .
virtual void do_absol() const
Computes the absolute coordinates.
Domain_fourD_periodic_nucleus(int num, int ttype, double radius, double ome, const Dim_array &nbr)
Standard constructor :
virtual void do_radius() const
Computes the generalized radius.
double alpha
Relates the numerical radius to the physical one.
virtual Val_domain div_x(const Val_domain &) const
Division by .
virtual const Point absol_to_num(const Point &) const
Computes the numerical coordinates from the physical ones.
virtual void do_der_abs_from_der_var(const Val_domain *const *const der_var, Val_domain **const der_abs) const
Computes the derivative with respect to the absolute Cartesian coordinates from the derivative with r...
virtual void do_coloc()
Computes the colocation points.
int type_time
Gives the type of time periodicity.
virtual Val_domain div_sin_theta(const Val_domain &) const
Division by .
virtual Base_spectral mult(const Base_spectral &, const Base_spectral &) const
Method for the multiplication of two Base_spectral.
virtual Val_domain mult_cos_theta(const Val_domain &) const
Multiplication by .
virtual Val_domain mult_sin_theta(const Val_domain &) const
Multiplication by .
virtual Tensor change_basis_spher_to_cart(int dd, const Tensor &) const
Changes the tensorial basis from spherical to Cartesian in a given domain.
Class for a spherical shell.
virtual Base_spectral mult(const Base_spectral &, const Base_spectral &) const
Method for the multiplication of two Base_spectral.
double beta
Relates the numerical radius to the physical one.
Domain_fourD_periodic_shell(int num, int ttype, double rin, double rout, double ome, const Dim_array &nbr)
Standard constructor :
virtual bool is_in(const Point &xx, double prec=1e-13) const
Check whether a point lies inside Domain.
virtual const Point absol_to_num(const Point &) const
Computes the numerical coordinates from the physical ones.
virtual void do_cart() const
Computes the Cartesian coordinates.
virtual ostream & print(ostream &o) const
Delegate function to virtualize the << operator.
virtual void do_absol() const
Computes the absolute coordinates.
virtual void save(FILE *) const
Saving function.
virtual void set_legendre_base_y_cart(Base_spectral &so) const
Gives the base using Legendre polynomials, for the component of a vector.
virtual void do_coloc()
Computes the colocation points.
virtual void do_radius() const
Computes the generalized radius.
virtual Tensor change_basis_spher_to_cart(int dd, const Tensor &) const
Changes the tensorial basis from spherical to Cartesian in a given domain.
virtual void set_cheb_base_y_cart(Base_spectral &so) const
Gives the base using Chebyshev polynomials, for the component of a vector.
virtual Val_domain mult_cos_phi(const Val_domain &) const
Multiplication by .
virtual Val_domain mult_cos_theta(const Val_domain &) const
Multiplication by .
double maxt
Upper bound of which is or .
virtual Val_domain div_sin_theta(const Val_domain &) const
Division by .
int type_time
Gives the type of time periodicity.
virtual Val_domain div_xm1(const Val_domain &) const
Division by .
double alpha
Relates the numerical radius to the physical one.
virtual Val_domain mult_sin_phi(const Val_domain &) const
Multiplication by .
virtual void set_cheb_base_x_cart(Base_spectral &so) const
Gives the base using Chebyshev polynomials, for the component of a vector.
virtual void set_legendre_base_x_cart(Base_spectral &so) const
Gives the base using Legendre polynomials, for the component of a vector.
virtual Val_domain mult_sin_theta(const Val_domain &) const
Multiplication by .
virtual void do_der_abs_from_der_var(const Val_domain *const *const der_var, Val_domain **const der_abs) const
Computes the derivative with respect to the absolute Cartesian coordinates from the derivative with r...
Val_domain translate(const Val_domain &so) const
Generates a Val_domain, from another one assumed to be on a Polar_periodic_nucleus.
Array< double > integ_outer_boundary(const Val_domain &so) const
Computes the surface integral, at the outer boundary.
Abstract class that implements the fonctionnalities common to all the type of domains.
Definition: space.hpp:60
Val_domain * radius
The generalized radius.
Definition: space.hpp:78
The class Point is used to store the coordinates of a point.
Definition: point.hpp:30
The Space_fourD_periodic class fills the space with one 4d nucleus and several 4d shells,...
double get_omega() const
Returns omega.
virtual void save(FILE *) const
Saving function.
Space_fourD_periodic(int tt, double omega, const Dim_array &nbr, const Array< double > &bounds)
Standard constructor.
The Space class is an ensemble of domains describing the whole space of the computation.
Definition: space.hpp:1362
Tensor handling.
Definition: tensor.hpp:149
Class for storing the basis of decompositions of a field and its values on both the configuration and...
Definition: val_domain.hpp:69