30 #ifndef OOMPH_SEGREGATED_FSI_SOLVER    31 #define OOMPH_SEGREGATED_FSI_SOLVER    34 #include "../generic/problem.h"    35 #include "../generic/geom_objects.h"    36 #include "../generic/mesh.h"   132    Ran_out_of_iterations=ran_out_of_iterations;
   182      Use_pointwise_aitken=
false;
   188      Use_irons_and_tuck_extrapolation=
false;
   191      Pointwise_aitken_start=0;
   194      Recheck_convergence_after_pointwise_aitken=
false;
   197      Solve_type = Full_solve;
   200      Convergence_criterion=Assess_convergence_based_on_max_global_residual;
   203      Convergence_tolerance=Problem::Newton_solver_tolerance;
   206      Doc_max_global_residual=
false;
   223      T_spent_on_actual_solve=0.0;
   226      Timer_has_been_halted=
false;
   245    virtual void identify_fluid_and_solid_dofs(
   246     Vector<Data*>& fluid_data_pt,
   247     Vector<Data*>& solid_data_pt,
   248     Mesh*& fluid_mesh_pt,
   249     Mesh*& solid_mesh_pt)=0;
   262    void setup_segregated_solver(
   263     const bool &full_setup_of_fluid_and_solid_dofs=
true);
   294                                                    const bool &shift_values);
   302      Convergence_criterion=Assess_convergence_based_on_max_global_residual;
   303      Convergence_tolerance=tol;
   312      assess_convergence_based_on_max_global_residual(
   313       Problem::Newton_solver_tolerance);
   321      Convergence_criterion=Assess_convergence_based_on_absolute_solid_change;
   322      Convergence_tolerance=tol;
   331      assess_convergence_based_on_absolute_solid_change(
   332       Problem::Newton_solver_tolerance);
   340      Convergence_criterion=Assess_convergence_based_on_relative_solid_change;
   341      Convergence_tolerance=tol;
   350      assess_convergence_based_on_relative_solid_change(
   351       Problem::Newton_solver_tolerance);
   360      Pointwise_aitken_start = pointwise_aitken_start;
   361      Use_pointwise_aitken = 
