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

Public Member Functions

 CapProblem (const bool &hijack_internal)
 
 ~CapProblem ()
 
void parameter_study (const string &dir_name)
 
void actions_before_newton_convergence_check ()
 Update the spine mesh after every Newton step. More...
 
void create_volume_constraint_elements ()
 Create the volume constraint elements. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 CapProblem (const unsigned &Nr, const unsigned &Nz1, const unsigned &Nz2, const double &width)
 Constructor. More...
 
void set_boundary_conditions ()
 Set boundary conditions on the wall. More...
 
void solve_system ()
 Solve the problem. More...
 
void create_volume_constraint_elements ()
 Create the volume constraint elements. More...
 
void actions_before_newton_convergence_check ()
 Update the spine mesh after every Newton step. More...
 
 CapProblem (const bool &hijack_internal)
 
 ~CapProblem ()
 
void parameter_study (const string &dir_name)
 
void actions_before_newton_convergence_check ()
 Update the spine mesh after every Newton step. More...
 
void create_volume_constraint_elements ()
 Create the volume constraint elements. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 CapProblem (const unsigned &Nx, const unsigned &Nh1, const unsigned &Nh2)
 Constructor. More...
 
void parameter_study ()
 Peform a parameter study: Solve problem for a range of contact angles. More...
 
void finish_problem_setup ()
 Finish full specification of the elements. More...
 
void actions_before_newton_convergence_check ()
 Update the spine mesh after every Newton step. More...
 
void create_volume_constraint_elements ()
 Create the volume constraint elements. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. 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 ()
 
virtual void actions_after_adapt ()
 Actions that are to be performed after a mesh adaptation. More...
 
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 ()
 

Public Attributes

TwoLayerSpineMesh< SpineElement< ELEMENT > > * Bulk_mesh_pt
 Pointer to the mesh. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 

Private Attributes

double Ca
 The Capillary number. More...
 
double Volume
 The volume of the fluid. More...
 
double Pext
 The external pressure. More...
 
double Angle
 The contact angle. More...
 
SingleLayerSpineMesh< SpineElement< ELEMENT > > * Bulk_mesh_pt
 The bulk mesh of fluid elements. More...
 
Mesh * Surface_mesh_pt
 The mesh for the interface elements. More...
 
Mesh * Point_mesh_pt
 The mesh for the element at the contact point. More...
 
Mesh * Volume_constraint_mesh_pt
 The volume constraint mesh. More...
 
ofstream Trace_file
 Trace file. More...
 
Data * External_pressure_data_pt
 Data object whose single value stores the external pressure. More...
 
Data * Traded_pressure_data_pt
 Data that is traded for the volume constraint. 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...
 
- 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_solve ()
 
virtual void actions_after_newton_solve ()
 
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 CapProblem< ELEMENT >

A Problem class that solves the Navier–Stokes equations + free surface in an axisymmetric geometry using a spine-based node update

A Problem class that solves the Navier–Stokes equations in an axisymmetric geometry N.B. we usually template problems by element-type and a timestepper in any problems where different elements or timesteppers MAY be used

A Problem class that solves the Navier–Stokes equations + free surface in a 2D geometry using a spine-based node update

Constructor & Destructor Documentation

◆ CapProblem() [1/4]

template<class ELEMENT >
CapProblem< ELEMENT >::CapProblem ( const bool &  hijack_internal)

Constructor: Pass boolean flag to indicate if the volume constraint is applied by hijacking an internal pressure or the external pressure

