RisingBubbleProblem< ELEMENT > Class Template Reference

Micky mouse problem. More...

+ Inheritance diagram for RisingBubbleProblem< ELEMENT >:

Public Member Functions

 RisingBubbleProblem ()
 Constructor. More...
 
 ~RisingBubbleProblem ()
 Destructor (empty) More...
 
void create_free_surface_elements ()
 Create free surface elements. More...
 
void delete_free_surface_elements ()
 Delete free surface elements. More...
 
void actions_after_adapt ()
 Totally new mesh, need to fix it. More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void doc_solution (const unsigned &nplot, DocInfo &doc_info)
 Doc the solution. 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...
 
void snap_onto_sphere ()
 Snap the boundary nodes onto the sphere. More...
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
virtual void actions_before_adapt ()
 
OomphCommunicatorcommunicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicatorcommunicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolvermass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Timetime_pt () const
 Return a pointer to the global time object (const version). More...
 
doubletime ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeSteppertime_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
doubleminimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
doublemaximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsignedmax_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
doublemax_residuals ()
 
booltime_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
doublenewton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
doubleglobal_dof_pt (const unsigned &i)
 
doubledof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
doubledof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
booluse_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual Problemmake_copy ()
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
doublebifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
intsign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 

Public Attributes

DataBubble_pressure_data_pt
 Pointer to data that will store the bubble pressure. More...
 
RefineableSolidTetgenMesh< ELEMENT > * Fluid_mesh_pt
 Pointer to the fluid mesh. More...
 
MeshFree_surface_mesh_pt
 Pointers to mesh of free surface elements. More...
 
MeshVolume_constraint_mesh_pt
 Pointer to mesh containing elements that impose volume constraint. More...
 
VolumeConstraintElementVol_constraint_el_pt
 Pointer to element that imposes volume constraint for bubble. More...
 
TetgenMeshOLDFacetedSurface * Outer_boundary_pt
 Storage for the outer boundary object. More...
 
Vector< TetgenMeshOLDFacetedSurface * > Inner_boundary_pt
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 

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_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)
 
doubledof_derivative (const unsigned &i)
 
doubledof_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 *, boolCalculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistributionDof_distribution_pt
 
Vector< double * > Dof_pt
 Vector of pointers to dofs. More...
 
DoubleVectorWithHaloEntries Element_count_per_dof
 
double Relaxation_factor
 
double Newton_solver_tolerance
 
unsigned Max_newton_iterations
 Maximum number of Newton iterations. More...
 
unsigned Nnewton_iter_taken
 
Vector< doubleMax_res
 Maximum residuals at start and after each newton iteration. More...
 
double Max_residuals
 
bool Time_adaptive_newton_crash_on_solve_fail
 
bool Jacobian_reuse_is_enabled
 Is re-use of Jacobian in Newton iteration enabled? Default: false. More...
 
bool Jacobian_has_been_computed
 
bool Problem_is_nonlinear
 
bool Pause_at_end_of_sparse_assembly
 
bool Doc_time_in_distribute
 
unsigned Sparse_assembly_method
 
unsigned Sparse_assemble_with_arrays_initial_allocation
 
unsigned Sparse_assemble_with_arrays_allocation_increment
 
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
 
double Numerical_zero_for_sparse_assembly
 
double FD_step_used_in_get_hessian_vector_products
 
bool Mass_matrix_reuse_is_enabled
 
bool Mass_matrix_has_been_computed
 
bool Discontinuous_element_formulation
 
double Minimum_dt
 Minimum desired dt: if dt falls below this value, exit. More...
 
double Maximum_dt
 Maximum desired dt. More...
 
double DTSF_max_increase
 
double DTSF_min_decrease
 
double Minimum_dt_but_still_proceed
 
bool Scale_arc_length
 Boolean to control whether arc-length should be scaled. More...
 
double Desired_proportion_of_arc_length
 Proportion of the arc-length to taken by the parameter. More...
 
double Theta_squared
 
int Sign_of_jacobian
 Storage for the sign of the global Jacobian. More...
 
double Continuation_direction
 
double Parameter_derivative
 Storage for the derivative of the global parameter wrt arc-length. More...
 
double Parameter_current
 Storage for the present value of the global parameter. More...
 
bool Use_continuation_timestepper
 Boolean to control original or new storage of dof stuff. More...
 
unsigned Dof_derivative_offset
 
unsigned Dof_current_offset
 
Vector< doubleDof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< doubleDof_current
 Storage for the present values of the variables. More...
 
double Ds_current
 Storage for the current step value. More...
 
unsigned Desired_newton_iterations_ds
 
double Minimum_ds
 Minimum desired value of arc-length. More...
 
bool Bifurcation_detection
 Boolean to control bifurcation detection via determinant of Jacobian. More...
 
bool Bisect_to_find_bifurcation
 Boolean to control wheter bisection is used to located bifurcation. More...
 
bool First_jacobian_sign_change
 Boolean to indicate whether a sign change has occured in the Jacobian. More...
 
bool Arc_length_step_taken
 Boolean to indicate whether an arc-length step has been taken. More...
 
bool Use_finite_differences_for_continuation_derivatives
 
