FSIRingProblem Class Reference
+ Inheritance diagram for FSIRingProblem:

Public Member Functions

 FSIRingProblem (const unsigned &nelement_wall, const double &eps_ampl, const double &pcos_initial, const double &pcos_duration)
 
void actions_after_newton_solve ()
 Update after solve (empty) More...
 
void actions_before_newton_solve ()
 Update before solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void actions_after_adapt ()
 Update the problem specs after adaptation: More...
 
void doc_solution (const unsigned &i, DocInfo &doc_info, ofstream &trace_file)
 
void dynamic_run ()
 Do dynamic run. More...
 
 FSIRingProblem (const unsigned &nelement_wall, const double &eps_ampl, const double &pcos_initial, const double &pcos_duration, const unsigned &i_case)
 
void actions_after_newton_solve ()
 Update after solve (empty) More...
 
void actions_before_newton_solve ()
 Update before solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void actions_after_adapt ()
 Update the problem specs after adaptation: More...
 
void doc_solution (const unsigned &i, DocInfo &doc_info, ofstream &trace_file, const unsigned &i_case)
 
void dynamic_run (const unsigned &i_case)
 Do dynamic run. More...
 
 FSIRingProblem (const unsigned &nelement_wall, const double &eps_ampl, const double &pcos_initial, const double &pcos_duration)
 
 ~FSIRingProblem ()
 
void actions_after_newton_solve ()
 Update after solve (empty) More...
 
void actions_before_newton_solve ()
 Update before solve (empty) More...
 
void actions_before_newton_convergence_check ()
 
void actions_after_adapt ()
 Update the problem specs after adaptation: More...
 
void actions_after_distribute ()
 Update the problem specs after distribution: More...
 
void doc_solution (const unsigned &i, DocInfo &doc_info, ofstream &trace_file)
 
void dynamic_run ()
 Do dynamic run. 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
 
virtual void actions_before_adapt ()
 
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 ()
 

Private Types

typedef AlgebraicElement< RefineableQCrouzeixRaviartElement< 2 > > FLUID_ELEMENT
 
typedef FSIHermiteBeamElement SOLID_ELEMENT
 Typedef to specify the solid element used. More...
 
typedef AlgebraicElement< RefineableQCrouzeixRaviartElement< 2 > > FLUID_ELEMENT
 
typedef FSIHermiteBeamElement SOLID_ELEMENT
 Typedef to specify the solid element used. More...
 
typedef AlgebraicElement< RefineableQCrouzeixRaviartElement< 2 > > FLUID_ELEMENT
 
typedef FSIHermiteBeamElement SOLID_ELEMENT
 Typedef to specify the solid element used. More...
 

Private Member Functions

void set_initial_condition ()
 Setup initial condition for both domains. More...
 
void set_wall_initial_condition ()
 Setup initial condition for wall. More...
 
void set_fluid_initial_condition ()
 Setup initial condition for fluid. More...
 
void set_initial_condition ()
 Setup initial condition for both domains. More...
 
void set_wall_initial_condition ()
 Setup initial condition for wall. More...
 
void set_fluid_initial_condition ()
 Setup initial condition for fluid. More...
 
void set_initial_condition ()
 Setup initial condition for both domains. More...
 
void set_wall_initial_condition ()
 Setup initial condition for wall. More...
 
void set_fluid_initial_condition ()
 Setup initial condition for fluid. More...
 

Private Attributes

SOLID_ELEMENTDoc_displacement_elem_pt
 Element used for documenting displacement. More...
 
OneDLagrangianMesh< SOLID_ELEMENT > * Wall_mesh_pt
 Pointer to wall mesh. More...
 
AlgebraicRefineableQuarterCircleSectorMesh< FLUID_ELEMENT > * Fluid_mesh_pt
 Pointer to fluid mesh. More...
 
GeomObjectUndef_geom_pt
 Pointer to geometric object that represents the undeformed wall shape. More...
 
Newmark< 2 > * Wall_time_stepper_pt
 Pointer to wall timestepper. More...
 
BDF< 2 > * Fluid_time_stepper_pt
 Pointer to fluid timestepper. More...
 
NodeVeloc_trace_node_pt
 Pointer to node on coarsest mesh on which velocity is traced. More...
 
double Eps_ampl
 Amplitude of initial deformation. More...
 
double Pcos_initial
 Initial pcos. More...
 
double Pcos_duration
 Duration of initial pcos. 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 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 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_before_newton_step ()
 
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 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
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

FSI Ring problem: a fluid-structure interaction problem in which a viscous fluid bounded by an initially circular beam is set into motion by a small sinusoidal perturbation of the beam (the domain boundary).

Member Typedef Documentation

◆ FLUID_ELEMENT [1/3]

There are very few element types that will work for this problem. Rather than passing the element type as a template parameter to the problem, we choose instead to use a typedef to specify the particular element fluid used.

◆ FLUID_ELEMENT [2/3]

There are very few element types that will work for this problem. Rather than passing the element type as a template parameter to the problem, we choose instead to use a typedef to specify the particular element fluid used.

◆ FLUID_ELEMENT [3/3]

There are very few element types that will work for this problem. Rather than passing the element type as a template parameter to the problem, we choose instead to use a typedef to specify the particular element fluid used.

◆ SOLID_ELEMENT [1/3]

Typedef to specify the solid element used.

◆ SOLID_ELEMENT [2/3]

Typedef to specify the solid element used.

◆ SOLID_ELEMENT [3/3]

Typedef to specify the solid element used.

Constructor & Destructor Documentation

◆ FSIRingProblem() [1/3]

FSIRingProblem::FSIRingProblem ( const unsigned N,
const double eps_ampl,
const double pcos_initial,
const double pcos_duration 
)

Constructor: Number of elements in wall mesh, amplitude of the initial wall deformation, amplitude of pcos perturbation and its duration.

Constructor for FSI ring problem. Pass number of wall elements and length of wall (in Lagrangian coordinates) amplitude of initial deformation, pcos perturbation and duration.