147  :
148  Ca(2.1), //Initialise value of Ca to some random value
149  Volume(0.125), //Initialise the value of the volume:
150  //the physical volume divided by 2pi
151  Pext(1.23), //Initialise the external pressure to some random value
152  Angle(0.5*MathematicalConstants::Pi) //Initialise the contact angle
153 {
154  //Set the wall normal
158 
159  // Number of elements in the horizontal direction
160  unsigned nx=4;
161 
162  // Number of elements in the vertical direction
163  unsigned nh=4;
164 
165  // Halfwidth of domain
166  double half_width=0.5;
167 
168  //Construct bulk mesh
169  Bulk_mesh_pt =
170  new SingleLayerSpineMesh<SpineElement<ELEMENT> >(nx,nh,half_width,1.0);
171 
172  //Create the surface mesh that will contain the interface elements
173  //First create storage, but with no elements or nodes
174  Surface_mesh_pt = new Mesh;
175  //Also create storage for a point mesh that contain the single element
176  //responsible for enforcing the contact angle condition
177  Point_mesh_pt = new Mesh;
178 
179  //Loop over the horizontal elements adjacent to the upper surface
180  //(boundary 2) and create the surface elements
181  unsigned n_boundary_element = Bulk_mesh_pt->nboundary_element(2);
182  for(unsigned e=0;e<n_boundary_element;e++)
183  {
184  //Construct a new 1D line element adjacent to boundary 2
185  FiniteElement *interface_element_pt =
189 
190  //Push it back onto the stack
191  this->Surface_mesh_pt->add_element_pt(interface_element_pt);
192 
193  //Find the (single) node that is on the solid boundary (boundary 1)
194  unsigned n_node = interface_element_pt->nnode();
195  //We only need to check the right-hand nodes (because I know the
196  //ordering of the nodes within the element)
197  if(interface_element_pt->node_pt(n_node-1)->is_on_boundary(1))
198  {
199  //Make the point (contact) element from right-hand edge of the element
200  FiniteElement* point_element_pt =
202  SpineElement<ELEMENT> >*>(interface_element_pt)
203  ->make_bounding_element(1);
204 
205  //Add it to the mesh
206  this->Point_mesh_pt->add_element_pt(point_element_pt);
207  }
208  }
209 
210  //Create a Data object whose single value stores the
211  //external pressure
213 
214  // Set external pressure
216 
217  // Which pressure are we trading for the volume constraint: We
218  // can either hijack an internal pressure or use the external pressure.
219  if (hijack_internal)
220  {
221  // The external pressure is pinned -- the external pressure
222  // sets the pressure throughout the domain -- we do not have
223  // the liberty to fix another pressure value!
225 
226  //Hijack one of the pressure values in the fluid and use it
227  //as the pressure whose value is determined by the volume constraint.
228  //(Its value will affect the residual of that element but it will not
229  //be determined by it, i.e. it's hijacked).
230  Traded_pressure_data_pt = dynamic_cast<ELEMENT*>(
231  Bulk_mesh_pt->element_pt(0))->hijack_internal_value(0,0);
232  }
233  else
234  {
235  // Regard the external pressure as an unknown and add
236  // it to the problem's global data so it gets included
237  // in the equation numbering. Note that, at the moment,
238  // there's no equation that determines its value!
240 
241  // Declare the external pressure to be the pressure determined
242  // by the volume constraint, i.e. the pressure that's "traded":
244 
245  // Since the external pressure is "traded" for the volume constraint,
246  // it no longer sets the overall pressure, and we
247  // can add an arbitrary constant to all pressures. To make
248  // the solution unique, we pin a single pressure value in the bulk:
249  // We arbitrarily set the pressure dof 0 in element 0 to zero.
250  dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(0))->fix_pressure(0,0.0);
251  }
252 
253 
254 
255  // Loop over the elements on the interface to pass pointer to Ca and
256  // the pointers to the Data items that contains the single
257  // (pressure) value that is "traded" for the volume constraint
258  // and the external pressure
259  unsigned n_interface = Surface_mesh_pt->nelement();
260  for(unsigned e=0;e<n_interface;e++)
261  {
262  //Cast to a 1D element
266 
267  //Set the Capillary number
268  el_pt->ca_pt() = &Ca;
269 
270  //Pass the Data item that contains the single external pressure value
272  }
273 
274 
275  //Set the boundary conditions
276 
277  //Pin the velocities on all boundaries apart from the free surface
278  //(boundary 2) where all velocities are free, and apart from the symmetry
279  //line (boundary 3) where only the horizontal velocity is pinned
280  unsigned n_bound=Bulk_mesh_pt->nboundary();
281  for (unsigned b=0;b<n_bound;b++)
282  {
283  if (b!=2)
284  {
285  //Find the number of nodes on the boundary
286  unsigned n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
287  //Loop over the nodes on the boundary
288  for(unsigned n=0;n<n_boundary_node;n++)
289  {
292  if (b!=3)
293  {
295  }
296  }
297  }
298  }
299 
300  // Set the contact angle boundary condition for the rightmost element
301  // (pass pointer to double that specifies the contact angle)
302  FluidInterfaceBoundingElement *contact_angle_element_pt
303  = dynamic_cast<FluidInterfaceBoundingElement*>(
305 
306  contact_angle_element_pt->set_contact_angle(&Angle);
307  contact_angle_element_pt->ca_pt() = &Ca;
308  contact_angle_element_pt->wall_unit_normal_fct_pt()
310 
311  //Now add the volume constraint
313 
314  this->add_sub_mesh(Bulk_mesh_pt);
315  this->add_sub_mesh(Surface_mesh_pt);
318 
319  this->build_global_mesh();
320 
321  //Setup all the equation numbering and look-up schemes
322  cout << "Number of unknowns: " << assign_eqn_numbers() << std::endl;
323 
324 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
Mesh * Volume_constraint_mesh_pt
The volume constraint mesh.
Definition: axi_static_cap.cc:126
Data * Traded_pressure_data_pt
Data that is traded for the volume constraint.
Definition: axi_static_cap.cc:135
Mesh * Surface_mesh_pt
The mesh for the interface elements.
Definition: axi_static_cap.cc:120
double Pext
The external pressure.
Definition: axi_static_cap.cc:111
double Angle
The contact angle.
Definition: axi_static_cap.cc:114
Data * External_pressure_data_pt
Data object whose single value stores the external pressure.
Definition: axi_static_cap.cc:132
void create_volume_constraint_elements()
Create the volume constraint elements.
Definition: axi_static_cap.cc:376
double Volume
The volume of the fluid.
Definition: axi_static_cap.cc:108
SingleLayerSpineMesh< SpineElement< ELEMENT > > * Bulk_mesh_pt
The bulk mesh of fluid elements.
Definition: axi_static_cap.cc:117
Mesh * Point_mesh_pt
The mesh for the element at the contact point.
Definition: axi_static_cap.cc:123
double Ca
The Capillary number.
Definition: axi_static_cap.cc:105
Definition: nodes.h:86
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: elements.h:1313
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
Definition: interface_elements.h:54
WallUnitNormalFctPt & wall_unit_normal_fct_pt()
Access function: Pointer to wall unit normal function.
Definition: interface_elements.h:141
double *& ca_pt()
Access function to the pointer specifying the capillary number.
Definition: interface_elements.h:172
void set_contact_angle(double *const &angle_pt, const bool &strong=true)
Definition: interface_elements.cc:47
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
Definition: mesh.h:67
unsigned long nboundary_node(const unsigned &ibound) const
Return number of nodes on a particular boundary.
Definition: mesh.h:833
int face_index_at_boundary(const unsigned &b, const unsigned &e) const
Definition: mesh.h:896
unsigned nboundary_element(const unsigned &b) const
Return number of finite elements that are adjacent to boundary b.
Definition: mesh.h:878
unsigned nboundary() const
Return number of boundaries.
Definition: mesh.h:827
FiniteElement * boundary_element_pt(const unsigned &b, const unsigned &e) const
Return pointer to e-th finite element on boundary b.
Definition: mesh.h:840
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617
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
virtual bool is_on_boundary() const
Definition: nodes.h:1373
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
Definition: single_layer_spine_mesh.template.h:47
Definition: specific_node_update_interface_elements.h:592
Definition: spines.h:477
double Pi
Definition: two_d_biharmonic.cc:235
void wall_unit_normal_fct(const Vector< double > &x, Vector< double > &normal)
Function that specifies the wall unit normal.
Definition: axi_static_cap.cc:62
Vector< double > Wall_normal
Direction of the wall normal vector.
Definition: axi_static_cap.cc:59
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30

References oomph::Mesh::add_element_pt(), oomph::Problem::add_global_data(), oomph::Problem::add_sub_mesh(), CapProblem< ELEMENT >::Angle, oomph::Problem::assign_eqn_numbers(), b, oomph::Mesh::boundary_element_pt(), oomph::Mesh::boundary_node_pt(), oomph::Problem::build_global_mesh(), CapProblem< ELEMENT >::Bulk_mesh_pt, CapProblem< ELEMENT >::Ca, oomph::FluidInterfaceBoundingElement::ca_pt(), oomph::FluidInterfaceElement::ca_pt(), CapProblem< ELEMENT >::create_volume_constraint_elements(), e(), oomph::Mesh::element_pt(), CapProblem< ELEMENT >::External_pressure_data_pt, oomph::Mesh::face_index_at_boundary(), oomph::Node::is_on_boundary(), n, oomph::Mesh::nboundary(), oomph::Mesh::nboundary_element(), oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), Mesh_Parameters::nx, CapProblem< ELEMENT >::Pext, oomph::Data::pin(), CapProblem< ELEMENT >::Point_mesh_pt, oomph::FluidInterfaceBoundingElement::set_contact_angle(), oomph::FluidInterfaceElement::set_external_pressure_data(), oomph::Data::set_value(), CapProblem< ELEMENT >::Surface_mesh_pt, CapProblem< ELEMENT >::Traded_pressure_data_pt, CapProblem< ELEMENT >::Volume_constraint_mesh_pt, Global_Physical_Variables::Wall_normal, Global_Physical_Variables::wall_unit_normal_fct(), and oomph::FluidInterfaceBoundingElement::wall_unit_normal_fct_pt().

◆ ~CapProblem() [1/2]

template<class ELEMENT >
CapProblem< ELEMENT >::~CapProblem

Destructor. Make sure to clean up all allocated memory, so that multiple instances of the problem don't lead to excessive memory usage.

333 {
334  //Loop over the volume mesh and delete the elements
335  unsigned n_element = Volume_constraint_mesh_pt->nelement();
336  for(unsigned e=0;e<n_element;e++)
338  //Now flush the storage
340  //Now delete the mesh
342 
343  //Delete the traded pressure if not the same as the external pressure
345  {delete Traded_pressure_data_pt;}
346  //Next delete the external data
348 
349  //Loop over the point mesh and delete the elements
350  n_element = Point_mesh_pt->nelement();
351  for(unsigned e=0;e<n_element;e++)
352  {delete Point_mesh_pt->element_pt(e);}
353  //Now flush the storage
355  //Then delete the mesh
356  delete Point_mesh_pt;
357 
358  //Loop over the surface mesh and delete the elements
359  n_element = Surface_mesh_pt->nelement();
360  for(unsigned e=0;e<n_element;e++)
361  {delete Surface_mesh_pt->element_pt(e);}
362  //Now flush the storage
364  //Then delete the mesh
365  delete Surface_mesh_pt;
366 
367  //Then delete the bulk mesh
368  delete Bulk_mesh_pt;
369 }
void flush_element_and_node_storage()
Definition: mesh.h:407

References e().

◆ CapProblem() [2/4]

template<class ELEMENT >
CapProblem< ELEMENT >::CapProblem ( const unsigned &  Nr,
const unsigned &  Nz1,
const unsigned &  Nz2,
const double &  width 
)

Constructor.

124  :
125  Ca(1.0), //Initialise value of Ca to one
126  Volume(0.125), //Initialise the value of the volume to 0.125
127  Angle(1.57) //Initialise the value of the contact angle
128 {
129  //Set the wall normal (in the r-direction)
133 
134  //Construct our mesh
135  Bulk_mesh_pt =
136  new TwoLayerSpineMesh<SpineElement<ELEMENT> >(Nr,Nz1,Nz2,width,1.0,1.0);
137 
138  Surface_mesh_pt = new Mesh;
139 
140  //Loop over the horizontal elements
141  unsigned n_interface_lower = Bulk_mesh_pt->ninterface_lower();
142  for(unsigned i=0;i<n_interface_lower;i++)
143  {
144  //Construct a new 1D line element adjacent to the interface
145  FiniteElement *interface_element_pt = new
147  Bulk_mesh_pt->interface_lower_boundary_element_pt(i),
148  Bulk_mesh_pt->interface_lower_face_index_at_boundary(i));
149 
150  this->Surface_mesh_pt->add_element_pt(interface_element_pt);
151  }
152 
153 //Create the point mesh
154  Point_mesh_pt = new Mesh;
155  {
156  //Make the point (contact) element from the last surface element
157  FiniteElement* point_element_pt =
159  SpineElement<ELEMENT> >*>(Surface_mesh_pt->element_pt(n_interface_lower-1))
160  ->make_bounding_element(1);
161 
162  //Add it to the mesh
163  this->Point_mesh_pt->add_element_pt(point_element_pt);
164  }
165 
166 
167  //Set the linear solver (frontal solver) (function defined in Problem class)
168  //linear_solver_pt() = new HSL_MA42;
169 
170  //We are going to hijack one of the pressure values and make a copy of it
171  //in global data
173 
174 
175  //Hijack one of the pressure values in the upper fluid
176  add_global_data(dynamic_cast<ELEMENT*>(Bulk_mesh_pt->upper_layer_element_pt(0))
177  ->hijack_internal_value(0,0));
178 
180 
181  //Loop over the elements on the free surface
182  unsigned Ninterface = Surface_mesh_pt->nelement();
183  for(unsigned e=0;e<Ninterface;e++)
184  {
185  //Cast to a 1D element
187  *el_pt =
188  dynamic_cast<
191  //Set the Capillary number
192  el_pt->ca_pt() = &Ca;
193  }
194 
195  //Set the boundary conditions
196  //Pin all velocity components on the bottom, wall and top
197  for(unsigned b=0;b<4;b++)
198  {
199  //Find the number of nodes on the boundary
200  unsigned n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
201  //Loop over the nodes on the boundary
202  for(unsigned n=0;n<n_boundary_node;n++)
203  {
204  for(unsigned i=0;i<3;i++)
205  {
207  }
208  }
209  }
210 
211  //Axis boundary, pin u (component 0) and v (component 2), but leave w free
212  for(unsigned b=4;b<6;b++)
213  {
214  //Find the number of nodes on the boundary
215  unsigned Nboundary_node = Bulk_mesh_pt->nboundary_node(b);
216  //Loop over the nodes on the boundary
217  for(unsigned n=0;n<Nboundary_node;n++)
218  {
221  }
222  }
223 
224  //Set the contact angle on the RHS
225  dynamic_cast<FluidInterfaceBoundingElement*>
226  (Point_mesh_pt->element_pt(0))->set_contact_angle(&Angle);
227 
228  dynamic_cast<FluidInterfaceBoundingElement*>
229  (Point_mesh_pt->element_pt(0))->ca_pt() = &Ca;
230 
231  //Set the wall normal on the rhs
232  dynamic_cast<FluidInterfaceBoundingElement*>
233  (Point_mesh_pt->element_pt(0))->wall_unit_normal_fct_pt() =
235 
236  //Pin a single pressure value
237  dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(0))->fix_pressure(0,0.0);
238 
240 
241  this->add_sub_mesh(Bulk_mesh_pt);
242  this->add_sub_mesh(Surface_mesh_pt);
245 
246  this->build_global_mesh();
247 
248  //Setup all the equation numbering and look-up schemes
249  //(function defined in Problem class)
250  cout << assign_eqn_numbers() << std::endl;
251 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void flush_global_data()
Definition: problem.h:1662
Data *& global_data_pt(const unsigned &i)
Return a pointer to the the i-th global data object.
Definition: problem.h:1647
Definition: two_layer_spine_mesh.template.h:61
unsigned Nr
Number of elements in r-direction.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:59

References oomph::Mesh::add_element_pt(), oomph::Problem::add_global_data(), oomph::Problem::add_sub_mesh(), CapProblem< ELEMENT >::Angle, oomph::Problem::assign_eqn_numbers(), b, oomph::Mesh::boundary_node_pt(), oomph::Problem::build_global_mesh(), CapProblem< ELEMENT >::Bulk_mesh_pt, CapProblem< ELEMENT >::Ca, oomph::FluidInterfaceElement::ca_pt(), CapProblem< ELEMENT >::create_volume_constraint_elements(), e(), oomph::Mesh::element_pt(), oomph::Problem::flush_global_data(), oomph::Problem::global_data_pt(), i, n, oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), Global_Parameters::Nr, oomph::Data::pin(), CapProblem< ELEMENT >::Point_mesh_pt, CapProblem< ELEMENT >::Surface_mesh_pt, CapProblem< ELEMENT >::Traded_pressure_data_pt, CapProblem< ELEMENT >::Volume_constraint_mesh_pt, Global_Physical_Variables::Wall_normal, and Global_Physical_Variables::wall_unit_normal_fct().

◆ CapProblem() [3/4]

template<class ELEMENT >
CapProblem< ELEMENT >::CapProblem ( const bool &  hijack_internal)

◆ ~CapProblem() [2/2]

template<class ELEMENT >
CapProblem< ELEMENT >::~CapProblem ( )

◆ CapProblem() [4/4]

template<class ELEMENT >
CapProblem< ELEMENT >::CapProblem ( const unsigned &  Nx,
const unsigned &  Nh1,
const unsigned &  Nh2 
)

Constructor.

139  :
140  Ca(2.1), //Initialise value of Ca to some random value
141  Volume(0.5), //Initialise the value of the volume
142  Angle(0.5*MathematicalConstants::Pi) //Initialise the contact angle
143 {
147 
148  //Construct our mesh
150  (Nx,Nh1,Nh2,0.5,1.0,1.0);
151 
152  Surface_mesh_pt = new Mesh;
153 
154  //Loop over the horizontal elements
155  unsigned n_interface_lower = Bulk_mesh_pt->ninterface_lower();
156  for(unsigned i=0;i<n_interface_lower;i++)
157  {
158  //Construct a new 1D line element adjacent to the interface
159  FiniteElement *interface_element_pt = new
161  Bulk_mesh_pt->interface_lower_boundary_element_pt(i),
162  Bulk_mesh_pt->interface_lower_face_index_at_boundary(i));
163 
164  this->Surface_mesh_pt->add_element_pt(interface_element_pt);
165  }
166 
167 //Create the point mesh
168 Point_mesh_pt = new Mesh;
169  {
170  //Make the point (contact) element from the last surface element
171  FiniteElement* point_element_pt =
172  dynamic_cast<SpineLineFluidInterfaceElement<
173  SpineElement<ELEMENT> >*>(Surface_mesh_pt->element_pt(n_interface_lower-1))
174  ->make_bounding_element(1);
175 
176  //Add it to the mesh
177  this->Point_mesh_pt->add_element_pt(point_element_pt);
178 }
179 
180  //Hijack one of the pressure values in the upper fluid. Its value
181  //will affect the residual of that element but it will not
182  //be determined by it!
183  Traded_pressure_data_pt = dynamic_cast<ELEMENT*>(
184  Bulk_mesh_pt->upper_layer_element_pt(0))->hijack_internal_value(0,0);
185 
186  // Loop over the elements on the interface to pass pointer to Ca and
187  // the pointer to the Data item that contains the single
188  // (pressure) value that is "traded" for the volume constraint
189  unsigned n_interface = Surface_mesh_pt->nelement();
190  for(unsigned e=0;e<n_interface;e++)
191  {
192  //Cast to a 1D element
194  dynamic_cast<SpineLineFluidInterfaceElement<
197  //Set the Capillary number
198  el_pt->ca_pt() = &Ca;
199  }
200 
201 
202  //Set the boundary conditions
203 
204  //Pin the velocities on all external boundaries apart from the symmetry
205  //line (boundaries 4 and 5) where only the horizontal velocity is pinned
206  for (unsigned b=0;b<6;b++)
207  {
208  //Find the number of nodes on the boundary
209  unsigned n_boundary_node = Bulk_mesh_pt->nboundary_node(b);
210  //Loop over the nodes on the boundary
211  for(unsigned n=0;n<n_boundary_node;n++)
212  {
214  if ((b!=4) && (b!=5))
215  {
217  }
218  }
219  }
220  // Set the contact angle boundary condition for the rightmost element
221  dynamic_cast<FluidInterfaceBoundingElement*>(
222  Point_mesh_pt->element_pt(0))->set_contact_angle(&Angle);
223 
224  dynamic_cast<FluidInterfaceBoundingElement*>(
225  Point_mesh_pt->element_pt(0))->ca_pt() = &Ca;
226 
227  dynamic_cast<FluidInterfaceBoundingElement*>(
228  Point_mesh_pt->element_pt(0))->wall_unit_normal_fct_pt() =
230 
231  // Pin a single pressure value: Set the pressure dof 0 in element 0
232  // of the lower layer to zero.
233  dynamic_cast<ELEMENT*>(Bulk_mesh_pt->lower_layer_element_pt(0))
234  ->fix_pressure(0,0.0);
235 
237 
238  this->add_sub_mesh(Bulk_mesh_pt);
239  this->add_sub_mesh(Surface_mesh_pt);
242 
243  this->build_global_mesh();
244 
245  //Setup all the equation numbering and look-up schemes
246  cout << "Number of unknowns: " << assign_eqn_numbers() << std::endl;
247 
248 }
Definition: specific_node_update_interface_elements.h:556
unsigned Nx
Number of elements in each direction (used by SimpleCubicMesh)
Definition: structured_cubic_point_source.cc:114

References oomph::Mesh::add_element_pt(), oomph::Problem::add_sub_mesh(), CapProblem< ELEMENT >::Angle, oomph::Problem::assign_eqn_numbers(), b, oomph::Mesh::boundary_node_pt(), oomph::Problem::build_global_mesh(), CapProblem< ELEMENT >::Bulk_mesh_pt, CapProblem< ELEMENT >::Ca, oomph::FluidInterfaceElement::ca_pt(), CapProblem< ELEMENT >::create_volume_constraint_elements(), e(), oomph::Mesh::element_pt(), i, n, oomph::Mesh::nboundary_node(), oomph::Mesh::nelement(), GlobalParameters::Nx, oomph::Data::pin(), CapProblem< ELEMENT >::Point_mesh_pt, CapProblem< ELEMENT >::Surface_mesh_pt, CapProblem< ELEMENT >::Traded_pressure_data_pt, CapProblem< ELEMENT >::Volume_constraint_mesh_pt, Global_Physical_Variables::Wall_normal, and Global_Physical_Variables::wall_unit_normal_fct().

Member Function Documentation

◆ actions_before_newton_convergence_check() [1/4]

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

Update the spine mesh after every Newton step.

Reimplemented from oomph::Problem.

void node_update(const bool &update_all_solid_nodes=false)
Definition: spines.cc:84

◆ actions_before_newton_convergence_check() [2/4]

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

Update the spine mesh after every Newton step.

Reimplemented from oomph::Problem.

References oomph::SpineMesh::node_update().

◆ actions_before_newton_convergence_check() [3/4]

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

Update the spine mesh after every Newton step.

Reimplemented from oomph::Problem.

◆ actions_before_newton_convergence_check() [4/4]

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

Update the spine mesh after every Newton step.

Reimplemented from oomph::Problem.

References oomph::SpineMesh::node_update().

◆ create_volume_constraint_elements() [1/4]

template<class ELEMENT >
void CapProblem< ELEMENT >::create_volume_constraint_elements

Create the volume constraint elements.

377 {
378  //The single volume constraint element
380  VolumeConstraintElement* vol_constraint_element =
382  Volume_constraint_mesh_pt->add_element_pt(vol_constraint_element);
383 
384  //Loop over all boundaries (or just 1 and 2 why?)
385  for(unsigned b=0;b<4;b++)
386  {
387  // How many bulk fluid elements are adjacent to boundary b?
388  unsigned n_element = Bulk_mesh_pt->nboundary_element(b);
389 
390  // Loop over the bulk fluid elements adjacent to boundary b?
391  for(unsigned e=0;e<n_element;e++)
392  {
393  // Get pointer to the bulk fluid element that is
394  // adjacent to boundary b
395  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
397 
398  //Find the index of the face of element e along boundary b
399  int face_index = Bulk_mesh_pt->face_index_at_boundary(b,e);
400 
401  // Create new element
404  bulk_elem_pt,face_index);
405 
406  //Set the "master" volume control element
407  el_pt->set_volume_constraint_element(vol_constraint_element);
408 
409  // Add it to the mesh
411  }
412  }
413 }
Definition: constrained_volume_elements.h:658
void set_volume_constraint_element(VolumeConstraintElement *const &vol_constraint_el_pt, const bool &check_nodal_data=true)
Definition: constrained_volume_elements.h:261
Definition: constrained_volume_elements.h:66

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

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

◆ create_volume_constraint_elements() [2/4]

template<class ELEMENT >
void CapProblem< ELEMENT >::create_volume_constraint_elements ( )

Create the volume constraint elements.

◆ create_volume_constraint_elements() [3/4]

template<class ELEMENT >
void CapProblem< ELEMENT >::create_volume_constraint_elements ( )

Create the volume constraint elements.

◆ create_volume_constraint_elements() [4/4]

template<class ELEMENT >
void CapProblem< ELEMENT >::create_volume_constraint_elements ( )

Create the volume constraint elements.

◆ doc_solution() [1/3]

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

Doc the solution.

