SegregatedFSICollapsibleChannelProblem< ELEMENT > Class Template Reference
+ Inheritance diagram for SegregatedFSICollapsibleChannelProblem< ELEMENT >:

Public Member Functions

 SegregatedFSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, const bool &displ_control, const bool &steady_flag)
 Constructor for the collapsible channel problem. More...
 
 ~SegregatedFSICollapsibleChannelProblem ()
 Empty destructor. More...
 
void identify_fluid_and_solid_dofs (Vector< Data * > &fluid_data_pt, Vector< Data * > &solid_data_pt, Mesh *&fluid_mesh_pt, Mesh *&solid_mesh_pt)
 
void write_convergence_history_header (std::ofstream &convergence_file, const bool &doc_max_global_residual)
 Write header for convergence history file. More...
 
void write_convergence_history (const unsigned &iter, const double &rms_change, const double &max_change, const double &rms_norm, const double &max_res, std::ofstream &convergence_file, const bool &doc_max_global_residual)
 Write to convergence history file. More...
 
void write_zone_info_for_convergence_history (ofstream &convergence_file)
 
void actions_before_newton_solve ()
 
void actions_before_segregated_solve ()
 
void actions_before_newton_step ()
 
void actions_before_newton_convergence_check ()
 
void actions_before_segregated_convergence_check ()
 for documentation purposes More...
 
void solid_output_during_picard (const unsigned &iter, DocInfo &doc_info)
 
void fluid_output_during_picard (const unsigned &iter, DocInfo &doc_info)
 
void doc_solution_steady (DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
 Doc the steady solution. More...
 
void doc_solution_unsteady (DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
 Doc the unsteady solution. More...
 
void steady_run ()
 Steady run. More...
 
void unsteady_run (const double &dummy_dt=0.1)
 Unsteady run. More...
 
 SegregatedFSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, const bool &displ_control, const bool &steady_flag)
 
 ~SegregatedFSICollapsibleChannelProblem ()
 Empty Destructor. More...
 
void identify_fluid_and_solid_dofs (Vector< Data * > &fluid_data_pt, Vector< Data * > &solid_data_pt, Mesh *&fluid_mesh_pt, Mesh *&solid_mesh_pt)
 
void actions_before_newton_convergence_check ()
 
void actions_before_segregated_convergence_check ()
 
void doc_solution (DocInfo &doc_info)
 Document the solution. More...
 
void steady_run ()
 Perform a steady run. More...
 
- Public Member Functions inherited from FSICollapsibleChannelProblem< ELEMENT >
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, const bool &displ_control, const bool &steady_flag)
 Constructor for the collapsible channel problem. More...
 
 ~FSICollapsibleChannelProblem ()
 Destructor. More...
 
AlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
virtual void doc_solution_steady (DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
 Doc the steady solution. More...
 
virtual void doc_solution_unsteady (DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
 Doc the unsteady solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
 Constructor for the collapsible channel problem. More...
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
AlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
RefineableAlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_adapt ()
 Actions before adapt: Wipe the mesh of prescribed traction elements. More...
 
void actions_after_adapt ()
 Actions after adapt: Rebuild the mesh of prescribed traction elements. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
ElasticCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 Update no slip before Newton convergence check. More...
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
ElasticRefineableCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_adapt ()
 Actions before adapt: Wipe the mesh of prescribed traction elements. More...
 
void actions_after_adapt ()
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 Update no slip before Newton convergence check. More...
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly)
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
RefineableAlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > *& wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_adapt ()
 Actions before adapt: Wipe the mesh of prescribed traction elements. More...
 
void actions_after_adapt ()
 
void actions_before_distribute ()
 Actions before distribute: wipe the mesh of prescribed traction elements. More...
 
void actions_after_distribute ()
 Actions after distribute: create traction elements and reset FSI. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
 FSICollapsibleChannelProblem (const unsigned &nup, const unsigned &ncollapsible, const unsigned &ndown, const unsigned &ny, const double &lup, const double &lcollapsible, const double &ldown, const double &ly, const bool &wall_jacobian_ignores_fluid_shear_stress_data, const bool &wall_jacobian_ignores_geometric_data, const bool &fluid_jacobian_ignores_geometric_data)
 Constructor for the collapsible channel problem. More...
 
 ~FSICollapsibleChannelProblem ()
 Destructor (empty) More...
 
AlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt ()
 Access function for the specific bulk (fluid) mesh. More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt ()
 Access function for the wall mesh. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void set_initial_condition ()
 Apply initial conditions. More...
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
OomphCommunicatorcommunicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicatorcommunicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolvermass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Timetime_pt () const
 Return a pointer to the global time object (const version). More...
 
doubletime ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeSteppertime_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
doubleminimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
doublemaximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsignedmax_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
doublemax_residuals ()
 
booltime_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
doublenewton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
doubleglobal_dof_pt (const unsigned &i)
 
doubledof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
doubledof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
booluse_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual Problemmake_copy ()
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
doublebifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
intsign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 
- Public Member Functions inherited from oomph::SegregatableFSIProblem
 SegregatableFSIProblem ()
 
virtual ~SegregatableFSIProblem ()
 Empty virtual destructor. More...
 
void setup_segregated_solver (const bool &full_setup_of_fluid_and_solid_dofs=true)
 
PicardConvergenceData segregated_solve ()
 
PicardConvergenceData steady_segregated_solve ()
 
PicardConvergenceData unsteady_segregated_solve (const double &dt)
 
PicardConvergenceData unsteady_segregated_solve (const double &dt, const bool &shift_values)
 
void assess_convergence_based_on_max_global_residual (const double &tol)
 
void assess_convergence_based_on_max_global_residual ()
 
void assess_convergence_based_on_absolute_solid_change (const double &tol)
 
void assess_convergence_based_on_absolute_solid_change ()
 
void assess_convergence_based_on_relative_solid_change (const double &tol)
 
void assess_convergence_based_on_relative_solid_change ()
 
void enable_pointwise_aitken (const unsigned &pointwise_aitken_start)
 
void enable_pointwise_aitken ()
 
void disable_pointwise_aitken ()
 Disable the use of pointwise Aitken extrapolation. More...
 
void enable_under_relaxation (const double &omega=1.0)
 
void enable_irons_and_tuck_extrapolation ()
 Use Irons and Tuck extrapolation for solid dofs. More...
 
void disable_irons_and_tuck_extrapolation ()
 Do not use Irons and Tuck extrapolation for solid dofs. More...
 
void get_solid_change (double &rms_change, double &max_change, double &rms_norm)
 
void store_solid_dofs ()
 
void reset_timer ()
 Reset timer. More...
 
void restart_timer ()
 
void halt_timer ()
 
double t_spent_on_actual_solve ()
 Total elapsed time since start of solve. More...
 

Private Attributes

int Picard_iter
 
Vector< std::pair< GeomObject *, Vector< double > > > Control_point_pair
 
ofstream Convergence_file
 Output stream to document the convergence history. More...
 

Additional Inherited Members

- Public Types inherited from oomph::Problem
typedef void(* SpatialErrorEstimatorFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error)
 Function pointer for spatial error estimator. More...
 
typedef void(* SpatialErrorEstimatorWithDocFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error, DocInfo &doc_info)
 Function pointer for spatial error estimator with doc. More...
 
- Public Types inherited from oomph::SegregatableFSIProblem
enum  convergence_criteria { Assess_convergence_based_on_absolute_solid_change , Assess_convergence_based_on_relative_solid_change , Assess_convergence_based_on_max_global_residual }
 Enumerated flags for convergence criteria. More...
 
enum  solve_type { Full_solve , Fluid_solve , Solid_solve }
 Enumerated flags to indicate which solve is taking place. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 
- Static Public Attributes inherited from oomph::Problem
static bool Suppress_warning_about_actions_before_read_unstructured_meshes
 
- Protected Types inherited from oomph::Problem
enum  Assembly_method {
  Perform_assembly_using_vectors_of_pairs , Perform_assembly_using_two_vectors , Perform_assembly_using_maps , Perform_assembly_using_lists ,
  Perform_assembly_using_two_arrays
}
 Enumerated flags to determine which sparse assembly method is used. More...
 
- Protected Member Functions inherited from FSICollapsibleChannelProblem< ELEMENT >
void dump_it (ofstream &dump_file)
 Dump problem to disk to allow for restart. More...
 
void restart (ifstream &restart_file)
 Read problem for restart from specified restart file. More...
 
- Protected Member Functions inherited from oomph::Problem
unsigned setup_element_count_per_dof ()
 
virtual void sparse_assemble_row_or_column_compressed (Vector< int * > &column_or_row_index, Vector< int * > &row_or_column_start, Vector< double * > &value, Vector< unsigned > &nnz, Vector< double * > &residual, bool compressed_row_flag)
 
virtual void actions_after_newton_step ()
 
virtual void actions_before_implicit_timestep ()
 
virtual void actions_after_implicit_timestep ()
 
virtual void actions_after_implicit_timestep_and_error_estimation ()
 
virtual void actions_before_explicit_timestep ()
 Actions that should be performed before each explicit time step. More...
 
virtual void actions_after_explicit_timestep ()
 Actions that should be performed after each explicit time step. More...
 
virtual void actions_before_read_unstructured_meshes ()
 
virtual void actions_after_read_unstructured_meshes ()
 
virtual void actions_after_change_in_global_parameter (double *const &parameter_pt)
 
virtual void actions_after_change_in_bifurcation_parameter ()
 
virtual void actions_after_parameter_increase (double *const &parameter_pt)
 
doubledof_derivative (const unsigned &i)
 
doubledof_current (const unsigned &i)
 
virtual double global_temporal_error_norm ()
 
unsigned newton_solve_continuation (double *const &parameter_pt)
 
unsigned newton_solve_continuation (double *const &parameter_pt, DoubleVector &z)
 
void calculate_continuation_derivatives (double *const &parameter_pt)
 
void calculate_continuation_derivatives (const DoubleVector &z)
 
void calculate_continuation_derivatives_fd (double *const &parameter_pt)
 
bool does_pointer_correspond_to_problem_data (double *const &parameter_pt)
 
void set_consistent_pinned_values_for_continuation ()
 
- Protected Member Functions inherited from oomph::SegregatableFSIProblem
virtual void actions_after_segregated_solve ()
 
void rebuild_monolithic_mesh ()
 Rebuild global mesh for monolithic discretisation. More...
 
void restore_fluid_dofs ()
 Restore pinned status of fluid dofs. More...
 
void pin_solid_dofs ()
 Pin solid dofs. More...
 
void restore_solid_dofs ()
 Restore pinned status of solid dofs. More...
 
void pointwise_aitken_extrapolate ()
 Do pointwise Aitken extrapolation for solid. More...
 
- Protected Attributes inherited from FSICollapsibleChannelProblem< ELEMENT >
unsigned Nup
 Number of elements in the x direction in the upstream part of the channel. More...
 
unsigned Ncollapsible
 
unsigned Ndown
 Number of elements in the x direction in the downstream part of the channel. More...
 
unsigned Ny
 Number of elements across the channel. More...
 
double Lup
 x-length in the upstream part of the channel More...
 
double Lcollapsible
 x-length in the collapsible part of the channel More...
 
double Ldown
 x-length in the downstream part of the channel More...
 
double Ly
 Transverse length. More...
 
AlgebraicCollapsibleChannelMesh< ELEMENT > * Bulk_mesh_pt
 Pointer to the "bulk" mesh. More...
 
Mesh * Displ_control_mesh_pt
 Pointer to the mesh that contains the displacement control element. More...
 
bool Displ_control
 Use displacement control? More...
 
OneDLagrangianMesh< FSIHermiteBeamElement > * Wall_mesh_pt
 Pointer to the "wall" mesh. More...
 
Node * Left_node_pt
 Pointer to the left control node. More...
 
Node * Right_node_pt
 Pointer to right control node. More...
 
Node * Wall_node_pt
 Pointer to control node on the wall. More...
 
bool Steady_flag
 Flag for steady run. More...
 
GeomObject * Ctrl_geom_obj_pt
 
Vector< doubleS_displ_ctrl
 
MeshAsGeomObject * Wall_geom_object_pt
 Geometric object incarnation of the wall mesh. More...
 
unsigned Newton_iter
 Counter for Newton iterations. More...
 
DocInfo Doc_info
 DocInfo object. More...
 
- Protected Attributes inherited from oomph::Problem
Vector< Problem * > Copy_of_problem_pt
 
std::map< double *, boolCalculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistributionDof_distribution_pt
 
Vector< double * > Dof_pt
 Vector of pointers to dofs. More...
 
DoubleVectorWithHaloEntries Element_count_per_dof
 
double Relaxation_factor
 
double Newton_solver_tolerance
 
unsigned Max_newton_iterations
 Maximum number of Newton iterations. More...
 
unsigned Nnewton_iter_taken
 
Vector< doubleMax_res
 Maximum residuals at start and after each newton iteration. More...
 
double Max_residuals
 
bool Time_adaptive_newton_crash_on_solve_fail
 
bool Jacobian_reuse_is_enabled
 Is re-use of Jacobian in Newton iteration enabled? Default: false. More...
 
bool Jacobian_has_been_computed
 
bool Problem_is_nonlinear
 
bool Pause_at_end_of_sparse_assembly
 
bool Doc_time_in_distribute
 
unsigned Sparse_assembly_method
 
unsigned Sparse_assemble_with_arrays_initial_allocation
 
unsigned Sparse_assemble_with_arrays_allocation_increment
 
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
 
double Numerical_zero_for_sparse_assembly
 
double FD_step_used_in_get_hessian_vector_products
 
bool Mass_matrix_reuse_is_enabled
 
bool Mass_matrix_has_been_computed
 
bool Discontinuous_element_formulation
 
double Minimum_dt
 Minimum desired dt: if dt falls below this value, exit. More...
 
double Maximum_dt
 Maximum desired dt. More...
 
double DTSF_max_increase
 
double DTSF_min_decrease
 
double Minimum_dt_but_still_proceed
 
bool Scale_arc_length
 Boolean to control whether arc-length should be scaled. More...
 
double Desired_proportion_of_arc_length
 Proportion of the arc-length to taken by the parameter. More...
 
double Theta_squared
 
int Sign_of_jacobian
 Storage for the sign of the global Jacobian. More...
 
double Continuation_direction
 
double Parameter_derivative
 Storage for the derivative of the global parameter wrt arc-length. More...
 
double Parameter_current
 Storage for the present value of the global parameter. More...
 
bool Use_continuation_timestepper
 Boolean to control original or new storage of dof stuff. More...
 
unsigned Dof_derivative_offset
 
unsigned Dof_current_offset
 
Vector< doubleDof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< doubleDof_current
 Storage for the present values of the variables. More...
 
double Ds_current
 Storage for the current step value. More...
 
unsigned Desired_newton_iterations_ds
 
double Minimum_ds
 Minimum desired value of arc-length. More...
 
bool Bifurcation_detection
 Boolean to control bifurcation detection via determinant of Jacobian. More...
 
bool Bisect_to_find_bifurcation
 Boolean to control wheter bisection is used to located bifurcation. More...
 
bool First_jacobian_sign_change
 Boolean to indicate whether a sign change has occured in the Jacobian. More...
 
bool Arc_length_step_taken
 Boolean to indicate whether an arc-length step has been taken. More...
 
bool Use_finite_differences_for_continuation_derivatives
 
OomphCommunicatorCommunicator_pt
 The communicator for this problem. More...
 
bool Always_take_one_newton_step
 
double Timestep_reduction_factor_after_nonconvergence
 
bool Keep_temporal_error_below_tolerance
 
- Protected Attributes inherited from oomph::SegregatableFSIProblem
int Pointwise_aitken_counter
 
bool Use_pointwise_aitken
 Use pointwise Aitken extrapolation? More...
 
unsigned Pointwise_aitken_start
 
int Solve_type
 Solve that is taking place (enumerated flag) More...
 
double Convergence_tolerance
 Convergence tolerance for Picard iteration. More...
 
unsigned Max_picard
 Max. number of Picard iterations. More...
 
bool Doc_max_global_residual
 Doc maximum global residual during iteration? (default: false) More...
 
Vector< Data * > Fluid_data_pt
 
Vector< std::vector< bool > > Fluid_value_is_pinned
 
Vector< Data * > Solid_data_pt
 
Vector< std::vector< bool > > Solid_value_is_pinned
 
Vector< doublePrevious_solid_value
 
MeshFluid_mesh_pt
 
MeshSolid_mesh_pt
 
Vector< Mesh * > Orig_sub_mesh_pt
 Backup for the pointers to the submeshes in the original problem. More...
 
Vector< doubleDel_irons_and_tuck
 Vector of changes in Irons and Tuck under-relaxation. More...
 
double R_irons_and_tuck
 Irons and Tuck relaxation factor. More...
 
Vector< Vector< double > > Pointwise_aitken_solid_value
 
bool Recheck_convergence_after_pointwise_aitken
 Have we just done a pointwise Aitken step. More...
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

template<class ELEMENT>
class SegregatedFSICollapsibleChannelProblem< ELEMENT >

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Problem class – add segregated solver capability to existing problem.

//////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// Problem class – add segregated solver capability to an existing problem.

Constructor & Destructor Documentation

◆ SegregatedFSICollapsibleChannelProblem() [1/2]

template<class ELEMENT >
SegregatedFSICollapsibleChannelProblem< ELEMENT >::SegregatedFSICollapsibleChannelProblem ( const unsigned nup,
const unsigned ncollapsible,
const unsigned ndown,
const unsigned ny,
const double lup,
const double lcollapsible,
const double ldown,
const double ly,
const bool displ_control,
const bool steady_flag 
)

Constructor for the collapsible channel problem.

Constructor: The arguments are the same as the original (non-segregated) problem, namely, numbers of elements and lengths of different sections of the domain.

425  :
427  ncollapsible,
428  ndown,
429  ny,
430  lup,
431  lcollapsible,
432  ldown,
433  ly,
434  displ_control,
435  steady_flag)
436 {
437  // Choose convergence criterion based on Flag::Convergence criterion
438  // with tolerance given by Flag::Convergence_tolerance
440  {
443  }
444  else if (Flags::Convergence_criterion==1)
445  {
448  }
449  else if (Flags::Convergence_criterion==2)
450  {
453  }
454 
455  //Selet a convergence-acceleration technique based on control flags
456 
457  // Pointwise Aitken extrapolation
459  {
460  this->enable_pointwise_aitken();
461  }
462  else
463  {
464  this->disable_pointwise_aitken();
465  }
466 
467  // Under-relaxation
469 
470  // Irons and Tuck's extrapolation
472  {
474  }
475  else
476  {
478  }
479 
480  //Initialise the number of Picard iterations
481  Picard_iter = -1;
482 
483  // Doc max. global residual during Picard iteration
485 
486  // Number of wall control points
487  unsigned n_control=10;
488  Control_point_pair.resize(n_control);
489 
490  // Get wall control points
491  for (unsigned i=0;i<n_control;i++)
492  {
493  // Get pointer to/local coordinate in wall element that contains
494  // control node
495  Vector<double> zeta_ctrl(1);
496  zeta_ctrl[0]=this->Lcollapsible*double(i+1)/double(n_control+1);
497  Control_point_pair[i].second.resize(1);
498  this->Wall_geom_object_pt->locate_zeta(zeta_ctrl,
499  Control_point_pair[i].first,
500  Control_point_pair[i].second);
501 
502  Vector<double> r_ctrl(2);
503  Control_point_pair[i].first->position(Control_point_pair[i].second,
504  r_ctrl);
505  }
506 
507 } //end_of_constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Problem class.
Definition: fsi_chan_problem.h:315
MeshAsGeomObject * Wall_geom_object_pt
Geometric object incarnation of the wall mesh.
Definition: fsi_chan_problem.h:466
double Lcollapsible
x-length in the collapsible part of the channel
Definition: fsi_chan_problem.h:424
int Picard_iter
Definition: fsi_chan_seg_driver.cc:218
Vector< std::pair< GeomObject *, Vector< double > > > Control_point_pair
Definition: fsi_chan_seg_driver.cc:224
void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
Definition: mesh_as_geometric_object.h:373
void enable_irons_and_tuck_extrapolation()
Use Irons and Tuck extrapolation for solid dofs.
Definition: segregated_fsi_solver.h:397
void assess_convergence_based_on_max_global_residual()
Definition: segregated_fsi_solver.h:320
void disable_pointwise_aitken()
Disable the use of pointwise Aitken extrapolation.
Definition: segregated_fsi_solver.h:381
void enable_pointwise_aitken()
Definition: segregated_fsi_solver.h:375
void enable_under_relaxation(const double &omega=1.0)
Definition: segregated_fsi_solver.h:391
void disable_irons_and_tuck_extrapolation()
Do not use Irons and Tuck extrapolation for solid dofs.
Definition: segregated_fsi_solver.h:403
bool Doc_max_global_residual
Doc maximum global residual during iteration? (default: false)
Definition: segregated_fsi_solver.h:506
void assess_convergence_based_on_absolute_solid_change()
Definition: segregated_fsi_solver.h:338
void assess_convergence_based_on_relative_solid_change()
Definition: segregated_fsi_solver.h:356
double Convergence_tolerance
Convergence tolerance.
Definition: fsi_chan_seg_driver.cc:75
double Omega_under_relax
Under-relaxation parameter (1.0: no under-relaxation; 0.0: freeze)
Definition: fsi_chan_seg_driver.cc:66
unsigned Use_irons_and_tuck_extrapolation
Use Irons and Tuck extrapolation (1) or not (0)
Definition: fsi_chan_seg_driver.cc:69
unsigned Use_pointwise_aitken
Use pointwise Aitken extrapolation (1) or not (0)
Definition: fsi_chan_seg_driver.cc:63
unsigned Convergence_criterion
Convergence criterion: 0: global resmax; 1: abs. change; 2: rel. change.
Definition: fsi_chan_seg_driver.cc:72
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31