432  :
433  Eps_ampl(eps_ampl), Pcos_initial(pcos_initial),
434  Pcos_duration(pcos_duration)
435 {
436  //-----------------------------------------------------------
437  // Create timesteppers
438  //-----------------------------------------------------------
439 
440  // Allocate the wall timestepper and add it to the problem's vector
441  // of timesteppers
444 
445  // Allocate the fluid timestepper and add it to the problem's Vector
446  // of timesteppers
449 
450  //----------------------------------------------------------
451  // Create the wall mesh
452  //----------------------------------------------------------
453 
454  // Undeformed wall is an elliptical ring
455  Undef_geom_pt = new Ellipse(1.0,1.0);
456 
457  //Length of wall in Lagrangian coordinates
458  double L = 2.0*atan(1.0);
459 
460  //Now create the (Lagrangian!) mesh
461  Wall_mesh_pt = new
463 
464  //----------------------------------------------------------
465  // Set the boundary conditions for wall mesh (problem)
466  //----------------------------------------------------------
467 
468  // Bottom boundary: (Boundary 0)
469  // No vertical displacement
470  Wall_mesh_pt->boundary_node_pt(0,0)->pin_position(1);
471  // Zero slope: Pin type 1 dof for displacement direction 0
472  Wall_mesh_pt->boundary_node_pt(0,0)->pin_position(1,0);
473 
474  // Top boundary: (Boundary 1)
475  // No horizontal displacement
476  Wall_mesh_pt->boundary_node_pt(1,0)->pin_position(0);
477  // Zero slope: Pin type 1 dof for displacement direction 1
478  Wall_mesh_pt->boundary_node_pt(1,0)->pin_position(1,1);
479 
480 
481  //-----------------------------------------------------------
482  // Create the fluid mesh:
483  //-----------------------------------------------------------
484 
485  // Fluid mesh is suspended from wall between the following Lagrangian
486  // coordinates:
487  double xi_lo=0.0;
488  double xi_hi=L;
489 
490  // Fractional position of dividing line for two outer blocks in mesh
491  double fract_mid=0.5;
492 
493  //Create a geometric object that represents the wall geometry from the
494  //wall mesh (one Lagrangian, two Eulerian coordinates).
495  MeshAsGeomObject *wall_mesh_as_geometric_object_pt
497 
498  // Build fluid mesh using the wall mesh as a geometric object
500  (wall_mesh_as_geometric_object_pt,
501  xi_lo,fract_mid,xi_hi,Fluid_time_stepper_pt);
502 
503  // Set the error estimator
506 
507  // Extract pointer to node at center of mesh
508  unsigned nnode=Fluid_mesh_pt->finite_element_pt(0)->nnode();
510 
511  //-------------------------------------------------------
512  // Set the fluid boundary conditions
513  //-------------------------------------------------------
514 
515  // Bottom boundary (boundary 0):
516  {
517  unsigned n_node = Fluid_mesh_pt->nboundary_node(0);
518  for (unsigned n=0;n<n_node;n++)
519  {
520  // Pin vertical velocity
522  }
523  }
524 
525  // Ring boundary (boundary 1):
526  // No slip; this also implies that the velocity needs
527  // to be updated in response to wall motion
528  {
529  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
530  for (unsigned n=0;n<n_node;n++)
531  {
532  // Which node are we dealing with?
533  Node* node_pt=Fluid_mesh_pt->boundary_node_pt(1,n);
534 
535  // Set auxiliary update function pointer
538 
539  // Pin both velocities
540  for(unsigned i=0;i<2;i++) {node_pt->pin(i);}
541  }
542  }
543 
544  // Left boundary (boundary 2):
545  {
546  unsigned n_node = Fluid_mesh_pt->nboundary_node(2);
547  for (unsigned n=0;n<n_node;n++)
548  {
549  // Pin horizontal velocity
551  }
552  }
553 
554 
555  //--------------------------------------------------------
556  // Add the submeshes and build global mesh
557  // -------------------------------------------------------
558 
559  // Wall mesh
561 
562  //Fluid mesh
564 
565  // Combine all submeshes into a single Mesh
567 
568 
569  //----------------------------------------------------------
570  // Finish problem setup
571  // ---------------------------------------------------------
572 
573  //Find number of elements in fluid mesh
574  unsigned n_element = Fluid_mesh_pt->nelement();
575 
576  // Loop over the fluid elements to set up element-specific
577  // things that cannot be handled by constructor
578  for(unsigned e=0;e<n_element;e++)
579  {
580  // Upcast from FiniteElement to the present element
581  FLUID_ELEMENT *el_pt
582  = dynamic_cast<FLUID_ELEMENT*>(Fluid_mesh_pt->element_pt(e));
583 
584  //Set the Reynolds number, etc
585  el_pt->re_pt() = &Global_Physical_Variables::Re;
586  el_pt->re_st_pt() = &Global_Physical_Variables::ReSt;
587 
588 
589  el_pt->evaluate_shape_derivs_by_direct_fd();
590 
591 // el_pt->evaluate_shape_derivs_by_chain_rule();
592 // el_pt->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
593 
594 // if (e==0)
595 // {
596 // el_pt->disable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
597 // }
598 // else
599 // {
600 // el_pt->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
601 // }
602 
603  //el_pt->evaluate_shape_derivs_by_direct_fd();
604 
605  }
606 
607 
608  //Loop over the solid elements to set physical parameters etc.
609  unsigned n_wall_element = Wall_mesh_pt->nelement();
610  for(unsigned e=0;e<n_wall_element;e++)
611  {
612  //Cast to proper element type
613  SOLID_ELEMENT *el_pt = dynamic_cast<SOLID_ELEMENT*>(
614  Wall_mesh_pt->element_pt(e));
615 
616  //Set physical parameters for each element:
618  el_pt->lambda_sq_pt() = &Global_Physical_Variables::Lambda_sq;
619 
620  //Function that specifies the external load Vector
621  el_pt->load_vector_fct_pt() = &Global_Physical_Variables::pcos_load;
622 
623  // Function that specifies the load ratios
624  el_pt->q_pt() = &Global_Physical_Variables::Q;
625 
626  //Assign the undeformed beam shape
627  el_pt->undeformed_beam_pt() = Undef_geom_pt;
628  }
629 
630  // Establish control displacment: (even if no displacement control is applied
631  // we still want to doc the displacement at the same point)
632 
633  // Choose element: (This is the last one)
634  Doc_displacement_elem_pt = dynamic_cast<SOLID_ELEMENT*>(
635  Wall_mesh_pt->element_pt(n_wall_element-1));
636 
637  // Setup fsi: Work out which fluid dofs affect the wall elements
638  // the correspondance between wall dofs and fluid elements is handled
639  // during the remeshing, but the "reverse" association must be done
640  // separately.
641  // We pass the boundary between the fluid and solid meshes and pointers
642  // to the meshes. The interaction boundary is boundary 1 of the
643  // 2D fluid mesh.
644  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
645  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
646 
647  // Do equation numbering
648  cout << "# of dofs " << assign_eqn_numbers() << std::endl;
649 
650 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
MatrixXd L
Definition: LLT_example.cpp:6
double Pcos_initial
Initial pcos.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:252
OneDLagrangianMesh< SOLID_ELEMENT > * Wall_mesh_pt
Pointer to wall mesh.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:231
GeomObject * Undef_geom_pt
Pointer to geometric object that represents the undeformed wall shape.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:237
AlgebraicElement< RefineableQCrouzeixRaviartElement< 2 > > FLUID_ELEMENT
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:146
Node * Veloc_trace_node_pt
Pointer to node on coarsest mesh on which velocity is traced.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:246
AlgebraicRefineableQuarterCircleSectorMesh< FLUID_ELEMENT > * Fluid_mesh_pt
Pointer to fluid mesh.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:234
Newmark< 2 > * Wall_time_stepper_pt
Pointer to wall timestepper.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:240
BDF< 2 > * Fluid_time_stepper_pt
Pointer to fluid timestepper.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:243
double Eps_ampl
Amplitude of initial deformation.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:249
SOLID_ELEMENT * Doc_displacement_elem_pt
Element used for documenting displacement.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:228
double Pcos_duration
Duration of initial pcos.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:255
FSIHermiteBeamElement SOLID_ELEMENT
Typedef to specify the solid element used.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:149
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
Definition: geom_objects.h:644
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
double *& h_pt()
Return a pointer to non-dim. wall thickness.
Definition: beam_elements.h:240
Definition: mesh_as_geometric_object.h:93
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
Node *& boundary_node_pt(const unsigned &b, const unsigned &n)
Return pointer to node n on boundary b.
Definition: mesh.h:493
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: nodes.h:906
void set_auxiliary_node_update_fct_pt(AuxNodeUpdateFctPt aux_node_update_fct_pt)
Definition: nodes.h:1596
Definition: one_d_lagrangian_mesh.template.h:46
void add_time_stepper_pt(TimeStepper *const &time_stepper_pt)
Definition: problem.cc:1545
unsigned add_sub_mesh(Mesh *const &mesh_pt)
Definition: problem.h:1330
void build_global_mesh()
Definition: problem.cc:1493
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
ErrorEstimator *& spatial_error_estimator_pt()
Access to spatial error estimator.
Definition: refineable_mesh.h:143
Definition: error_estimator.h:266
@ N
Definition: constructor.cpp:22
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
double ReSt
Womersley number.
Definition: rayleigh_instability.cc:56
double Q
Ratio of scales.
Definition: elastic_bretherton.cc:131
double Lambda_sq
Pseudo-solid mass density.
Definition: pressure_driven_torus.cc:62
void pcos_load(const Vector< double > &xi, const Vector< double > &x, const Vector< double > &N, Vector< double > &load)
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:125
double Re
Reynolds number.
Definition: fibre.cc:55
double H
Nondim thickness.
Definition: steady_ring.cc:50
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
void apply_no_slip_on_moving_wall(Node *node_pt)
Definition: fsi.cc:48

References oomph::Problem::add_sub_mesh(), oomph::Problem::add_time_stepper_pt(), oomph::FSI_functions::apply_no_slip_on_moving_wall(), oomph::Problem::assign_eqn_numbers(), Eigen::bfloat16_impl::atan(), oomph::Mesh::boundary_node_pt(), oomph::Problem::build_global_mesh(), Doc_displacement_elem_pt, e(), oomph::Mesh::element_pt(), MeshRefinement::error_estimator_pt, oomph::ElementWithMovingNodes::evaluate_shape_derivs_by_direct_fd(), oomph::Mesh::finite_element_pt(), Fluid_mesh_pt, Fluid_time_stepper_pt, Global_Physical_Variables::H, oomph::KirchhoffLoveBeamEquations::h_pt(), i, L, Global_Physical_Variables::Lambda_sq, oomph::KirchhoffLoveBeamEquations::lambda_sq_pt(), oomph::KirchhoffLoveBeamEquations::load_vector_fct_pt, n, N, oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), Global_Physical_Variables::pcos_load(), oomph::Data::pin(), Global_Physical_Variables::Q, oomph::FSIWallElement::q_pt(), Global_Physical_Variables::Re, Global_Physical_Variables::ReSt, oomph::Node::set_auxiliary_node_update_fct_pt(), oomph::RefineableMeshBase::spatial_error_estimator_pt(), Undef_geom_pt, oomph::KirchhoffLoveBeamEquations::undeformed_beam_pt(), Veloc_trace_node_pt, Wall_mesh_pt, and Wall_time_stepper_pt.

Referenced by main().

◆ FSIRingProblem() [2/3]

FSIRingProblem::FSIRingProblem ( const unsigned N,
const double eps_ampl,
const double pcos_initial,
const double pcos_duration,
const unsigned i_case 
)

Constructor: Number of elements in wall mesh, amplitude of the initial wall deformation, amplitude of pcos perturbation and its duration.

Constructor for FSI ring problem. Pass number of wall elements and length of wall (in Lagrangian coordinates) amplitude of initial deformation, pcos perturbation and duration.

435  :
436  Eps_ampl(eps_ampl), Pcos_initial(pcos_initial),
437  Pcos_duration(pcos_duration)
438 {
439  //-----------------------------------------------------------
440  // Create timesteppers
441  //-----------------------------------------------------------
442 
443  // Allocate the wall timestepper and add it to the problem's vector
444  // of timesteppers
447 
448  // Allocate the fluid timestepper and add it to the problem's Vector
449  // of timesteppers
452 
453  //----------------------------------------------------------
454  // Create the wall mesh
455  //----------------------------------------------------------
456 
457  // Undeformed wall is an elliptical ring
458  Undef_geom_pt = new Ellipse(1.0,1.0);
459 
460  //Length of wall in Lagrangian coordinates
461  double L = 2.0*atan(1.0);
462 
463  //Now create the (Lagrangian!) mesh
464  Wall_mesh_pt = new
466 
467  //----------------------------------------------------------
468  // Set the boundary conditions for wall mesh (problem)
469  //----------------------------------------------------------
470 
471  // Bottom boundary: (Boundary 0)
472  // No vertical displacement
473  Wall_mesh_pt->boundary_node_pt(0,0)->pin_position(1);
474  // Zero slope: Pin type 1 dof for displacement direction 0
475  Wall_mesh_pt->boundary_node_pt(0,0)->pin_position(1,0);
476 
477  // Top boundary: (Boundary 1)
478  // No horizontal displacement
479  Wall_mesh_pt->boundary_node_pt(1,0)->pin_position(0);
480  // Zero slope: Pin type 1 dof for displacement direction 1
481  Wall_mesh_pt->boundary_node_pt(1,0)->pin_position(1,1);
482 
483 
484  //-----------------------------------------------------------
485  // Create the fluid mesh:
486  //-----------------------------------------------------------
487 
488  // Fluid mesh is suspended from wall between the following Lagrangian
489  // coordinates:
490  double xi_lo=0.0;
491  double xi_hi=L;
492 
493  // Fractional position of dividing line for two outer blocks in mesh
494  double fract_mid=0.5;
495 
496  //Create a geometric object that represents the wall geometry from the
497  //wall mesh (one Lagrangian, two Eulerian coordinates).
498  MeshAsGeomObject *wall_mesh_as_geometric_object_pt
500 
501  // Build fluid mesh using the wall mesh as a geometric object
503  (wall_mesh_as_geometric_object_pt,
504  xi_lo,fract_mid,xi_hi,Fluid_time_stepper_pt);
505 
506  // Set the error estimator
509 
510  // Extract pointer to node at center of mesh
511  unsigned nnode=Fluid_mesh_pt->finite_element_pt(0)->nnode();
513 
514  // Do some random refinement
515  Vector<unsigned> elements_to_be_refined;
516  elements_to_be_refined.push_back(2);
517  Fluid_mesh_pt->refine_selected_elements(elements_to_be_refined);
518  Fluid_mesh_pt->refine_selected_elements(elements_to_be_refined);
519 
520  //-------------------------------------------------------
521  // Set the fluid boundary conditions
522  //-------------------------------------------------------
523 
524  // Bottom boundary (boundary 0):
525  {
526  unsigned n_node = Fluid_mesh_pt->nboundary_node(0);
527  for (unsigned n=0;n<n_node;n++)
528  {
529  // Pin vertical velocity
531  }
532  }
533 
534  // Ring boundary (boundary 1):
535  // No slip; this also implies that the velocity needs
536  // to be updated in response to wall motion
537  {
538  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
539  for (unsigned n=0;n<n_node;n++)
540  {
541  // Which node are we dealing with?
542  Node* node_pt=Fluid_mesh_pt->boundary_node_pt(1,n);
543 
544  // Set auxiliary update function pointer
547 
548  // Pin both velocities
549  for(unsigned i=0;i<2;i++) {node_pt->pin(i);}
550  }
551  }
552 
553  // Left boundary (boundary 2):
554  {
555  unsigned n_node = Fluid_mesh_pt->nboundary_node(2);
556  for (unsigned n=0;n<n_node;n++)
557  {
558  // Pin horizontal velocity
560  }
561  }
562 
563 
564  //--------------------------------------------------------
565  // Add the submeshes and build global mesh
566  // -------------------------------------------------------
567 
568  // Wall mesh
570 
571  //Fluid mesh
573 
574  // Combine all submeshes into a single Mesh
576 
577 
578  //----------------------------------------------------------
579  // Finish problem setup
580  // ---------------------------------------------------------
581 
582  //Find number of elements in fluid mesh
583  unsigned n_element = Fluid_mesh_pt->nelement();
584 
585  bool done=false;
586 
587  // Loop over the fluid elements to set up element-specific
588  // things that cannot be handled by constructor
589  for(unsigned e=0;e<n_element;e++)
590  {
591  // Upcast from FiniteElement to the present element
592  FLUID_ELEMENT *el_pt
593  = dynamic_cast<FLUID_ELEMENT*>(Fluid_mesh_pt->element_pt(e));
594 
595  //Set the Reynolds number, etc
596  el_pt->re_pt() = &Global_Physical_Variables::Re;
597  el_pt->re_st_pt() = &Global_Physical_Variables::ReSt;
598 
599  // Choose evaluation of shape derivatives
600 
601  // Direct FD
602  if (i_case==0)
603  {
604  el_pt->evaluate_shape_derivs_by_direct_fd();
605  if (!done) std::cout << "\n\n [CR residuals] Direct FD" << std::endl;
606  }
607  // Chain rule with/without FD
608  else if ( (i_case==1) || (i_case==2) )
609  {
610  // It's broken but let's call it anyway to keep self-test alive
611  bool i_know_what_i_am_doing=true;
612  el_pt->evaluate_shape_derivs_by_chain_rule(i_know_what_i_am_doing);
613  if (i_case==1)
614  {
615  el_pt->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
616  if (!done) std::cout << "\n\n [CR residuals] Chain rule and FD"
617  << std::endl;
618  }
619  else
620  {
621  el_pt->disable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
622  if (!done) std::cout << "\n\n [CR residuals] Chain rule and analytic"
623  << std::endl;
624  }
625  }
626  // Fastest with/without FD
627  else if ( (i_case==3) || (i_case==4) )
628  {
629 
630  // It's broken but let's call it anyway to keep self-test alive
631  bool i_know_what_i_am_doing=true;
632  el_pt->evaluate_shape_derivs_by_fastest_method(i_know_what_i_am_doing);
633  if (i_case==3)
634  {
635  el_pt->enable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
636  if (!done) std::cout << "\n\n [CR residuals] Fastest and FD"
637  << std::endl;
638  }
639  else
640  {
641  el_pt->disable_always_evaluate_dresidual_dnodal_coordinates_by_fd();
642  if (!done) std::cout << "\n\n [CR residuals] Fastest and analytic"
643  << std::endl;
644  }
645  }
646  done=true;
647 
648  }
649 
650 
651  //Loop over the solid elements to set physical parameters etc.
652  unsigned n_wall_element = Wall_mesh_pt->nelement();
653  for(unsigned e=0;e<n_wall_element;e++)
654  {
655  //Cast to proper element type
656  SOLID_ELEMENT *el_pt = dynamic_cast<SOLID_ELEMENT*>(
657  Wall_mesh_pt->element_pt(e));
658 
659  //Set physical parameters for each element:
661  el_pt->lambda_sq_pt() = &Global_Physical_Variables::Lambda_sq;
662 
663  //Function that specifies the external load Vector
664  el_pt->load_vector_fct_pt() = &Global_Physical_Variables::pcos_load;
665 
666  // Function that specifies the load ratios
667  el_pt->q_pt() = &Global_Physical_Variables::Q;
668 
669  //Assign the undeformed beam shape
670  el_pt->undeformed_beam_pt() = Undef_geom_pt;
671  }
672 
673  // Establish control displacment: (even if no displacement control is applied
674  // we still want to doc the displacement at the same point)
675 
676  // Choose element: (This is the last one)
677  Doc_displacement_elem_pt = dynamic_cast<SOLID_ELEMENT*>(
678  Wall_mesh_pt->element_pt(n_wall_element-1));
679 
680  // Setup fsi: Work out which fluid dofs affect the wall elements
681  // the correspondance between wall dofs and fluid elements is handled
682  // during the remeshing, but the "reverse" association must be done
683  // separately.
684  // We pass the boundary between the fluid and solid meshes and pointers
685  // to the meshes. The interaction boundary is boundary 1 of the
686  // 2D fluid mesh.
687  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
688  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
689 
690  // Do equation numbering
691  cout << "# of dofs " << assign_eqn_numbers() << std::endl;
692 
693 }
virtual void refine_selected_elements(const Vector< unsigned > &elements_to_be_refined)
Definition: refineable_mesh.cc:1816