OomphCommunicatorCommunicator_pt
 The communicator for this problem. More...
 
bool Always_take_one_newton_step
 
double Timestep_reduction_factor_after_nonconvergence
 
bool Keep_temporal_error_below_tolerance
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

template<class ELEMENT>
class RisingBubbleProblem< ELEMENT >

Micky mouse problem.

Constructor & Destructor Documentation

◆ RisingBubbleProblem()

template<class ELEMENT >
RisingBubbleProblem< ELEMENT >::RisingBubbleProblem

Constructor.

Constructor for RisingBubble problem.

1689 {
1690 
1691  //Add a time stepper
1692  this->add_time_stepper_pt(new BDF<2>);
1693 
1694  // Create bubble pressure as global Data
1695  Bubble_pressure_data_pt = new Data(1);
1696  unsigned index_of_traded_pressure=0;
1698 
1702  index_of_traded_pressure);
1703 
1704  //Provide a reasonable initial guess for bubble pressure (hydrostatics):
1705  Bubble_pressure_data_pt->set_value(index_of_traded_pressure,
1708 
1709  //Make the external box
1710  const double box_width = Global_Parameters::Box_width;
1711  const double box_length = Global_Parameters::Box_length;
1712  Vector<Vector<double> > box_point(8);
1713  box_point[0].resize(3);
1714  box_point[0][0] = -box_width;
1715  box_point[0][1] = -box_width;
1716  box_point[0][2] = -box_length;
1717 
1718  box_point[1].resize(3);
1719  box_point[1][0] = -box_width;
1720  box_point[1][1] = box_width;
1721  box_point[1][2] = -box_length;
1722 
1723  box_point[2].resize(3);
1724  box_point[2][0] = -box_width;
1725  box_point[2][1] = box_width;
1726  box_point[2][2] = box_length;
1727 
1728  box_point[3].resize(3);
1729  box_point[3][0] = -box_width;
1730  box_point[3][1] = -box_width;
1731  box_point[3][2] = box_length;
1732 
1733  box_point[4].resize(3);
1734  box_point[4][0] = box_width;
1735  box_point[4][1] = -box_width;
1736  box_point[4][2] = -box_length;
1737 
1738  box_point[5].resize(3);
1739  box_point[5][0] = box_width;
1740  box_point[5][1] = box_width;
1741  box_point[5][2] = -box_length;
1742 
1743  box_point[6].resize(3);
1744  box_point[6][0] = box_width;
1745  box_point[6][1] = box_width;
1746  box_point[6][2] = box_length;
1747 
1748  box_point[7].resize(3);
1749  box_point[7][0] = box_width;
1750  box_point[7][1] = -box_width;
1751  box_point[7][2] = box_length;
1752 
1753  Vector<Vector<unsigned> > box_facet(6);
1754  box_facet[0].resize(4);
1755  box_facet[0][0] = 0;
1756  box_facet[0][1] = 4;
1757  box_facet[0][2] = 7;
1758  box_facet[0][3] = 3;
1759 
1760  box_facet[1].resize(4);
1761  box_facet[1][0] = 4;
1762  box_facet[1][1] = 5;
1763  box_facet[1][2] = 6;
1764  box_facet[1][3] = 7;
1765 
1766  box_facet[2].resize(4);
1767  box_facet[2][0] = 3;
1768  box_facet[2][1] = 7;
1769  box_facet[2][2] = 6;
1770  box_facet[2][3] = 2;
1771 
1772  box_facet[3].resize(4);
1773  box_facet[3][0] = 6;
1774  box_facet[3][1] = 5;
1775  box_facet[3][2] = 1;
1776  box_facet[3][3] = 2;
1777 
1778  box_facet[4].resize(4);
1779  box_facet[4][0] = 3;
1780  box_facet[4][1] = 2;
1781  box_facet[4][2] = 1;
1782  box_facet[4][3] = 0;
1783 
1784  box_facet[5].resize(4);
1785  box_facet[5][0] = 5;
1786  box_facet[5][1] = 1;
1787  box_facet[5][2] = 0;
1788  box_facet[5][3] = 4;
1789 
1790  Vector<unsigned> box_facet_boundary_id(6);
1791  box_facet_boundary_id[0] = 1;
1792  box_facet_boundary_id[1] = 2;
1793  box_facet_boundary_id[2] = 3;
1794  box_facet_boundary_id[3] = 4;
1795  box_facet_boundary_id[4] = 5;
1796  box_facet_boundary_id[5] = 6;
1797 
1798  //Make the outer boundary object
1800  new TetgenMeshOLDFacetedSurface(box_point,box_facet,box_facet_boundary_id);
1801 
1802 
1803  //Set basic icosahedron points
1804  Vector<Vector<double> > icosa_point(12);
1805 
1806  //Golden ratio
1807  const double phi = 0.5*(1.0 + sqrt(5.0));
1808  icosa_point[0].resize(3);
1809  icosa_point[0][0] = 0.0;
1810  icosa_point[0][1] = 1.0;
1811  icosa_point[0][2] = phi;
1812  icosa_point[1].resize(3);
1813  icosa_point[1][0] = 0.0;
1814  icosa_point[1][1] = -1.0;
1815  icosa_point[1][2] = phi;
1816  icosa_point[2].resize(3);
1817  icosa_point[2][0] = 0.0;
1818  icosa_point[2][1] = 1.0;
1819  icosa_point[2][2] = -phi;
1820  icosa_point[3].resize(3);
1821  icosa_point[3][0] = 0.0;
1822  icosa_point[3][1] = -1.0;
1823  icosa_point[3][2] = -phi;
1824  icosa_point[4].resize(3);
1825  icosa_point[4][0] = 1.0;
1826  icosa_point[4][1] = phi;
1827  icosa_point[4][2] = 0.0;
1828  icosa_point[5].resize(3);
1829  icosa_point[5][0] = -1.0;
1830  icosa_point[5][1] = phi;
1831  icosa_point[5][2] = 0.0;
1832  icosa_point[6].resize(3);
1833  icosa_point[6][0] = 1.0;
1834  icosa_point[6][1] = -phi;
1835  icosa_point[6][2] = 0.0;
1836  icosa_point[7].resize(3);
1837  icosa_point[7][0] = -1.0;
1838  icosa_point[7][1] = -phi;
1839  icosa_point[7][2] = 0.0;
1840  icosa_point[8].resize(3);
1841  icosa_point[8][0] = phi;
1842  icosa_point[8][1] = 0.0;
1843  icosa_point[8][2] = 1.0;
1844  icosa_point[9].resize(3);
1845  icosa_point[9][0] = phi;
1846  icosa_point[9][1] = 0.0;
1847  icosa_point[9][2] = -1.0;
1848  icosa_point[10].resize(3);
1849  icosa_point[10][0] = -phi;
1850  icosa_point[10][1] = 0.0;
1851  icosa_point[10][2] = 1.0;
1852  icosa_point[11].resize(3);
1853  icosa_point[11][0] = -phi;
1854  icosa_point[11][1] = 0.0;
1855  icosa_point[11][2] = -1.0;
1856 
1857  //Scale the points by the radius
1858  for(unsigned p=0;p<12;p++)
1859  {
1860  double r2 = 0.0;
1861  for(unsigned i=0;i<3;i++) {r2 += icosa_point[p][i]*icosa_point[p][i];}
1862 
1863  //Now scale all of the points
1864  for(unsigned i=0;i<3;i++)
1865  {
1866  icosa_point[p][i] *= Global_Parameters::Radius/sqrt(r2);
1867  }
1868  }
1869 
1870  //Set up the connectivity
1871  Vector<Vector<unsigned> > icosa_facet(20);
1872  icosa_facet[0].resize(3);
1873  icosa_facet[0][0] = 0;
1874  icosa_facet[0][1] = 1;
1875  icosa_facet[0][2] = 8;
1876 
1877  icosa_facet[1].resize(3);
1878  icosa_facet[1][0] = 0;
1879  icosa_facet[1][1] = 10;
1880  icosa_facet[1][2] = 1;
1881 
1882  icosa_facet[2].resize(3);
1883  icosa_facet[2][0] = 0;
1884  icosa_facet[2][1] = 5;
1885  icosa_facet[2][2] = 10;
1886 
1887  icosa_facet[3].resize(3);
1888  icosa_facet[3][0] = 0;
1889  icosa_facet[3][1] = 4;
1890  icosa_facet[3][2] = 5;
1891 
1892  icosa_facet[4].resize(3);
1893  icosa_facet[4][0] = 0;
1894  icosa_facet[4][1] = 8;
1895  icosa_facet[4][2] = 4;
1896 
1897  icosa_facet[5].resize(3);
1898  icosa_facet[5][0] = 5;
1899  icosa_facet[5][1] = 11;
1900  icosa_facet[5][2] = 10;
1901 
1902  icosa_facet[6].resize(3);
1903  icosa_facet[6][0] = 5;
1904  icosa_facet[6][1] = 2;
1905  icosa_facet[6][2] = 11;
1906 
1907  icosa_facet[7].resize(3);
1908  icosa_facet[7][0] = 4;
1909  icosa_facet[7][1] = 2;
1910  icosa_facet[7][2] = 5;
1911 
1912  icosa_facet[8].resize(3);
1913  icosa_facet[8][0] = 4;
1914  icosa_facet[8][1] = 9;
1915  icosa_facet[8][2] = 2;
1916 
1917  icosa_facet[9].resize(3);
1918  icosa_facet[9][0] = 8;
1919  icosa_facet[9][1] = 9;
1920  icosa_facet[9][2] = 4;
1921 
1922  icosa_facet[10].resize(3);
1923  icosa_facet[10][0] = 6;
1924  icosa_facet[10][1] = 9;
1925  icosa_facet[10][2] = 8;
1926 
1927  icosa_facet[11].resize(3);
1928  icosa_facet[11][0] = 1;
1929  icosa_facet[11][1] = 6;
1930  icosa_facet[11][2] = 8;
1931 
1932  icosa_facet[12].resize(3);
1933  icosa_facet[12][0] = 1;
1934  icosa_facet[12][1] = 7;
1935  icosa_facet[12][2] = 6;
1936 
1937  icosa_facet[13].resize(3);
1938  icosa_facet[13][0] = 10;
1939  icosa_facet[13][1] = 7;
1940  icosa_facet[13][2] = 1;
1941 
1942  icosa_facet[14].resize(3);
1943  icosa_facet[14][0] = 10;
1944  icosa_facet[14][1] = 11;
1945  icosa_facet[14][2] = 7;
1946 
1947  icosa_facet[15].resize(3);
1948  icosa_facet[15][0] = 11;
1949  icosa_facet[15][1] = 3;
1950  icosa_facet[15][2] = 7;
1951 
1952  icosa_facet[16].resize(3);
1953  icosa_facet[16][0] = 7;
1954  icosa_facet[16][1] = 3;
1955  icosa_facet[16][2] = 6;
1956 
1957  icosa_facet[17].resize(3);
1958  icosa_facet[17][0] = 6;
1959  icosa_facet[17][1] = 3;
1960  icosa_facet[17][2] = 9;
1961 
1962  icosa_facet[18].resize(3);
1963  icosa_facet[18][0] = 9;
1964  icosa_facet[18][1] = 3;
1965  icosa_facet[18][2] = 2;
1966 
1967  icosa_facet[19].resize(3);
1968  icosa_facet[19][0] = 2;
1969  icosa_facet[19][1] = 3;
1970  icosa_facet[19][2] = 11;
1971 
1972  //Set each icosahedral facet to be a separate boundary
1973  //This is required so that we can set up a unique surface
1974  //coordinate system
1975  Vector<unsigned> icosa_facet_boundary_id(20);
1976  for(unsigned i=0;i<20;i++)
1977  {
1978  icosa_facet_boundary_id[i] = 7+i;
1979  }
1980 
1981 
1982  //Create the inner boundary object
1983  Inner_boundary_pt.resize(1);
1984  Inner_boundary_pt[0] =
1985  new TetgenMeshClosedFacetedSurface(icosa_point,icosa_facet,
1986  icosa_facet_boundary_id);
1987 
1988  Vector<double> inner_point(3,0.0);
1989  dynamic_cast<TetgenMeshClosedFacetedSurface*>(Inner_boundary_pt[0])->
1990  set_hole(inner_point);
1991 
1992  /*in.numberofregions = 1;
1993  in.regionlist = new double[5*in.numberofregions];
1994  in.regionlist[0] = 0.0;
1995  in.regionlist[1] = 0.0;
1996  in.regionlist[2] = 0.0;
1997  in.regionlist[3] = 1;
1998  in.regionlist[4] = 1;*/
1999 
2000  Fluid_mesh_pt =
2002  Inner_boundary_pt,2.0,
2003  this->time_stepper_pt(),
2004  true);
2005 
2006  //Must split the elements in the corners
2007  Fluid_mesh_pt->split_elements_in_corners(this->time_stepper_pt());
2008 
2009  // Set error estimator for bulk mesh
2011  Fluid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
2012 
2013  // Set targets for spatial adaptivity
2014  Fluid_mesh_pt->max_permitted_error()=0.005;
2015  Fluid_mesh_pt->min_permitted_error()=0.001;
2016  Fluid_mesh_pt->max_element_size()=1.0;
2017  Fluid_mesh_pt->min_element_size()=0.001;
2018 
2019  // Use coarser mesh during validation
2021  {
2022  Fluid_mesh_pt->max_element_size()=2.0;
2023  Fluid_mesh_pt->min_element_size()=0.1;
2024  }
2025 
2026  // Set the problem pointer
2027  Fluid_mesh_pt->problem_pt()=this;
2028 
2029  // Set the boundary conditions for this problem
2030  // Only on the "outer boundaries"
2031  for(unsigned ibound=0;ibound<6;ibound++)
2032  {
2033  unsigned final_index = 3;
2034  //Do no pin the outlet z-velocity
2035  if(ibound==2) {final_index = 2;}
2036  unsigned num_nod= Fluid_mesh_pt->nboundary_node(ibound);
2037  for (unsigned inod=0;inod<num_nod;inod++)
2038  {
2039  Node* nod_pt = Fluid_mesh_pt->boundary_node_pt(ibound,inod);
2040  //Pin the fluid velocities
2041  for(unsigned i=0;i<final_index;++i) {nod_pt->pin(i);}
2042 
2043  //Now pin all positions not on bubble
2044  for(unsigned i=0;i<3;i++)
2045  {dynamic_cast<SolidNode*>(nod_pt)->pin_position(i);}
2046  }
2047  }
2048 
2049  // Complete the build of all elements so they are fully functional
2050 
2051  //Find number of elements in mesh
2052  unsigned n_element = Fluid_mesh_pt->nelement();
2053 
2054  // Loop over the elements to set up element-specific
2055  // things that cannot be handled by constructor
2056  for(unsigned i=0;i<n_element;i++)
2057  {
2058  // Upcast from GeneralElement to the present element
2059  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(i));
2060 
2061  //Set the source function pointer
2062  el_pt->re_pt() = &Global_Parameters::Re;
2063 
2064  //Set the gravity term
2065  el_pt->re_invfr_pt() = &Global_Parameters::ReInvFr;
2066 
2067  //Set gravity
2068  el_pt->g_pt() = &Global_Parameters::G;
2069 
2070  //Set the contitutive parameter
2071  el_pt->constitutive_law_pt() = Global_Parameters::Constitutive_law_pt;
2072  }
2073 
2074  //Loop over the elements in region 1
2075  /*unsigned n_inner = Fluid_mesh_pt->nregion_element(1);
2076  for(unsigned e=0;e<n_inner;++e)
2077  {
2078  // Upcast from GeneralElement to the present element
2079  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->region_element_pt(1,e));
2080 
2081  //Set the source function pointer
2082  el_pt->viscosity_ratio_pt() = &Global_Parameters::Visc_Ratio;
2083  }*/
2084 
2085  //Now create the other meshes
2086  Free_surface_mesh_pt = new Mesh;
2088 
2091 
2092  //Combine the meshes
2093  //Bubble_pressure_data_pt->pin(0);
2094 
2095  // Add volume constraint sub mesh
2097 
2098  // Add Fluid_mesh_pt sub meshes
2099  this->add_sub_mesh(Fluid_mesh_pt);
2100 
2101  // Add Free_surface sub meshes
2102  this->add_sub_mesh(this->Free_surface_mesh_pt);
2103 
2104  // Build global mesh
2105  this->build_global_mesh();
2106 
2107 
2108  // Setup equation numbering scheme
2109  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
2110 
2111 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
float * p
Definition: Tutorial_Map_using.cpp:9
TetgenMeshOLDFacetedSurface * Outer_boundary_pt
Storage for the outer boundary object.
Definition: uns_adapt_3d_fs.cc:1676
Vector< TetgenMeshOLDFacetedSurface * > Inner_boundary_pt
Definition: uns_adapt_3d_fs.cc:1678
RefineableSolidTetgenMesh< ELEMENT > * Fluid_mesh_pt
Pointer to the fluid mesh.
Definition: uns_adapt_3d_fs.cc:1664
Mesh * Volume_constraint_mesh_pt
Pointer to mesh containing elements that impose volume constraint.
Definition: uns_adapt_3d_fs.cc:1670
Mesh * Free_surface_mesh_pt
Pointers to mesh of free surface elements.
Definition: uns_adapt_3d_fs.cc:1667
Data * Bubble_pressure_data_pt
Pointer to data that will store the bubble pressure.
Definition: uns_adapt_3d_fs.cc:1659
void create_free_surface_elements()
Create free surface elements.
Definition: uns_adapt_3d_fs.cc:1337
void create_volume_constraint_elements()
Create elements that impose volume constraint on the bubble.
Definition: uns_adapt_3d_fs.cc:1496
VolumeConstraintElement * Vol_constraint_el_pt
Pointer to element that imposes volume constraint for bubble.
Definition: uns_adapt_3d_fs.cc:1673
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: mesh.h:67
Definition: nodes.h:906
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
Definition: uns_adapt_3d_fs.cc:1258
Definition: nodes.h:1686
Definition: oomph-lib/src/generic/Vector.h:58
Definition: constrained_volume_elements.h:66
Definition: error_estimator.h:266
double Radius
Radius of cylinder.
Definition: interaction/turek_flag/turek_flag.cc:84
Vector< double > G
Gravity.
Definition: axisym_heat_sphere.cc:65
double ReInvFr
The Reynolds INverse Froude number.
Definition: uns_adapt_3d_fs.cc:70
double Box_length
Definition: uns_adapt_3d.cc:47
double Re
reynolds number
Definition: adaptive_hopf.cc:54
double Box_width
Definition: uns_adapt_3d.cc:46
double Volume
Definition: uns_adapt_3d_fs.cc:64
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: interaction/turek_flag/turek_flag.cc:87
double Ca
Set the Capillary number.
Definition: uns_adapt_3d_fs.cc:54
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501

