VibratingShellProblem< ELEMENT > Class Template Reference

Problem class to simulate the settling of a viscous drop. More...

+ Inheritance diagram for VibratingShellProblem< ELEMENT >:

Public Member Functions

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

Private Types

enum  { Internal_boundary1_id =0 , Free_surface_boundary_id =1 , Symmetry_line_id =2 , Shell_wall_boundary_id =3 }
 Enumeration of boundaries. More...
 

Private Member Functions

void create_free_surface_elements ()
 Create free surface elements. More...
 
void delete_free_surface_elements ()
 Delete free surface elements. More...
 

Private Attributes

NodeCentral_node_on_free_surface_pt
 Pointer to free surface node on symmetry line. More...
 
double Next_dt
 
MeshFree_surface_mesh_pt
 Pointers to mesh of free surface elements. More...
 
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
 Pointer to Fluid_mesh. More...
 
DataExternal_pressure_data_pt
 Pointer to a global external pressure datum. More...
 
TriangleMeshClosedCurveOuter_boundary_polyline_pt
 Triangle mesh polygon for outer boundary. More...
 
Vector< TriangleMeshOpenCurve * > Internal_open_boundary_pt
 
double Pext
 External pressure. More...
 

Additional Inherited Members

- Public Types inherited from oomph::Problem
typedef void(* SpatialErrorEstimatorFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error)
 Function pointer for spatial error estimator. More...
 
typedef void(* SpatialErrorEstimatorWithDocFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error, DocInfo &doc_info)
 Function pointer for spatial error estimator with doc. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 
- Static Public Attributes inherited from oomph::Problem
static bool Suppress_warning_about_actions_before_read_unstructured_meshes
 
- Protected Types inherited from oomph::Problem
enum  Assembly_method {
  Perform_assembly_using_vectors_of_pairs , Perform_assembly_using_two_vectors , Perform_assembly_using_maps , Perform_assembly_using_lists ,
  Perform_assembly_using_two_arrays
}
 Enumerated flags to determine which sparse assembly method is used. More...
 
- Protected Member Functions inherited from oomph::Problem
unsigned setup_element_count_per_dof ()
 
virtual void sparse_assemble_row_or_column_compressed (Vector< int * > &column_or_row_index, Vector< int * > &row_or_column_start, Vector< double * > &value, Vector< unsigned > &nnz, Vector< double * > &residual, bool compressed_row_flag)
 
virtual void actions_before_newton_step ()
 
virtual void actions_after_newton_step ()
 
virtual void actions_before_implicit_timestep ()
 
virtual void actions_after_implicit_timestep ()
 
virtual void actions_after_implicit_timestep_and_error_estimation ()
 
virtual void actions_before_explicit_timestep ()
 Actions that should be performed before each explicit time step. More...
 
virtual void actions_after_explicit_timestep ()
 Actions that should be performed after each explicit time step. More...
 
virtual void actions_before_read_unstructured_meshes ()
 
virtual void actions_after_read_unstructured_meshes ()
 
virtual void actions_after_change_in_global_parameter (double *const &parameter_pt)
 
virtual void actions_after_change_in_bifurcation_parameter ()
 
virtual void actions_after_parameter_increase (double *const &parameter_pt)
 
doubledof_derivative (const unsigned &i)
 
doubledof_current (const unsigned &i)
 
virtual void set_initial_condition ()
 
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 VibratingShellProblem< ELEMENT >

Problem class to simulate the settling of a viscous drop.

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

Member Enumeration Documentation

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private

Enumeration of boundaries.

Enumerator
Internal_boundary1_id 
Free_surface_boundary_id 
Symmetry_line_id 
Shell_wall_boundary_id 
701  {
706  };
@ Free_surface_boundary_id
Definition: vibrating_shell_non_newtonian.cc:703
@ Shell_wall_boundary_id
Definition: vibrating_shell_non_newtonian.cc:705
@ Symmetry_line_id
Definition: vibrating_shell_non_newtonian.cc:704
@ Internal_boundary1_id
Definition: vibrating_shell_non_newtonian.cc:702

Constructor & Destructor Documentation

◆ VibratingShellProblem()

template<class ELEMENT >
VibratingShellProblem< ELEMENT >::VibratingShellProblem

Constructor.

Get pointer to the free surface node

Get the node's boundary coordinate

Get the node's coordinate in the spline representation

Get pointer to the free surface node

Get the node's r-coordinate

Set external pressure to zero

718 {
719 
722  Max_residuals=10.0;
724 
725  //enable_globally_convergent_newton_method();
726 
727  // Allocate the timestepper -- this constructs the Problem's
728  // time object with a sufficient amount of storage to store the
729  // previous timsteps.
731  {
732  case 1:
733  this->add_time_stepper_pt(new BDF<1>(true));
734  oomph_info << "Using BDF1\n";
735  break;
736 
737  case 2:
738  this->add_time_stepper_pt(new BDF<2>(true));
739  oomph_info << "Using BDF2\n";
740  break;
741 
742  case 4:
743  this->add_time_stepper_pt(new BDF<4>(true));
744  oomph_info << "Using BDF4\n";
745  break;
746 
747  default:
748  oomph_info << "Wrong BDF type: " << Problem_Parameter::BDF_type
749  << std::endl;
750  break;
751  }
752 
753  // Build the boundary segments for outer boundary, consisting of
754  //--------------------------------------------------------------
755  // 2 separate polylines
756  //------------------------
757 
758  Vector<TriangleMeshCurveSection*> boundary_curve_section_pt(3);
759  Vector<TriangleMeshPolyLine*> internal_polyline_pt(2);
760 
761  // Each polyline only has two vertices -- provide storage for their
762  // coordinates
763  Vector<Vector<double> > vertex_coord;
764 
765  Ellipse* Shell_wall_pt = new Ellipse(Problem_Parameter::Shell_radius,
767 
768 
769  double zeta_start=0.0;
770  double zeta_end=MathematicalConstants::Pi/2.0;
771 
772  // number of points along the shell wall
773  unsigned npoints_wall=80;
774 
775  // get the increment in boundary coordinate
776  double unit_zeta = (zeta_end-zeta_start)/double(npoints_wall-1);
777 
778  // resize the vector storing the vertices
779  vertex_coord.resize(npoints_wall);
780 
781  // boundary coordinate
782  Vector<double> zeta(1,0.0);
783 
784  // coordinates of point on the boundary
785  Vector<double> coord(2,0.0);
786 
787  // Create points on boundary
788  for(unsigned ipoint=0; ipoint<npoints_wall;ipoint++)
789  {
790  // Get the coordinates
791  zeta[0]=zeta_start+unit_zeta*double(ipoint);
792  Shell_wall_pt->position(zeta,coord);
793 
794  // resize vertex coordinate
795  vertex_coord[ipoint].resize(2);
796 
797  // Shift
798  vertex_coord[ipoint][0]=coord[0];
799  //std::cout<<vertex_coord[ipoint][0]<< " ";
800  vertex_coord[ipoint][1]=coord[1];
801  //std::cout<<vertex_coord[ipoint][1]<< std::endl;
802  }
803 
804  boundary_curve_section_pt[0]=
805  new TriangleMeshPolyLine(vertex_coord, Shell_wall_boundary_id);
806 
807  ofstream file;
808  file.open((Problem_Parameter::Directory+"/boundary_section0.dat").c_str());
809  boundary_curve_section_pt[0]->output(file);
810  file.close();
811 
812  // Resize the vertex coordinates vector
813  vertex_coord.resize(2);
814 
815  for(unsigned i=0;i<2;i++)
816  {
817  vertex_coord[i].resize(2);
818  }
819 
820  // Build the symmetry polyline
821  vertex_coord[0][0]=0.0;
822  vertex_coord[0][1]=Problem_Parameter::Shell_radius;
823  vertex_coord[1][0]=0.0;
824  vertex_coord[1][1]=Problem_Parameter::free_surface_profile(0.0); // obacht
825  boundary_curve_section_pt[1]= new TriangleMeshPolyLine(vertex_coord,
827 
828  file.open((Problem_Parameter::Directory+"/boundary_section1.dat").c_str());
829  boundary_curve_section_pt[1]->output(file);
830  file.close();
831 
832  // number of points along the shell wall
833  unsigned npoints_fs=80;
834 
835  // get the increment in boundary coordinate
836  double increment = 1.0/double(npoints_fs-1);
837 
838  // resize the vector storing the vertices
839  vertex_coord.resize(npoints_fs);
840 
841  // Create points on boundary
842  for(unsigned ipoint=0; ipoint<npoints_fs;ipoint++)
843  {
844  // resize vertex coordinate
845  vertex_coord[ipoint].resize(2);
846 
847  if(ipoint==0)
848  {
849  vertex_coord[ipoint][0]=0.0;
850  //std::cout<<vertex_coord[ipoint][0]<< " ";
851  vertex_coord[ipoint][1]=
853  //std::cout<<vertex_coord[ipoint][1]<< std::endl;
854  continue;
855  }
856  else if(ipoint==npoints_fs-1)
857  {
858  vertex_coord[ipoint][0]=Problem_Parameter::Shell_radius;
859  //std::cout<<vertex_coord[ipoint][0]<< " ";
860  vertex_coord[ipoint][1]=0.0;
861  //std::cout<<vertex_coord[ipoint][1]<< std::endl;
862  continue;
863  }
864 
865  // Get the coordinates
866  coord[0]=double(ipoint)*increment;
867  coord[1]=Problem_Parameter::free_surface_profile(coord[0]);
868  //-1.0*(-0.05*tanh(10.0*coord[0]-7.5)+0.05); // obacht
869 
870  // Shift
871  vertex_coord[ipoint][0]=coord[0];
872  //std::cout<<vertex_coord[ipoint][0]<< " ";
873  vertex_coord[ipoint][1]=coord[1];
874  //std::cout<<vertex_coord[ipoint][1]<< std::endl;
875  }
876 
877  // Build the boundary polyline
878  boundary_curve_section_pt[2]=
880 
881  file.open((Problem_Parameter::Directory+"/boundary_section2.dat").c_str());
882  boundary_curve_section_pt[2]->output(file);
883  file.close();
884 
885  // Create the triangle mesh polygon for outer boundary
887  new TriangleMeshClosedCurve(boundary_curve_section_pt);
888 
889  // Use the TriangleMeshParameters object for gathering all
890  // the necessary arguments for the TriangleMesh object
891  TriangleMeshParameters triangle_mesh_parameters(
893 
894  // Define the maximum element areas
895  triangle_mesh_parameters.element_area() =
897 
898  // enable the boundary refinement
899  triangle_mesh_parameters.enable_boundary_refinement();
900 
901  // Create the mesh
902  Fluid_mesh_pt =
903  new RefineableSolidTriangleMesh<ELEMENT>(
904  triangle_mesh_parameters,this->time_stepper_pt());
905 
906  // Increase number of bins to reduce bias/drift in area targets
907  Fluid_mesh_pt->nbin_x_for_area_transfer()=500;
908  Fluid_mesh_pt->nbin_y_for_area_transfer()=500;
909 
910 // Fluid_mesh_pt->output((Problem_Parameter::Directory+"/Mesh_before_snapping.dat").c_str());
911 
912  //----------------------------------------------------------------
913  // Snap nodes manually onto the curved boundary
914  //----------------------------------------------------------------
915 
916  // loop over the nodes on the wall boundary
917  unsigned n_boundary_node = Fluid_mesh_pt->
918  nboundary_node(Shell_wall_boundary_id);
919 
920  for(unsigned n=0;n<n_boundary_node;n++)
921  {
923  Node* nod_pt = Fluid_mesh_pt->boundary_node_pt(Shell_wall_boundary_id,n);
924 
926  Vector<double> zeta(1);
928 
930  Vector<double> new_x(2,0.0);
931  // updating zeta
932  zeta[0]=zeta_start+zeta[0]*(zeta_end-zeta_start);
933  Shell_wall_pt->position(zeta,new_x);
934  nod_pt->x(0) = new_x[0];
935  nod_pt->x(1) = new_x[1];
936 
937  }
938 
939  n_boundary_node=Fluid_mesh_pt->nboundary_node(Free_surface_boundary_id);
940 
941  for(unsigned n=0;n<n_boundary_node;n++)
942  {
944  Node* nod_pt = Fluid_mesh_pt->boundary_node_pt(Free_surface_boundary_id,n);
945 
948  {
949  continue;
950  }
951 
953  double r=nod_pt->x(0);
954 
955  // calculate node's z-coordinate
956  double new_z=Problem_Parameter::free_surface_profile(r); // obacht
957 
958  // move node
959  nod_pt->x(1) = new_z;
960 
961  }
962 
963  //-----------------------------------------------------------------
964  // End of snapping
965  //-----------------------------------------------------------------
966 
967  //Fluid_mesh_pt->output((Problem_Parameter::Directory+"/Mesh_after_snapping.dat").c_str());
968  Fluid_mesh_pt->output_boundaries((Problem_Parameter::Directory+"/boundaries.dat").c_str());
969 
970  // Set error estimator for bulk mesh
972  Fluid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
973 
974  // Set targets for spatial adaptivity
975  Fluid_mesh_pt->max_permitted_error()=5.0e-3; // was 0.005; 0.0005
976  Fluid_mesh_pt->min_permitted_error()=1.0e-3; // was 0.001; 0.0001
978  Fluid_mesh_pt->min_element_size()=1.0e-5; // was 0.001 or 0.00001
979 
980 
982  Pext=0.0;
983 
984  //Create a Data object whose single value stores the
985  //external pressure
987 
988  // Set external pressure
990 
991  // The external pressure is pinned -- the external pressure
992  // sets the pressure throughout the domain -- we do not have
993  // the liberty to fix another pressure value!
995 
996  // Construct the mesh of free surface elements
999 
1000  // Set boundary condition and complete the build of all bulk elements
1002 
1003  // Combine meshes
1004  //---------------
1005 
1006  // Add Fluid_mesh_pt sub meshes
1007  this->add_sub_mesh(Fluid_mesh_pt);
1008 
1009  // Add Free_surface sub meshes
1010  this->add_sub_mesh(this->Free_surface_mesh_pt);
1011 
1012  // Build global mesh
1013  this->build_global_mesh();
1014 
1015  // Set lagrangian coordinates for pseudo-solid
1016  Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
1017 
1018  // Use mumps
1019  //linear_solver_pt()=new MumpsSolver;
1020 
1021  // Setup equation numbering scheme
1022  cout <<"Number of equations: " << this->assign_eqn_numbers() << std::endl;
1023 
1024 
1025 } // end_of_constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
double Pext
External pressure.
Definition: vibrating_shell_non_newtonian.cc:709
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
Pointer to Fluid_mesh.
Definition: vibrating_shell_non_newtonian.cc:689
Data * External_pressure_data_pt
Pointer to a global external pressure datum.
Definition: vibrating_shell_non_newtonian.cc:692
void complete_problem_setup()
Set boundary conditions and complete the build of all elements.
Definition: vibrating_shell_non_newtonian.cc:1072
void create_free_surface_elements()
Create free surface elements.
Definition: vibrating_shell_non_newtonian.cc:1271
TriangleMeshClosedCurve * Outer_boundary_polyline_pt
Triangle mesh polygon for outer boundary.
Definition: vibrating_shell_non_newtonian.cc:695
Mesh * Free_surface_mesh_pt
Pointers to mesh of free surface elements.
Definition: vibrating_shell_non_newtonian.cc:686
Definition: timesteppers.h:1165
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: geom_objects.h:644
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:745
Definition: mesh.h:67
Definition: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
virtual bool is_on_boundary() const
Definition: nodes.h:1373
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Definition: nodes.cc:2379
bool Always_take_one_newton_step
Definition: problem.h:2197
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
unsigned Max_newton_iterations
Maximum number of Newton iterations.
Definition: problem.h:599
void build_global_mesh()
Definition: problem.cc:1493
double Minimum_dt_but_still_proceed
Definition: problem.h:725
double Max_residuals
Definition: problem.h:610
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
Base class defining a closed curve for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1339
Definition: triangle_mesh.template.h:94
Class defining a polyline for use in Triangle Mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:868
Definition: oomph-lib/src/generic/Vector.h:58
Definition: error_estimator.h:266
string Directory
Directory.
Definition: all_foeppl_von_karman/axisym_displ_based_fvk.cc:70
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
r
Definition: UniformPSDSelfTest.py:20
double Uniform_element_area
Uniform initial element area.
Definition: axisym_vibrating_shell_non_newtonian.cc:61
double Shell_radius
Radius of the shell.
Definition: axisym_vibrating_shell_non_newtonian.cc:143
unsigned BDF_type
Which bdf timestepper do we use?
Definition: axisym_vibrating_shell_non_newtonian.cc:54
double free_surface_profile(const double r)
Definition: axisym_vibrating_shell_non_newtonian.cc:128
double Dt_min
Minimum allowable timestep.
Definition: axisym_vibrating_shell_non_newtonian.cc:103
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References oomph::Problem_Parameter::BDF_type, AxisymFvKParameters::Directory, oomph::Problem_Parameter::Dt_min, oomph::TriangleMeshParameters::element_area(), oomph::TriangleMeshParameters::enable_boundary_refinement(), MeshRefinement::error_estimator_pt, oomph::Problem_Parameter::free_surface_profile(), oomph::Node::get_coordinates_on_boundary(), i, oomph::Node::is_on_boundary(), oomph::Locate_zeta_helpers::Max_newton_iterations, n, oomph::oomph_info, Global_Physical_Variables::Pext, BiharmonicTestFunctions2::Pi, oomph::Ellipse::position(), UniformPSDSelfTest::r, oomph::Problem_Parameter::Shell_radius, oomph::Problem_Parameter::Uniform_element_area, oomph::Node::x(), and Eigen::zeta().

◆ ~VibratingShellProblem()

template<class ELEMENT >
VibratingShellProblem< ELEMENT >::~VibratingShellProblem

Destructor.

1033 {
1034  // Fluid timestepper
1035  delete this->time_stepper_pt(0);
1036 
1037  // Kill data associated with outer boundary
1039  for (unsigned j=0;j<n;j++)
1040  {
1042  }
1044 
1045 
1046 
1047  // Flush element of free surface elements
1049  delete Free_surface_mesh_pt;
1050 
1051  // Delete error estimator
1052  delete Fluid_mesh_pt->spatial_error_estimator_pt();
1053 
1054  // Delete fluid mesh
1055  delete Fluid_mesh_pt;
1056 
1057  // Delete pressure data
1059 
1060  // Kill const eqn
1062 
1064 
1065 } // end_of_destructor
void delete_free_surface_elements()
Delete free surface elements.
Definition: vibrating_shell_non_newtonian.cc:668
virtual TriangleMeshCurveSection * curve_section_pt(const unsigned &i) const
Pointer to i-th constituent curve section.
Definition: unstructured_two_d_mesh_geometry_base.h:1308
virtual unsigned ncurve_section() const
Number of constituent curves.
Definition: unstructured_two_d_mesh_geometry_base.h:1172
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
Definition: jeffery_orbit.cc:82
GeneralisedNewtonianConstitutiveEquation< 3 > * Const_eqn_pt
Fluid constitutive equation.
Definition: axisym_vibrating_shell_non_newtonian.cc:213
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::Problem_Parameter::Const_eqn_pt, Problem_Parameter::Constitutive_law_pt, j, and n.

Member Function Documentation

◆ actions_after_adapt()

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

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

Reimplemented from oomph::Problem.

303  {
304 
305  // Create the elements that impose the displacement constraint
307 
308  // Rebuild the Problem's global mesh from its various sub-meshes
309  this->rebuild_global_mesh();
310 
311  // Setup the problem again -- remember that fluid mesh has been
312  // completely rebuilt and its element's don't have any
313  // pointers to Re etc. yet
315 
316  }// end of actions_after_adapt
void rebuild_global_mesh()
Definition: problem.cc:1533

◆ actions_after_newton_convergence_check()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::actions_after_newton_convergence_check ( )
inline

Don't allow inverted elements in general.

349  {
350  unsigned n_element = Fluid_mesh_pt->nelement();
351  for(unsigned e=0;e<n_element;e++)
352  {
353  // Upcast from GeneralisedElement to the present element
354  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
355 
356  el_pt->Accept_negative_jacobian=false;
357  }
358 
359  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)

References e().

◆ actions_after_newton_solve()

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

Update the after solve (empty)

Reimplemented from oomph::Problem.

320 {}

◆ actions_before_adapt()

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

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

Reimplemented from oomph::Problem.

291  {
292  // Kill the elements and wipe surface mesh
294 
295  // Rebuild the Problem's global mesh from its various sub-meshes
296  this->rebuild_global_mesh();
297 
298  }// end of actions_before_adapt

◆ actions_before_newton_convergence_check()

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

Allow inverted elements during Newton iteration.

Reimplemented from oomph::Problem.

334  {
335  unsigned n_element = Fluid_mesh_pt->nelement();
336  for(unsigned e=0;e<n_element;e++)
337  {
338  // Upcast from GeneralisedElement to the present element
339  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
340 
341  // accept negative jacobian in solution process
342  el_pt->Accept_negative_jacobian=true;
343  }
344 
345  }

References e().

◆ actions_before_newton_solve()

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

Update the problem specs before solve.

Reimplemented from oomph::Problem.

324  {
325  //Reset the Lagrangian coordinates of the nodes to be the current
326  //Eulerian coordinates -- this makes the current configuration
327  //stress free
328  Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
329  }

◆ calculate_error_of_fixed_point_iteration()

template<class ELEMENT >
double VibratingShellProblem< ELEMENT >::calculate_error_of_fixed_point_iteration ( )
inline

get the error of the fixed point iteration

471  {
472  // Get elemental max/min/norms
473  double norm_squared=0.0;
474  double latest_guess_norm_squared=0.0;
475  double error_norm_squared=0.0;
476 
477  unsigned nel=Fluid_mesh_pt->nelement();
478  for (unsigned e=0;e<nel;e++)
479  {
480  // Get element
481  ELEMENT* el_pt=dynamic_cast<ELEMENT*>(
482  Fluid_mesh_pt->element_pt(e));
483 
484  // Get norms of invariant
485  double el_norm_squared=0.0;
486  double el_latest_guess_norm_squared=0.0;
487  double el_error_norm_squared=0.0;
488  el_pt->square_of_norm_of_fixed_point(
489  el_norm_squared,
490  el_latest_guess_norm_squared,
491  el_error_norm_squared);
492 
493  // Add it...
494  norm_squared+=el_norm_squared;
495  latest_guess_norm_squared+=el_latest_guess_norm_squared;
496  error_norm_squared+=el_error_norm_squared;
497  }
498 
499  oomph_info << "Norm of current strain rate invariant: "
500  << sqrt(norm_squared) << std::endl;
501  oomph_info << "Norm of latest fixed point iteration guess for "
502  << "strain rate invariant: "
503  << sqrt(latest_guess_norm_squared) << std::endl;
504  oomph_info << "Norm of error in fixed point iteration "
505  << "strain rate invariant: "
506  << sqrt(error_norm_squared) << " equivalent to " ;
507  if (sqrt(norm_squared)!=0.0)
508  {
509  oomph_info << sqrt(error_norm_squared)/sqrt(norm_squared)*100.0 << " %";
510  }
511  oomph_info << std::endl;
512 
513  if (sqrt(norm_squared)!=0.0)
514  {
515  return sqrt(error_norm_squared)/sqrt(norm_squared)*100.0;
516  }
517  else
518  {
519  return 0.0;
520  }
521 
522  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134

References e(), oomph::oomph_info, and sqrt().

◆ complete_problem_setup()

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

Set boundary conditions and complete the build of all elements.

Set up the problem: apply BC and make bulk elements fully functional.

Get pointer to the free surface node

1073 {
1074  // Re-set the boundary conditions for fluid problem: All nodes are
1075  // free by default -- just pin the ones that have Dirichlet conditions
1076  // here.
1077  unsigned nbound=Fluid_mesh_pt->nboundary();
1078  for(unsigned ibound=0;ibound<nbound;ibound++)
1079  {
1080  unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
1081  for (unsigned inod=0;inod<num_nod;inod++)
1082  {
1083  // Get node
1084  Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
1085 
1086  //Pin both velocities at the shell wall boundary
1087  if(ibound==Shell_wall_boundary_id)
1088  {
1089  nod_pt->pin(0);
1090  nod_pt->pin(1);
1091  }
1092 
1093  // pin horizontal velocity at symmetry boundary
1094  if(ibound==Symmetry_line_id)
1095  {
1096  nod_pt->pin(0);
1097  }
1098 
1099  // pin Lagrange multiplier at the intersection of the shell wall
1100  // boundary and the free surface
1101  if( (nod_pt->is_on_boundary(Shell_wall_boundary_id)) &&
1103  {
1104  // Get the number of values at this node
1105  unsigned n_value=nod_pt->nvalue();
1106 
1107  // check that it is the corner node with 4 values
1108  // (u,v,p,delta)
1109  if(n_value != 4)
1110  {
1111  oomph_info <<" Here!\n";
1112  abort();
1113  }
1114 
1115  nod_pt->pin(n_value-1);
1116  }
1117 
1118  // Pin pseudo-solid positions apart from free surface boundary which
1119  // we allow to move
1120  SolidNode* solid_node_pt = dynamic_cast<SolidNode*>(nod_pt);
1121  if(ibound==Shell_wall_boundary_id)
1122  {
1123  solid_node_pt->pin_position(0);
1124  solid_node_pt->pin_position(1);
1125  }
1126  else if(ibound==Symmetry_line_id)
1127  {
1128  solid_node_pt->pin_position(0);
1129  }
1130 
1131  }
1132 
1133  } // end loop over boundaries
1134 
1135  // Complete the build of all elements so they are fully functional
1136  // Remember that adaptation for triangle meshes involves a complete
1137  // regneration of the mesh (rather than splitting as in tree-based
1138  // meshes where such parameters can be passed down from the father
1139  // element!)
1140  unsigned n_element = Fluid_mesh_pt->nelement();
1141  for(unsigned e=0;e<n_element;e++)
1142  {
1143  // Upcast from GeneralisedElement to the present element
1144  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
1145 
1146  // Modify the tolerance for when the mapping is considered singular
1147  el_pt->Tolerance_for_singular_jacobian=1.0e-26;
1148 
1149  // Set the Reynolds number
1150  el_pt->re_pt() = &Problem_Parameter::Re;
1151 
1152  // Set the Womersley number
1153  el_pt->re_st_pt() = &Problem_Parameter::Re_St;
1154 
1155  // Set the body force
1156  el_pt->GeneralisedNewtonianNavierStokesEquations<2>::body_force_fct_pt() =
1158 
1159  // Set the product of Reynolds number and inverse Froude number
1160  el_pt->re_invfr_pt() = &Problem_Parameter::ReInvFr;
1161 
1162  // Set the constitutive law for pseudo-elastic mesh deformation
1163  el_pt->constitutive_law_pt()=Problem_Parameter::Constitutive_law_pt;
1164 
1165  // Assign Constitutive equation
1166  el_pt->constitutive_eqn_pt() = Problem_Parameter::Const_eqn_pt;
1167 
1168  // Use extrapolated strain rate when determining viscosity
1169  el_pt->use_extrapolated_strainrate_to_compute_second_invariant();
1170 
1171  } // end of functional elements
1172 
1173 
1174  // Setup extrapolation
1177 
1178 
1179  // Re-apply boundary values on Dirichlet boundary conditions
1180  // (Boundary conditions are ignored when the solution is transferred
1181  // from the old to the new mesh by projection; this leads to a slight
1182  // change in the boundary values (which are, of course, never changed,
1183  // unlike the actual unknowns for which the projected values only
1184  // serve as an initial guess)
1185 
1186  // Set velocity and history values of velocity on walls
1187  nbound=this->Fluid_mesh_pt->nboundary();
1188  for(unsigned ibound=0;ibound<nbound;++ibound)
1189  {
1190  if( (ibound==Shell_wall_boundary_id) ||
1191  (ibound==Symmetry_line_id) )
1192  {
1193  // Loop over nodes on this boundary
1194  unsigned num_nod=this->Fluid_mesh_pt->nboundary_node(ibound);
1195  for (unsigned inod=0;inod<num_nod;inod++)
1196  {
1197  // Get node
1198  Node* nod_pt=this->Fluid_mesh_pt->boundary_node_pt(ibound,inod);
1199 
1200  // Get number of previous (history) values
1201  unsigned n_prev=nod_pt->time_stepper_pt()->nprev_values();
1202 
1203  // Velocity is and was zero at all previous times
1204  for (unsigned t=0;t<=n_prev;t++)
1205  {
1206  if(ibound==Shell_wall_boundary_id)
1207  {
1208  nod_pt->set_value(t,1,0.0);
1209  nod_pt->set_value(t,0,0.0);
1210  }
1211  else
1212  {
1213  nod_pt->set_value(t,0,0.0);
1214  }
1215 
1216  // Move nodes on symmetry line exactly onto r=0 (for all times)
1217  if(ibound==Symmetry_line_id)
1218  {
1219  nod_pt->x(t,0)=0.0;
1220  }
1221  }
1222  }
1223  }
1224  }
1225 
1226 
1227  // Update pointer to central node
1228  oomph_info << "Updating central node" << std::endl;
1230  const unsigned n_boundary_node = Fluid_mesh_pt->
1231  nboundary_node(Free_surface_boundary_id);
1232  for(unsigned n=0;n<n_boundary_node;n++)
1233  {
1235  Node* nod_pt = Fluid_mesh_pt->boundary_node_pt(Free_surface_boundary_id,n);
1236 
1237  // Is this the one?
1238  if (nod_pt->is_on_boundary(Symmetry_line_id))
1239  {
1241  {
1242  oomph_info << "Odd -- more than one free surface node on sym line?\n";
1243  abort();
1244  }
1246  }
1247  }
1248 
1250  {
1251  oomph_info << "Odd -- not found the free surface node on sym line...\n";
1252  abort();
1253  }
1254  else
1255  {
1256  oomph_info << "Updated central node" << std::endl;
1257  oomph_info << "Central node now at: "
1258  << Central_node_on_free_surface_pt->x(0) << " "
1259  << Central_node_on_free_surface_pt->x(1) << " "
1260  << std::endl;
1261  }
1262 
1263 } // end of complete_problem_setup
void set_nprev_for_extrapolation_of_strain_rate_for_all_elements(const unsigned &nprev)
Definition: vibrating_shell_non_newtonian.cc:444
Node * Central_node_on_free_surface_pt
Pointer to free surface node on symmetry line.
Definition: vibrating_shell_non_newtonian.cc:658
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
Definition: nodes.h:1686
void pin_position(const unsigned &i)
Pin the nodal position.
Definition: nodes.h:1816
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
double ReInvFr
Product of Reynolds number and inverse of Froude number.
Definition: refineable_two_layer_interface.cc:303
double Re
Reynolds number.
Definition: jeffery_orbit.cc:59
void oscillation(const double &time, const Vector< double > &x, Vector< double > &force)
Function describing the oscillation.
Definition: axisym_vibrating_shell_non_newtonian.cc:106
unsigned Nprev_for_extrapolation_of_strain_rate
Definition: axisym_vibrating_shell_non_newtonian.cc:58
double Re_St
Reynolds multiplied Strouhal.
Definition: axisym_vibrating_shell_non_newtonian.cc:91
t
Definition: plotPSD.py:36

References oomph::Problem_Parameter::Const_eqn_pt, Problem_Parameter::Constitutive_law_pt, e(), oomph::Node::is_on_boundary(), n, oomph::Problem_Parameter::Nprev_for_extrapolation_of_strain_rate, oomph::TimeStepper::nprev_values(), oomph::Data::nvalue(), oomph::oomph_info, oomph::Problem_Parameter::oscillation(), oomph::Data::pin(), oomph::SolidNode::pin_position(), Problem_Parameter::Re, oomph::Problem_Parameter::Re_St, Problem_Parameter::ReInvFr, oomph::Data::set_value(), plotPSD::t, oomph::Data::time_stepper_pt(), and oomph::Node::x().

◆ compute_error_estimate()

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

Compute the error estimates and assign to elements for plotting.

Compute error estimates and assign to elements for plotting.

1645 {
1646  // Get error estimator
1647  ErrorEstimator* err_est_pt=Fluid_mesh_pt->spatial_error_estimator_pt();
1648 
1649  // Get/output error estimates
1650  unsigned nel=Fluid_mesh_pt->nelement();
1651  Vector<double> elemental_error(nel);
1652 
1653  // We need a dynamic cast, get_element_errors from the Fluid_mesh_pt
1654  // Dynamic cast is used because get_element_errors require a Mesh* ans
1655  // not a SolidMesh*
1656  Mesh* fluid_mesh_pt=dynamic_cast<Mesh*>(Fluid_mesh_pt);
1657  err_est_pt->get_element_errors(fluid_mesh_pt,
1658  elemental_error);
1659 
1660  // Set errors for post-processing and find extrema
1661  max_err=0.0;
1662  min_err=DBL_MAX;
1663  for (unsigned e=0;e<nel;e++)
1664  {
1665  dynamic_cast<MyTaylorHoodElement*>(Fluid_mesh_pt->element_pt(e))->
1666  set_error(elemental_error[e]);
1667 
1668  max_err=std::max(max_err,elemental_error[e]);
1669  min_err=std::min(min_err,elemental_error[e]);
1670  }
1671 
1672 }
Base class for spatial error estimators.
Definition: error_estimator.h:40
void get_element_errors(Mesh *&mesh_pt, Vector< double > &elemental_error)
Definition: error_estimator.h:56
Overload TaylorHood element to modify output.
Definition: pressure_driven_torus.cc:98
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
void set_error(const double &error)
Set error value for post-processing.
Definition: overloaded_element_body.h:432

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

◆ create_free_surface_elements()

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

Create free surface elements.

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

1272 {
1273  // How many bulk fluid elements are adjacent to boundary b?
1274  unsigned n_element =
1275  Fluid_mesh_pt->nboundary_element(Free_surface_boundary_id);
1276 
1277  // Loop over the bulk fluid elements adjacent to boundary b?
1278  for(unsigned e=0;e<n_element;e++)
1279  {
1280  // Get pointer to the bulk fluid element that is
1281  // adjacent to boundary b
1282  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
1283  Fluid_mesh_pt->boundary_element_pt(Free_surface_boundary_id,e));
1284 
1285  //Find the index of the face of element e along boundary b
1286  int face_index =
1287  Fluid_mesh_pt->face_index_at_boundary(Free_surface_boundary_id,e);
1288 
1289  // Create new element
1292  bulk_elem_pt,face_index);
1293 
1294  // Add it to the mesh
1296 
1297  //Add the appropriate boundary number
1299 
1300  //Specify the capillary number
1301  el_pt->ca_pt() = &Problem_Parameter::Ca;
1302 
1303  //Specify the Strouhal number
1304  el_pt->st_pt() = &Problem_Parameter::St;
1305 
1306  // Specify the bubble pressure (pointer to Data object and
1307  // index of value within that Data object that corresponds
1308  // to the traded pressure
1310 
1311  }
1312 
1313 } // end of create_free_surface_elements
Specialise the elastic update template class to concrete 1D case.
Definition: specific_node_update_interface_elements.h:1220
void set_boundary_number_in_bulk_mesh(const unsigned &b)
Set function for the boundary number in bulk mesh.
Definition: elements.h:4482
double *& ca_pt()
Pointer to the Capillary number.
Definition: interface_elements.h:492
double *& st_pt()
The pointer to the Strouhal number.
Definition: interface_elements.h:504
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
double St
Strouhal number.
Definition: jeffery_orbit.cc:62
double Ca
Capillary number.
Definition: refineable_two_layer_interface.cc:314

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

◆ delete_free_surface_elements()

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

Delete free surface elements.

669  {
670  // How many surface elements are in the surface mesh
671  unsigned n_element = Free_surface_mesh_pt->nelement();
672 
673  // Loop over the surface elements
674  for(unsigned e=0;e<n_element;e++)
675  {
676  // Kill surface element
678  }
679 
680  // Wipe the mesh
682 
683  } // 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().

◆ disable_aitken_extrapolation_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::disable_aitken_extrapolation_for_all_elements ( )
inline

Disable use of Aitken extrapolation.

433  {
434  unsigned n_element = Fluid_mesh_pt->nelement();
435  for(unsigned e=0;e<n_element;e++)
436  {
437  // Upcast from GeneralisedElement to the present element
438  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
439  el_pt->disable_aitken_extrapolation();
440  }
441  }

References e().

◆ disable_fixed_point_iteration_for_strain_rate_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::disable_fixed_point_iteration_for_strain_rate_for_all_elements ( )
inline

Disable use of fixed point iteration.

409  {
410  unsigned n_element = Fluid_mesh_pt->nelement();
411  for(unsigned e=0;e<n_element;e++)
412  {
413  // Upcast from GeneralisedElement to the present element
414  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
415  el_pt->disable_fixed_point_iteration_for_strain_rate();
416  }
417  }

References e().

◆ doc_solution()

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

Doc the solution.

1379 {
1380 
1381  ofstream some_file;
1382  char filename[1000];
1383 
1384  oomph_info << "Docing trace step: "
1385  << Problem_Parameter::Doc_info_trace.number() << std::endl;
1386 
1387  // Compute errors and assign to each element for plotting
1388  double max_err=0.0;
1389  double min_err=0.0;
1390  compute_error_estimate(max_err,min_err);
1391 
1392  // Write restart file
1394  ("--suppress_restart_files") &&
1396  ("--validation") )
1397  {
1398  sprintf(filename,"%s/restart%i.dat",
1399  Problem_Parameter::Doc_info_soln.directory().c_str(),
1401  ofstream dump_file;
1402  dump_file.open(filename);
1403  dump_file.precision(20);
1404  dump_it(dump_file);
1405  dump_file.close();
1406  }
1407 
1408  // Get body force
1409  Vector<double> body_force(2,0.0);
1410  Vector<double> x(2,0.0);
1412 
1413  // only output the actual solution when it's the right time
1414  // hierher if(this->time_pt()->time() >= double(Count_doc)*Dt_doc)
1415  {
1416  oomph_info << "Docing soln step: "
1417  << Problem_Parameter::Doc_info_soln.number() << std::endl;
1418 
1419  // Number of plot points
1420  unsigned npts=5;
1421 
1422 
1423  // Actual solution
1424  sprintf(filename,"%s/soln%i.dat",
1425  Problem_Parameter::Doc_info_soln.directory().c_str(),
1427  some_file.open(filename);
1428  some_file << dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(0))
1429  ->variable_identifier();
1430  this->Fluid_mesh_pt->output(some_file,npts);
1431  some_file.close();
1432 
1433 
1434  // Actual solution on the free surface
1435  sprintf(filename,"%s/free_surface_soln%i.dat",
1436  Problem_Parameter::Doc_info_soln.directory().c_str(),
1438  some_file.open(filename);
1439  unsigned nel=Free_surface_mesh_pt->nelement();
1440  for (unsigned e=0;e<nel;e++)
1441  {
1443  Free_surface_mesh_pt->element_pt(e))->output(some_file,npts);
1444  }
1445  some_file.close();
1446 
1447 
1448  // Output free surface
1449  sprintf(filename,"%s/free_surface%i.dat",
1450  Problem_Parameter::Doc_info_soln.directory().c_str(),
1452  some_file.open(filename);
1453  unsigned num_nod=Fluid_mesh_pt->nboundary_node(Free_surface_boundary_id);
1454  if (num_nod>0)
1455  {
1456  for (unsigned inod=0;inod<num_nod;inod++)
1457  {
1458  Fluid_mesh_pt->boundary_node_pt(Free_surface_boundary_id, inod)
1459  ->output(some_file);
1460  }
1461  }
1462  some_file.close();
1463 
1464 
1465  // Coarse solution (mesh)
1466  unsigned npts_coarse=2;
1467  sprintf(filename,"%s/coarse_soln%i.dat",
1468  Problem_Parameter::Doc_info_soln.directory().c_str(),
1470  some_file.open(filename);
1471  some_file << dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(0))
1472  ->variable_identifier();
1473  this->Fluid_mesh_pt->output(some_file,npts_coarse);
1474  some_file.close();
1475 
1476  // Doc body force
1477  sprintf(filename,"%s/body_force%i.dat",
1478  Problem_Parameter::Doc_info_soln.directory().c_str(),
1480  some_file.open(filename);
1481  some_file << "-0.5 0.0 0.0 "
1482  << body_force[0] << " "
1483  << body_force[1] << " "
1484  << std::endl;
1485  some_file.close();
1486 
1487 
1488  // Increment the doc_info number
1490 
1491  }
1492 
1493  // Assemble square of L2 norm
1494  double square_of_l2_norm=0.0;
1495  unsigned nel=Fluid_mesh_pt->nelement();
1496  for (unsigned e=0;e<nel;e++)
1497  {
1499  dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(e))->
1501  }
1502  Problem_Parameter::Norm_file << sqrt(square_of_l2_norm) << std::endl;
1503 
1504 
1505  // Output boundaries
1506  sprintf(filename,"%s/boundaries%i.dat",
1507  Problem_Parameter::Doc_info_soln.directory().c_str(),
1509  some_file.open(filename);
1510  this->Fluid_mesh_pt->output_boundaries(some_file);
1511  some_file.close();
1512 
1513  // Get max/min area
1514  double max_area=0.0;
1515  double min_area=0.0;
1516  Fluid_mesh_pt->max_and_min_element_size(max_area, min_area);
1517 
1518 
1519  // Compute current volume and error in extrapolation from fluid elements
1520  double current_vol=0.0;
1521  double norm_squared=0.0;
1522  double visc_norm_squared=0.0;
1523  double extrapolated_norm_squared=0.0;
1524  double error_norm_squared=0.0;
1525  double min_invariant=DBL_MAX;
1526  double max_invariant=-DBL_MAX;
1527  double min_viscosity=DBL_MAX;
1528  double max_viscosity=-DBL_MAX;
1529  for (unsigned e=0;e<nel;e++)
1530  {
1531  // Get element
1532  ELEMENT* el_pt=dynamic_cast<ELEMENT*>(
1533  Fluid_mesh_pt->element_pt(e));
1534 
1535  // Add to physical size (actual volume) -- not implemented
1536  //current_vol+=el_pt->compute_physical_size();
1537 
1538  // Check size (in computational coordinates
1539  double size=el_pt->size();
1540 
1541  // Get norms of invariant
1542  double el_norm_squared=0.0;
1543  double el_extrapolated_norm_squared=0.0;
1544  double el_error_norm_squared=0.0;
1545  double test_size=0.0;
1546  test_size=el_pt->square_of_norm_of_strain_invariant(
1547  el_norm_squared,
1548  el_extrapolated_norm_squared,
1549  el_error_norm_squared);
1550 
1551  if (std::fabs(test_size-size)>1.0e-10)
1552  {
1553  oomph_info << "Trouble: "
1554  << test_size << " "
1555  << size << std::endl;
1556  }
1557 
1558  // Get norms of viscosity
1559  double el_visc_norm_squared=0.0;
1560  double el_visc_extrapolated_norm_squared=0.0;
1561  double el_visc_error_norm_squared=0.0;
1562  el_pt->square_of_norm_of_viscosity(
1563  el_visc_norm_squared,
1564  el_visc_extrapolated_norm_squared,
1565  el_visc_error_norm_squared);
1566 
1567  // Add it...
1568  norm_squared+=el_norm_squared;
1569  visc_norm_squared+=el_visc_norm_squared;
1570  extrapolated_norm_squared+=el_extrapolated_norm_squared;
1571  error_norm_squared+=el_error_norm_squared;
1572 
1573  // Get viscosity extrema
1574  double el_min_invariant=0.0;
1575  double el_max_invariant=0.0;
1576  double el_min_viscosity=0.0;
1577  double el_max_viscosity=0.0;
1578  el_pt->max_and_min_invariant_and_viscosity(el_min_invariant,
1579  el_max_invariant,
1580  el_min_viscosity,
1581  el_max_viscosity);
1582 
1583  // Update overall extrema
1584  min_invariant=std::min(min_invariant,el_min_invariant);
1585  max_invariant=std::max(max_invariant,el_max_invariant);
1586  min_viscosity=std::min(min_viscosity,el_min_viscosity);
1587  max_viscosity=std::max(max_viscosity,el_max_viscosity);
1588  }
1589 
1590  oomph_info << "Norm of strain rate invariant: "
1591  << sqrt(norm_squared) << std::endl;
1592  oomph_info << "Norm of extrapolated strain rate invariant: "
1593  << sqrt(extrapolated_norm_squared) << std::endl;
1594  oomph_info << "Norm of error in extrapolated strain rate invariant: "
1595  << sqrt(error_norm_squared) << " equivalent to " ;
1596  if (sqrt(norm_squared)!=0.0)
1597  {
1598  oomph_info << sqrt(error_norm_squared)/sqrt(norm_squared)*100.0 << " %";
1599  }
1600  oomph_info << std::endl;
1601 
1602 
1603  oomph_info << "min_invariant = " << min_invariant << "\n"
1604  << "max_invariant = " << max_invariant << "\n"
1605  << "min_viscosity = " << min_viscosity << "\n"
1606  << "max_viscosity = " << max_viscosity
1607  << std::endl;
1608 
1609  // Write trace file
1611  << this->time_pt()->time() << " " // 1
1612  << Central_node_on_free_surface_pt->x(1) << " " // 2
1613  << body_force[1] << " " // 3
1614  << current_vol << " " // 4
1615  << Fluid_mesh_pt->nelement() << " " // 5
1616  << max_area << " " // 6
1617  << min_area << " " // 7
1618  << max_err << " " // spatial error 8
1619  << min_err << " " // spatial error 9
1620  << sqrt(norm_squared) << " " // strain invariant 10
1621  << sqrt(extrapolated_norm_squared) << " " // strain invariant 11
1622  << sqrt(error_norm_squared) << " " // strain invariant 12
1623  << min_invariant << " " // 13
1624  << max_invariant << " " // 14
1625  << min_viscosity << " " // 15
1626  << max_viscosity << " " // 16
1627  << max_viscosity << " " // 17
1628  << this->time_pt()->dt() << " " // 18
1629  << global_temporal_error_norm() << " " // temporal error measure 19
1630  << Problem_Parameter::Doc_info_trace.number() << " " // 20
1631  << std::endl;
1632 
1633  // Increment the doc_info number
1635 
1636 } // end_of_doc_full_solution
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
void dump_it(ofstream &dump_file)
Dump problem data to allow for later restart.
Definition: vibrating_shell_non_newtonian.cc:558
double global_temporal_error_norm()
Error norm to determine the next time step.
Definition: vibrating_shell_non_newtonian.cc:1320
void compute_error_estimate(double &max_err, double &min_err)
Compute the error estimates and assign to elements for plotting.
Definition: vibrating_shell_non_newtonian.cc:1644
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
double & dt(const unsigned &t=0)
Definition: timesteppers.h:136
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
void body_force(const double &time, const Vector< double > &x, Vector< double > &result)
Definition: axisym_linear_elasticity/cylinder/cylinder.cc:96
string filename
Definition: MergeRestartFiles.py:39
ofstream Norm_file
Definition: refineable_two_layer_interface.cc:341
ofstream Trace_file
Trace file.
Definition: refineable_two_layer_interface.cc:335
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
DocInfo Doc_info_soln
Doc info solutions.
Definition: axisym_vibrating_shell_non_newtonian.cc:73
DocInfo Doc_info_trace
Doc info trace file.
Definition: axisym_vibrating_shell_non_newtonian.cc:70
list x
Definition: plotDoE.py:28
void output(std::ostream &outfile, const unsigned &nplot)
Overload output function.
Definition: overloaded_element_body.h:490
double square_of_l2_norm()
Get square of L2 norm of velocity.
Definition: overloaded_element_body.h:1031

References Global_Parameters::body_force(), oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::Problem_Parameter::Doc_info_soln, oomph::Problem_Parameter::Doc_info_trace, e(), boost::multiprecision::fabs(), MergeRestartFiles::filename, max, min, Problem_Parameter::Norm_file, oomph::DocInfo::number(), oomph::oomph_info, oomph::Problem_Parameter::oscillation(), output(), size, sqrt(), square_of_l2_norm(), Problem_Parameter::Trace_file, and plotDoE::x.

◆ dump_it()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::dump_it ( ofstream &  dump_file)
inline

Dump problem data to allow for later restart.

559  {
560 
561  // Write doc numbers
563  << " # current doc number for trace" << std::endl;
565  << " # current doc number for soln" << std::endl;
566 
567  // Next timestep (required for restart from temporally adaptive
568  // run
569  dump_file << Next_dt << " # next timestep " << std::endl;
570 
571  // Dump the refinement pattern and the generic problem data
572  Problem::dump(dump_file);
573  }
double Next_dt
Definition: vibrating_shell_non_newtonian.cc:662

References oomph::Problem_Parameter::Doc_info_soln, oomph::Problem_Parameter::Doc_info_trace, and oomph::DocInfo::number().

◆ enable_aitken_extrapolation_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::enable_aitken_extrapolation_for_all_elements ( )
inline

Enable use of Aitken extrapolation for all elements.

421  {
422  unsigned n_element = Fluid_mesh_pt->nelement();
423  for(unsigned e=0;e<n_element;e++)
424  {
425  // Upcast from GeneralisedElement to the present element
426  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
427  el_pt->enable_aitken_extrapolation();
428  }
429  }

References e().

◆ enable_fixed_point_iteration_for_strain_rate_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::enable_fixed_point_iteration_for_strain_rate_for_all_elements ( )
inline

Enable use of fixed point iteration for all elements

397  {
398  unsigned n_element = Fluid_mesh_pt->nelement();
399  for(unsigned e=0;e<n_element;e++)
400  {
401  // Upcast from GeneralisedElement to the present element
402  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
403  el_pt->enable_fixed_point_iteration_for_strain_rate();
404  }
405  }

References e().

◆ global_temporal_error_norm()

template<class ELEMENT >
double VibratingShellProblem< ELEMENT >::global_temporal_error_norm
virtual

Error norm to determine the next time step.

Calculate the global temporal error norm.

Reimplemented from oomph::Problem.

1321 {
1322 
1323  //oomph_info << "hierher bypassed global temporal error norm\n";
1324  //return 0.0;
1325 
1326  // Initialise
1327  double global_error = 0.0;
1328 
1329  //Find out how many nodes there are in the problem
1330  const unsigned n_node = Fluid_mesh_pt->nnode();
1331 
1332 
1333  oomph_info << "in here with node = " << n_node << std::endl;
1334 
1335  //Loop over the nodes and calculate the errors in the positions
1336  for(unsigned n=0;n<n_node;n++)
1337  {
1338  //Find number of dimensions of the node
1339  const unsigned n_dim = Fluid_mesh_pt->node_pt(n)->ndim();
1340  //Set the position error to zero
1341  double node_position_error = 0.0;
1342  //Loop over the dimensions
1343  for(unsigned i=0;i<n_dim;i++)
1344  {
1345  //Get position error
1346  double error =
1347  Fluid_mesh_pt->node_pt(n)->position_time_stepper_pt()->
1348  temporal_error_in_position(Fluid_mesh_pt->node_pt(n),i);
1349 
1350  //Add the square of the individual error to the position error
1351  node_position_error += error*error;
1352  }
1353 
1354  //Divide the position error by the number of dimensions
1355  node_position_error /= n_dim;
1356 
1357  //Now add to the global error
1358  global_error += node_position_error;
1359  }
1360 
1361  //Now the global error must be divided by the number of nodes
1362  global_error /= n_node;
1363 
1364  oomph_info << "done global error = " << global_error << std::endl;
1365 
1366  //Return the square root of the errr
1367  return sqrt(global_error);
1368 
1369 
1370 }
int error
Definition: calibrate.py:297

References calibrate::error, i, n, oomph::oomph_info, and sqrt().

◆ height_central_node()

template<class ELEMENT >
double VibratingShellProblem< ELEMENT >::height_central_node ( )
inline

Get the height at the centre node.

378  {
380  }

◆ next_dt()

template<class ELEMENT >
double& VibratingShellProblem< ELEMENT >::next_dt ( )
inline

Access the next suggested timestep.

374 {return Next_dt;}

◆ restart()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::restart ( )
inline

Restart.

578  {
579  // Pointer to restart file
580  ifstream* restart_file_pt=0;
581 
582  // Open restart file from stem
583  restart_file_pt=new ifstream(Problem_Parameter::Restart_file.c_str(),
584  ios_base::in);
585  if (restart_file_pt!=0)
586  {
587  oomph_info << "Have opened "
589  << " for restart. " << std::endl;
590  }
591  else
592  {
593  std::ostringstream error_stream;
594  error_stream
595  << "ERROR while trying to open "
597  << " for restart." << std::endl;
598 
599  throw OomphLibError(
600  error_stream.str(),
601  "restart()",
603  }
604 
605 
606  // Read restart data:
607  //-------------------
608  if (restart_file_pt!=0)
609  {
610 
611  // Doc number for trace
612  //---------------------
613  // Read line up to termination sign
614  string input_string;
615  getline(*restart_file_pt,input_string,'#');
616 
617  // Ignore rest of line
618  restart_file_pt->ignore(80,'\n');
619 
620  // Doc number
621  Problem_Parameter::Doc_info_trace.number()=unsigned(atoi(input_string.c_str()));
622 
623 
624  // Doc number for solution
625  //---------------------
626  // Read line up to termination sign
627  getline(*restart_file_pt,input_string,'#');
628 
629  // Ignore rest of line
630  restart_file_pt->ignore(80,'\n');
631 
632  // Doc number
633  Problem_Parameter::Doc_info_soln.number()=unsigned(atoi(input_string.c_str()));
634 
635 
636  // Next timestep (required for restart from temporally adaptive run
637  //-----------------------------------------------------------------
638 
639  // Read line up to termination sign
640  getline(*restart_file_pt,input_string,'#');
641 
642  // Ignore rest of line
643  restart_file_pt->ignore(80,'\n');
644 
645  // Next timestep
646  Next_dt=double(atof(input_string.c_str()));
647 
648 
649  // Refine the mesh and read in the generic problem data
650  Problem::read(*restart_file_pt);
651  }
652  }
Definition: oomph_definitions.h:222
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< PacketLoad, PacketType > read(const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &ld)
read, a template function used for loading the data from global memory. This function is used to guar...
Definition: TensorContractionSycl.h:162
std::string Restart_file
Name of restart file.
Definition: axisym_vibrating_shell_non_newtonian.cc:67
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61

References oomph::Problem_Parameter::Doc_info_soln, oomph::Problem_Parameter::Doc_info_trace, oomph::DocInfo::number(), OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, Eigen::TensorSycl::internal::read(), and oomph::Problem_Parameter::Restart_file.

◆ set_nprev_for_extrapolation_of_strain_rate_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::set_nprev_for_extrapolation_of_strain_rate_for_all_elements ( const unsigned nprev)
inline
446  {
447  unsigned n_element = Fluid_mesh_pt->nelement();
448  for(unsigned e=0;e<n_element;e++)
449  {
450  // Upcast from GeneralisedElement to the present element
451  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
452 
453  // Use extrapolated strain rate when determining viscosity?
455  ("--use_current_strainrate_for_viscosity"))
456  {
457  el_pt->use_extrapolated_strainrate_to_compute_second_invariant();
458 
459  // Set extrapolation order
460  el_pt->nprev_for_extrapolation_of_strain_rate()=nprev;
461  }
462  else
463  {
464  el_pt->use_current_strainrate_to_compute_second_invariant();
465  }
466  }
467  }

References oomph::CommandLineArgs::command_line_flag_has_been_set(), and e().

◆ strainrate_norm()

template<class ELEMENT >
double VibratingShellProblem< ELEMENT >::strainrate_norm ( )
inline
526  {
527  // Compute current volume and error in extrapolation from fluid elements
528  double norm_squared=0.0;
529  double extrapolated_norm_squared=0.0;
530  double error_norm_squared=0.0;
531  unsigned nel=Fluid_mesh_pt->nelement();
532  for (unsigned e=0;e<nel;e++)
533  {
534  // Get element
535  ELEMENT* el_pt=dynamic_cast<ELEMENT*>(
536  Fluid_mesh_pt->element_pt(e));
537 
538  // Get norms of invariant
539  double el_norm_squared=0.0;
540  double el_extrapolated_norm_squared=0.0;
541  double el_error_norm_squared=0.0;
542  double test_size=0.0;
543  test_size=el_pt->square_of_norm_of_strain_invariant(
544  el_norm_squared,
545  el_extrapolated_norm_squared,
546  el_error_norm_squared);
547 
548  // Add it...
549  norm_squared+=el_norm_squared;
550  extrapolated_norm_squared+=el_extrapolated_norm_squared;
551  error_norm_squared+=el_error_norm_squared;
552  }
553 
554  return sqrt(norm_squared);
555  }

References e(), and sqrt().

◆ update_latest_fixed_point_iteration_guess_for_strain_rate_for_all_elements()

template<class ELEMENT >
void VibratingShellProblem< ELEMENT >::update_latest_fixed_point_iteration_guess_for_strain_rate_for_all_elements ( )
inline

Update latest guess for strain rate.

384  {
385  unsigned n_element = Fluid_mesh_pt->nelement();
386  for(unsigned e=0;e<n_element;e++)
387  {
388  // Upcast from GeneralisedElement to the present element
389  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
390  el_pt->update_latest_fixed_point_iteration_guess_for_strain_rate();
391  }
392  }

References e().

Member Data Documentation

◆ Central_node_on_free_surface_pt

template<class ELEMENT >
Node* VibratingShellProblem< ELEMENT >::Central_node_on_free_surface_pt
private

Pointer to free surface node on symmetry line.

◆ External_pressure_data_pt

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

Pointer to a global external pressure datum.

◆ Fluid_mesh_pt

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

Pointer to Fluid_mesh.

◆ Free_surface_mesh_pt

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

Pointers to mesh of free surface elements.

◆ Internal_open_boundary_pt

template<class ELEMENT >
Vector<TriangleMeshOpenCurve* > VibratingShellProblem< ELEMENT >::Internal_open_boundary_pt
private

◆ Next_dt

template<class ELEMENT >
double VibratingShellProblem< ELEMENT >::Next_dt
private

Suggestion for the next timestep (allows it to be written to or read from a restart file)

◆ Outer_boundary_polyline_pt

template<class ELEMENT >
TriangleMeshClosedCurve* VibratingShellProblem< ELEMENT >::Outer_boundary_polyline_pt
private

Triangle mesh polygon for outer boundary.

◆ Pext

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

External pressure.


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