References oomph::Problem::add_sub_mesh(), oomph::Problem::add_time_stepper_pt(), oomph::FSI_functions::apply_no_slip_on_moving_wall(), oomph::Problem::assign_eqn_numbers(), Eigen::bfloat16_impl::atan(), oomph::Mesh::boundary_node_pt(), oomph::Problem::build_global_mesh(), oomph::ElementWithMovingNodes::disable_always_evaluate_dresidual_dnodal_coordinates_by_fd(), Doc_displacement_elem_pt, e(), oomph::Mesh::element_pt(), oomph::ElementWithMovingNodes::enable_always_evaluate_dresidual_dnodal_coordinates_by_fd(), MeshRefinement::error_estimator_pt, oomph::ElementWithMovingNodes::evaluate_shape_derivs_by_chain_rule(), oomph::ElementWithMovingNodes::evaluate_shape_derivs_by_direct_fd(), oomph::ElementWithMovingNodes::evaluate_shape_derivs_by_fastest_method(), oomph::Mesh::finite_element_pt(), Fluid_mesh_pt, Fluid_time_stepper_pt, Global_Physical_Variables::H, oomph::KirchhoffLoveBeamEquations::h_pt(), i, L, Global_Physical_Variables::Lambda_sq, oomph::KirchhoffLoveBeamEquations::lambda_sq_pt(), oomph::KirchhoffLoveBeamEquations::load_vector_fct_pt, n, N, oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), Global_Physical_Variables::pcos_load(), oomph::Data::pin(), Global_Physical_Variables::Q, oomph::FSIWallElement::q_pt(), Global_Physical_Variables::Re, oomph::TreeBasedRefineableMeshBase::refine_selected_elements(), Global_Physical_Variables::ReSt, oomph::Node::set_auxiliary_node_update_fct_pt(), oomph::RefineableMeshBase::spatial_error_estimator_pt(), Undef_geom_pt, oomph::KirchhoffLoveBeamEquations::undeformed_beam_pt(), Veloc_trace_node_pt, Wall_mesh_pt, and Wall_time_stepper_pt.

◆ FSIRingProblem() [3/3]

FSIRingProblem::FSIRingProblem ( const unsigned nelement_wall,
const double eps_ampl,
const double pcos_initial,
const double pcos_duration 
)

Constructor: Number of elements in wall mesh, amplitude of the initial wall deformation, amplitude of pcos perturbation and its duration.

◆ ~FSIRingProblem()

FSIRingProblem::~FSIRingProblem ( )
inline
159 {}

Member Function Documentation

◆ actions_after_adapt() [1/3]

void FSIRingProblem::actions_after_adapt ( )
inlinevirtual

Update the problem specs after adaptation:

Reimplemented from oomph::Problem.

176  {
177  // The functions used to update the no slip boundary conditions
178  // must be set on any new nodes that have been created during the
179  // mesh adaptation process.
180  // There is no mechanism by which auxiliary update functions
181  // are copied to newly created nodes.
182  // (because, unlike boundary conditions, they don't occur exclusively
183  // at boundaries)
184 
185  // The no-slip boundary is boundary 1 of the mesh
186  // Loop over the nodes on this boundary and reset the auxilliary
187  // node update function
188  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
189  for (unsigned n=0;n<n_node;n++)
190  {
193  }
194 
195  // (Re-)setup fsi: Work out which fluid dofs affect wall elements
196  // the correspondance between wall dofs and fluid elements is handled
197  // during the remeshing, but the "reverse" association must be done
198  // separately.
199  // We need to set up the interaction every time because the fluid element
200  // adjacent to a given solid element's integration point may have changed
201  // We pass the boundary between the fluid and solid meshes and pointers
202  // to the meshes. The interaction boundary is boundary 1 of the 2D
203  // fluid mesh.
204  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
205  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
206  }

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), and n.

◆ actions_after_adapt() [2/3]

void FSIRingProblem::actions_after_adapt ( )
inlinevirtual

Update the problem specs after adaptation:

Reimplemented from oomph::Problem.

176  {
177  // The functions used to update the no slip boundary conditions
178  // must be set on any new nodes that have been created during the
179  // mesh adaptation process.
180  // There is no mechanism by which auxiliary update functions
181  // are copied to newly created nodes.
182  // (because, unlike boundary conditions, they don't occur exclusively
183  // at boundaries)
184 
185  // The no-slip boundary is boundary 1 of the mesh
186  // Loop over the nodes on this boundary and reset the auxilliary
187  // node update function
188  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
189  for (unsigned n=0;n<n_node;n++)
190  {
193  }
194 
195  // (Re-)setup fsi: Work out which fluid dofs affect wall elements
196  // the correspondance between wall dofs and fluid elements is handled
197  // during the remeshing, but the "reverse" association must be done
198  // separately.
199  // We need to set up the interaction every time because the fluid element
200  // adjacent to a given solid element's integration point may have changed
201  // We pass the boundary between the fluid and solid meshes and pointers
202  // to the meshes. The interaction boundary is boundary 1 of the 2D
203  // fluid mesh.
204  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
205  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
206  }

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), and n.

◆ actions_after_adapt() [3/3]

void FSIRingProblem::actions_after_adapt ( )
inlinevirtual

Update the problem specs after adaptation:

Reimplemented from oomph::Problem.