References oomph::SegregatableFSIProblem::assess_convergence_based_on_absolute_solid_change(), oomph::SegregatableFSIProblem::assess_convergence_based_on_max_global_residual(), oomph::SegregatableFSIProblem::assess_convergence_based_on_relative_solid_change(), SegregatedFSICollapsibleChannelProblem< ELEMENT >::Control_point_pair, Flags::Convergence_criterion, Flags::Convergence_tolerance, oomph::SegregatableFSIProblem::disable_irons_and_tuck_extrapolation(), oomph::SegregatableFSIProblem::disable_pointwise_aitken(), oomph::SegregatableFSIProblem::Doc_max_global_residual, oomph::SegregatableFSIProblem::enable_irons_and_tuck_extrapolation(), oomph::SegregatableFSIProblem::enable_pointwise_aitken(), oomph::SegregatableFSIProblem::enable_under_relaxation(), i, FSICollapsibleChannelProblem< ELEMENT >::Lcollapsible, oomph::MeshAsGeomObject::locate_zeta(), Flags::Omega_under_relax, SegregatedFSICollapsibleChannelProblem< ELEMENT >::Picard_iter, Flags::Use_irons_and_tuck_extrapolation, Flags::Use_pointwise_aitken, and FSICollapsibleChannelProblem< ELEMENT >::Wall_geom_object_pt.

◆ ~SegregatedFSICollapsibleChannelProblem() [1/2]

template<class ELEMENT >
SegregatedFSICollapsibleChannelProblem< ELEMENT >::~SegregatedFSICollapsibleChannelProblem ( )
inline

Empty destructor.

244 {}

◆ SegregatedFSICollapsibleChannelProblem() [2/2]

template<class ELEMENT >
SegregatedFSICollapsibleChannelProblem< ELEMENT >::SegregatedFSICollapsibleChannelProblem ( const unsigned nup,
const unsigned ncollapsible,
const unsigned ndown,
const unsigned ny,
const double lup,
const double lcollapsible,
const double ldown,
const double ly,
const bool displ_control,
const bool steady_flag 
)

Constructor: The arguments are the same as the original (non-segregated) problem, namely, numbers of elements and lengths of different sections of the domain.

◆ ~SegregatedFSICollapsibleChannelProblem() [2/2]

template<class ELEMENT >
SegregatedFSICollapsibleChannelProblem< ELEMENT >::~SegregatedFSICollapsibleChannelProblem ( )
inline

Empty Destructor.

108 {}

Member Function Documentation