References Global_Parameters::Box_length, Global_Parameters::Box_width, Global_Parameters::Ca, oomph::CommandLineArgs::command_line_flag_has_been_set(), Global_Parameters::Constitutive_law_pt, MeshRefinement::error_estimator_pt, Global_Parameters::G, i, p, oomph::Data::pin(), Global_Parameters::Radius, Global_Parameters::Re, Global_Parameters::ReInvFr, sqrt(), and Global_Parameters::Volume.

◆ ~RisingBubbleProblem()

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

Destructor (empty)

1326  {
1327  //Delete the objects
1328  unsigned nh = Inner_boundary_pt.size();
1329  for(unsigned h=0;h<nh;++h)
1330  {
1331  delete Inner_boundary_pt[h];
1332  }
1333  delete Outer_boundary_pt;
1334  }

Member Function Documentation

◆ actions_after_adapt()

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

Totally new mesh, need to fix it.

Reimplemented from oomph::Problem.

1407  {
1408  // Set the boundary conditions for this problem
1409  // Only on the "outer boundaries"
1410  for(unsigned ibound=0;ibound<6;ibound++)
1411  {
1412  unsigned final_index = 3;
1413  //Do no pin the outlet z-velocity
1414  if(ibound==2) {final_index = 2;}
1415  unsigned num_nod= Fluid_mesh_pt->nboundary_node(ibound);
1416  for (unsigned inod=0;inod<num_nod;inod++)
1417  {
1418  for(unsigned i=0;i<final_index;++i)
1419  {
1420  Fluid_mesh_pt->boundary_node_pt(ibound,inod)->pin(i);
1421  }
1422  }
1423  }
1424 
1425  // Complete the build of all elements so they are fully functional
1426 
1427  //Find number of elements in mesh
1428  unsigned n_element = Fluid_mesh_pt->nelement();
1429 
1430  // Loop over the elements to set up element-specific
1431  // things that cannot be handled by constructor
1432  for(unsigned i=0;i<n_element;i++)
1433  {
1434  // Upcast from GeneralElement to the present element
1435  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(i));
1436 
1437  //Set the source function pointer
1438  el_pt->re_pt() = &Global_Parameters::Re;
1439 
1440  //Set the gravity term
1441  el_pt->re_invfr_pt() = &Global_Parameters::ReInvFr;
1442 
1443  el_pt->g_pt() = &Global_Parameters::G;
1444 
1445  //Set the contitutive law
1446  el_pt->constitutive_law_pt() = Global_Parameters::Constitutive_law_pt;
1447  }
1448  }

References Global_Parameters::Constitutive_law_pt, Global_Parameters::G, i, Global_Parameters::Re, and Global_Parameters::ReInvFr.

◆ actions_after_newton_solve()

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

1489 {}

◆ actions_before_newton_solve()

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

1454  {
1455  //Loop over the boundaries
1456  for(unsigned ibound=0;ibound<6;ibound++)
1457  {
1458  //Don't boundary 3's z-coordinates
1459  unsigned final_index = 3;
1460  if(ibound==2) {final_index = 2;}
1461 
1462  // Loop over the nodes on boundary
1463  unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
1464  for (unsigned inod=0;inod<num_nod;inod++)
1465  {
1466  Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
1467  for(unsigned i=0;i<final_index;++i) {nod_pt->set_value(i,0.0);}
1468  }
1469  }
1470 
1471  //Now set a Poiseuille like inflow
1472  {
1473  using namespace Global_Parameters;
1474 
1475  // Loop over the nodes on boundary
1476  unsigned num_nod=Fluid_mesh_pt->nboundary_node(5);
1477  for (unsigned inod=0;inod<num_nod;inod++)
1478  {
1479  //Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(5,inod);
1480  //double x = nod_pt->x(0);
1481  //double y = nod_pt->x(1);
1482  //double u = (Box_width-x)*(Box_width+x)*(Box_width-y)*(Box_width+y);
1483  // nod_pt->set_value(2,u);
1484  }
1485  }
1486  }
Namespace for global parameters.
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:44