178  {
179  // (Re-)setup fsi: Work out which fluid dofs affect wall elements
180  // the correspondance between wall dofs and fluid elements is handled
181  // during the remeshing, but the "reverse" association must be done
182  // separately.
183  // We need to set up the interaction every time because the fluid element
184  // adjacent to a given solid element's integration point may have changed
185  // We pass the boundary between the fluid and solid meshes and pointers
186  // to the meshes. The interaction boundary is boundary 1 of the 2D
187  // fluid mesh.
188  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
189  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
190 
191  // The functions used to update the no slip boundary conditions
192  // must be set on any new nodes that have been created during the
193  // mesh adaptation process.
194  // There is no mechanism by which auxiliary update functions
195  // are copied to newly created nodes.
196  // (because, unlike boundary conditions, they don't occur exclusively
197  // at boundaries)
198 
199  // The no-slip boundary is boundary 1 of the mesh
200  // Loop over the nodes on this boundary and reset the auxilliary
201  // node update function - DEBUG, ignore this
202  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
203  for (unsigned n=0;n<n_node;n++)
204  {
205  //Must cast to an AlgebraicNode in order to set the function pointer
206  static_cast<AlgebraicNode*>(Fluid_mesh_pt->boundary_node_pt(1,n))
207  ->set_auxiliary_node_update_fct_pt(
209  }
210 
211  }
Definition: algebraic_elements.h:55

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), and n.

◆ actions_after_distribute()

void FSIRingProblem::actions_after_distribute ( )
inline

Update the problem specs after distribution:

215  {
216  // (Re-)setup fsi: Work out which fluid dofs affect wall elements
217  // the correspondance between wall dofs and fluid elements is handled
218  // during the remeshing, but the "reverse" association must be done
219  // separately.
220  // We need to set up the interaction every time because the fluid element
221  // adjacent to a given solid element's integration point may now be on
222  // a different processor following the distribution of the problem.
223  // We pass the boundary between the fluid and solid meshes and pointers
224  // to the meshes. The interaction boundary is boundary 1 of the 2D
225  // fluid mesh.
226  FSI_functions::setup_fluid_load_info_for_solid_elements<FLUID_ELEMENT,2>
227  (this,1,Fluid_mesh_pt,Wall_mesh_pt);
228 
229  // The functions used to update the no slip boundary conditions
230  // must be set on any new nodes that have been created during the
231  // mesh adaptation process.
232  // There is no mechanism by which auxiliary update functions
233  // are copied to newly created nodes.
234  // (because, unlike boundary conditions, they don't occur exclusively
235  // at boundaries)
236 
237  // The no-slip boundary is boundary 1 of the mesh
238  // Loop over the nodes on this boundary and reset the auxilliary
239  // node update function
240  unsigned n_node = Fluid_mesh_pt->nboundary_node(1);
241  for (unsigned n=0;n<n_node;n++)
242  {
243  //Must cast to an AlgebraicNode in order to set the function pointer
244  static_cast<AlgebraicNode*>(Fluid_mesh_pt->boundary_node_pt(1,n))
245  ->set_auxiliary_node_update_fct_pt(
247  }
248 
249  }

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), and n.

◆ actions_after_newton_solve() [1/3]

void FSIRingProblem::actions_after_newton_solve ( )
inlinevirtual

Update after solve (empty)

Reimplemented from oomph::Problem.

160 {}

◆ actions_after_newton_solve() [2/3]

void FSIRingProblem::actions_after_newton_solve ( )
inlinevirtual

Update after solve (empty)

Reimplemented from oomph::Problem.

160 {}

◆ actions_after_newton_solve() [3/3]

void FSIRingProblem::actions_after_newton_solve ( )
inlinevirtual

Update after solve (empty)

Reimplemented from oomph::Problem.

162 {}

◆ actions_before_newton_convergence_check() [1/3]

void FSIRingProblem::actions_before_newton_convergence_check ( )
inlinevirtual

Update the problem specs before checking Newton convergence

Reimplemented from oomph::Problem.

168  {
169  // Update the fluid mesh -- auxiliary update function for algebraic
170  // nodes automatically updates no slip condition.
172  }
void node_update(const bool &update_all_solid_nodes=false)
Definition: quarter_circle_sector_mesh.template.h:501

◆ actions_before_newton_convergence_check() [2/3]

void FSIRingProblem::actions_before_newton_convergence_check ( )
inlinevirtual

Update the problem specs before checking Newton convergence

Reimplemented from oomph::Problem.

168  {
169  // Update the fluid mesh -- auxiliary update function for algebraic
170  // nodes automatically updates no slip condition.
172  }

◆ actions_before_newton_convergence_check() [3/3]

void FSIRingProblem::actions_before_newton_convergence_check ( )
inlinevirtual

Update the problem specs before checking Newton convergence

Reimplemented from oomph::Problem.

170  {
171  // Update the fluid mesh -- auxiliary update function for algebraic
172  // nodes automatically updates no slip condition.
174  }

◆ actions_before_newton_solve() [1/3]

void FSIRingProblem::actions_before_newton_solve ( )
inlinevirtual

Update before solve (empty)

Reimplemented from oomph::Problem.

163 {}

◆ actions_before_newton_solve() [2/3]

void FSIRingProblem::actions_before_newton_solve ( )
inlinevirtual

Update before solve (empty)

Reimplemented from oomph::Problem.

163 {}

◆ actions_before_newton_solve() [3/3]

void FSIRingProblem::actions_before_newton_solve ( )
inlinevirtual

Update before solve (empty)

Reimplemented from oomph::Problem.

165 {}

◆ doc_solution() [1/3]

void FSIRingProblem::doc_solution ( const unsigned i,
DocInfo doc_info,
ofstream &  trace_file 
)

Doc solution: Pass number of timestep, i (we append to tracefile after every timestep but do a full doc only at certain intervals), DocInfo object and tracefile

Document solution: Pass number of timestep, i; we append to trace file at every timestep and do a full doc only after a certain number of steps.

Output the solution using 5x5 plot points

354 {
355 
356  // Full doc every nskip steps
357  unsigned nskip=1; // ADJUST
358 
359  // If we at an integer multiple of nskip, full documentation.
360  if (i%nskip==0)
361  {
362  doc_info.enable_doc();
363  cout << "Full doc step " << doc_info.number()
364  << " for time " << time_stepper_pt()->time_pt()->time() << std::endl;
365  }
366  //Otherwise, just output the trace file
367  else
368  {
369  doc_info.disable_doc();
370  cout << "Only trace for time "
371  << time_stepper_pt()->time_pt()->time() << std::endl;
372  }
373 
374 
375  // If we are at a full documentation step, output the fluid solution
376  if (doc_info.is_doc_enabled())
377  {
378  //Variables used in the output file.
379  ofstream some_file; char filename[100];
380  //Construct the output filename from the doc_info number and the
381  //output directory
382  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
383  doc_info.number());
384  //Open the output file
385  some_file.open(filename);
387  Fluid_mesh_pt->output(some_file,5);
388  //Close the output file
389  some_file.close();
390  }
391 
392  //Temporary vector to give the local coordinate at which to document
393  //the wall displacment
394  Vector<double> s(1,1.0);
395  // Write to the trace file:
396  trace_file << time_pt()->time()
397  //Document the displacement at the end of the the chosen element
399  << " " << Veloc_trace_node_pt->x(0)
400  << " " << Veloc_trace_node_pt->x(1)
401  << " " << Veloc_trace_node_pt->value(0)
402  << " " << Veloc_trace_node_pt->value(1)
403  << " " << Fluid_mesh_pt->nelement()
404  << " " << ndof()
406  << " " << Fluid_mesh_pt->max_error()
407  << " " << Fluid_mesh_pt->min_error()
408  << " " << Fluid_mesh_pt->max_permitted_error()
409  << " " << Fluid_mesh_pt->min_permitted_error()
410  << " " << Fluid_mesh_pt->max_keep_unrefined();
411 
412  // Output the number of the corresponding full documentation
413  // file number (or -1 if no full doc was made)
414  if (doc_info.is_doc_enabled())
415  {trace_file << " " <<doc_info.number() << " ";}
416  else {trace_file << " " <<-1 << " ";}
417 
418  //End the trace file
419  trace_file << std::endl;
420 
421  // Increment counter for full doc
422  if (doc_info.is_doc_enabled()) {doc_info.number()++;}
423 }
void enable_doc()
Enable documentation.
Definition: oomph_utilities.h:536
bool is_doc_enabled() const
Are we documenting?
Definition: oomph_utilities.h:548
void disable_doc()
Disable documentation.
Definition: oomph_utilities.h:542
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
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
double value(const unsigned &i) const
Definition: nodes.cc:2408
unsigned long ndof() const
Return the number of dofs.
Definition: problem.h:1674
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
unsigned & max_keep_unrefined()
Definition: refineable_mesh.h:123
double & min_error()
Definition: refineable_mesh.h:170
double & max_error()
Definition: refineable_mesh.h:177
double & min_permitted_error()
Definition: refineable_mesh.h:156
double & max_permitted_error()
Definition: refineable_mesh.h:163
unsigned & nrefinement_overruled()
Definition: refineable_mesh.h:114
Time *const & time_pt() const
Access function for the pointer to time (const version)
Definition: timesteppers.h:572
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
RealScalar s
Definition: level1_cplx_impl.h:130
string filename
Definition: MergeRestartFiles.py:39

References oomph::DocInfo::directory(), oomph::DocInfo::disable_doc(), oomph::DocInfo::enable_doc(), MergeRestartFiles::filename, i, oomph::DocInfo::is_doc_enabled(), oomph::DocInfo::number(), and s.

Referenced by dynamic_run().

◆ doc_solution() [2/3]

void FSIRingProblem::doc_solution ( const unsigned i,
DocInfo doc_info,
ofstream &  trace_file 
)

Doc solution: Pass number of timestep, i (we append to tracefile after every timestep but do a full doc only at certain intervals), DocInfo object and tracefile

◆ doc_solution() [3/3]

void FSIRingProblem::doc_solution ( const unsigned i,
DocInfo doc_info,
ofstream &  trace_file,
const unsigned i_case 
)

Doc solution: Pass number of timestep, i (we append to tracefile after every timestep but do a full doc only at certain intervals), DocInfo object and tracefile

Document solution: Pass number of timestep, i; we append to trace file at every timestep and do a full doc only after a certain number of steps.

Output the solution using 5x5 plot points

355 {
356 
357  // Full doc every nskip steps
358  unsigned nskip=1; // ADJUST
359 
360  // If we at an integer multiple of nskip, full documentation.
361  if (i%nskip==0)
362  {
363  doc_info.enable_doc();
364  cout << "Full doc step " << doc_info.number()
365  << " for time " << time_stepper_pt()->time_pt()->time() << std::endl;
366  }
367  //Otherwise, just output the trace file
368  else
369  {
370  doc_info.disable_doc();
371  cout << "Only trace for time "
372  << time_stepper_pt()->time_pt()->time() << std::endl;
373  }
374 
375 
376  // If we are at a full documentation step, output the fluid solution
377  if (doc_info.is_doc_enabled())
378  {
379  //Variables used in the output file.
380  ofstream some_file; char filename[100];
381  //Construct the output filename from the doc_info number and the
382  //output directory
383  sprintf(filename,"%s/soln%i_%i.dat",doc_info.directory().c_str(),
384  i_case,doc_info.number());
385  //Open the output file
386  some_file.open(filename);
388  Fluid_mesh_pt->output(some_file,5);
389  //Close the output file
390  some_file.close();
391  }
392 
393  //Temporary vector to give the local coordinate at which to document
394  //the wall displacment
395  Vector<double> s(1,1.0);
396  // Write to the trace file:
397  trace_file << time_pt()->time()
398  //Document the displacement at the end of the the chosen element
400  << " " << Veloc_trace_node_pt->x(0)
401  << " " << Veloc_trace_node_pt->x(1)
402  << " " << Veloc_trace_node_pt->value(0)
403  << " " << Veloc_trace_node_pt->value(1)
404  << " " << Fluid_mesh_pt->nelement()
405  << " " << ndof()
407  << " " << Fluid_mesh_pt->max_error()
408  << " " << Fluid_mesh_pt->min_error()
409  << " " << Fluid_mesh_pt->max_permitted_error()
410  << " " << Fluid_mesh_pt->min_permitted_error()
411  << " " << Fluid_mesh_pt->max_keep_unrefined();
412 
413  // Output the number of the corresponding full documentation
414  // file number (or -1 if no full doc was made)
415  if (doc_info.is_doc_enabled())
416  {trace_file << " " <<doc_info.number() << " ";}
417  else {trace_file << " " <<-1 << " ";}
418 
419  //End the trace file
420  trace_file << std::endl;
421 
422  // Increment counter for full doc
423  if (doc_info.is_doc_enabled()) {doc_info.number()++;}
424 }

References oomph::DocInfo::directory(), oomph::DocInfo::disable_doc(), oomph::DocInfo::enable_doc(), MergeRestartFiles::filename, i, oomph::DocInfo::is_doc_enabled(), oomph::DocInfo::number(), and s.

◆ dynamic_run() [1/3]

void FSIRingProblem::dynamic_run ( )

Do dynamic run.

Solver loop to perform unsteady run.

Label for output

Perturbation pressure

Switch off perturbation pressure

657 {
658  // Setup documentation
659  //---------------------------------------------------------------
660 
662  DocInfo doc_info;
663 
664  // Output directory
665  doc_info.set_directory("RESLT");
666 
667  // Step number
668  doc_info.number()=0;
669 
670  //Open a trace file
671  ofstream trace_file("RESLT/trace_ring.dat");
672 
673  // Write header for trace file
674  trace_file << "VARIABLES=\"time\",\"V_c_t_r_l\"";
675  trace_file << ",\"x<sub>1</sub><sup>(track)</sup>\"";
676  trace_file << ",\"x<sub>2</sub><sup>(track)</sup>\"";
677  trace_file << ",\"u<sub>1</sub><sup>(track)</sup>\"";
678  trace_file << ",\"u<sub>2</sub><sup>(track)</sup>\"";
679  trace_file << ",\"N<sub>element</sub>\"";
680  trace_file << ",\"N<sub>dof</sub>\"";
681  trace_file << ",\"# of under-refined elements\"";
682  trace_file << ",\"max. error\"";
683  trace_file << ",\"min. error\"";
684  trace_file << ",\"max. permitted error\"";
685  trace_file << ",\"min. permitted error\"";
686  trace_file << ",\"max. permitted # of unrefined elements\"";
687  trace_file << ",\"doc number\"";
688  trace_file << std::endl;
689 
690 
691  // Initialise timestepping
692  // -------------------------------------------------------------
693 
694  // Number of steps
695  unsigned nstep=300;
696 
697  // Nontrivial command line input: validation: only do three steps
698  if (CommandLineArgs::Argc>1)
699  {
700  nstep=1;
701  cout << "Only doing nstep steps for validation: " << nstep << std::endl;
702  }
703 
704  // Set initial timestep
705  double dt=0.004;
706 
707  // Set initial value for dt -- also assigns weights to the timesteppers
708  initialise_dt(dt);
709 
710  // Set physical parameters
711  //---------------------------------------------------------
712  using namespace Global_Physical_Variables;
713 
714  // Set Womersley number
715  Alpha_sq=100.0; // 50.0; // ADJUST
716 
717  // Set density ratio
718  Density_ratio=10.0; // 0.0; ADJUST
719 
720  // Wall thickness
721  H=1.0/20.0;
722 
723  // Set external pressure
724  Pext=0.0;
725 
728 
729  // Assign/doc corresponding computational parameters
730  set_params();
731 
732 
733  // Refine uniformly and assign initial conditions
734  //--------------------------------------------------------------
735 
736  // Refine the problem uniformly
739 
740  // This sets up the solution at the initial time
742 
743  // Set targets for spatial adptivity
744  //---------------------------------------------------------------
745 
746  // Max. and min. error for adaptive refinement/unrefinement
749 
750  // Don't allow refinement to drop under given level
752 
753  // Don't allow refinement beyond given level
755 
756  // Don't bother adapting the mesh if no refinement is required
757  // and if less than ... elements are to be merged.
759 
760  // Doc refinement targets
762 
763 
764  // Do the timestepping
765  //----------------------------------------------------------------
766 
767  // Reset initial conditions after refinement for first step only
768  bool first=true;
769 
770  //Output initial data
771  doc_solution(0,doc_info,trace_file);
772 
773 
774 // {
775 // unsigned nel=Fluid_mesh_pt->nelement();
776 // for (unsigned e=0;e<nel;e++)
777 // {
778 // std::cout << "\n\nEl: " << e << std::endl << std::endl;
779 // FiniteElement* el_pt=Fluid_mesh_pt->finite_element_pt(e);
780 // unsigned n_dof=el_pt->ndof();
781 // Vector<double> residuals(n_dof);
782 // DenseDoubleMatrix jacobian(n_dof,n_dof);
783 // el_pt->get_jacobian(residuals,jacobian);
784 // }
785 // exit(0);
786 // }
787 
788  // Time integration loop
789  for(unsigned i=1;i<=nstep;i++)
790  {
791  // Switch doc off during solve
792  doc_info.disable_doc();
793 
794  // Solve
795  unsigned max_adapt=1;
796  unsteady_newton_solve(dt,max_adapt,first);
797 
798  // Now we've done the first step
799  first=false;
800 
801  // Doc solution
802  doc_solution(i,doc_info,trace_file);
803 
805  if (time_pt()->time()>Pcos_duration) {Pcos=0.0;}
806 
807  }
808 
809 }
MatrixXf H
Definition: HessenbergDecomposition_matrixH.cpp:4
void set_initial_condition()
Setup initial condition for both domains.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:264
void doc_solution(const unsigned &i, DocInfo &doc_info, ofstream &trace_file)
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:352
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
void initialise_dt(const double &dt)
Definition: problem.cc:13231
void unsteady_newton_solve(const double &dt)
Definition: problem.cc:10953
void refine_uniformly()
Definition: problem.h:2640
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
unsigned & max_refinement_level()
Access fct for max. permissible refinement level (relative to base mesh)
Definition: refineable_mesh.h:486
void doc_adaptivity_targets(std::ostream &outfile)
Doc the targets for mesh adaptation.
Definition: refineable_mesh.h:467
unsigned & min_refinement_level()
Access fct for min. permissible refinement level (relative to base mesh)
Definition: refineable_mesh.h:492
Global variables.
Definition: TwenteMeshGluing.cpp:60
double Pext
External Pressure.
Definition: elastic_bretherton.cc:99
double Alpha_sq
Square of Womersly number (a frequency parameter)
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:52
void set_params()
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:87
double Pcos
Perturbation pressure.
Definition: steady_ring.cc:56
double Density_ratio
Density ratio of the solid and the fluid.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:55
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407