◆ actions_before_newton_convergence_check() [1/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_newton_convergence_check
virtual

Overload actions after Newton step: Update nodal positions in the fluid mesh in response to any changes in the wall displacement field. If monolithic Newton solver is used, doc progress of Newton iteration, using the same output as during Picard iteration.

Actions after Newton step: Update nodal positions in the fluid mesh in response to any changes in the wall displacement field. If monolithic Newton solver is used, doc progress of Newton iteration, using the same output as during Picard iteration.

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

522 {
523  //For a "true" segregated solver, we would not do this in fluid or solid
524  //solves, but adding the bulk node update to the solid solve phase aids
525  //convergence and makes it possible for larger values of Q. Of course,
526  //there is a small cost associated with doing this.
527  if(Solve_type!=Fluid_solve) {this->Bulk_mesh_pt->node_update();}
528 
529  //If we are solving the full problem using a Newton method
530  //The default Solve_type is Full_solve, so we will have updated the nodes
531  //in the above call
533  {
534  //Update the positions
535  //this->Bulk_mesh_pt->node_update();
536 
537  // Halt timer
538  halt_timer();
539 
540  double rms_change;
541  double max_change;
542  double rms_norm;
543  double max_res=0.0;
544  get_solid_change(rms_change,max_change,rms_norm);
545 
546  DoubleVector residual;
547  get_residuals(residual);
548  max_res=residual.max();
549 
550  std::cout << "==================================================\n";
551  std::cout << "Iteration : "
552  << this->Newton_iter << std::endl;
553  std::cout << "RMS change : "
554  << rms_change << std::endl;
555  std::cout << "Max. change : "
556  << max_change << std::endl;
557  std::cout << "RMS norm : "
558  << rms_norm << std::endl;
559  std::cout << "Max. global residual : "
560  << max_res << std::endl;
561  std::cout << "==================================================\n\n";
562 
563  bool get_max_global_residual=true;
565  rms_change,
566  max_change,
567  rms_norm,
568  max_res,
570  get_max_global_residual);
571 
572  // Store the current values of the solid dofs as reference values
574 
575  // Increment counter
576  this->Newton_iter++;
577 
578  // Restart timer
579  restart_timer();
580  }
581 }
unsigned Newton_iter
Counter for Newton iterations.
Definition: fsi_chan_problem.h:469
AlgebraicCollapsibleChannelMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
Definition: fsi_chan_problem.h:433
ofstream Convergence_file
Output stream to document the convergence history.
Definition: fsi_chan_seg_driver.cc:400
void write_convergence_history(const unsigned &iter, const double &rms_change, const double &max_change, const double &rms_norm, const double &max_res, std::ofstream &convergence_file, const bool &doc_max_global_residual)
Write to convergence history file.
Definition: fsi_chan_seg_driver.cc:288
Definition: double_vector.h:58
double max() const
returns the maximum coefficient
Definition: double_vector.cc:604
virtual void get_residuals(DoubleVector &residuals)
Get the total residuals Vector for the problem.
Definition: problem.cc:3714
@ Fluid_solve
Definition: segregated_fsi_solver.h:421
void restart_timer()
Definition: segregated_fsi_solver.h:450
void halt_timer()
Definition: segregated_fsi_solver.h:460
void get_solid_change(double &rms_change, double &max_change, double &rms_norm)
Definition: segregated_fsi_solver.cc:303
int Solve_type
Solve that is taking place (enumerated flag)
Definition: segregated_fsi_solver.h:497
void store_solid_dofs()
Definition: segregated_fsi_solver.cc:260
unsigned Use_segregated_solver
Use Newton solver (0) or segregated solver (1)?
Definition: fsi_chan_seg_driver.cc:60

References GlobalFct::get_residuals(), oomph::DoubleVector::max(), and Flags::Use_segregated_solver.

◆ actions_before_newton_convergence_check() [2/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_newton_convergence_check ( )
inlinevirtual

Update nodal positions in the fluid mesh in response to changes in the wall displacement field after every Newton step in a monolithic or segregated solid solve. Note the use of the (protected) flag Solve_type, which can take the values Full_solve, Fluid_solve or Solid_solve. This flag is used to allow specification of different actions depending on the precise solve taking place.

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

130  {
131  //For a "true" segregated solver, we would not do this in fluid or solid
132  //solves, but adding the bulk node update to the solid solve phase aids
133  //convergence and makes it possible for larger values of Q. Of course,
134  //there is a small cost associated with doing this.
135  if(Solve_type!=Fluid_solve) {this->Bulk_mesh_pt->node_update();}
136  }

◆ actions_before_newton_solve()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_newton_solve ( )
inlinevirtual

Initialise timer and reset counter for Newton iterations if monolithic solver is used.

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

337  {
339  {
340  // Initialise counter for Newton iteration
341  this->Newton_iter=0;
342 
343  // Initialise timer that allows doc of iteration/cpu time
344  reset_timer();
345  }
346  }
void reset_timer()
Reset timer.
Definition: segregated_fsi_solver.h:439

References Flags::Use_segregated_solver.

◆ actions_before_newton_step()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_newton_step ( )
inlinevirtual

Overload actions before Newton step: Update nodal positions in the fluid mesh in response to any changes in the wall displacement field if segregated solver is used.

Reimplemented from oomph::Problem.

358 {}

◆ actions_before_segregated_convergence_check() [1/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_segregated_convergence_check
virtual

for documentation purposes

Overload actions before the segregated_convergence_check

Actions after Segregated step: Update nodal positions in the fluid mesh in response to any changes in the wall displacement field. If monolithic Newton solver is used, doc progress of Newton iteration, using the same output as during Picard iteration.

Reimplemented from oomph::SegregatableFSIProblem.

593 {
594  //Update the nodal positions (not necesary because we do the solid solve
595  //last, but doesn't really cost us much.
596  this->Bulk_mesh_pt->node_update();
597 
598  //If we are NOT going to do the Aitken acceleration, then increase
599  //the Picard iteration
601 
602  //Stop timing for the documentation
603  halt_timer();
604  double rms_change;
605  double max_change;
606  double rms_norm;
607  double max_res=0.0;
608  get_solid_change(rms_change,max_change,rms_norm);
609 
610  bool get_max_global_residual = Doc_max_global_residual;
611 
612  if (get_max_global_residual)
613  {
618  DoubleVector residual;
619  get_residuals(residual);
620 
621  //Get maximum residuals, using our own abscmp function
622  max_res = residual.max();
623  }
624 
625  // Write
627  rms_change,
628  max_change,
629  rms_norm,
630  max_res,
632  get_max_global_residual);
633 
634 
635  // Restart timer
636  restart_timer();
637 }
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
bool Recheck_convergence_after_pointwise_aitken
Have we just done a pointwise Aitken step.
Definition: segregated_fsi_solver.h:567
void rebuild_monolithic_mesh()
Rebuild global mesh for monolithic discretisation.
Definition: segregated_fsi_solver.cc:87
void restore_solid_dofs()
Restore pinned status of solid dofs.
Definition: segregated_fsi_solver.cc:229
void restore_fluid_dofs()
Restore pinned status of fluid dofs.
Definition: segregated_fsi_solver.cc:176

References GlobalFct::get_residuals(), and oomph::DoubleVector::max().

◆ actions_before_segregated_convergence_check() [2/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_segregated_convergence_check ( )
inlinevirtual

Update nodal positions in the fluid mesh in response to any changes in the wall displacement field after every segregated solve. This is not strictly necessary because we do the solid solve last, which performs its own node update before the convergence check of the sub problem. It remains here because if we were solving in a completely segregated fashion a node update would be required for the fluid mesh in the final converged solution to be consistent with the solid positions.

Reimplemented from oomph::SegregatableFSIProblem.

148  {
149  this->Bulk_mesh_pt->node_update();
150  }

◆ actions_before_segregated_solve()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::actions_before_segregated_solve ( )
inlinevirtual

This function is called once at the start of each segregated solve.

Reimplemented from oomph::SegregatableFSIProblem.

349  {
350  //Initialise the counter for the Picard iteration
351  Picard_iter = -1;
352  }

◆ doc_solution()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::doc_solution ( DocInfo doc_info)

Document the solution.

328 {
329  //Output stream filenames
330  ofstream some_file;
331  char filename[100];
332 
333  // Number of plot points
334  unsigned npts=5;
335 
336  // Output fluid solution
337  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
338  doc_info.number());
339  some_file.open(filename);
340  this->bulk_mesh_pt()->output(some_file,npts);
341  some_file.close();
342 
343  // Document the wall shape
344  sprintf(filename,"%s/beam%i.dat",doc_info.directory().c_str(),
345  doc_info.number());
346  some_file.open(filename);
347  this->wall_mesh_pt()->output(some_file,npts);
348  some_file.close();
349 
350 } // end_of_doc_solution
AlgebraicCollapsibleChannelMesh< ELEMENT > * bulk_mesh_pt()
Access function for the specific bulk (fluid) mesh.
Definition: fsi_chan_problem.h:347
OneDLagrangianMesh< FSIHermiteBeamElement > * wall_mesh_pt()
Access function for the wall mesh.
Definition: fsi_chan_problem.h:357
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
string filename
Definition: MergeRestartFiles.py:39

References oomph::DocInfo::directory(), MergeRestartFiles::filename, and oomph::DocInfo::number().

◆ doc_solution_steady()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::doc_solution_steady ( DocInfo doc_info,
ofstream &  trace_file,
const double cpu,
const unsigned niter 
)

Doc the steady solution.

Doc the solution for a steady run.

775 {
776 
777  ofstream some_file;
778  char filename[100];
779 
780  // Number of plot points
781  unsigned npts;
782  npts=5;
783 
784  // Output fluid solution
785  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
786  doc_info.number());
787  some_file.open(filename);
788  this->bulk_mesh_pt()->output(some_file,npts);
789  some_file.close();
790 
791  // Document the wall shape
792  sprintf(filename,"%s/beam%i.dat",doc_info.directory().c_str(),
793  doc_info.number());
794  some_file.open(filename);
795  this->wall_mesh_pt()->output(some_file,npts);
796  some_file.close();
797 
798 // Write restart file
799  sprintf(filename,"%s/restart%i.dat",doc_info.directory().c_str(),
800  doc_info.number());
801  some_file.open(filename);
802  some_file.precision(16);
803  this->dump_it(some_file);
804  some_file.close();
805 
806  // Write trace file
807  trace_file << Global_Physical_Variables::P_ext_data_pt->value(0) << " ";
808  trace_file << Global_Physical_Variables::Yprescr << " ";
809 
810  // Get vertical position of control points
811  unsigned n_control= Control_point_pair.size();
812 
813  // Get wall control points
814  for (unsigned i=0;i<n_control;i++)
815  {
816  std::pair<GeomObject*,Vector<double> > point=Control_point_pair[i];
817 
818  // Get position
819  Vector<double> r_ctrl(2);
820  point.first->position(point.second,r_ctrl);
821  trace_file << r_ctrl[1] << " ";
822  }
823 
824  // Write trace file
825  trace_file << this->Left_node_pt->value(0) << " "
826  << this->Right_node_pt->value(0) << " "
828  << Flags::Use_pointwise_aitken << " "
829  << Flags::Omega_under_relax << " "
831  << cpu << " "
832  << niter << " "
833  << std::endl;
834 
835 
836 } // end_of_doc_solution_steady
Node * Left_node_pt
Pointer to the left control node.
Definition: fsi_chan_problem.h:445
Node * Right_node_pt
Pointer to right control node.
Definition: fsi_chan_problem.h:448
void dump_it(ofstream &dump_file)
Dump problem to disk to allow for restart.
Definition: fsi_chan_problem.h:974
double value(const unsigned &i) const
Definition: nodes.h:293
double value(const unsigned &i) const
Definition: nodes.cc:2408
Data * P_ext_data_pt
Pointer to Data object that stores external pressure.
Definition: fsi_chan_problem.h:48
double Yprescr
Definition: fsi_chan_problem.h:66