References i, and oomph::Data::set_value().

◆ create_free_surface_elements()

template<class ELEMENT >
void RisingBubbleProblem< ELEMENT >::create_free_surface_elements ( )
inline

Create free surface elements.

Volume constraint element stores the Data item that stores the bubble pressure that is adjusted/traded to allow for volume conservation. Which value is the pressure stored in?

1338  {
1342  unsigned p_traded_index=Vol_constraint_el_pt->index_of_traded_pressure();
1343 
1344  //Loop over the free surface boundaries
1345  //which is actually quite a large number
1346  unsigned nb=Fluid_mesh_pt->nboundary();
1347  for(unsigned b=6;b<nb;b++)
1348  {
1349  // How many bulk fluid elements are adjacent to boundary b?
1350  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
1351 
1352  // Loop over the bulk fluid elements adjacent to boundary b?
1353  for(unsigned e=0;e<n_element;e++)
1354  {
1355  // Get pointer to the bulk fluid element that is
1356  // adjacent to boundary b
1357  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
1358  Fluid_mesh_pt->boundary_element_pt(b,e));
1359 
1360  //Find the index of the face of element e along boundary b
1361  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
1362 
1363  // Create new element
1366  bulk_elem_pt,face_index);
1367 
1368  // Add it to the mesh
1370 
1371  //Add the appropriate boundary number
1373 
1374  //Specify the capillary number
1375  el_pt->ca_pt() = &Global_Parameters::Ca;
1376 
1377  // Specify the bubble pressure (pointer to Data object and
1378  // index of value within that Data object that corresponds
1379  // to the traded pressure
1381  Vol_constraint_el_pt->p_traded_data_pt(),p_traded_index);
1382  }
1383  }
1384  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
Specialise Elastic update case to the concrete 2D case.
Definition: specific_node_update_interface_elements.h:1295
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
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
int nb
Definition: level2_impl.h:286

References b, Global_Parameters::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 RisingBubbleProblem< ELEMENT >::create_volume_constraint_elements ( )
inline

Create elements that impose volume constraint on the bubble.

1497  {
1498  // Add volume constraint element to the mesh
1500 
1501  //Loop over the free surface boundaries
1502  unsigned nb=Fluid_mesh_pt->nboundary();
1503  for(unsigned b=6;b<nb;b++)
1504  {
1505  // How many bulk fluid elements are adjacent to boundary b?
1506  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
1507 
1508  // Loop over the bulk fluid elements adjacent to boundary b?
1509  for(unsigned e=0;e<n_element;e++)
1510  {
1511  // Get pointer to the bulk fluid element that is
1512  // adjacent to boundary b
1513  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
1514  Fluid_mesh_pt->boundary_element_pt(b,e));
1515 
1516  //Find the index of the face of element e along boundary b
1517  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
1518 
1519  // Create new element
1522  bulk_elem_pt,face_index);
1523 
1524  //Set the "master" volume control element
1526 
1527  // Add it to the mesh
1529  }
1530  }
1531  }
Definition: constrained_volume_elements.h:756
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 RisingBubbleProblem< ELEMENT >::delete_free_surface_elements ( )
inline

Delete free surface elements.

1388  {
1389  // How many surface elements are in the surface mesh
1390  unsigned n_element = Free_surface_mesh_pt->nelement();
1391 
1392  // Loop over the surface elements
1393  for(unsigned e=0;e<n_element;e++)
1394  {
1395  // Kill surface element
1397  }
1398 
1399  // Wipe the mesh
1401 
1402  } // 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 RisingBubbleProblem< ELEMENT >::delete_volume_constraint_elements ( )
inline

Delete volume constraint elements.

1535  {
1536  // How many surface elements are in the surface mesh
1537  unsigned n_element = Volume_constraint_mesh_pt->nelement();
1538 
1539  // Loop over the surface elements (but don't kill the volume constraint
1540  // element (element 0))
1541  unsigned first_el_to_be_killed=1;
1542  for(unsigned e=first_el_to_be_killed;e<n_element;e++)
1543  {
1545  }
1546 
1547  // Wipe the mesh
1549 
1550  } // end of delete_volume_constraint_elements

References e().

◆ doc_solution()

template<class ELEMENT >
void RisingBubbleProblem< ELEMENT >::doc_solution ( const unsigned nplot,
DocInfo doc_info 
)

Doc the solution.

2121 {
2122 
2123  ofstream some_file;
2124  char filename[100];
2125 
2126  // Doc local node numbering
2127  //-------------------------
2128  sprintf(filename,"%s/node_numbering%i.dat",doc_info.directory().c_str(),
2129  doc_info.number());
2130  some_file.open(filename);
2131  FiniteElement* el_pt=Fluid_mesh_pt->finite_element_pt(0);
2132  unsigned nnode=el_pt->nnode();
2133  unsigned ndim=el_pt->node_pt(0)->ndim();
2134  for (unsigned j=0;j<nnode;j++)
2135  {
2136  for (unsigned i=0;i<ndim;i++)
2137  {
2138  some_file << el_pt->node_pt(j)->x(i) << " " ;
2139  }
2140  some_file << j << std::endl;
2141  }
2142  some_file.close();
2143 
2144  //Tell me how many elements there are
2145  std::cout << "Surface " << Free_surface_mesh_pt->nelement() << "\n";
2146 
2147  // Output boundaries
2148  //------------------
2149  sprintf(filename,"%s/surface%i.dat",doc_info.directory().c_str(),
2150  doc_info.number());
2151  some_file.open(filename);
2152  Free_surface_mesh_pt->output(some_file,nplot);
2153 
2154  //Tell me what we have
2155  some_file.close();
2156 
2157 
2158  // Output solution
2159  //----------------
2160  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
2161  doc_info.number());
2162  some_file.open(filename);
2163  Fluid_mesh_pt->output(some_file,nplot);
2164  some_file.close();
2165 
2166 
2167 
2168 } // end of doc
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
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
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
string filename
Definition: MergeRestartFiles.py:39
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::DocInfo::directory(), MergeRestartFiles::filename, i, j, oomph::Node::ndim(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::DocInfo::number(), and oomph::Node::x().

◆ snap_onto_sphere()

template<class ELEMENT >
void RisingBubbleProblem< ELEMENT >::snap_onto_sphere ( )
inline

Snap the boundary nodes onto the sphere.

1555  {
1556  const unsigned n_boundary = Fluid_mesh_pt->nboundary();
1557  for(unsigned b=6;b<n_boundary;b++)
1558  {
1559  unsigned n_node = Fluid_mesh_pt->nboundary_node(b);
1560  for(unsigned n=0;n<n_node;++n)
1561  {
1562  Node* nod_pt = Fluid_mesh_pt->boundary_node_pt(b,n);
1563  double x = nod_pt->x(0);
1564  double y = nod_pt->x(1);
1565  double z = nod_pt->x(2);
1566 
1567  //Now let's snap by calculating the angle
1568  double r = sqrt(x*x + y*y + z*z);
1569  double theta = acos(z/r);
1570  double phi = atan2(y,x);
1571 
1572  //Do the snapping
1573  double R_new = Global_Parameters::Radius;
1574  nod_pt->x(0) = R_new*sin(theta)*cos(phi);
1575  nod_pt->x(1) = R_new*sin(theta)*sin(phi);
1576  nod_pt->x(2) = R_new*cos(theta);
1577  }
1578 
1579  //Loop over the elements adjacent to the boundary
1580  unsigned n_element = this->Fluid_mesh_pt->nboundary_element(b);
1581  if(n_element > 0)
1582  {
1583  //Make a dummy simplex element
1584  TElement<3,2> dummy_four_node_element;
1585  //Make a dummy quadratic element
1586  TElement<3,3> dummy_ten_node_element;
1587  Vector<double> s(3);
1588  Vector<double> x_new(3);
1589  for(unsigned n=0;n<4;n++) {dummy_four_node_element.construct_node(n);}
1590  for(unsigned n=0;n<10;n++) {dummy_ten_node_element.construct_node(n);}
1591  for(unsigned e=0;e<n_element;e++)
1592  {
1593  //Cache the element pointer
1594  ELEMENT* elem_pt = dynamic_cast<ELEMENT*>(
1595  this->Fluid_mesh_pt->boundary_element_pt(b,e));
1596 
1597  //Find the number of nodes
1598  const unsigned n_node = elem_pt->nnode();
1599  //Only do something if not simplex element
1600  if(n_node > 4)
1601  {
1602  //Copy the nodes into the dummy
1603  for(unsigned n=0;n<4;n++)
1604  {
1605  for(unsigned i=0;i<3;i++)
1606  {
1607  dummy_four_node_element.node_pt(n)->x(i) =
1608  elem_pt->node_pt(n)->x(i);
1609  }
1610  }
1611 
1612  //Now sort out the mid-side nodes
1613  for(unsigned n=4;n<10;n++)
1614  {
1615  //If it's not on a boundary then reset to be interpolated
1616  //from the simplex
1617  if(!elem_pt->node_pt(n)->is_on_boundary())
1618  {
1619  elem_pt->local_coordinate_of_node(n,s);
1620  dummy_four_node_element.interpolated_x(s,x_new);
1621  for(unsigned i=0;i<3;i++) {elem_pt->node_pt(n)->x(i) = x_new[i];}
1622  }
1623  }
1624  }
1625 
1626  //If we have more than 10 nodes interpolate from the quadratic shape
1627  if(n_node > 10)
1628  {
1629  //Copy the nodes into the dummy
1630  for(unsigned n=0;n<10;n++)
1631  {
1632  for(unsigned i=0;i<3;i++)
1633  {
1634  dummy_ten_node_element.node_pt(n)->x(i) =
1635  elem_pt->node_pt(n)->x(i);
1636  }
1637  }
1638 
1639  //Now sort out the mid-face and central nodes
1640  for(unsigned n=10;n<n_node;n++)
1641  {
1642  //If it's not on a boundary then reset to be interpolated
1643  //from the simplex
1644  if(!elem_pt->node_pt(n)->is_on_boundary())
1645  {
1646  elem_pt->local_coordinate_of_node(n,s);
1647  dummy_ten_node_element.interpolated_x(s,x_new);
1648  for(unsigned i=0;i<3;i++) {elem_pt->node_pt(n)->x(i) = x_new[i];}
1649  }
1650  }
1651  }
1652  }
1653  } //End of fix up of elements
1654  }
1655 
1656  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar atan2(const AnnoyingScalar &y, const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:139
AnnoyingScalar acos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:138
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: Telements.h:1208
Scalar * y
Definition: level1_cplx_impl.h:128
RealScalar s
Definition: level1_cplx_impl.h:130
double theta
Definition: two_d_biharmonic.cc:236
r
Definition: UniformPSDSelfTest.py:20
list x
Definition: plotDoE.py:28

References acos(), atan2(), b, cos(), e(), i, n, UniformPSDSelfTest::r, Global_Parameters::Radius, s, sin(), sqrt(), BiharmonicTestFunctions2::theta, plotDoE::x, oomph::Node::x(), and y.

Member Data Documentation

◆ Bubble_pressure_data_pt

template<class ELEMENT >
Data* RisingBubbleProblem< ELEMENT >::Bubble_pressure_data_pt

Pointer to data that will store the bubble pressure.

◆ Fluid_mesh_pt

template<class ELEMENT >
RefineableSolidTetgenMesh<ELEMENT>* RisingBubbleProblem< ELEMENT >::Fluid_mesh_pt

Pointer to the fluid mesh.

◆ Free_surface_mesh_pt

template<class ELEMENT >
Mesh* RisingBubbleProblem< ELEMENT >::Free_surface_mesh_pt

Pointers to mesh of free surface elements.

◆ Inner_boundary_pt

template<class ELEMENT >
Vector<TetgenMeshOLDFacetedSurface*> RisingBubbleProblem< ELEMENT >::Inner_boundary_pt

◆ Outer_boundary_pt

template<class ELEMENT >
TetgenMeshOLDFacetedSurface* RisingBubbleProblem< ELEMENT >::Outer_boundary_pt

Storage for the outer boundary object.

◆ Vol_constraint_el_pt

template<class ELEMENT >
VolumeConstraintElement* RisingBubbleProblem< ELEMENT >::Vol_constraint_el_pt

Pointer to element that imposes volume constraint for bubble.

◆ Volume_constraint_mesh_pt

template<class ELEMENT >
Mesh* RisingBubbleProblem< ELEMENT >::Volume_constraint_mesh_pt

Pointer to mesh containing elements that impose volume constraint.


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