BubbleInChannelProblem< ELEMENT > Class Template Reference

Problem class to simulate inviscid bubble propagating along 2D channel. More...

+ Inheritance diagram for BubbleInChannelProblem< ELEMENT >:

Public Member Functions

 BubbleInChannelProblem ()
 Constructor. More...
 
 ~BubbleInChannelProblem ()
 Destructor. More...
 
void actions_before_adapt ()
 Actions before adapt: Wipe the mesh of free surface elements. More...
 
void actions_after_adapt ()
 Actions after adapt: Rebuild the mesh of free surface elements. More...
 
void actions_after_newton_solve ()
 Update the after solve (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve. More...
 
void complete_problem_setup ()
 Set boundary conditions and complete the build of all elements. More...
 
void doc_solution (const std::string &comment="")
 Doc the solution. More...
 
void compute_error_estimate (double &max_err, double &min_err)
 Compute the error estimates and assign to elements for plotting. 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
 
OomphCommunicator * communicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicator * communicator_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 ()
 
LinearSolver * mass_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...
 
Time * time_pt () const
 Return a pointer to the global time object (const version). More...
 
double & time ()
 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 TimeStepper * time_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...
 
double & minimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
double & maximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsigned & max_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...
 
double & max_residuals ()
 
bool & time_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
double & newton_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...
 
double * global_dof_pt (const unsigned &i)
 
double & dof (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...
 
double * dof_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...
 
bool & use_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 Problem * make_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 ()
 
double * bifurcation_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 ()
 
int & sign_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

enum  {
  Inflow_boundary_id =0 , Upper_wall_boundary_id =1 , Outflow_boundary_id =2 , Bottom_wall_boundary_id =3 ,
  First_bubble_boundary_id =4 , Second_bubble_boundary_id =5
}
 Enumeration of mesh boundaries. More...
 

Private Member Functions

void create_free_surface_elements ()
 Create free surface elements. More...
 
void delete_free_surface_elements ()
 Delete free surface elements. More...
 
void create_volume_constraint_elements ()
 Create elements that impose volume constraint on the bubble. More...
 
void delete_volume_constraint_elements ()
 Delete volume constraint elements. More...
 

Private Attributes

Mesh * Free_surface_mesh_pt
 Pointers to mesh of free surface elements. More...
 
Mesh * Volume_constraint_mesh_pt
 Pointer to mesh containing elements that impose volume constraint. More...
 
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
 Pointer to Fluid_mesh. More...
 
Vector< TriangleMeshPolygon * > Bubble_polygon_pt
 Vector storing pointer to the bubble polygons. More...
 
TriangleMeshPolygon * Outer_boundary_polyline_pt
 Triangle mesh polygon for outer boundary. More...
 
Data * Bubble_pressure_data_pt
 Pointer to a global bubble pressure datum. More...
 
VolumeConstraintElement * Vol_constraint_el_pt
 Pointer to element that imposes volume constraint for bubble. 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_convergence_check ()
 
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)
 
double & dof_derivative (const unsigned &i)
 
double & dof_current (const unsigned &i)
 
virtual void set_initial_condition ()
 
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 *, bool > Calculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistribution * Dof_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< double > Max_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< double > Dof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< double > Dof_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
 
OomphCommunicator * Communicator_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

template<class ELEMENT>
class BubbleInChannelProblem< ELEMENT >

Problem class to simulate inviscid bubble propagating along 2D channel.

//////////////////////////////////////////////////////// //////////////////////////////////////////////////////// ////////////////////////////////////////////////////////

Member Enumeration Documentation

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private

Enumeration of mesh boundaries.

Enumerator
Inflow_boundary_id 
Upper_wall_boundary_id 
Outflow_boundary_id 
Bottom_wall_boundary_id 
First_bubble_boundary_id 
Second_bubble_boundary_id 
602  {
609  };
@ Bottom_wall_boundary_id
Definition: adaptive_bubble_in_channel.cc:606
@ Second_bubble_boundary_id
Definition: adaptive_bubble_in_channel.cc:608
@ First_bubble_boundary_id
Definition: adaptive_bubble_in_channel.cc:607
@ Upper_wall_boundary_id
Definition: adaptive_bubble_in_channel.cc:604
@ Inflow_boundary_id
Definition: adaptive_bubble_in_channel.cc:603
@ Outflow_boundary_id
Definition: adaptive_bubble_in_channel.cc:605

Constructor & Destructor Documentation

◆ BubbleInChannelProblem()

template<class ELEMENT >
BubbleInChannelProblem< ELEMENT >::BubbleInChannelProblem

Constructor.

620 {
621  // Output directory
623 
624  // Allocate the timestepper -- this constructs the Problem's
625  // time object with a sufficient amount of storage to store the
626  // previous timsteps.
627  this->add_time_stepper_pt(new BDF<2>);
628 
629 
630 
631  // Build volume constraint element: Pass pointer to double that
632  // specifies target volume, data that contains the "traded" pressure
633  // and the index of the traded pressure value within this Data item
634 
635 #ifdef GLOBAL_DATA
636 
637  // Create bubble pressure as global Data
638  Bubble_pressure_data_pt = new Data(1);
639  unsigned index_of_traded_pressure=0;
641 
642 
646  index_of_traded_pressure);
647 
648  //Provide a reasonable initial guess for bubble pressure (hydrostatics):
649  Bubble_pressure_data_pt->set_value(index_of_traded_pressure,
652 #else
653 
654  // Build element and create pressure internally
657 
658  // Which value stores the pressure?
660 
661  // Pressure data
663 
664  // Assign initial value
667 
668 #endif
669 
670 
671  // Build the boundary segments for outer boundary, consisting of
672  //--------------------------------------------------------------
673  // four separate polylines
674  //------------------------
675  Vector<TriangleMeshCurveSection*> boundary_polyline_pt(4);
676 
677  // Each polyline only has two vertices -- provide storage for their
678  // coordinates
679  Vector<Vector<double> > vertex_coord(2);
680  for(unsigned i=0;i<2;i++)
681  {
682  vertex_coord[i].resize(2);
683  }
684 
685  // First polyline: Inflow
686  vertex_coord[0][0]=0.0;
687  vertex_coord[0][1]=0.0;
688  vertex_coord[1][0]=0.0;
689  vertex_coord[1][1]=1.0;
690 
691  // Build the 1st boundary polyline
692  boundary_polyline_pt[0] = new TriangleMeshPolyLine(vertex_coord,
694 
695  // Second boundary polyline: Upper wall
696  vertex_coord[0][0]=0.0;
697  vertex_coord[0][1]=1.0;
698  vertex_coord[1][0]=Problem_Parameter::Length;
699  vertex_coord[1][1]=1.0;
700 
701  // Build the 2nd boundary polyline
702  boundary_polyline_pt[1] = new TriangleMeshPolyLine(vertex_coord,
704 
705  // Third boundary polyline: Outflow
706  vertex_coord[0][0]=Problem_Parameter::Length;
707  vertex_coord[0][1]=1.0;
708  vertex_coord[1][0]=Problem_Parameter::Length;
709  vertex_coord[1][1]=0.0;
710 
711  // Build the 3rd boundary polyline
712  boundary_polyline_pt[2] = new TriangleMeshPolyLine(vertex_coord,
714 
715  // Fourth boundary polyline: Bottom wall
716  vertex_coord[0][0]=Problem_Parameter::Length;
717  vertex_coord[0][1]=0.0;
718  vertex_coord[1][0]=0.0;
719  vertex_coord[1][1]=0.0;
720 
721  // Build the 4th boundary polyline
722  boundary_polyline_pt[3] = new TriangleMeshPolyLine(vertex_coord,
724 
725  // Create the triangle mesh polygon for outer boundary
726  Outer_boundary_polyline_pt = new TriangleMeshPolygon(boundary_polyline_pt);
727 
728 
729  // Now define initial shape of bubble(s) with polygon
730  //---------------------------------------------------
731 
732  // We have one bubble
733  Bubble_polygon_pt.resize(1);
734 
735  // Place it smack in the middle of the channel
736  double x_center = 0.5*Problem_Parameter::Length;
737  double y_center = 0.5;
738  Ellipse * bubble_pt = new Ellipse(Problem_Parameter::Radius,
740 
741  // Intrinsic coordinate along GeomObject defining the bubble
742  Vector<double> zeta(1);
743 
744  // Position vector to GeomObject defining the bubble
745  Vector<double> coord(2);
746 
747  // Number of points defining bubble
748  unsigned npoints = 16;
749  double unit_zeta = MathematicalConstants::Pi/double(npoints-1);
750 
751  // This bubble is bounded by two distinct boundaries, each
752  // represented by its own polyline
753  Vector<TriangleMeshCurveSection*> bubble_polyline_pt(2);
754 
755  // Vertex coordinates
756  Vector<Vector<double> > bubble_vertex(npoints);
757 
758  // Create points on boundary
759  for(unsigned ipoint=0; ipoint<npoints;ipoint++)
760  {
761  // Resize the vector
762  bubble_vertex[ipoint].resize(2);
763 
764  // Get the coordinates
765  zeta[0]=unit_zeta*double(ipoint);
766  bubble_pt->position(zeta,coord);
767 
768  // Shift
769  bubble_vertex[ipoint][0]=coord[0]+x_center;
770  bubble_vertex[ipoint][1]=coord[1]+y_center;
771  }
772 
773  // Build the 1st bubble polyline
774  bubble_polyline_pt[0] = new TriangleMeshPolyLine(bubble_vertex,
776 
777  // Second boundary of bubble
778  for(unsigned ipoint=0; ipoint<npoints;ipoint++)
779  {
780  // Resize the vector
781  bubble_vertex[ipoint].resize(2);
782 
783  // Get the coordinates
784  zeta[0]=(unit_zeta*double(ipoint))+MathematicalConstants::Pi;
785  bubble_pt->position(zeta,coord);
786 
787  // Shift
788  bubble_vertex[ipoint][0]=coord[0]+x_center;
789  bubble_vertex[ipoint][1]=coord[1]+y_center;
790  }
791 
792  // Build the 2nd bubble polyline
793  bubble_polyline_pt[1] = new TriangleMeshPolyLine(bubble_vertex,
795 
796 
797  // Define coordinates of a point inside the bubble
798  Vector<double> bubble_center(2);
799  bubble_center[0]=x_center;
800  bubble_center[1]=y_center;
801 
802 
803  // Create closed polygon from two polylines
805  bubble_polyline_pt,
806  bubble_center);
807 
808  // Now build the mesh, based on the boundaries specified by
809  //---------------------------------------------------------
810  // polygons just created
811  //----------------------
812 
813  // Convert to "closed curve" objects
815  unsigned nb=Bubble_polygon_pt.size();
816  Vector<TriangleMeshClosedCurve*> bubble_closed_curve_pt(nb);
817  for (unsigned i=0;i<nb;i++)
818  {
819  bubble_closed_curve_pt[i]=Bubble_polygon_pt[i];
820  }
821 
822  // Target area for initial mesh
823  double uniform_element_area=0.2;
824 
825  // Use the TriangleMeshParameters object for gathering all
826  // the necessary arguments for the TriangleMesh object
827  TriangleMeshParameters triangle_mesh_parameters(
828  outer_closed_curve_pt);
829 
830  // Define the holes on the boundary
831  triangle_mesh_parameters.internal_closed_curve_pt() =
832  bubble_closed_curve_pt;
833 
834  // Define the maximum element areas
835  triangle_mesh_parameters.element_area() =
836  uniform_element_area;
837 
838  // Create the mesh
839  Fluid_mesh_pt =
840  new RefineableSolidTriangleMesh<ELEMENT>(
841  triangle_mesh_parameters, this->time_stepper_pt());
842 
843  // Set error estimator for bulk mesh
845  Fluid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
846 
847  // Set targets for spatial adaptivity
848  Fluid_mesh_pt->max_permitted_error()=0.005;
849  Fluid_mesh_pt->min_permitted_error()=0.001;
850  Fluid_mesh_pt->max_element_size()=0.2;
851  Fluid_mesh_pt->min_element_size()=0.001;
852 
853  // Use coarser mesh during validation
855  {
856  Fluid_mesh_pt->min_element_size()=0.01;
857  }
858 
859  // Output boundary and mesh initial mesh for information
860  this->Fluid_mesh_pt->output_boundaries("boundaries.dat");
861  this->Fluid_mesh_pt->output("mesh.dat");
862 
863  // Set boundary condition and complete the build of all elements
865 
866  // Construct the mesh of free surface elements
869 
870  // Construct the mesh of elements that impose the volume constraint
873 
874  // Combine meshes
875  //---------------
876 
877  // Add volume constraint sub mesh
879 
880  // Add Fluid_mesh_pt sub meshes
882 
883  // Add Free_surface sub meshes
884  this->add_sub_mesh(this->Free_surface_mesh_pt);
885 
886  // Build global mesh
887  this->build_global_mesh();
888 
889  // Setup equation numbering scheme
890  cout <<"Number of equations: " << this->assign_eqn_numbers() << std::endl;
891 
892 } // end_of_constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
Pointer to Fluid_mesh.
Definition: adaptive_bubble_in_channel.cc:586
Vector< TriangleMeshPolygon * > Bubble_polygon_pt
Vector storing pointer to the bubble polygons.
Definition: adaptive_bubble_in_channel.cc:589
Mesh * Volume_constraint_mesh_pt
Pointer to mesh containing elements that impose volume constraint.
Definition: adaptive_bubble_in_channel.cc:583
TriangleMeshPolygon * Outer_boundary_polyline_pt
Triangle mesh polygon for outer boundary.
Definition: adaptive_bubble_in_channel.cc:592
Mesh * Free_surface_mesh_pt
Pointers to mesh of free surface elements.
Definition: adaptive_bubble_in_channel.cc:580
void complete_problem_setup()
Set boundary conditions and complete the build of all elements.
Definition: adaptive_bubble_in_channel.cc:1003
Data * Bubble_pressure_data_pt
Pointer to a global bubble pressure datum.
Definition: adaptive_bubble_in_channel.cc:595
void create_free_surface_elements()
Create free surface elements.
Definition: adaptive_bubble_in_channel.cc:900
VolumeConstraintElement * Vol_constraint_el_pt
Pointer to element that imposes volume constraint for bubble.
Definition: adaptive_bubble_in_channel.cc:598
void create_volume_constraint_elements()
Create elements that impose volume constraint on the bubble.
Definition: adaptive_bubble_in_channel.cc:958
Definition: nodes.h:86
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
Definition: geom_objects.h:644
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:745
Definition: mesh.h:67
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 add_global_data(Data *const &global_data_pt)
Definition: problem.h:1654
void build_global_mesh()
Definition: problem.cc:1493
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
Base class defining a closed curve for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1339
Definition: triangle_mesh.template.h:94
Class defining a polyline for use in Triangle Mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:868
Class defining a closed polygon for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1451
Definition: oomph-lib/src/generic/Vector.h:58
Definition: constrained_volume_elements.h:66
Data * p_traded_data_pt()
Access to Data that contains the traded pressure.
Definition: constrained_volume_elements.h:124
unsigned index_of_traded_pressure()
Return the index of Data object at which the traded pressure is stored.
Definition: constrained_volume_elements.h:145
Definition: error_estimator.h:266
int nb
Definition: level2_impl.h:286
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
DocInfo Doc_info
Doc info.
Definition: refineable_two_layer_interface.cc:291
double Length
Length of the channel.
Definition: refineable_two_layer_interface.cc:323
double Radius
Initial radius of bubble.
Definition: adaptive_bubble_in_channel.cc:384
double Volume
Definition: adaptive_bubble_in_channel.cc:388
double Ca
Capillary number.
Definition: refineable_two_layer_interface.cc:314
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501

References Problem_Parameter::Ca, oomph::CommandLineArgs::command_line_flag_has_been_set(), Problem_Parameter::Doc_info, oomph::TriangleMeshParameters::element_area(), MeshRefinement::error_estimator_pt, i, oomph::TriangleMeshParameters::internal_closed_curve_pt(), Problem_Parameter::Length, nb, BiharmonicTestFunctions2::Pi, oomph::Ellipse::position(), Problem_Parameter::Radius, oomph::DocInfo::set_directory(), Problem_Parameter::Volume, and Eigen::zeta().

◆ ~BubbleInChannelProblem()

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

Destructor.

434  {
435  // Fluid timestepper
436  delete this->time_stepper_pt(0);
437 
438  // Kill data associated with outer boundary
440  for (unsigned j=0;j<n;j++)
441  {
443  }
445 
446  //Kill data associated with bubbles
447  unsigned n_bubble = Bubble_polygon_pt.size();
448  for(unsigned ibubble=0;ibubble<n_bubble;ibubble++)
449  {
450  unsigned n=Bubble_polygon_pt[ibubble]->npolyline();
451  for (unsigned j=0;j<n;j++)
452  {
453  delete Bubble_polygon_pt[ibubble]->polyline_pt(j);
454  }
455  delete Bubble_polygon_pt[ibubble];
456  }
457 
458  // Flush element of free surface elements
460  delete Free_surface_mesh_pt;
463 
464  // Delete error estimator
465  delete Fluid_mesh_pt->spatial_error_estimator_pt();
466 
467  // Delete fluid mesh
468  delete Fluid_mesh_pt;
469 
470  // Delete the global pressure bubble data
472 
473  // Kill const eqn
475 
476  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void delete_volume_constraint_elements()
Delete volume constraint elements.
Definition: adaptive_bubble_in_channel.cc:561
void delete_free_surface_elements()
Delete free surface elements.
Definition: adaptive_bubble_in_channel.cc:539
unsigned npolyline() const
Number of constituent polylines.
Definition: unstructured_two_d_mesh_geometry_base.h:1482
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
Definition: unstructured_two_d_mesh_geometry_base.h:1488
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
Definition: jeffery_orbit.cc:82
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References Problem_Parameter::Constitutive_law_pt, j, and n.

Member Function Documentation

◆ actions_after_adapt()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::actions_after_adapt ( )
inlinevirtual

Actions after adapt: Rebuild the mesh of free surface elements.

Reimplemented from oomph::Problem.

494  {
495  // Create the elements that impose the displacement constraint
498 
499  // Rebuild the Problem's global mesh from its various sub-meshes
500  this->rebuild_global_mesh();
501 
502  // Setup the problem again -- remember that fluid mesh has been
503  // completely rebuilt and its element's don't have any
504  // pointers to Re etc. yet
506 
507  }// end of actions_after_adapt
void rebuild_global_mesh()
Definition: problem.cc:1533

◆ actions_after_newton_solve()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::actions_after_newton_solve ( )
inlinevirtual

Update the after solve (empty)

Reimplemented from oomph::Problem.

511 {}

◆ actions_before_adapt()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::actions_before_adapt ( )
inlinevirtual

Actions before adapt: Wipe the mesh of free surface elements.

Reimplemented from oomph::Problem.

481  {
482  // Kill the elements and wipe surface mesh
485 
486  // Rebuild the Problem's global mesh from its various sub-meshes
487  this->rebuild_global_mesh();
488 
489  }// end of actions_before_adapt

◆ actions_before_newton_solve()

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

Update the problem specs before solve.

Reimplemented from oomph::Problem.

515  {
516  //Reset the Lagrangian coordinates of the nodes to be the current
517  //Eulerian coordinates -- this makes the current configuration
518  //stress free
519  Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
520  }

◆ complete_problem_setup()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::complete_problem_setup

Set boundary conditions and complete the build of all elements.

1004 {
1005  // Map to record if a given boundary is on a bubble or not
1006  map<unsigned,bool> is_on_bubble_bound;
1007 
1008  // Loop over the bubbles
1009  unsigned nbubble=Bubble_polygon_pt.size();
1010  for(unsigned ibubble=0;ibubble<nbubble;ibubble++)
1011  {
1012  // Get the vector all boundary IDs associated with the polylines that
1013  // make up the closed polygon
1014  Vector<unsigned> bubble_bound_id=this->Bubble_polygon_pt[ibubble]->
1015  polygon_boundary_id();
1016 
1017  // Get the number of boundary
1018  unsigned nbound=bubble_bound_id.size();
1019 
1020  // Fill in the map
1021  for(unsigned ibound=0;ibound<nbound;ibound++)
1022  {
1023  // This boundary...
1024  unsigned bound_id=bubble_bound_id[ibound];
1025 
1026  // ...is on the bubble
1027  is_on_bubble_bound[bound_id]=true;
1028  }
1029  } // points on bubble boundary located
1030 
1031  // Re-set the boundary conditions for fluid problem: All nodes are
1032  // free by default -- just pin the ones that have Dirichlet conditions
1033  // here.
1034  unsigned nbound=Fluid_mesh_pt->nboundary();
1035  for(unsigned ibound=0;ibound<nbound;ibound++)
1036  {
1037  unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
1038  for (unsigned inod=0;inod<num_nod;inod++)
1039  {
1040  // Get node
1041  Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
1042 
1043  //Pin both velocities on inflow (0) and side boundaries (1 and 3)
1044  if((ibound==0) || (ibound==1) || (ibound==3))
1045  {
1046  nod_pt->pin(0);
1047  nod_pt->pin(1);
1048  }
1049 
1050  //If it's the outflow pin only the vertical velocity
1051  if(ibound==2) {nod_pt->pin(1);}
1052 
1053  // Pin pseudo-solid positions apart from bubble boundary which
1054  // we allow to move
1055  SolidNode* solid_node_pt = dynamic_cast<SolidNode*>(nod_pt);
1056  if(is_on_bubble_bound[ibound])
1057  {
1058  solid_node_pt->unpin_position(0);
1059  solid_node_pt->unpin_position(1);
1060  }
1061  else
1062  {
1063  solid_node_pt->pin_position(0);
1064  solid_node_pt->pin_position(1);
1065  }
1066  }
1067  } // end loop over boundaries
1068 
1069  // Complete the build of all elements so they are fully functional
1070  // Remember that adaptation for triangle meshes involves a complete
1071  // regneration of the mesh (rather than splitting as in tree-based
1072  // meshes where such parameters can be passed down from the father
1073  // element!)
1074  unsigned n_element = Fluid_mesh_pt->nelement();
1075  for(unsigned e=0;e<n_element;e++)
1076  {
1077  // Upcast from GeneralisedElement to the present element
1078  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
1079 
1080  // Set the Reynolds number
1081  el_pt->re_pt() = &Problem_Parameter::Re;
1082 
1083  // Set the Womersley number (same as Re since St=1)
1084  el_pt->re_st_pt() = &Problem_Parameter::Re;
1085 
1086  // Set the constitutive law for pseudo-elastic mesh deformation
1087  el_pt->constitutive_law_pt()=Problem_Parameter::Constitutive_law_pt;
1088  }
1089 
1090  // Re-apply boundary values on Dirichlet boundary conditions
1091  // (Boundary conditions are ignored when the solution is transferred
1092  // from the old to the new mesh by projection; this leads to a slight
1093  // change in the boundary values (which are, of course, never changed,
1094  // unlike the actual unknowns for which the projected values only
1095  // serve as an initial guess)
1096 
1097  // Set velocity and history values of velocity on walls
1098  nbound=this->Fluid_mesh_pt->nboundary();
1099  for(unsigned ibound=0;ibound<nbound;++ibound)
1100  {
1101  if ((ibound==Upper_wall_boundary_id)||
1102  (ibound==Bottom_wall_boundary_id)||
1103  (ibound==Outflow_boundary_id)||
1104  (ibound==Inflow_boundary_id))
1105  {
1106  // Loop over nodes on this boundary
1107  unsigned num_nod=this->Fluid_mesh_pt->nboundary_node(ibound);
1108  for (unsigned inod=0;inod<num_nod;inod++)
1109  {
1110  // Get node
1111  Node* nod_pt=this->Fluid_mesh_pt->boundary_node_pt(ibound,inod);
1112 
1113  // Get number of previous (history) values
1114  unsigned n_prev=nod_pt->time_stepper_pt()->nprev_values();
1115 
1116  // Velocity is and was zero at all previous times
1117  for (unsigned t=0;t<=n_prev;t++)
1118  {
1119  if (ibound!=Inflow_boundary_id)
1120  {
1121  // Parallel outflow
1122  if (ibound!=Outflow_boundary_id)
1123  {
1124  nod_pt->set_value(t,0,0.0);
1125  }
1126  nod_pt->set_value(t,1,0.0);
1127  }
1128 
1129  // Nodes have always been there...
1130  nod_pt->x(t,0)=nod_pt->x(0,0);
1131  nod_pt->x(t,1)=nod_pt->x(0,1);
1132  }
1133  }
1134  }
1135  }
1136 
1137  // Re-assign prescribed inflow velocity at inlet
1138  unsigned num_nod=this->Fluid_mesh_pt->nboundary_node(Inflow_boundary_id);
1139  for (unsigned inod=0;inod<num_nod;inod++)
1140  {
1141  // Get node
1142  Node* nod_pt=this->Fluid_mesh_pt->boundary_node_pt(Inflow_boundary_id,
1143  inod);
1144  //Now set the boundary velocity
1145  double y = nod_pt->x(1);
1147  }
1148 
1149 } // end of complete_problem_setup
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
Definition: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
Definition: nodes.h:1686
void pin_position(const unsigned &i)
Pin the nodal position.
Definition: nodes.h:1816
void unpin_position(const unsigned &i)
Unpin the nodal position.
Definition: nodes.h:1829
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
Scalar * y
Definition: level1_cplx_impl.h:128
double Inflow_veloc_magnitude
Definition: adaptive_bubble_in_channel.cc:392
double Re
Reynolds number.
Definition: jeffery_orbit.cc:59
t
Definition: plotPSD.py:36

References Problem_Parameter::Constitutive_law_pt, e(), Problem_Parameter::Inflow_veloc_magnitude, oomph::TimeStepper::nprev_values(), oomph::Data::pin(), oomph::SolidNode::pin_position(), Problem_Parameter::Re, oomph::Data::set_value(), plotPSD::t, oomph::Data::time_stepper_pt(), oomph::SolidNode::unpin_position(), oomph::Node::x(), and y.

◆ compute_error_estimate()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::compute_error_estimate ( double &  max_err,
double &  min_err 
)

Compute the error estimates and assign to elements for plotting.

Compute error estimates and assign to elements for plotting.

1239 {
1240  // Get error estimator
1241  ErrorEstimator* err_est_pt=Fluid_mesh_pt->spatial_error_estimator_pt();
1242 
1243  // Get/output error estimates
1244  unsigned nel=Fluid_mesh_pt->nelement();
1245  Vector<double> elemental_error(nel);
1246 
1247  // We need a dynamic cast, get_element_errors from the Fluid_mesh_pt
1248  // Dynamic cast is used because get_element_errors require a Mesh* ans
1249  // not a SolidMesh*
1250  Mesh* fluid_mesh_pt=dynamic_cast<Mesh*>(Fluid_mesh_pt);
1251  err_est_pt->get_element_errors(fluid_mesh_pt,
1252  elemental_error);
1253 
1254  // Set errors for post-processing and find extrema
1255  max_err=0.0;
1256  min_err=DBL_MAX;
1257  for (unsigned e=0;e<nel;e++)
1258  {
1259  dynamic_cast<MyTaylorHoodElement*>(Fluid_mesh_pt->element_pt(e))->
1260  set_error(elemental_error[e]);
1261 
1262  max_err=std::max(max_err,elemental_error[e]);
1263  min_err=std::min(min_err,elemental_error[e]);
1264  }
1265 
1266 }
Base class for spatial error estimators.
Definition: error_estimator.h:40
void get_element_errors(Mesh *&mesh_pt, Vector< double > &elemental_error)
Definition: error_estimator.h:56
Overload TaylorHood element to modify output.
Definition: pressure_driven_torus.cc:98
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
void set_error(const double &error)
Set error value for post-processing.
Definition: overloaded_element_body.h:432

References e(), oomph::ErrorEstimator::get_element_errors(), max, min, and set_error().

◆ create_free_surface_elements()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::create_free_surface_elements
private

Create free surface elements.

Create elements that impose the kinematic and dynamic bcs for the pseudo-solid fluid mesh

901 {
902 
903  // Volume constraint element stores the Data item that stores
904  // the bubble pressure that is adjusted/traded to allow for
905  // volume conservation. Which value is the pressure stored in?
906  unsigned p_traded_index=Vol_constraint_el_pt->index_of_traded_pressure();
907 
908  //Loop over the free surface boundaries
909  unsigned nb=Fluid_mesh_pt->nboundary();
910  for(unsigned b=First_bubble_boundary_id;b<nb;b++)
911  {
912  // How many bulk fluid elements are adjacent to boundary b?
913  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
914 
915  // Loop over the bulk fluid elements adjacent to boundary b?
916  for(unsigned e=0;e<n_element;e++)
917  {
918  // Get pointer to the bulk fluid element that is
919  // adjacent to boundary b
920  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
921  Fluid_mesh_pt->boundary_element_pt(b,e));
922 
923  //Find the index of the face of element e along boundary b
924  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
925 
926  // Create new element
929  bulk_elem_pt,face_index);
930 
931  // Add it to the mesh
933 
934  //Add the appropriate boundary number
936 
937  //Specify the capillary number
938  el_pt->ca_pt() = &Problem_Parameter::Ca;
939 
940  // Specify the bubble pressure (pointer to Data object and
941  // index of value within that Data object that corresponds
942  // to the traded pressure
944  Vol_constraint_el_pt->p_traded_data_pt(),p_traded_index);
945  }
946  }
947 }
Scalar * b
Definition: benchVecAdd.cpp:17
Specialise the elastic update template class to concrete 1D case.
Definition: specific_node_update_interface_elements.h:1220
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
Definition: elements.h:4482
double *& ca_pt()
Pointer to the Capillary number.
Definition: interface_elements.h:492
void set_external_pressure_data(Data *external_pressure_data_pt)
Definition: interface_elements.h:539
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617

References b, Problem_Parameter::Ca, oomph::FluidInterfaceElement::ca_pt(), e(), nb, oomph::FaceElement::set_boundary_number_in_bulk_mesh(), and oomph::FluidInterfaceElement::set_external_pressure_data().

◆ create_volume_constraint_elements()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::create_volume_constraint_elements
private

Create elements that impose volume constraint on the bubble.

959 {
960 
961  // Add volume constraint element to the mesh
963 
964  //Loop over the free surface boundaries
965  unsigned nb=Fluid_mesh_pt->nboundary();
966  for(unsigned b=First_bubble_boundary_id;b<nb;b++)
967  {
968  // How many bulk fluid elements are adjacent to boundary b?
969  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
970 
971  // Loop over the bulk fluid elements adjacent to boundary b?
972  for(unsigned e=0;e<n_element;e++)
973  {
974  // Get pointer to the bulk fluid element that is
975  // adjacent to boundary b
976  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
977  Fluid_mesh_pt->boundary_element_pt(b,e));
978 
979  //Find the index of the face of element e along boundary b
980  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
981 
982  // Create new element
985  bulk_elem_pt,face_index);
986 
987  //Set the "master" volume constraint element
989 
990  // Add it to the mesh
992  }
993  }
994 }
Definition: constrained_volume_elements.h:372
void set_volume_constraint_element(VolumeConstraintElement *const &vol_constraint_el_pt, const bool &check_nodal_data=true)
Definition: constrained_volume_elements.h:261

References b, e(), nb, and oomph::VolumeConstraintBoundingElement::set_volume_constraint_element().

◆ delete_free_surface_elements()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::delete_free_surface_elements ( )
inlineprivate

Delete free surface elements.

540  {
541  // How many surface elements are in the surface mesh
542  unsigned n_element = Free_surface_mesh_pt->nelement();
543 
544  // Loop over the surface elements
545  for(unsigned e=0;e<n_element;e++)
546  {
547  // Kill surface element
549  }
550 
551  // Wipe the mesh
553 
554  } // end of delete_free_surface_elements
void flush_element_and_node_storage()
Definition: mesh.h:407
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590

References e().

◆ delete_volume_constraint_elements()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::delete_volume_constraint_elements ( )
inlineprivate

Delete volume constraint elements.

562  {
563  // How many surface elements are in the surface mesh
564  unsigned n_element = Volume_constraint_mesh_pt->nelement();
565 
566  // Loop over the surface elements (but don't kill the volume constraint
567  // element (element 0))
568  unsigned first_el_to_be_killed=1;
569  for(unsigned e=first_el_to_be_killed;e<n_element;e++)
570  {
572  }
573 
574  // Wipe the mesh
576 
577  } // end of delete_volume_constraint_elements

References e().

◆ doc_solution()

template<class ELEMENT >
void BubbleInChannelProblem< ELEMENT >::doc_solution ( const std::string &  comment = "")

Doc the solution.

1157 {
1158  oomph_info << "Docing step: " << Problem_Parameter::Doc_info.number()
1159  << std::endl;
1160 
1161  ofstream some_file;
1162  char filename[100];
1163  sprintf(filename,"%s/soln%i.dat",
1164  Problem_Parameter::Doc_info.directory().c_str(),
1165  Problem_Parameter::Doc_info.number());
1166 
1167  // Number of plot points
1168  unsigned npts;
1169  npts=5;
1170 
1171  // Compute errors and assign to each element for plotting
1172  double max_err;
1173  double min_err;
1174  compute_error_estimate(max_err,min_err);
1175 
1176  // Assemble square of L2 norm
1177  double square_of_l2_norm=0.0;
1178  unsigned nel=Fluid_mesh_pt->nelement();
1179  for (unsigned e=0;e<nel;e++)
1180  {
1182  dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(e))->
1184  }
1185  Problem_Parameter::Norm_file << sqrt(square_of_l2_norm) << std::endl;
1186 
1187 
1188  some_file.open(filename);
1189  some_file << dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(0))
1190  ->variable_identifier();
1191  this->Fluid_mesh_pt->output(some_file,npts);
1192  some_file << "TEXT X = 25, Y = 78, CS=FRAME T = \"Global Step "
1193  << Problem_Parameter::Doc_info.number() << " "
1194  << comment << "\"\n";
1195  some_file.close();
1196 
1197 
1198 
1199  // Output boundaries
1200  sprintf(filename,"%s/boundaries%i.dat",
1201  Problem_Parameter::Doc_info.directory().c_str(),
1202  Problem_Parameter::Doc_info.number());
1203  some_file.open(filename);
1204  this->Fluid_mesh_pt->output_boundaries(some_file);
1205  some_file.close();
1206 
1207  // Get max/min area
1208  double max_area;
1209  double min_area;
1210  Fluid_mesh_pt->max_and_min_element_size(max_area, min_area);
1211 
1212  // Get total volume enclosed by face elements (ignore first one)
1213  double vol=0.0;
1215 
1216  // Write trace file
1218  << this->time_pt()->time() << " "
1219  << Fluid_mesh_pt->nelement() << " "
1220  << max_area << " "
1221  << min_area << " "
1222  << max_err << " "
1223  << min_err << " "
1224  << sqrt(square_of_l2_norm) << " "
1225  << vol << " "
1226  << std::endl;
1227 
1228  // Increment the doc_info number
1230 
1231 } //end_of_doc_solution
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
void compute_error_estimate(double &max_err, double &min_err)
Compute the error estimates and assign to elements for plotting.
Definition: adaptive_bubble_in_channel.cc:1237
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
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
string filename
Definition: MergeRestartFiles.py:39
ofstream Norm_file
Definition: refineable_two_layer_interface.cc:341
ofstream Trace_file
Trace file.
Definition: refineable_two_layer_interface.cc:335
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
double square_of_l2_norm()
Get square of L2 norm of velocity.
Definition: overloaded_element_body.h:1031

References Problem_Parameter::Doc_info, e(), MergeRestartFiles::filename, Problem_Parameter::Norm_file, oomph::DocInfo::number(), oomph::oomph_info, sqrt(), square_of_l2_norm(), Problem_Parameter::Trace_file, and Problem_Parameter::Volume.

Member Data Documentation

◆ Bubble_polygon_pt

template<class ELEMENT >
Vector<TriangleMeshPolygon*> BubbleInChannelProblem< ELEMENT >::Bubble_polygon_pt
private

Vector storing pointer to the bubble polygons.

◆ Bubble_pressure_data_pt

template<class ELEMENT >
Data* BubbleInChannelProblem< ELEMENT >::Bubble_pressure_data_pt
private

Pointer to a global bubble pressure datum.

◆ Fluid_mesh_pt

template<class ELEMENT >
RefineableSolidTriangleMesh<ELEMENT>* BubbleInChannelProblem< ELEMENT >::Fluid_mesh_pt
private

Pointer to Fluid_mesh.

◆ Free_surface_mesh_pt

template<class ELEMENT >
Mesh* BubbleInChannelProblem< ELEMENT >::Free_surface_mesh_pt
private

Pointers to mesh of free surface elements.

◆ Outer_boundary_polyline_pt

template<class ELEMENT >
TriangleMeshPolygon* BubbleInChannelProblem< ELEMENT >::Outer_boundary_polyline_pt
private

Triangle mesh polygon for outer boundary.

◆ Vol_constraint_el_pt

template<class ELEMENT >
VolumeConstraintElement* BubbleInChannelProblem< ELEMENT >::Vol_constraint_el_pt
private

Pointer to element that imposes volume constraint for bubble.

◆ Volume_constraint_mesh_pt

template<class ELEMENT >
Mesh* BubbleInChannelProblem< ELEMENT >::Volume_constraint_mesh_pt
private

Pointer to mesh containing elements that impose volume constraint.


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