References oomph::DocInfo::directory(), MergeRestartFiles::filename, i, oomph::DocInfo::number(), Flags::Omega_under_relax, Global_Physical_Variables::P_ext_data_pt, Flags::Use_irons_and_tuck_extrapolation, Flags::Use_pointwise_aitken, Flags::Use_segregated_solver, oomph::Data::value(), and Global_Physical_Variables::Yprescr.

◆ doc_solution_unsteady()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::doc_solution_unsteady ( DocInfo doc_info,
ofstream &  trace_file,
const double cpu,
const unsigned niter 
)

Doc the unsteady solution.

Doc the solution for an unstady run.

854 {
855 
856  std::cout << "Doc-ing " << doc_info.number() << std::endl;
857 
858  ofstream some_file;
859  char filename[100];
860 
861  // Number of plot points
862  unsigned npts;
863  npts=5;
864 
865  // Output fluid solution
866  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
867  doc_info.number());
868  some_file.open(filename);
869  this->bulk_mesh_pt()->output(some_file,npts);
870  some_file.close();
871 
872  // Document the wall shape
873  sprintf(filename,"%s/beam%i.dat",doc_info.directory().c_str(),
874  doc_info.number());
875  some_file.open(filename);
876  this->wall_mesh_pt()->output(some_file,npts);
877  some_file.close();
878 
879 // Write restart file
880  sprintf(filename,"%s/restart%i.dat",doc_info.directory().c_str(),
881  doc_info.number());
882  some_file.open(filename);
883  this->dump_it(some_file);
884  some_file.close();
885 
886  // Write trace file
887  trace_file << time_pt()->time() << " ";
888 
889  // Get/doc y-coordinate of control point
890  Vector<double> r(2);
891  this->Ctrl_geom_obj_pt->position(this->S_displ_ctrl,r);
892  trace_file << r[1] << " ";
893 
894  // Get vertical position of control points
895  unsigned n_control= Control_point_pair.size();
896 
897  // Get wall control points
898  for (unsigned i=0;i<n_control;i++)
899  {
900  std::pair<GeomObject*,Vector<double> > point=Control_point_pair[i];
901 
902  // Get position
903  Vector<double> r_ctrl(2);
904  point.first->position(point.second,r_ctrl);
905  trace_file << r_ctrl[1] << " ";
906  }
907 
908  // Write trace file
909  trace_file << this->Left_node_pt->value(0) << " "
910  << this->Right_node_pt->value(0) << " "
912  << Flags::Use_pointwise_aitken << " "
913  << Flags::Omega_under_relax << " "
915  << cpu << " "
916  << niter << " "
917  << std::endl;
918 
919 
920 } // end_of_doc_solution_steady
GeomObject * Ctrl_geom_obj_pt
Definition: fsi_chan_problem.h:458
Vector< double > S_displ_ctrl
Definition: fsi_chan_problem.h:462
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
r
Definition: UniformPSDSelfTest.py:20

References oomph::DocInfo::directory(), MergeRestartFiles::filename, i, oomph::DocInfo::number(), Flags::Omega_under_relax, UniformPSDSelfTest::r, Flags::Use_irons_and_tuck_extrapolation, Flags::Use_pointwise_aitken, and Flags::Use_segregated_solver.

◆ fluid_output_during_picard()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::fluid_output_during_picard ( const unsigned iter,
DocInfo doc_info 
)

Perform output of fluid flow during after the iter-th Picard iteration. This re-implements an empty virtual fct in the SegregatableFSIproblem base class.