466 {
467 
468  ofstream some_file;
469  char filename[100];
470 
471  // Number of plot points
472  unsigned npts=5;
473 
474 
475  //Output domain
476  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
477  doc_info.number());
478  some_file.open(filename);
479  Bulk_mesh_pt->output(some_file,npts);
480  Surface_mesh_pt->output(some_file,npts);
481  some_file.close();
482 
483  //Output domain in paraview format
484  sprintf(filename,"%s/soln%i.vtu",doc_info.directory().c_str(),
485  doc_info.number());
486  some_file.open(filename);
487  Bulk_mesh_pt->output_paraview(some_file,npts);
488  some_file.close();
489 
490  // Number of spines
491  unsigned nspine=Bulk_mesh_pt->nspine();
492 
493  // Doc
495  Trace_file << " " << Bulk_mesh_pt->spine_pt(0)->height();
496  Trace_file << " " << Bulk_mesh_pt->spine_pt(nspine-1)->height();
497  Trace_file << " "
498  << dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(0))
499  ->p_axi_nst(0) - External_pressure_data_pt->value(0);
500  Trace_file << " " << -4.0*cos(Angle)/Ca;
501  Trace_file << std::endl;
502 
503 }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
ofstream Trace_file
Trace file.
Definition: axi_static_cap.cc:129
double value(const unsigned &i) const
Definition: nodes.h:293
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
void output_paraview(std::ofstream &file_out, const unsigned &nplot) const
Definition: mesh.cc:1225
unsigned long nspine() const
Return the number of spines in the mesh.
Definition: spines.h:635
Spine *& spine_pt(const unsigned long &i)
Return the i-th spine in the mesh.
Definition: spines.h:623
double & height()
Access function to spine height.
Definition: spines.h:150
string filename
Definition: MergeRestartFiles.py:39

References Global_Physical_Variables::Angle, Global_Physical_Variables::Ca, cos(), oomph::DocInfo::directory(), MergeRestartFiles::filename, oomph::DocInfo::number(), BiharmonicTestFunctions2::Pi, and oomph::Problem_Parameter::Trace_file.

◆ doc_solution() [2/3]

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

Doc the solution.

◆ doc_solution() [3/3]

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

Doc the solution.

◆ finish_problem_setup()

template<class ELEMENT >
void CapProblem< ELEMENT >::finish_problem_setup ( )

Finish full specification of the elements.

◆ parameter_study() [1/3]

template<class ELEMENT >
void CapProblem< ELEMENT >::parameter_study

Peform a parameter study: Solve problem for a range of contact angles.

Perform a parameter study.

336 {
337 
338  // Create DocInfo object (allows checking if output directory exists)
339  DocInfo doc_info;
340  doc_info.set_directory("RESLT");
341  doc_info.number()=0;
342 
343 
344  // Open trace file
345  char filename[100];
346  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
347  Trace_file.open(filename);
348  Trace_file << "VARIABLES=\"<greek>a</greek><sub>prescribed</sub>\",";
349  Trace_file << "\"h<sub>left</sub>\",\"h<sub>right</sub>\",";
350  Trace_file << "\"<greek>a</greek><sub>left</sub>\",";
351  Trace_file << "\"<greek>a</greek><sub>right</sub>\",";
352  Trace_file << "\"p<sub>upper</sub>\",";
353  Trace_file << "\"p<sub>lower</sub>\",";
354  Trace_file << "\"p<sub>exact</sub>\"";
355  Trace_file << std::endl;
356 
357  // Doc initial state
358  doc_solution(doc_info);
359 
360  // Bump up counter
361  doc_info.number()++;
362 
363  //Gradually increase the contact angle
364  for(unsigned i=0;i<6;i++)
365  {
366  //Solve the problem
368 
369  //Output result
370  doc_solution(doc_info);
371 
372  // Bump up counter
373  doc_info.number()++;
374 
375  //Decrease the contact angle
376  Angle -= 5.0*MathematicalConstants::Pi/180.0;
377  }
378 
379 }
void doc_solution(DocInfo &doc_info)
Doc the solution.
Definition: axi_static_cap.cc:465
Definition: oomph_utilities.h:499
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
void steady_newton_solve(unsigned const &max_adapt=0)
Definition: problem.cc:9292

References Global_Physical_Variables::Angle, oomph::DocInfo::directory(), MergeRestartFiles::filename, i, oomph::DocInfo::number(), BiharmonicTestFunctions2::Pi, oomph::DocInfo::set_directory(), and oomph::Problem_Parameter::Trace_file.

◆ parameter_study() [2/3]

template<class ELEMENT >
void CapProblem< ELEMENT >::parameter_study ( const string &  dir_name)

Perform a parameter study: Solve problem for a range of contact angles Pass name of output directory as a string

Perform a parameter study. Pass name of output directory as a string