References Global_Physical_Variables::Alpha_sq, oomph::CommandLineArgs::Argc, Global_Physical_Variables::Density_ratio, oomph::DocInfo::disable_doc(), oomph::TreeBasedRefineableMeshBase::doc_adaptivity_targets(), doc_solution(), Fluid_mesh_pt, H, i, oomph::Problem::initialise_dt(), oomph::RefineableMeshBase::max_keep_unrefined(), oomph::RefineableMeshBase::max_permitted_error(), oomph::TreeBasedRefineableMeshBase::max_refinement_level(), oomph::RefineableMeshBase::min_permitted_error(), oomph::TreeBasedRefineableMeshBase::min_refinement_level(), oomph::DocInfo::number(), Global_Physical_Variables::Pcos, Pcos_duration, Pcos_initial, Global_Physical_Variables::Pext, oomph::Problem::refine_uniformly(), oomph::DocInfo::set_directory(), set_initial_condition(), Global_Physical_Variables::set_params(), oomph::Problem::time(), oomph::Problem::time_pt(), and oomph::Problem::unsteady_newton_solve().

Referenced by main().

◆ dynamic_run() [2/3]

void FSIRingProblem::dynamic_run ( )

Do dynamic run.

◆ dynamic_run() [3/3]

void FSIRingProblem::dynamic_run ( const unsigned i_case)

Do dynamic run.

Solver loop to perform unsteady run.

Label for output

Perturbation pressure

Switch off perturbation pressure

700 {
701  // Setup documentation
702  //---------------------------------------------------------------
703 
705  DocInfo doc_info;
706 
707  // Output directory
708  doc_info.set_directory("RESLT");
709 
710  // Step number
711  doc_info.number()=0;
712 
713  //Open a trace file
714  ofstream trace_file("RESLT/trace_ring.dat");
715 
716  // Write header for trace file
717  trace_file << "VARIABLES=\"time\",\"V_c_t_r_l\"";
718  trace_file << ",\"x<sub>1</sub><sup>(track)</sup>\"";
719  trace_file << ",\"x<sub>2</sub><sup>(track)</sup>\"";
720  trace_file << ",\"u<sub>1</sub><sup>(track)</sup>\"";
721  trace_file << ",\"u<sub>2</sub><sup>(track)</sup>\"";
722  trace_file << ",\"N<sub>element</sub>\"";
723  trace_file << ",\"N<sub>dof</sub>\"";
724  trace_file << ",\"# of under-refined elements\"";
725  trace_file << ",\"max. error\"";
726  trace_file << ",\"min. error\"";
727  trace_file << ",\"max. permitted error\"";
728  trace_file << ",\"min. permitted error\"";
729  trace_file << ",\"max. permitted # of unrefined elements\"";
730  trace_file << ",\"doc number\"";
731  trace_file << std::endl;
732 
733 
734  // Initialise timestepping
735  // -------------------------------------------------------------
736 
737  // Number of steps
738  unsigned nstep=300;
739 
740  // Nontrivial command line input: validation: only do three steps
741  if (CommandLineArgs::Argc>1)
742  {
743  nstep=1;
744  cout << "Only doing nstep steps for validation: " << nstep << std::endl;
745  }
746 
747  // Set initial timestep
748  double dt=0.004;
749 
750  // Set initial value for dt -- also assigns weights to the timesteppers
751  initialise_dt(dt);
752 
753  // Set physical parameters
754  //---------------------------------------------------------
755  using namespace Global_Physical_Variables;
756 
757  // Set Womersley number
758  Alpha_sq=100.0; // 50.0; // ADJUST
759 
760  // Set density ratio
761  Density_ratio=10.0; // 0.0; ADJUST
762 
763  // Wall thickness
764  H=1.0/20.0;
765 
766  // Set external pressure
767  Pext=0.0;
768 
771 
772  // Assign/doc corresponding computational parameters
773  set_params();
774 
775 
776  // Refine uniformly and assign initial conditions
777  //--------------------------------------------------------------
778 
779  // Refine the problem uniformly
780  //refine_uniformly();
781  //refine_uniformly();
782 
783  // This sets up the solution at the initial time
785 
786  // Set targets for spatial adptivity
787  //---------------------------------------------------------------
788 
789  // Max. and min. error for adaptive refinement/unrefinement
792 
793  // Don't allow refinement to drop under given level
795 
796  // Don't allow refinement beyond given level
798 
799  // Don't bother adapting the mesh if no refinement is required
800  // and if less than ... elements are to be merged.
802 
803  // Doc refinement targets
805 
806 
807  // Do the timestepping
808  //----------------------------------------------------------------
809 
810  // Reset initial conditions after refinement for first step only
811  bool first=true;
812 
813  //Output initial data
814  doc_solution(0,doc_info,trace_file,i_case);
815 
816 
817 // {
818 // unsigned nel=Fluid_mesh_pt->nelement();
819 // for (unsigned e=0;e<nel;e++)
820 // {
821 // std::cout << "\n\nEl: " << e << std::endl << std::endl;
822 // FiniteElement* el_pt=Fluid_mesh_pt->finite_element_pt(e);
823 // unsigned n_dof=el_pt->ndof();
824 // Vector<double> residuals(n_dof);
825 // DenseDoubleMatrix jacobian(n_dof,n_dof);
826 // el_pt->get_jacobian(residuals,jacobian);
827 // }
828 // exit(0);
829 // }
830 
831  // Time integration loop
832  for(unsigned i=1;i<=nstep;i++)
833  {
834  // Switch doc off during solve
835  doc_info.disable_doc();
836 
837  // Solve
838  unsigned max_adapt=1;
839  unsteady_newton_solve(dt,max_adapt,first);
840 
841  // Now we've done the first step
842  first=false;
843 
844  // Doc solution
845  doc_solution(i,doc_info,trace_file,i_case);
846 
848  if (time_pt()->time()>Pcos_duration) {Pcos=0.0;}
849 
850  }
851 
852 }
double Density_ratio
Ratio of pore fluid density to solid matrix density.
Definition: unstructured_two_d_curved.cc:74