◆ identify_fluid_and_solid_dofs() [1/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::identify_fluid_and_solid_dofs ( Vector< Data * > &  fluid_data_pt,
Vector< Data * > &  solid_data_pt,
Mesh *&  fluid_mesh_pt,
Mesh *&  solid_mesh_pt 
)
virtual

Identify the fluid and solid Data and meshes that contain only elements involved in the respective sub-problems. This is a specific implementation of a pure virtual function in the SegregatableFSIProblem base class.

Identify the fluid and solid Data and the meshes that contain only elements that are involved in the respective sub-problems. This implements a pure pure virtual function in the SegregatableFSIProblem base class.

Identify the fluid and solid Data and the meshes that contain only elements that are involved in the respective sub-problems. This implements a pure virtual function in the SegregatableFSIProblem base class.

Implements oomph::SegregatableFSIProblem.

692 {
693 
694  //FLUID DATA:
695  //All fluid elements are stored in the Mesh addressed by bulk_mesh_pt()
696 
697  //Reset the storage
698  fluid_data_pt.clear();
699 
700  //Find number of fluid elements
701  unsigned n_fluid_elem=this->bulk_mesh_pt()->nelement();
702  //Loop over fluid elements and add internal data to fluid_data_ptt
703  for(unsigned e=0;e<n_fluid_elem;e++)
704  {
705  GeneralisedElement* el_pt=this->bulk_mesh_pt()->element_pt(e);
706  unsigned n_internal=el_pt->ninternal_data();
707  for(unsigned i=0;i<n_internal;i++)
708  {
709  fluid_data_pt.push_back(el_pt->internal_data_pt(i));
710  }
711  }
712 
713  //Find number of nodes in fluid mesh
714  unsigned n_fluid_node=this->bulk_mesh_pt()->nnode();
715  //Loop over nodes and add the nodal data to fluid_data_pt
716  for (unsigned n=0;n<n_fluid_node;n++)
717  {
718  fluid_data_pt.push_back(this->bulk_mesh_pt()->node_pt(n));
719  }
720 
721  // The bulk_mesh_pt() is a mesh that contains only fluid elements
722  fluid_mesh_pt = this->bulk_mesh_pt();
723 
724 
725  //SOLID DATA
726  //All solid elements are stored in the Mesh addressed by wall_mesh_pt()
727 
728  //Reset the storage
729  solid_data_pt.clear();
730 
731  //Find number of nodes in the solid mesh
732  unsigned n_solid_node=this->wall_mesh_pt()->nnode();
733  //Loop over nodes and add nodal position data to solid_data_pt
734  for(unsigned n=0;n<n_solid_node;n++)
735  {
736  solid_data_pt.push_back(
737  this->wall_mesh_pt()->node_pt(n)->variable_position_pt());
738  }
739 
740  //If we are using displacement control then the displacement control element
741  //and external pressure degree of freedom should be treated as part
742  //of the solid problem
743 
744  //We will assemble a single solid mesh from a vector of pointers to meshes
745  Vector<Mesh*> s_mesh_pt(1);
746  //The wall_mesh_pt() contains all solid elements and is the first
747  //entry in our vector
748  s_mesh_pt[0]=this->wall_mesh_pt();
749 
750  //If we are using displacement control
751  if (this->Displ_control)
752  {
753  //Add the external pressure data to solid_data_pt
754  solid_data_pt.push_back(Global_Physical_Variables::P_ext_data_pt);
755  //Add a pointer to a Mesh containing the displacement control element
756  //to the vector of pointers to meshes
757  s_mesh_pt.push_back(this->Displ_control_mesh_pt);
758  }
759 
760  // Build "combined" mesh from our vector of solid meshes
761  solid_mesh_pt = new Mesh(s_mesh_pt);
762 
763 } //end_of_identify_fluid_and_solid
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Mesh * Displ_control_mesh_pt
Pointer to the mesh that contains the displacement control element.
Definition: fsi_chan_problem.h:436
bool Displ_control
Use displacement control?
Definition: fsi_chan_problem.h:439
Definition: elements.h:73
Data *& internal_data_pt(const unsigned &i)
Return a pointer to i-th internal data object.
Definition: elements.h:622
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
Definition: mesh.h:67
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596

References e(), i, oomph::GeneralisedElement::internal_data_pt(), n, oomph::GeneralisedElement::ninternal_data(), and Global_Physical_Variables::P_ext_data_pt.

◆ identify_fluid_and_solid_dofs() [2/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::identify_fluid_and_solid_dofs ( Vector< Data * > &  fluid_data_pt,
Vector< Data * > &  solid_data_pt,
Mesh *&  fluid_mesh_pt,
Mesh *&  solid_mesh_pt 
)
virtual

Identify the fluid and solid Data and meshes that contain only elements involved in the respective sub-problems. This is a specific implementation of a pure virtual function in the SegregatableFSIProblem base class.

Implements oomph::SegregatableFSIProblem.

◆ solid_output_during_picard()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::solid_output_during_picard ( const unsigned iter,
DocInfo doc_info 
)

Perform output of wall shape during after the iter-th Picard iteration. This re-implements an empty virtual fct in the SegregatableFSIproblem base class.

◆ steady_run() [1/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::steady_run
virtual

Steady run.

Perform a steady run in which the external pressure (or presribed displacement) is varied causing the channel to collapse.

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

932 {
933 
934  // Set initial value for external pressure (on the wall stiffness scale).
935  // This can be overwritten in set_initial_condition.
937  set_value(0,Global_Physical_Variables::Pmin);
938 
939  // Apply initial condition
941 
942  //Set output directory
943  DocInfo doc_info;
944  doc_info.set_directory("RESLT");
945 
946  // Open a trace file
947  ofstream trace_file;
948  char filename[100];
949  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
950  trace_file.open(filename);
951 
952 
953 
954  // Write trace file header
955  trace_file << "VARIABLES=\"p<sub>ext</sub>\","
956  << "\"y<sub>ctrl</sub>\",";
957  unsigned n_control= Control_point_pair.size();
958  for (unsigned i=0;i<n_control;i++)
959  {
960  trace_file << "\"y_" << i << "\",";
961  }
962  trace_file << "\"u_1\","
963  << "\"u_2\","
964  << "\"segregated solver flag\","
965  << "\"Aitken flag\","
966  << "\"Under-relaxation factor\","
967  << "\"Irons and Tuck flag\","
968  << "\"CPU time for solve\","
969  << "\"Number of iterations\""
970  << std::endl;
971 
972  trace_file << "ZONE T=\"";
973  trace_file << "Re=" << Global_Physical_Variables::Re << ", ";
974  trace_file << "Q=" << Global_Physical_Variables::Q << ", ";
975  trace_file << "resolution factor: " << Flags::Resolution_factor << ", ";
977  {
978  trace_file << "Picard";
980  {
981  trace_file << " with Irons and Tuck";
982  trace_file << " with initial under-relaxation factor of "
984  }
985  else
986  {
987  trace_file << " with fixed under-relaxation factor of "
989  }
990  trace_file << "; Tol = "
992  }
993  else
994  {
995  trace_file << "Newton";
996  }
997  trace_file << "\"" << std::endl;
998 
999  // Output the initial solution (dummies for CPU time and # of picard iters
1000  doc_solution_steady(doc_info, trace_file,0.0,0);
1001 
1002  // Increment step number
1003  doc_info.number()++;
1004 
1005 
1006  // Increment for external pressure (on the wall stiffness scale)
1007  double delta_p=(Global_Physical_Variables::Pmax-
1009 
1010  // Initial and final values for control position
1012 
1013  // Steady run: Go down to 0.6. Preparation for unsteady: Go down to 0.65
1014  double y_min=0.65; // 0.65; // 0.6;
1015  double delta_y=(y_min-Global_Physical_Variables::Yprescr)/
1016  double(Flags::Nsteps-1);
1017 
1018  // Boolean flag used to specify whether a full setup of solid and fluid dofs
1019  // is required
1020  bool full_setup = true;
1021 
1022  // Parameter study
1023  //----------------
1024  for (unsigned istep=0;istep<Flags::Nsteps;istep++)
1025  {
1026 
1027  // Displacement control?
1028  if (this->Displ_control)
1029  {
1030  std::cout << "Solving for control displ = "
1032  << std::endl;
1033  }
1034  else
1035  {
1036  std::cout << "Solving for p_ext = "
1038  << std::endl;
1039  }
1040 
1041  // Object that stores the convergence data for Picard iteration
1042  PicardConvergenceData conv_data;
1043 
1044  // Number of iterations taken
1045  unsigned niter=0;
1046 
1047  // Setup segregated solver in either case
1048  setup_segregated_solver(full_setup);
1049 
1050  // Solve the problem
1051  //------------------
1052  clock_t t_start = clock();
1053 
1054 
1055  // SEGREGATED SOLVER
1056  //==================
1058  {
1059  Max_picard =50;
1060  // Doc convergence history?
1061  if (doc_info.is_doc_enabled())
1062  {
1063  // Initialise timer that allows doc of iteration/cpu time
1064  reset_timer();
1065 
1066  // Halt timer before output of reference data
1067  halt_timer();
1068 
1069  char filename[100];
1070  sprintf(filename,"%s/picard_convergence%i.dat",
1071  doc_info.directory().c_str(),
1072  doc_info.number());
1073  Convergence_file.open(filename);
1074 
1075  bool get_max_global_residual= Doc_max_global_residual;
1077  get_max_global_residual);
1078  // Restart timer after doc
1079  restart_timer();
1080  }
1081 
1082  // Solve and return converence data
1083  conv_data=steady_segregated_solve();
1084 
1085  niter=conv_data.niter();
1086 
1087  Convergence_file.close();
1088 
1089  if (conv_data.cpu_total()!=0.0)
1090  {
1091  std::cout
1092  << std::endl << std::endl << std::endl
1093  << "PERCENTAGE OF CPU TIME SPENT IN COMPUTATION OF GLOBAL RESIDUAL="
1094  << double(conv_data.cpu_for_global_residual()/
1095  conv_data.cpu_total())*100.0
1096  << std::endl << std::endl << std::endl <<std::endl;
1097 
1098  std::cout
1099  << "PERCENTAGE OF CPU TIME SPENT IN COMPUTATION OF NON-ESSENTIAL BITS="
1100  << double((conv_data.cpu_total()-conv_data.essential_cpu_total())/
1101  conv_data.cpu_total())*100.0 << " "
1102  << conv_data.cpu_total() << " "
1103  << conv_data.essential_cpu_total() << " "
1104  << std::endl << std::endl << std::endl <<std::endl;
1105  }
1106 
1107 
1108  }
1109 
1110  // NEWTON SOLVER
1111  //==============
1112  else
1113  {
1114  // Doc convergence history?
1115  if (doc_info.is_doc_enabled())
1116  {
1117  // Initialise timer that allows doc of iteration/cpu time
1118  reset_timer();
1119 
1120  // Halt timer before output of reference data
1121  halt_timer();
1122 
1123  // Store the current values of the solid dofs as reference values
1124  store_solid_dofs();
1125 
1126  char filename[100];
1127  sprintf(filename,"%s/newton_convergence%i.dat",
1128  doc_info.directory().c_str(),
1129  doc_info.number());
1130  Convergence_file.open(filename);
1131 
1132  bool get_max_global_residual=true;
1134  get_max_global_residual);
1135 
1136  // Restart timer after doc
1137  restart_timer();
1138  }
1139 
1140  // Explit call to the steady Newton solve.
1142 
1143  // Number of iterations
1144  niter=this->Newton_iter;
1145 
1146  Convergence_file.close();
1147  }
1148  clock_t t_end= clock();
1149  double cpu=double(t_end-t_start)/CLOCKS_PER_SEC;
1150 
1151 
1152 
1153  // Outpt the solution
1154  //-------------------
1155  doc_solution_steady(doc_info,trace_file,cpu,niter);
1156 
1157  // Step number
1158  doc_info.number()++;
1159 
1160  // Adjust control parameter
1161  if (this->Displ_control)
1162  {
1163  // Increment control position
1165  }
1166  else
1167  {
1168  // Increment external pressure
1171  }
1172 
1173  //We no longer need a full setup of the dofs
1174  full_setup = false;
1175 
1176  }
1177 
1178  // Close trace file.
1179  trace_file.close();
1180 
1181 }
void set_initial_condition()
Apply initial conditions.
Definition: fsi_chan_problem.h:1073
void doc_solution_steady(DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
Doc the steady solution.
Definition: fsi_chan_seg_driver.cc:770
void write_convergence_history_header(std::ofstream &convergence_file, const bool &doc_max_global_residual)
Write header for convergence history file.
Definition: fsi_chan_seg_driver.cc:259
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: oomph_utilities.h:499
bool is_doc_enabled() const
Are we documenting?
Definition: oomph_utilities.h:548
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
Object that collates convergence data of Picard iteration.
Definition: segregated_fsi_solver.h:40
unsigned & niter()
Number of iterations performed.
Definition: segregated_fsi_solver.h:57
double & cpu_for_global_residual()
Definition: segregated_fsi_solver.h:80
double & essential_cpu_total()
Definition: segregated_fsi_solver.h:71
double & cpu_total()
Total CPU time for segregated solve.
Definition: segregated_fsi_solver.h:63
void steady_newton_solve(unsigned const &max_adapt=0)
Definition: problem.cc:9292
void setup_segregated_solver(const bool &full_setup_of_fluid_and_solid_dofs=true)
Definition: segregated_fsi_solver.cc:1111
PicardConvergenceData steady_segregated_solve()
Definition: segregated_fsi_solver.cc:964
unsigned Max_picard
Max. number of Picard iterations.
Definition: segregated_fsi_solver.h:503
unsigned Resolution_factor
Resolution factor (multiplier for number of elements across channel)
Definition: fsi_chan_problem.h:236
unsigned Nsteps
Number of steps in parameter study.
Definition: fsi_chan_problem.h:245
double Pmax
Definition: fsi_chan_problem.h:58
double Q
Ratio of scales.
Definition: elastic_bretherton.cc:131
double Re
Reynolds number.
Definition: fibre.cc:55
double Pmin
Definition: fsi_chan_problem.h:53

References Flags::Convergence_tolerance, oomph::PicardConvergenceData::cpu_for_global_residual(), oomph::PicardConvergenceData::cpu_total(), oomph::DocInfo::directory(), oomph::PicardConvergenceData::essential_cpu_total(), MergeRestartFiles::filename, i, oomph::DocInfo::is_doc_enabled(), oomph::PicardConvergenceData::niter(), Flags::Nsteps, oomph::DocInfo::number(), Flags::Omega_under_relax, Global_Physical_Variables::P_ext_data_pt, Global_Physical_Variables::Pmax, Global_Physical_Variables::Pmin, Global_Physical_Variables::Q, Global_Physical_Variables::Re, Flags::Resolution_factor, oomph::DocInfo::set_directory(), oomph::Data::set_value(), Flags::Use_irons_and_tuck_extrapolation, Flags::Use_segregated_solver, oomph::Data::value(), and Global_Physical_Variables::Yprescr.

◆ steady_run() [2/2]

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::steady_run ( )
virtual

Perform a steady run.

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

◆ unsteady_run()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::unsteady_run ( const double dummy_dt = 0.1)
virtual

Unsteady run.

Unsteady run, dummy argument to be consistent with definition in FSICollapsibleChannelProblem

Reimplemented from FSICollapsibleChannelProblem< ELEMENT >.

1195 {
1196 
1197  // Set initial value for external pressure (on the wall stiffness scale).
1198  // Will be overwritten by restart data if a restart file (and pressure
1199  // jump) are specified
1201  set_value(0,Global_Physical_Variables::Pmax);
1202 
1203  // Timestep
1204  double dt=Flags::Dt;
1205 
1206  // Initialise timestep -- also sets the weights for all timesteppers
1207  // in the problem.
1208  initialise_dt(dt);
1209 
1210  std::cout << "Pressure before set initial: "
1212  << std::endl;
1213 
1214  // Apply initial condition
1216 
1217  std::cout << "Pressure after set initial: "
1219  << std::endl;
1220 
1221  //Set output directory
1222  DocInfo doc_info;
1223  doc_info.set_directory("RESLT");
1224 
1225  // Open a trace file
1226  ofstream trace_file;
1227  char filename[100];
1228  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
1229  trace_file.open(filename);
1230 
1231 
1232  // Write trace file header
1233  trace_file << "VARIABLES=\"time\","
1234  << "\"y<sub>ctrl</sub>\",";
1235  unsigned n_control=Control_point_pair.size();
1236  for (unsigned i=0;i<n_control;i++)
1237  {
1238  trace_file << "\"y_" << i << "\",";
1239  }
1240  trace_file << "\"u_1\","
1241  << "\"u_2\","
1242  << "\"segregated solver flag\","
1243  << "\"Aitken flag\","
1244  << "\"Under-relaxation factor\","
1245  << "\"Irons and Tuck flag\","
1246  << "\"CPU time for solve\","
1247  << "\"Number of iterations\""
1248  << std::endl;
1249 
1250  trace_file << "ZONE T=\"";
1251  trace_file << "Re=" << Global_Physical_Variables::Re << ", ";
1252  trace_file << "Q=" << Global_Physical_Variables::Q << ", ";
1253  trace_file << "resolution factor: " << Flags::Resolution_factor << ", ";
1255  {
1256  trace_file << "Picard";
1258  {
1259  trace_file << " with Irons and Tuck";
1260  trace_file << " with initial under-relaxation factor of "
1262  }
1263  else
1264  {
1265  trace_file << " with fixed under-relaxation factor of "
1267  }
1268  trace_file << "; Tol = "
1270  }
1271  else
1272  {
1273  trace_file << "Newton";
1274  }
1275  trace_file << "\"" << std::endl;
1276 
1277 
1278  // Output the initial solution (dummies for CPU time and # of picard iters
1279  doc_solution_unsteady(doc_info, trace_file,0.0,0);
1280 
1281  // Increment step number
1282  doc_info.number()++;
1283 
1284  // Boolean flag used to specify whether a full setup of solid and fluid dofs
1285  // is required
1286  bool full_setup = true;
1287 
1288  // Timestepping loop
1289  //------------------
1290  for (unsigned istep=0;istep<Flags::Nsteps;istep++)
1291  {
1292 
1293  // Object that stores the convergence data for Picard iteration
1294  PicardConvergenceData conv_data;
1295 
1296  // Number iterations taken
1297  unsigned niter=0;
1298 
1299  // Setup segregated solver in either case
1300  setup_segregated_solver(full_setup);
1301 
1302  // Solve the problem
1303  //------------------
1304  clock_t t_start = clock();
1306  {
1307  Max_picard = 50;
1308  // Doc convergence history?
1309  if (doc_info.is_doc_enabled())
1310  {
1311  // Initialise timer that allows doc of iteration/cpu time
1312  reset_timer();
1313 
1314  // Halt timer before setup of reference data/doc
1315  halt_timer();
1316 
1317  // Store the current values of the solid dofs as reference values
1318  //store_solid_dofs();
1319 
1320  char filename[100];
1321  sprintf(filename,"%s/picard_convergence%i.dat",
1322  doc_info.directory().c_str(),
1323  doc_info.number());
1324  Convergence_file.open(filename);
1325 
1326  bool get_max_global_residual=Doc_max_global_residual;
1328  get_max_global_residual);
1329 
1330  // Restart timer after setup/doc of reference data
1331  restart_timer();
1332  }
1333 
1334  // Solve and return convergence data
1335  conv_data=unsteady_segregated_solve(dt);
1336 
1337  niter=conv_data.niter();
1338 
1339  Convergence_file.close();
1340 
1341  if (conv_data.cpu_total()!=0.0)
1342  {
1343  std::cout
1344  << std::endl << std::endl << std::endl
1345  << "PERCENTAGE OF CPU TIME SPENT IN COMPUTATION OF GLOBAL RESIDUAL="
1346  << double(conv_data.cpu_for_global_residual()/
1347  conv_data.cpu_total())*100.0
1348  << std::endl << std::endl << std::endl <<std::endl;
1349 
1350  std::cout
1351  <<"PERCENTAGE OF CPU TIME SPENT IN COMPUTATION OF NON-ESSENTIAL BITS="
1352  << double((conv_data.cpu_total()-conv_data.essential_cpu_total())/
1353  conv_data.cpu_total())*100.0 << " "
1354  << conv_data.cpu_total() << " "
1355  << conv_data.essential_cpu_total() << " "
1356  << std::endl << std::endl << std::endl <<std::endl;
1357  }
1358  }
1359  else
1360  {
1361 
1362  // Doc convergence history?
1363  if (doc_info.is_doc_enabled())
1364  {
1365  // Initialise timer that allows doc of iteration/cpu time
1366  reset_timer();
1367 
1368  // Halt timer before setup of reference data/doc
1369  halt_timer();
1370 
1371  // Store the current values of the solid dofs as reference values
1372  store_solid_dofs();
1373 
1374  char filename[100];
1375  sprintf(filename,"%s/newton_convergence%i.dat",
1376  doc_info.directory().c_str(),
1377  doc_info.number());
1378  Convergence_file.open(filename);
1379 
1380  bool get_max_global_residual=true;
1382  get_max_global_residual);
1383 
1384  // Restart timer after setup/doc of reference data
1385  restart_timer();
1386  }
1387 
1388  // Explit call to the unsteady Newton solve.
1390 
1391  // Number of Newton iterations
1392  niter=this->Newton_iter;
1393 
1394  Convergence_file.close();
1395 
1396  }
1397 
1398  clock_t t_end= clock();
1399  double cpu=double(t_end-t_start)/CLOCKS_PER_SEC;
1400 
1401 
1402  // Output the solution
1403  //--------------------
1404  doc_solution_unsteady(doc_info,trace_file,cpu,niter);
1405 
1406  // Step number
1407  doc_info.number()++;
1408 
1409  // Only keep the last ten solutions unless we're using the
1410  // Newton solver
1412  {
1413  if (doc_info.number()==10) doc_info.number()-=10;
1414  std::cout << "Resetting doc file numbers" << std::endl;
1415  }
1416 
1417 
1418  //We no longer need a full setup of the dofs
1419  full_setup = false;
1420 
1421  }
1422 
1423  // Close trace file.
1424  trace_file.close();
1425 
1426 }
void doc_solution_unsteady(DocInfo &doc_info, ofstream &trace_file, const double &cpu, const unsigned &niter)
Doc the unsteady solution.
Definition: fsi_chan_seg_driver.cc:849
void initialise_dt(const double &dt)
Definition: problem.cc:13231
void unsteady_newton_solve(const double &dt)
Definition: problem.cc:10953
PicardConvergenceData unsteady_segregated_solve(const double &dt)
Definition: segregated_fsi_solver.cc:1033
double Dt
Timestep.
Definition: fsi_chan_seg_driver.cc:78

References Flags::Convergence_tolerance, oomph::PicardConvergenceData::cpu_for_global_residual(), oomph::PicardConvergenceData::cpu_total(), oomph::DocInfo::directory(), Flags::Dt, oomph::PicardConvergenceData::essential_cpu_total(), MergeRestartFiles::filename, i, oomph::DocInfo::is_doc_enabled(), oomph::PicardConvergenceData::niter(), Flags::Nsteps, oomph::DocInfo::number(), Flags::Omega_under_relax, Global_Physical_Variables::P_ext_data_pt, Global_Physical_Variables::Pmax, Global_Physical_Variables::Q, Global_Physical_Variables::Re, Flags::Resolution_factor, oomph::DocInfo::set_directory(), Flags::Use_irons_and_tuck_extrapolation, Flags::Use_segregated_solver, and oomph::Data::value().

◆ write_convergence_history()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::write_convergence_history ( const unsigned iter,
const double rms_change,
const double max_change,
const double rms_norm,
const double max_res,
std::ofstream &  convergence_file,
const bool doc_max_global_residual 
)
inline

Write to convergence history file.

296  {
297 
298  // Doc iteration number
299  convergence_file << iter << " ";
300 
301  // Doc elapsed cpu time
302  convergence_file << t_spent_on_actual_solve()
303  << " ";
304 
305  // Get wall control points
306  unsigned n_control=Control_point_pair.size();
307  for (unsigned i=0;i<n_control;i++)
308  {
309  // Get position
310  Vector<double> r_ctrl(2);
311  Control_point_pair[i].first->position(Control_point_pair[i].second,
312  r_ctrl);
313  convergence_file << r_ctrl[1] << " ";
314  }
315 
316  // Max. change:
317  convergence_file << rms_change << " "
318  << max_change << " "
319  << rms_norm << " " ;
320  if (doc_max_global_residual) convergence_file << max_res << " ";
321  convergence_file << std::endl;
322 
323  }
double t_spent_on_actual_solve()
Total elapsed time since start of solve.
Definition: segregated_fsi_solver.h:471

References i.

◆ write_convergence_history_header()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::write_convergence_history_header ( std::ofstream &  convergence_file,
const bool doc_max_global_residual 
)
inline

Write header for convergence history file.

261  {
262  convergence_file
263  << "VARIABLES=\"iteration\",\"CPU time (excluding doc etc.)\",";
264 
265  unsigned n_control=Control_point_pair.size();
266  for (unsigned i=0;i<n_control;i++)
267  {
268  convergence_file << "\"control point" << i << "\",";
269  }
270  convergence_file << "\"rms change\","
271  << "\"max change\",\"rms norm\"";
272  if (doc_max_global_residual)
273  {
274  convergence_file << ",\"max global residual\"";
275  }
276  convergence_file << std::endl;
277 
278  // Fill in zone header as defined in the derived problem
279  // (or call empty version defined in here....)
280  write_zone_info_for_convergence_history(convergence_file);
281 
282  }
void write_zone_info_for_convergence_history(ofstream &convergence_file)
Definition: fsi_chan_seg_driver.cc:648

References i.

◆ write_zone_info_for_convergence_history()

template<class ELEMENT >
void SegregatedFSICollapsibleChannelProblem< ELEMENT >::write_zone_info_for_convergence_history ( ofstream &  convergence_file)

Overload empty virtual function that is called before header for convergence history is written. This can be overloaded to insert zone information that can be used to identify the problem parameters for this solve.

Overload empty virtual function that is called before header for convergence history is written. Overloaded to insert zone information that can be used to identify the problem parameters for this solve.

649 {
650 
651  convergence_file << "ZONE T=\"";
652  convergence_file << "Re=" << Global_Physical_Variables::Re << ", ";
653  convergence_file << "Q=" << Global_Physical_Variables::Q << ", ";
654  convergence_file << "resolution factor: " << Flags::Resolution_factor << ", ";
656  {
657  convergence_file << "Picard";
659  {
660  convergence_file << " with Irons and Tuck";
661  convergence_file << " with initial under-relaxation factor of "
663  }
664  else
665  {
666  convergence_file << " with fixed under-relaxation factor of "
668  }
669  convergence_file << "; Tol = "
671  }
672  else
673  {
674  convergence_file << "Newton";
675  }
676  convergence_file << "\""<< std::endl;
677 
678 }

References Flags::Convergence_tolerance, Flags::Omega_under_relax, Global_Physical_Variables::Q, Global_Physical_Variables::Re, Flags::Resolution_factor, Flags::Use_irons_and_tuck_extrapolation, and Flags::Use_segregated_solver.

Member Data Documentation

◆ Control_point_pair

template<class ELEMENT >
Vector<std::pair<GeomObject*, Vector<double> > > SegregatedFSICollapsibleChannelProblem< ELEMENT >::Control_point_pair
private

Vector of pairs of pointers to wall elements (in their incarnation as GeomObjects) that contains the control points and the local coordinate in those objects

Referenced by SegregatedFSICollapsibleChannelProblem< ELEMENT >::SegregatedFSICollapsibleChannelProblem().

◆ Convergence_file

template<class ELEMENT >
ofstream SegregatedFSICollapsibleChannelProblem< ELEMENT >::Convergence_file
private

Output stream to document the convergence history.

◆ Picard_iter


The documentation for this class was generated from the following files: