16#ifndef Multigrille_base_included
17#define Multigrille_base_included
20#include <Matrice_Grossiere.h>
21#include <SolveurSys.h>
22#include <TRUSTLists.h>
36 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
39 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
42 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
45 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
51 virtual void alloc_field(IJK_Field_float& x,
int level,
bool with_additional_k_layers =
false)
const = 0;
52 virtual void alloc_field(IJK_Field_double& x,
int level,
bool with_additional_k_layers =
false)
const = 0;
54 virtual void dump_lata(
const Nom& field,
const IJK_Field_float& data,
int tstep)
const = 0;
55 virtual void dump_lata(
const Nom& field,
const IJK_Field_double& data,
int tstep)
const = 0;
64 solveur_grossier_->reinit();
65 return coarse_matrix_;
71 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
74 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
77 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
80 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
83 template <
typename _TYPE_FUNC_,
typename _TYPE_,
typename _TYPE_ARRAY_>
86 template <
typename _TYPE_>
92 template<
typename _TYPE_>
99 template<
typename _TYPE_>
108 const IJK_Field_float *secmem,
109 const int grid_level,
111 IJK_Field_float *residu)
const = 0;
113 const IJK_Field_double *secmem,
114 const int grid_level,
116 IJK_Field_double *residu)
const = 0;
118 virtual void coarsen(
const IJK_Field_float& fine, IJK_Field_float& coarse,
int fine_level)
const = 0;
119 virtual void coarsen(
const IJK_Field_double& fine, IJK_Field_double& coarse,
int fine_level)
const = 0;
124 template <
typename _TYPE_,
typename _TYPE_ARRAY_>
126 int grid_level,
int iter_number);
130 if (level < relax_jacobi_.size_array())
133 i = relax_jacobi_.size_array()-1;
134 return relax_jacobi_[i];
151 ArrOfDouble relax_jacobi_;
153 ArrOfInt pre_smooth_steps_;
154 ArrOfInt smooth_steps_;
155 ArrOfInt nb_full_mg_steps_;
164 int max_iter_mixed_solver_;
169#include <Multigrille_base.tpp>
: This class is an IJK_Field_local with parallel informations.
Classe Matrice_Base Classe de base de la hierarchie des matrices.
virtual int needed_kshift_for_jacobi(int level) const =0
virtual void ajouter_param(Param &)
virtual double multigrille_failure()=0
virtual void prepare_secmem(IJK_Field_float &x) const =0
void solve_ijk_in_storage_template()
double relax_jacobi(int level) const
int solveur_direct() const override
virtual IJK_Field_float & get_storage_float(StorageId, int level)=0
std::enable_if_t< std::is_same< _TYPE_, float >::value, IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & > get_storage_template(StorageId id, int level)
virtual void interpolate_sub_shiftk(const IJK_Field_float &coarse, IJK_Field_float &fine, int fine_level) const =0
std::enable_if_t< std::is_same< _TYPE_, double >::value, IJK_Field_template< _TYPE_, TRUSTArray< _TYPE_ > > & > get_storage_template(StorageId id, int level)
virtual int nb_grid_levels() const =0
void resoudre_systeme_IJK_template(const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &rhs, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x)
void convert_to_ijk(const DoubleVect &x, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &ijk_x)
virtual void coarsen(const IJK_Field_double &fine, IJK_Field_double &coarse, int fine_level) const =0
virtual void dump_lata(const Nom &field, const IJK_Field_float &data, int tstep) const =0
int get_flag_updated_input() const override
virtual IJK_Field_double & get_storage_double(StorageId, int level)=0
virtual void prepare_secmem(IJK_Field_double &x) const =0
const int precision_double_
int resoudre_systeme(const Matrice_Base &a, const DoubleVect &b, DoubleVect &x, int) override
virtual void alloc_field(IJK_Field_double &x, int level, bool with_additional_k_layers=false) const =0
virtual void interpolate_sub_shiftk(const IJK_Field_double &coarse, IJK_Field_double &fine, int fine_level) const =0
void resoudre_avec_gmres(IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &b, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &residu)
virtual void coarsen(const IJK_Field_float &fine, IJK_Field_float &coarse, int fine_level) const =0
virtual void alloc_field(IJK_Field_float &x, int level, bool with_additional_k_layers=false) const =0
void resoudre_avec_gcp(IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &b, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &residu)
double multigrille(IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x, const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &b, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &residu)
void convert_from_ijk(const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &ijk_x, DoubleVect &x)
const int precision_float_
virtual void jacobi_residu(IJK_Field_double &x, const IJK_Field_double *secmem, const int grid_level, const int n_jacobi, IJK_Field_double *residu) const =0
Matrice_Grossiere & set_coarse_matrix()
void resoudre_systeme_template(const Matrice_Base &a, const DoubleVect &b, DoubleVect &x)
double multigrille_(IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x, const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &b, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &residu, int grid_level, int iter_number)
virtual void jacobi_residu(IJK_Field_float &x, const IJK_Field_float *secmem, const int grid_level, const int n_jacobi, IJK_Field_float *residu) const =0
int nsweeps_jacobi_residu(int level) const
void resoudre_systeme_IJK(const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &rhs, IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x)
void coarse_solver(IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &x, const IJK_Field_template< _TYPE_, _TYPE_ARRAY_ > &b)
virtual void dump_lata(const Nom &field, const IJK_Field_double &data, int tstep) const =0
class Nom Une chaine de caractere pour nommer les objets de TRUST
Helper class to factorize the readOn method of Objet_U classes.
class SolveurSys Un SolveurSys represente n'importe qu'elle classe