References Global_Physical_Variables::Alpha_sq, oomph::CommandLineArgs::Argc, ProblemParameters::Density_ratio, oomph::DocInfo::disable_doc(), oomph::TreeBasedRefineableMeshBase::doc_adaptivity_targets(), doc_solution(), Fluid_mesh_pt, H, i, oomph::Problem::initialise_dt(), oomph::RefineableMeshBase::max_keep_unrefined(), oomph::RefineableMeshBase::max_permitted_error(), oomph::TreeBasedRefineableMeshBase::max_refinement_level(), oomph::RefineableMeshBase::min_permitted_error(), oomph::TreeBasedRefineableMeshBase::min_refinement_level(), oomph::DocInfo::number(), Global_Physical_Variables::Pcos, Pcos_duration, Pcos_initial, Global_Physical_Variables::Pext, oomph::DocInfo::set_directory(), set_initial_condition(), Global_Physical_Variables::set_params(), oomph::Problem::time(), oomph::Problem::time_pt(), and oomph::Problem::unsteady_newton_solve().

◆ set_fluid_initial_condition() [1/3]

void FSIRingProblem::set_fluid_initial_condition ( )
private

Setup initial condition for fluid.

Setup initial condition for fluid: Impulsive start.

280 {
281 
282  // Update fluid domain: Careful!!! This also applies the no slip conditions
283  // on all nodes on the wall! Since the wall might have moved since
284  // we created the mesh; we're therefore imposing a nonzero
285  // velocity on these nodes. Must wipe this afterwards (done
286  // by setting *all* velocities to zero) otherwise we get
287  // an impulsive start from a very bizarre initial velocity
288  // field! [Yes, it took me a while to figure this out...]
290 
291  // Assign initial values for the velocities;
292  // pressures don't carry a time history and can be left alone.
293 
294  //Find number of nodes in fluid mesh
295  unsigned n_node = Fluid_mesh_pt->nnode();
296 
297  // Loop over the nodes to set initial guess everywhere
298  for(unsigned n=0;n<n_node;n++)
299  {
300  // Loop over velocity directions: Impulsive initial start from
301  // zero velocity!
302  for(unsigned i=0;i<2;i++)
303  {
305  }
306  }
307 
308  // Do an impulsive start with the assigned velocity field
310 
311 }
AlgebraicNode * node_pt(const unsigned long &n)
Return a pointer to the n-th global AlgebraicNode.
Definition: algebraic_elements.h:620
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
void assign_initial_values_impulsive()
Assign initial values for an impulsive start.
Definition: mesh.cc:2288

References i, and n.

◆ set_fluid_initial_condition() [2/3]

void FSIRingProblem::set_fluid_initial_condition ( )
private

Setup initial condition for fluid.

◆ set_fluid_initial_condition() [3/3]

void FSIRingProblem::set_fluid_initial_condition ( )
private

Setup initial condition for fluid.

◆ set_initial_condition() [1/3]

void FSIRingProblem::set_initial_condition ( )
privatevirtual

Setup initial condition for both domains.

Setup initial condition: When we're done here, all variables represent the state at the initial time.

Reimplemented from oomph::Problem.

265 {
266 
267  cout << "Setting wall ic" << std::endl;
269 
270  cout << "Setting fluid ic" << std::endl;
272 
273 }
void set_wall_initial_condition()
Setup initial condition for wall.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:318
void set_fluid_initial_condition()
Setup initial condition for fluid.
Definition: interaction/fsi_osc_ring/fsi_osc_ring.cc:279

Referenced by dynamic_run().

◆ set_initial_condition() [2/3]

void FSIRingProblem::set_initial_condition ( )
privatevirtual

Setup initial condition for both domains.

Reimplemented from oomph::Problem.

◆ set_initial_condition() [3/3]

void FSIRingProblem::set_initial_condition ( )
privatevirtual

Setup initial condition for both domains.

Reimplemented from oomph::Problem.

◆ set_wall_initial_condition() [1/3]

void FSIRingProblem::set_wall_initial_condition ( )
private

Setup initial condition for wall.

Setup initial condition: Impulsive start either from deformed or undeformed wall shape.

319 {
320 
321  // Geometric object that specifies the initial conditions:
322  // A ring that is bucked in a 2-lobed mode
323  GeomObject* ic_geom_object_pt=
326 
327  // Assign period of oscillation of the geometric object
328  static_cast<PseudoBucklingRing*>(ic_geom_object_pt)->set_T(1.0);
329 
330  //Set initial time (to deform wall into max. amplitude)
331  double time=0.25;
332 
333  // Assign initial radius of the object
334  static_cast<PseudoBucklingRing*>(ic_geom_object_pt)->set_R_0(1.00);
335 
336  // Setup object that specifies the initial conditions:
337  SolidInitialCondition* IC_pt = new SolidInitialCondition(ic_geom_object_pt);
338 
339  // Assign values of positional data of all elements on wall mesh
340  // so that the wall deforms into the shape specified by IC object.
341  SolidMesh::Solid_IC_problem.set_static_initial_condition(
342  this,Wall_mesh_pt,IC_pt,time);
343 
344 }
Definition: geom_objects.h:101
Definition: pseudo_buckling_ring.h:56
Definition: elements.h:3496

References Global_Physical_Variables::H.

◆ set_wall_initial_condition() [2/3]

void FSIRingProblem::set_wall_initial_condition ( )
private

Setup initial condition for wall.

◆ set_wall_initial_condition() [3/3]

void FSIRingProblem::set_wall_initial_condition ( )
private

Setup initial condition for wall.

Member Data Documentation

◆ Doc_displacement_elem_pt

SOLID_ELEMENT * FSIRingProblem::Doc_displacement_elem_pt
private

Element used for documenting displacement.

Referenced by FSIRingProblem().

◆ Eps_ampl

double FSIRingProblem::Eps_ampl
private

Amplitude of initial deformation.

◆ Fluid_mesh_pt

AlgebraicRefineableQuarterCircleSectorMesh< FLUID_ELEMENT > * FSIRingProblem::Fluid_mesh_pt
private

Pointer to fluid mesh.

Referenced by dynamic_run(), and FSIRingProblem().

◆ Fluid_time_stepper_pt

BDF< 2 > * FSIRingProblem::Fluid_time_stepper_pt
private

Pointer to fluid timestepper.

Referenced by FSIRingProblem().

◆ Pcos_duration

double FSIRingProblem::Pcos_duration
private

Duration of initial pcos.

Referenced by dynamic_run().

◆ Pcos_initial

double FSIRingProblem::Pcos_initial
private

Initial pcos.

Referenced by dynamic_run().

◆ Undef_geom_pt

GeomObject * FSIRingProblem::Undef_geom_pt
private

Pointer to geometric object that represents the undeformed wall shape.

Referenced by FSIRingProblem().

◆ Veloc_trace_node_pt

Node * FSIRingProblem::Veloc_trace_node_pt
private

Pointer to node on coarsest mesh on which velocity is traced.

Referenced by FSIRingProblem().

◆ Wall_mesh_pt

OneDLagrangianMesh< SOLID_ELEMENT > * FSIRingProblem::Wall_mesh_pt
private

Pointer to wall mesh.

Referenced by FSIRingProblem().

◆ Wall_time_stepper_pt

Newmark< 2 > * FSIRingProblem::Wall_time_stepper_pt
private

Pointer to wall timestepper.

Referenced by FSIRingProblem().


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