true;
   382    {Use_irons_and_tuck_extrapolation = 
true;}
   386    {Use_irons_and_tuck_extrapolation = 
false;}
   391                              Assess_convergence_based_on_max_global_residual};
   401    void get_solid_change(
double& rms_change, 
   408    void store_solid_dofs();
   413      T_spent_on_actual_solve=0.0;
   415      Timer_has_been_halted=
false;
   425      Timer_has_been_halted=
false;
   434      if (!Timer_has_been_halted)
   436        T_spent_on_actual_solve+=double(clock()-T_ref)/CLOCKS_PER_SEC;
   437        Timer_has_been_halted=
true;
   446      double time=T_spent_on_actual_solve;
   455    void rebuild_monolithic_mesh();
   482    void restore_fluid_dofs();
   485    void pin_solid_dofs();
   488    void restore_solid_dofs();
   492    void pointwise_aitken_extrapolate();
   545    void extrapolate_solid_data();
   549    void under_relax_solid();
   560    void use_only_fluid_elements();
   571    void use_only_solid_elements();
   574    void pin_fluid_dofs();
 unsigned & niter()
Number of iterations performed. 
 
void assess_convergence_based_on_absolute_solid_change(const double &tol)
Assess convergence based on max. absolute change of solid dofs. The argument specifies the convergenc...
 
virtual void actions_before_segregated_solve()
This function is called once at the start of each segregated solve. 
 
void restart_timer()
(Re-)start timer (e.g. after completing non-essential parts of the code such as documentation of the ...
 
Vector< Vector< double > > Pointwise_aitken_solid_value
Vector of Vectors containing up to three previous iterates for the solid dofs; used for pointwise Ait...
 
Vector< double > Del_irons_and_tuck
Vector of changes in Irons and Tuck under-relaxation. 
 
bool Ran_out_of_iterations
 
double Essential_cpu_total
Total essential CPU time for segregated solve (excluding any actions that merely doc the progress of ...
 
Vector< Mesh * > Orig_sub_mesh_pt
Backup for the pointers to the submeshes in the original problem. 
 
double T_spent_on_actual_solve
Total elapsed time since start of solve, can be accumulated by adding bits of time spent in relevant ...
 
double CPU_total
Total CPU time for segregated solve. 
 
double Tol_achieved
Final tolerance achieved by the iteration. 
 
virtual void actions_after_segregated_solve()
This function is called once at the end of each segregated solve. 
 
double R_irons_and_tuck
Irons and Tuck relaxation factor. 
 
bool Recheck_convergence_after_pointwise_aitken
Have we just done a pointwise Aitken step. 
 
unsigned Niter
Number of iterations performed. 
 
double & cpu_for_global_residual()
CPU time for computation of global residual vectors Note: This time is contained in Total_CPU and is ...
 
unsigned Max_picard
Max. number of Picard iterations. 
 
void set_solver_converged()
Set the flag to indicate that the solver has converged. 
 
virtual ~SegregatableFSIProblem()
Empty virtual destructor. 
 
double t_spent_on_actual_solve()
Total elapsed time since start of solve. 
 
void enable_irons_and_tuck_extrapolation()
Use Irons and Tuck extrapolation for solid dofs. 
 
bool has_converged() const
Flag to indicate if the solver has converged. 
 
void halt_timer()
Halt timer (e.g. before performing non-essential parts of the code such as documentation of the itera...
 
SegregatedSolverError(const bool &ran_out_of_iterations=false)
Default constructor, does nothing. 
 
double Convergence_tolerance
Convergence tolerance for Picard iteration. 
 
double & tol_achieved()
Final tolerance achieved by the iteration. 
 
void enable_pointwise_aitken()
Use pointwise Aitken extrapolation. This interface has no argument and the current value of Pointwise...
 
void assess_convergence_based_on_max_global_residual()
Assess convergence based on max. residuals of coupled system of eqns. This interface has no argument ...
 
double & cpu_total()
Total CPU time for segregated solve. 
 
void assess_convergence_based_on_relative_solid_change()
Assess convergence based on max. relative change of solid dofs. This interface has no argument and th...
 
bool Use_pointwise_aitken
Use pointwise Aitken extrapolation? 
 
bool Timer_has_been_halted
boolean flag to indicate if timer has been halted 
 
int Convergence_criterion
Convergence criterion (enumerated flag) 
 
clock_t T_ref
Reference time for segregated solve. Can be re-initialised whenever total elapsed time has been store...
 
int Pointwise_aitken_counter
Number of Aitken histories available (int because after extrapolation it's re-initialised to -1 to fo...
 
void assess_convergence_based_on_relative_solid_change(const double &tol)
Assess convergence based on max. relative change of solid dofs. The argument specifies the convergenc...
 
void reset_timer()
Reset timer. 
 
A class to handle errors in the Segregated solver. 
 
bool Use_irons_and_tuck_extrapolation
Boolean flag to indicate use of Irons and Tuck's extrapolation for solid values. 
 
void enable_under_relaxation(const double &omega=1.0)
Use under-relaxation and (optionally) specify under-relaxation parameter. Default: omega=1...
 
~PicardConvergenceData()
Empty destructor. 
 
solve_type
Enumerated flags to indicate which solve is taking place. 
 
virtual void actions_before_segregated_convergence_check()
This function is to be filled with actions that take place before the check for convergence of the en...
 
double Omega_relax
Under-relaxation parameter. (1.0: no under-relaxation; 0.0: Freeze wall shape) 
 
Vector< double > Previous_solid_value
Vector storing the previous solid values – used for convergence check. 
 
double CPU_for_global_residual
CPU time for computation of global residual vectors Note: This time is contained in Total_CPU and is ...
 
bool Has_converged
Flag to indicate if the solver has converged. 
 
bool Doc_max_global_residual
Doc maximum global residual during iteration? (default: false) 
 
int Solve_type
Solve that is taking place (enumerated flag) 
 
Vector< Data * > Solid_data_pt
Vector storing the Data objects associated with the solid problem: Typically the positional data of s...
 
convergence_criteria
Enumerated flags for convergence criteria. 
 
Vector< std::vector< bool > > Fluid_value_is_pinned
Vector of vectors that store the pinned status of fluid Data values. 
 
PicardConvergenceData()
Constructor initialises all data. 
 
void assess_convergence_based_on_absolute_solid_change()
Assess convergence based on max. absolute change of solid dofs. This interface has no argument and th...
 
Object that collates convergence data of Picard iteration. 
 
void disable_pointwise_aitken()
Disable the use of pointwise Aitken extrapolation. 
 
unsigned Pointwise_aitken_start
Start pointwise Aitken extrpolation after specified number of Picard iterations. 
 
Vector< std::vector< bool > > Solid_value_is_pinned
Vector of vectors that store the pinned status of solid Data values. 
 
void set_solver_not_converged()
Set the flag to indicate that the solver has not converged. 
 
SegregatableFSIProblem()
Constructor. Set default values for solver parameters: 
 
Vector< Data * > Fluid_data_pt
Vector storing the Data objects associated with the fluid problem: Tyically the nodal and internal da...
 
Mesh * Fluid_mesh_pt
Mesh containing only fluid elements – the elements in this Mesh will be excluded from the assembly p...
 
double & essential_cpu_total()
Total essential CPU time for segregated solve (excluding any actions that merely doc the progress of ...
 
void assess_convergence_based_on_max_global_residual(const double &tol)
Assess convergence based on max. residual of coupled system of eqns. The argument specifies the conve...
 
Mesh * Solid_mesh_pt
Mesh containing only solid elements – the elements in this mesh will be excluded from the assembly p...
 
void disable_irons_and_tuck_extrapolation()
Do not use Irons and Tuck extrapolation for solid dofs. 
 
void enable_pointwise_aitken(const unsigned &pointwise_aitken_start)
Use pointwise Aitken extrapolation. The argument is used to specify the Picard iteration after which ...