422 {
423 
424  // Create DocInfo object (allows checking if output directory exists)
425  DocInfo doc_info;
426  doc_info.set_directory(dir_name);
427  doc_info.number()=0;
428 
429 
430  // Open trace file
431  char filename[100];
432  sprintf(filename,"%s/trace.dat",doc_info.directory().c_str());
433  Trace_file.open(filename);
434  Trace_file << "VARIABLES=\"<greek>a</greek><sub>prescribed</sub>\",";
435  Trace_file << "\"h<sub>left</sub>\",\"h<sub>right</sub>\",";
436  Trace_file << "\"p<sub>fluid</sub>-p<sub>ext</sub>\",";
437  Trace_file << "\"<greek>D</greek>p<sub>exact</sub>\"";
438  Trace_file << std::endl;
439 
440  //Gradually increase the contact angle
441  for(unsigned i=0;i<6;i++)
442  {
443  //Solve the problem
445 
446  //Output result
447  doc_solution(doc_info);
448 
449  // Bump up counter
450  doc_info.number()++;
451 
452  //Decrease the contact angle
453  Angle -= 5.0*MathematicalConstants::Pi/180.0;
454  }
455 
456 }

References Global_Physical_Variables::Angle, oomph::DocInfo::directory(), MergeRestartFiles::filename, i, oomph::DocInfo::number(), BiharmonicTestFunctions2::Pi, oomph::DocInfo::set_directory(), and oomph::Problem_Parameter::Trace_file.

◆ parameter_study() [3/3]

template<class ELEMENT >
void CapProblem< ELEMENT >::parameter_study ( const string &  dir_name)

Perform a parameter study: Solve problem for a range of contact angles Pass name of output directory as a string

◆ set_boundary_conditions()

template<class ELEMENT >
void CapProblem< ELEMENT >::set_boundary_conditions

Set boundary conditions on the wall.

335 {
336  //NOTE: The default value of all parameters is zero, so we don't need
337  //to set anything here
338 }

◆ solve_system()

template<class ELEMENT >
void CapProblem< ELEMENT >::solve_system

Solve the problem.

343 {
344  //Define a string that we can set to be the name of the output file
345  char filename[100];
346 
347  //Set the boundary conditions (only need to do this once)
348  //If the boundary conditions depend up on time, or Re, we need to
349  //reset them every time something changes. This is most easily
350  //achieved using the actions_before_newton_solve() {} function.
352 
353  //Solve the problem (function defined in Problem class)
354  //The default tolerance is that the maximum residual must be less that 1.0e-8
356 
357  //Output first solution
358  ofstream file("step0_spine.dat");
359  Bulk_mesh_pt->output(file,5);
360  Surface_mesh_pt->output(file,5);
361  file.close();
362 
363  //Gradually increase the contact angle
364  for(unsigned i=1;i<6;i++)
365  {
366  //Decrease the contact angle
367  Angle -= 0.1;
368 
369  //Solve the problem
371 
372  //Create the filename, including the array index
373  sprintf(filename,"step%i_spine.dat",i);
374  //Actually, write the data
375  file.open(filename);
376  Bulk_mesh_pt->output(file,5);
377  Surface_mesh_pt->output(file,5);
378  file.close();
379  }
380 
381 }
void set_boundary_conditions()
Set boundary conditions on the wall.
Definition: two_fluid_spherical_cap.cc:334

References Global_Physical_Variables::Angle, MergeRestartFiles::filename, and i.

Member Data Documentation

◆ Angle

template<class ELEMENT >
double CapProblem< ELEMENT >::Angle
private

The contact angle.

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

◆ Bulk_mesh_pt [1/2]

template<class ELEMENT >
TwoLayerSpineMesh< SpineElement< ELEMENT > > * CapProblem< ELEMENT >::Bulk_mesh_pt
private

The bulk mesh of fluid elements.

Pointer to the mesh.

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

◆ Bulk_mesh_pt [2/2]

template<class ELEMENT >
TwoLayerSpineMesh<SpineElement<ELEMENT> >* CapProblem< ELEMENT >::Bulk_mesh_pt

Pointer to the mesh.

◆ Ca

template<class ELEMENT >
double CapProblem< ELEMENT >::Ca
private

The Capillary number.

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

◆ External_pressure_data_pt

template<class ELEMENT >
Data * CapProblem< ELEMENT >::External_pressure_data_pt
private

Data object whose single value stores the external pressure.

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

◆ Pext

template<class ELEMENT >
double CapProblem< ELEMENT >::Pext
private

The external pressure.

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

◆ Point_mesh_pt

template<class ELEMENT >
Mesh * CapProblem< ELEMENT >::Point_mesh_pt
private

The mesh for the element at the contact point.

Pointer to the point mesh.

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

◆ Surface_mesh_pt

template<class ELEMENT >
Mesh * CapProblem< ELEMENT >::Surface_mesh_pt
private

The mesh for the interface elements.

Pointer to the surface mesh.

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

◆ Trace_file

template<class ELEMENT >
ofstream CapProblem< ELEMENT >::Trace_file
private

Trace file.

◆ Traded_pressure_data_pt

template<class ELEMENT >
Data * CapProblem< ELEMENT >::Traded_pressure_data_pt
private

Data that is traded for the volume constraint.

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

◆ Volume

template<class ELEMENT >
double CapProblem< ELEMENT >::Volume
private

The volume of the fluid.

◆ Volume_constraint_mesh_pt

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

The volume constraint mesh.

Pointer to the volume constraint mesh.

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


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