UnstructuredTorusProblem< ELEMENT > Class Template Reference

Solve the Axisymmetric Navier Stokes equations in a torus. More...

+ Inheritance diagram for UnstructuredTorusProblem< ELEMENT >:

Public Member Functions

 UnstructuredTorusProblem (const double &min_error_target, const double &max_error_target)
 
double calculate_square_of_l2_norm ()
 Calculate the square of the l2 norm. More...
 
double calculate_area ()
 Calculate the cross-sectional area of the domain. More...
 
void set_initial_condition ()
 Set the initial conditions: all nodes have zero velocity. More...
 
void set_boundary_conditions (const double &time)
 Set boundary conditions on the walls. More...
 
void solve_system (const double &dt, const unsigned &nstep, const std::string &directory)
 Function that is used to run the parameter study. More...
 
void actions_before_implicit_timestep ()
 Update the problem specs before next timestep: More...
 
void actions_before_adapt ()
 
void actions_after_adapt ()
 
void create_lagrange_multiplier_elements ()
 
void delete_lagrange_multiplier_elements ()
 
 UnstructuredTorusProblem (const double &min_error_target, const double &max_error_target)
 
double calculate_square_of_l2_norm ()
 Calculate the square of the l2 norm. More...
 
double calculate_area ()
 Calculate the cross-sectional area of the domain. More...
 
void set_initial_condition ()
 Set the initial conditions: all nodes have zero velocity. More...
 
void set_boundary_conditions (const double &time)
 Set boundary conditions on the walls. More...
 
void solve_system (const double &dt, const unsigned &nstep, const std::string &directory)
 Function that is used to run the parameter study. More...
 
RefineableTriangleMesh< ELEMENT > * mesh_pt ()
 Return a pointer to the specific mesh used. More...
 
void actions_before_implicit_timestep ()
 Update the problem specs before next timestep: More...
 
void actions_after_adapt ()
 
- 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 ()
 

Public Attributes

Vector< BackupMeshForProjection< TElement< 1, 3 > > * > Backed_up_surface_mesh_pt
 Pointer to the Backedup Surface mesh. More...
 
Vector< SolidMesh * > Lagrange_multiplier_mesh_pt
 Pointers to mesh of Lagrange multiplier elements. More...
 
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
 Pointer to Fluid_mesh. More...
 
- 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_solve ()
 
virtual void actions_after_newton_solve ()
 
virtual void actions_before_newton_convergence_check ()
 
virtual void actions_before_newton_step ()
 
virtual void actions_after_newton_step ()
 
virtual void actions_after_implicit_timestep ()
 
virtual void actions_after_implicit_timestep_and_error_estimation ()
 
virtual void actions_before_explicit_timestep ()
 Actions that should be performed before each explicit time step. More...
 
virtual void actions_after_explicit_timestep ()
 Actions that should be performed after each explicit time step. More...
 
virtual void actions_before_read_unstructured_meshes ()
 
virtual void actions_after_read_unstructured_meshes ()
 
virtual void actions_after_change_in_global_parameter (double *const &parameter_pt)
 
virtual void actions_after_change_in_bifurcation_parameter ()
 
virtual void actions_after_parameter_increase (double *const &parameter_pt)
 
doubledof_derivative (const unsigned &i)
 
doubledof_current (const unsigned &i)
 
virtual double global_temporal_error_norm ()
 
unsigned newton_solve_continuation (double *const &parameter_pt)
 
unsigned newton_solve_continuation (double *const &parameter_pt, DoubleVector &z)
 
void calculate_continuation_derivatives (double *const &parameter_pt)
 
void calculate_continuation_derivatives (const DoubleVector &z)
 
void calculate_continuation_derivatives_fd (double *const &parameter_pt)
 
bool does_pointer_correspond_to_problem_data (double *const &parameter_pt)
 
void set_consistent_pinned_values_for_continuation ()
 
- Protected Attributes inherited from oomph::Problem
Vector< Problem * > Copy_of_problem_pt
 
std::map< double *, boolCalculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistributionDof_distribution_pt
 
Vector< double * > Dof_pt
 Vector of pointers to dofs. More...
 
DoubleVectorWithHaloEntries Element_count_per_dof
 
double Relaxation_factor
 
double Newton_solver_tolerance
 
unsigned Max_newton_iterations
 Maximum number of Newton iterations. More...
 
unsigned Nnewton_iter_taken
 
Vector< doubleMax_res
 Maximum residuals at start and after each newton iteration. More...
 
double Max_residuals
 
bool Time_adaptive_newton_crash_on_solve_fail
 
bool Jacobian_reuse_is_enabled
 Is re-use of Jacobian in Newton iteration enabled? Default: false. More...
 
bool Jacobian_has_been_computed
 
bool Problem_is_nonlinear
 
bool Pause_at_end_of_sparse_assembly
 
bool Doc_time_in_distribute
 
unsigned Sparse_assembly_method
 
unsigned Sparse_assemble_with_arrays_initial_allocation
 
unsigned Sparse_assemble_with_arrays_allocation_increment
 
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
 
double Numerical_zero_for_sparse_assembly
 
double FD_step_used_in_get_hessian_vector_products
 
bool Mass_matrix_reuse_is_enabled
 
bool Mass_matrix_has_been_computed
 
bool Discontinuous_element_formulation
 
double Minimum_dt
 Minimum desired dt: if dt falls below this value, exit. More...
 
double Maximum_dt
 Maximum desired dt. More...
 
double DTSF_max_increase
 
double DTSF_min_decrease
 
double Minimum_dt_but_still_proceed
 
bool Scale_arc_length
 Boolean to control whether arc-length should be scaled. More...
 
double Desired_proportion_of_arc_length
 Proportion of the arc-length to taken by the parameter. More...
 
double Theta_squared
 
int Sign_of_jacobian
 Storage for the sign of the global Jacobian. More...
 
double Continuation_direction
 
double Parameter_derivative
 Storage for the derivative of the global parameter wrt arc-length. More...
 
double Parameter_current
 Storage for the present value of the global parameter. More...
 
bool Use_continuation_timestepper
 Boolean to control original or new storage of dof stuff. More...
 
unsigned Dof_derivative_offset
 
unsigned Dof_current_offset
 
Vector< doubleDof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< doubleDof_current
 Storage for the present values of the variables. More...
 
double Ds_current
 Storage for the current step value. More...
 
unsigned Desired_newton_iterations_ds
 
double Minimum_ds
 Minimum desired value of arc-length. More...
 
bool Bifurcation_detection
 Boolean to control bifurcation detection via determinant of Jacobian. More...
 
bool Bisect_to_find_bifurcation
 Boolean to control wheter bisection is used to located bifurcation. More...
 
bool First_jacobian_sign_change
 Boolean to indicate whether a sign change has occured in the Jacobian. More...
 
bool Arc_length_step_taken
 Boolean to indicate whether an arc-length step has been taken. More...
 
bool Use_finite_differences_for_continuation_derivatives
 
OomphCommunicatorCommunicator_pt
 The communicator for this problem. More...
 
bool Always_take_one_newton_step
 
double Timestep_reduction_factor_after_nonconvergence
 
bool Keep_temporal_error_below_tolerance
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

template<class ELEMENT>
class UnstructuredTorusProblem< ELEMENT >

Solve the Axisymmetric Navier Stokes equations in a torus.

Constructor & Destructor Documentation

◆ UnstructuredTorusProblem() [1/2]

template<class ELEMENT >
UnstructuredTorusProblem< ELEMENT >::UnstructuredTorusProblem ( const double min_error_target,
const double max_error_target 
)

Constructor taking the maximum refinement level and the minimum and maximum error targets.

Constructor: specify the maximum refinement level, the minimum and maximum error targets

624 {
626 
627  Max_residuals = 1e10;
628 
629  using namespace Global_Physical_Variables;
630 
631  //Create a timestepper
633 
634  //Create the domain for the mesh, which consists of a circle of
635  //radius Radius and centred at y=0
636  GeomObject* area_pt = new GeneralCircle(0.0,Radius);
637 
638  // No holes
639  Vector<TriangleMeshClosedCurve*> Inner_hole_pt;
640 
641  //Now create the mesh
642  double uniform_element_area = 0.2;
643 
644  // Build the two parts of the curvilinear boundary
645  Vector<TriangleMeshCurveSection*> curvilinear_boundary_pt(2);
646 
647  double zeta_start=0.0;
648  double zeta_end=MathematicalConstants::Pi;
649  unsigned nsegment=8;
650  unsigned boundary_id=0;
651  curvilinear_boundary_pt[0]=new TriangleMeshCurviLine(
652  area_pt,zeta_start,zeta_end,
653  nsegment,boundary_id);
654 
655  zeta_start=-MathematicalConstants::Pi;
656  zeta_end=0.0; //2.0*MathematicalConstants::Pi;
657  nsegment=8;
658  boundary_id=1;
659  curvilinear_boundary_pt[1]=new TriangleMeshCurviLine(
660  area_pt,zeta_start,zeta_end,
661  nsegment,boundary_id);
662 
663  // Combine to hole
664  Vector<double> hole_coords(2);
665  hole_coords[0]=0.0;
666  hole_coords[1]=0.0;
667  TriangleMeshClosedCurve* curvilinear_outer_boundary_pt=
668  new TriangleMeshClosedCurve(curvilinear_boundary_pt);
669 
670  // Use the TriangleMeshParameters object for gathering all
671  // the necessary arguments for the TriangleMesh object
672  TriangleMeshParameters triangle_mesh_parameters(
673  curvilinear_outer_boundary_pt);
674 
675  // Take the holes into the TriangleMeshParameters object
676  triangle_mesh_parameters.internal_closed_curve_pt() =
677  Inner_hole_pt;
678 
679  // Take the maximum element area
680  triangle_mesh_parameters.element_area() =
681  uniform_element_area;
682 
683  // Create the mesh
684  this->Fluid_mesh_pt = new RefineableSolidTriangleMesh<ELEMENT>(
685  triangle_mesh_parameters, this->time_stepper_pt());
686 
687  // Set error estimator
689  Fluid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
690 
691  // Error targets for adaptive refinement
692  Fluid_mesh_pt->max_permitted_error() = max_error_target;
693  Fluid_mesh_pt->min_permitted_error() = min_error_target;
694 
695  //Loop over all the (fluid) elements
696  unsigned n_element = Fluid_mesh_pt->nelement();
697  for(unsigned e=0;e<n_element;e++)
698  {
699  //Cast to the particular element type, this is necessary because
700  //the base elements don't have the member functions that we're about
701  //to call!
702  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
703 
704  //There is no need for ALE
705  el_pt->disable_ALE();
706 
707  //Set the Reynolds number for each element
708  //(yes we could have different Reynolds number in each element!!)
709  el_pt->re_pt() = &Re;
710  //Set the product of Reynolds and Strouhal numbers
711  el_pt->re_st_pt() = &Re;
712  //Set the body force
713  el_pt->axi_nst_body_force_fct_pt() = &Global_Physical_Variables::
715  // Set the constitutive law for pseudo-elastic mesh deformation
716  el_pt->constitutive_law_pt()=
718  // Set the "density" for pseudo-elastic mesh deformation
719  el_pt->lambda_sq_pt()=&Global_Physical_Variables::Lambda_sq;
720  }
721 
722  //Let this problem be conventional form by setting gamma to zero
723  ELEMENT::Gamma[0] = 0.0; //r-momentum
724  ELEMENT::Gamma[1] = 0.0; //z-momentum
725 
726 
727 
728  //Set the boundary conditions (no slip on the torus walls)
729  //Loop over the nodes on the (only) mesh boundary
730  const unsigned n_boundary = Fluid_mesh_pt->nboundary();
731  //Pin the boundary nodes
732  for(unsigned b=0;b<n_boundary;b++)
733  {
734  unsigned n_boundary_node = Fluid_mesh_pt->nboundary_node(b);
735  for(unsigned n=0;n<n_boundary_node;++n)
736  {
737  //Repin all the nodes
738  for(unsigned i=0;i<3;i++)
739  {Fluid_mesh_pt->boundary_node_pt(b,n)->pin(i);}
740  }
741  }
742 
743  //Pin a single pressure value
744  dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(0))->fix_pressure(0,0.0);
745 
746  // Create Lagrange multiplier mesh for boundary motion
747  //----------------------------------------------------
748  // Construct the mesh of elements that enforce prescribed boundary motion
749  // of pseudo-solid fluid mesh by Lagrange multipliers
750  Backed_up_surface_mesh_pt.resize(n_boundary);
751  Lagrange_multiplier_mesh_pt.resize(n_boundary);
752  for(unsigned b=0;b<n_boundary;++b)
753  {
755  }
757 
758  // Combine meshes
759  //---------------
760 
761  // Add Fluid_mesh_pt sub meshes
763 
764  // Add Lagrange_multiplier sub meshes
765  for(unsigned b=0;b<n_boundary;++b)
766  {
768  }
769 
770  // Build global mesh
771  this->build_global_mesh();
772 
773  // Setup equation numbering scheme
774  cout <<"Number of equations: " << this->assign_eqn_numbers() << std::endl;
775  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Scalar * b
Definition: benchVecAdd.cpp:17
Vector< SolidMesh * > Lagrange_multiplier_mesh_pt
Pointers to mesh of Lagrange multiplier elements.
Definition: pressure_driven_torus.cc:502
void create_lagrange_multiplier_elements()
Definition: pressure_driven_torus.cc:512
Vector< BackupMeshForProjection< TElement< 1, 3 > > * > Backed_up_surface_mesh_pt
Pointer to the Backedup Surface mesh.
Definition: pressure_driven_torus.cc:499
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
Pointer to Fluid_mesh.
Definition: pressure_driven_torus.cc:505
Definition: circle.h:96
Definition: geom_objects.h:101
void add_time_stepper_pt(TimeStepper *const &time_stepper_pt)
Definition: problem.cc:1545
unsigned add_sub_mesh(Mesh *const &mesh_pt)
Definition: problem.h:1330
void build_global_mesh()
Definition: problem.cc:1493
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
bool Use_continuation_timestepper
Boolean to control original or new storage of dof stuff.
Definition: problem.h:758
Definition: mesh.h:2562
Base class defining a closed curve for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1339
Definition: unstructured_two_d_mesh_geometry_base.h:662
Definition: triangle_mesh.template.h:94
Definition: oomph-lib/src/generic/Vector.h:58
Definition: error_estimator.h:266
double Pi
Definition: two_d_biharmonic.cc:235
double Re
Reynolds number.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:61
double Gamma
Aspect ratio (cylinder height / cylinder radius)
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:70
Global variables.
Definition: TwenteMeshGluing.cpp:60
double Radius
Radius of the pipe.
Definition: pipe.cc:55
void axial_pressure_gradient(const double &time, const Vector< double > &x, Vector< double > &result)
A function to specify a constant axial body force.
Definition: pressure_driven_torus.cc:74
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: TwenteMeshGluing.cpp:65
double Lambda_sq
Pseudo-solid mass density.
Definition: pressure_driven_torus.cc:62
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190

References Global_Physical_Variables::axial_pressure_gradient(), b, Global_Physical_Variables::Constitutive_law_pt, e(), oomph::TriangleMeshParameters::element_area(), MeshRefinement::error_estimator_pt, GlobalPhysicalVariables::Gamma, i, oomph::TriangleMeshParameters::internal_closed_curve_pt(), Global_Physical_Variables::Lambda_sq, n, BiharmonicTestFunctions2::Pi, Global_Physical_Variables::Radius, and GlobalPhysicalVariables::Re.

◆ UnstructuredTorusProblem() [2/2]

template<class ELEMENT >
UnstructuredTorusProblem< ELEMENT >::UnstructuredTorusProblem ( const double min_error_target,
const double max_error_target 
)

Constructor taking the maximum refinement level and the minimum and maximum error targets.

Member Function Documentation

◆ actions_after_adapt() [1/2]

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

After adaptation: Pin pressure again (the previously pinned value might have disappeared) and pin redudant pressure dofs.

Reimplemented from oomph::Problem.

417  {
418  using namespace Global_Physical_Variables;
419  //Reset the lagrangian coordinates for the solid mechanics
420  //an updated lagrangian approach
421  //Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
422 
423  // Create the elements that impose the displacement constraint
425 
426  //Now to the projection
427  const unsigned n_boundary = this->Fluid_mesh_pt->nboundary();
428  for(unsigned b=0;b<n_boundary;++b)
429  {
431  project_onto_new_mesh(this->Lagrange_multiplier_mesh_pt[b]);
432  }
433 
434  this->rebuild_global_mesh();
435 
436  //Loop over all the (fluid) elements
437  unsigned n_element = Fluid_mesh_pt->nelement();
438  for(unsigned e=0;e<n_element;e++)
439  {
440  //Cast to the particular element type, this is necessary because
441  //the base elements don't have the member functions that we're about
442  //to call!
443  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
444 
445  //There is no need for ALE
446  el_pt->disable_ALE();
447 
448  //Set the Reynolds number for each element
449  //(yes we could have different Reynolds number in each element!!)
450  el_pt->re_pt() = &Global_Physical_Variables::Re;
451  //Set the product of Reynolds and Strouhal numbers
452  el_pt->re_st_pt() = &Global_Physical_Variables::Re;
453  //Set the body force
454  el_pt->axi_nst_body_force_fct_pt() = &Global_Physical_Variables::
456  // Set the constitutive law for pseudo-elastic mesh deformation
457  el_pt->constitutive_law_pt()=
459  // Set the "density" for pseudo-elastic mesh deformation
460  el_pt->lambda_sq_pt()=&Global_Physical_Variables::Lambda_sq;
461  }
462 
463  //Repin the boundary nodes
464  for(unsigned b=0;b<n_boundary;b++)
465  {
466  unsigned n_boundary_node = Fluid_mesh_pt->nboundary_node(b);
467  for(unsigned n=0;n<n_boundary_node;++n)
468  {
469  Node* nod_pt= Fluid_mesh_pt->boundary_node_pt(b,n);
470  //Repin all the nodes
471  for(unsigned i=0;i<3;i++)
472  {nod_pt->pin(i);}
473  }
474  }
475 
476  //Set the boundary conditions
477  this->set_boundary_conditions(this->time());
478 
479  //Pin a single pressure value
480  dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(0))->fix_pressure(0,0.0);
481 
482  //Kill the backed up mesh
483  for(unsigned b=0;b<n_boundary;++b)
484  {
487  }
488 
489  //Dump the output
490  /*char filename[100];
491  sprintf(filename,"./post_adapt_%g_%g_%g.dat", Re, Delta,Mu);
492  std::ofstream out_file(filename);
493  Fluid_mesh_pt->output(out_file,5);
494  out_file.close();*/
495  }
void set_boundary_conditions(const double &time)
Set boundary conditions on the walls.
Definition: pressure_driven_torus.cc:782
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
Definition: nodes.h:906
void rebuild_global_mesh()
Definition: problem.cc:1533
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
double Re
Reynolds number.
Definition: fibre.cc:55

References Global_Physical_Variables::axial_pressure_gradient(), b, Global_Physical_Variables::Constitutive_law_pt, e(), i, Global_Physical_Variables::Lambda_sq, n, oomph::Data::pin(), and Global_Physical_Variables::Re.

◆ actions_after_adapt() [2/2]

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

After adaptation: Pin pressure again (the previously pinned value might have disappeared) and pin redudant pressure dofs.

Reimplemented from oomph::Problem.

291  {
292  //Loop over all the (fluid) elements
293  unsigned n_element = mesh_pt()->nelement();
294  for(unsigned e=0;e<n_element;e++)
295  {
296  //Cast to the particular element type, this is necessary because
297  //the base elements don't have the member functions that we're about
298  //to call!
299  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
300 
301  //There is no need for ALE
302  el_pt->disable_ALE();
303 
304  //Set the Reynolds number for each element
305  //(yes we could have different Reynolds number in each element!!)
306  el_pt->re_pt() = &Global_Physical_Variables::Re;
307  //Set the product of Reynolds and Strouhal numbers
308  el_pt->re_st_pt() = &Global_Physical_Variables::Re;
309  }
310 
311  const unsigned n_boundary = mesh_pt()->nboundary();
312  //Repin the boundary nodes
313  for(unsigned b=0;b<n_boundary;b++)
314  {
315  unsigned n_boundary_node = mesh_pt()->nboundary_node(b);
316  Vector<double> new_x(2);
317  Vector<double> b_coord(1);
318  bool geom_object=false;
319  if(this->mesh_pt()->boundary_geom_object_pt(b)!=0)
320  {geom_object=true;}
321  for(unsigned n=0;n<n_boundary_node;++n)
322  {
323  //Now move the boundary nodes exactly onto the geometric object
324  Node* const nod_pt = this->mesh_pt()->boundary_node_pt(b,n);
325  if(geom_object)
326  {
327  nod_pt->get_coordinates_on_boundary(b,b_coord);
328  //Let's find boundary coordinates of the new node
329  this->mesh_pt()->boundary_geom_object_pt(b)->position(b_coord,new_x);
330  //Snap to the boundary
331  for(unsigned i=0;i<2;i++)
332  {
333  nod_pt->x(i) = new_x[i];
334  }
335  }
336  //Repin all the nodes
337  for(unsigned i=0;i<3;i++)
338  {nod_pt->pin(i);}
339  }
340  }
341 
342  //Set the boundary conditions
343  this->set_boundary_conditions(this->time());
344 
345  //Pin a single pressure value
346  dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(0))->fix_pressure(0,0.0);
347  }
RefineableTriangleMesh< ELEMENT > * mesh_pt()
Return a pointer to the specific mesh used.
Definition: unstructured_torus.cc:282
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
virtual void get_coordinates_on_boundary(const unsigned &b, const unsigned &k, Vector< double > &boundary_zeta)
Definition: nodes.cc:2379

References b, e(), oomph::Node::get_coordinates_on_boundary(), i, n, oomph::Data::pin(), Global_Physical_Variables::Re, and oomph::Node::x().

◆ actions_before_adapt()

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

Actions that are to be performed before a mesh adaptation. These might include removing any additional elements, such as traction boundary elements before the adaptation.

Reimplemented from oomph::Problem.

389  {
390  using namespace Global_Physical_Variables;
391  /*char filename[100];
392  sprintf(filename,"./pre_adapt_%g_%g_%g.dat", Re, Delta,Mu);
393  std::ofstream out_file(filename);
394  Fluid_mesh_pt->output(out_file,5);
395  out_file.close();*/
396 
397 
398  const unsigned n_boundary = this->Fluid_mesh_pt->nboundary();
399  //Back up the surface meshes
400  for(unsigned b=0;b<n_boundary;++b)
401  {
405  }
406 
407  // Kill the elements and wipe surface mesh
409 
410  // Rebuild the Problem's global mesh from its various sub-meshes
411  this->rebuild_global_mesh();
412  }
void delete_lagrange_multiplier_elements()
Definition: pressure_driven_torus.cc:593
Definition: face_mesh_project.h:223

References b.

◆ actions_before_implicit_timestep() [1/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::actions_before_implicit_timestep ( )
inlinevirtual

Update the problem specs before next timestep:

Reimplemented from oomph::Problem.

◆ actions_before_implicit_timestep() [2/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::actions_before_implicit_timestep ( )
inlinevirtual

Update the problem specs before next timestep:

Reimplemented from oomph::Problem.

◆ calculate_area() [1/2]

template<class ELEMENT >
double UnstructuredTorusProblem< ELEMENT >::calculate_area ( )
inline

Calculate the cross-sectional area of the domain.

347  {
348  //Initialise
349  double sum = 0.0;
350 
351  //Now loop over all elements and add the contributions to the
352  //components of the norm
353  const unsigned n_element = this->Fluid_mesh_pt->nelement();
354  for(unsigned e=0;e<n_element;e++)
355  {
356  sum += this->Fluid_mesh_pt->finite_element_pt(e)->size();
357  }
358  return sum;
359  }

References e().

◆ calculate_area() [2/2]

template<class ELEMENT >
double UnstructuredTorusProblem< ELEMENT >::calculate_area ( )
inline

Calculate the cross-sectional area of the domain.

246  {
247  //Initialise
248  double sum = 0.0;
249 
250  //Now loop over all elements and add the contributions to the
251  //components of the norm
252  const unsigned n_element = this->mesh_pt()->nelement();
253  for(unsigned e=0;e<n_element;e++)
254  {
255  sum += this->mesh_pt()->finite_element_pt(e)->size();
256  }
257  return sum;
258  }

References e().

◆ calculate_square_of_l2_norm() [1/2]

template<class ELEMENT >
double UnstructuredTorusProblem< ELEMENT >::calculate_square_of_l2_norm ( )
inline

Calculate the square of the l2 norm.

329  {
330  //Initialise
331  double sum = 0.0;
332 
333  //Now loop over all elements and add the contributions to the
334  //components of the norm
335  const unsigned n_element = this->Fluid_mesh_pt->nelement();
336  for(unsigned e=0;e<n_element;e++)
337  {
338  sum += dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(e))
339  ->square_of_l2_norm();
340  }
341  return sum;
342  }
double square_of_l2_norm()
Get square of L2 norm of velocity.
Definition: overloaded_element_body.h:1031

References e(), and square_of_l2_norm().

◆ calculate_square_of_l2_norm() [2/2]

template<class ELEMENT >
double UnstructuredTorusProblem< ELEMENT >::calculate_square_of_l2_norm ( )
inline

Calculate the square of the l2 norm.

228  {
229  //Initialise
230  double sum = 0.0;
231 
232  //Now loop over all elements and add the contributions to the
233  //components of the norm
234  const unsigned n_element = this->mesh_pt()->nelement();
235  for(unsigned e=0;e<n_element;e++)
236  {
237  sum += dynamic_cast<ELEMENT*>(this->mesh_pt()->element_pt(e))
238  ->square_of_l2_norm();
239  }
240  return sum;
241  }

References e(), and square_of_l2_norm().

◆ create_lagrange_multiplier_elements()

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::create_lagrange_multiplier_elements ( )
inline

Create elements that impose the prescribed boundary displacement for the pseudo-solid fluid mesh

513 {
514  // The idea is to apply Lagrange multipliers to the boundaries in
515  // the mesh that have associated geometric objects
516 
517  //Find the number of boundaries
518  unsigned n_boundary = Fluid_mesh_pt->nboundary();
519 
520  // Loop over the boundaries
521  for(unsigned b=0;b<n_boundary;b++)
522  {
523  //Get the geometric object associated with the boundary
524  GeomObject* boundary_geom_obj_pt =
525  Fluid_mesh_pt->boundary_geom_object_pt(b);
526 
527  //Only bother to do anything if there is a geometric object
528  if(boundary_geom_obj_pt!=0)
529  {
530  // How many bulk fluid elements are adjacent to boundary b?
531  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
532 
533  // Loop over the bulk fluid elements adjacent to boundary b?
534  for(unsigned e=0;e<n_element;e++)
535  {
536  // Get pointer to the bulk fluid element that is
537  // adjacent to boundary b
538  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
539  Fluid_mesh_pt->boundary_element_pt(b,e));
540 
541  //Find the index of the face of element e along boundary b
542  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
543 
544  // Create new element. Note that we use different Lagrange
545  // multiplier fields for each distinct boundary (here indicated
546  // by b.
549  bulk_elem_pt,face_index,b);
550 
551  // Add it to the mesh
552  Lagrange_multiplier_mesh_pt[b]->add_element_pt(el_pt);
553 
554  // Set the GeomObject that defines the boundary shape and set
555  // which bulk boundary we are attached to (needed to extract
556  // the boundary coordinate from the bulk nodes)
558  boundary_geom_obj_pt,b);
559 
560  // Loop over the nodes to pin Lagrange multiplier
561  unsigned nnod=el_pt->nnode();
562  for(unsigned j=0;j<nnod;j++)
563  {
564  Node* nod_pt = el_pt->node_pt(j);
565 
566  // How many nodal values were used by the "bulk" element
567  // that originally created this node?
568  unsigned n_bulk_value=el_pt->nbulk_value(j);
569 
570  // Pin two of the four Lagrange multipliers at vertices
571  // This is not totally robust, but will work in this application
572  unsigned nval=nod_pt->nvalue();
573  if (nval==8)
574  {
575  for (unsigned i=0;i<2;i++)
576  {
577  // Pin lagrangian multipliers
578  nod_pt->pin(n_bulk_value+2+i);
579  }
580  }
581  }
582  } // end loop over the element
583  } //End of case if there is a geometric object
584  } //End of loop over boundaries
585 }
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
unsigned & nbulk_value(const unsigned &n)
Definition: elements.h:4845
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
Definition: solid_traction_elements.h:1107
void set_boundary_shape_geom_object_pt(GeomObject *boundary_shape_geom_object_pt, const unsigned &boundary_number_in_bulk_mesh)
Definition: solid_traction_elements.h:1209
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References b, e(), i, j, oomph::FaceElement::nbulk_value(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::Data::nvalue(), oomph::Data::pin(), and oomph::ImposeDisplacementByLagrangeMultiplierElement< ELEMENT >::set_boundary_shape_geom_object_pt().

◆ delete_lagrange_multiplier_elements()

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::delete_lagrange_multiplier_elements ( )
inline

Delete elements that impose the prescribed boundary displacement and wipe the associated mesh

594 {
595  unsigned n_bound = this->Fluid_mesh_pt->nboundary();
596  for(unsigned b=0;b<n_bound;b++)
597  {
598  // How many surface elements are in the surface mesh
599  unsigned n_element = Lagrange_multiplier_mesh_pt[b]->nelement();
600 
601  // Loop over the surface elements
602  for(unsigned e=0;e<n_element;e++)
603  {
604  // Kill surface element
605  delete Lagrange_multiplier_mesh_pt[b]->element_pt(e);
606  }
607 
608  // Wipe the mesh
609  Lagrange_multiplier_mesh_pt[b]->flush_element_and_node_storage();
610 
611  } // end of delete_lagrange_multiplier_elements
612 }

References b, and e().

◆ mesh_pt()

template<class ELEMENT >
RefineableTriangleMesh<ELEMENT>* UnstructuredTorusProblem< ELEMENT >::mesh_pt ( )
inline

Return a pointer to the specific mesh used.

283  {return dynamic_cast<RefineableTriangleMesh<ELEMENT>*>(Problem::mesh_pt());}
Unstructured refineable Triangle Mesh.
Definition: triangle_mesh.template.h:2249

◆ set_boundary_conditions() [1/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::set_boundary_conditions ( const double time)

Set boundary conditions on the walls.

Set the boundary conditions as a function of time we are going to spin up the torus

784 {
785  //NOTE: The default value of all parameters is zero, so we need only
786  //set the values that are non-zero on the boundary, i.e. the swirl
787 
788  const unsigned n_boundary = Fluid_mesh_pt->nboundary();
789  for(unsigned b=0;b<n_boundary;++b)
790  {
791  //Loop over the nodes on the boundary
792  unsigned n_boundary_node = Fluid_mesh_pt->nboundary_node(b);
793  //Loop over the nodes on the boundary
794  for(unsigned n=0;n<n_boundary_node;n++)
795  {
796  //Get the radial values
797  double r = Fluid_mesh_pt->boundary_node_pt(b,n)->x(0);
798  //Set the value of the u-, v- and w-velocity
799  //Fast(ish) spin-up
800  Fluid_mesh_pt->boundary_node_pt(b,n)->set_value(0,0.0);
801  Fluid_mesh_pt->boundary_node_pt(b,n)->set_value(1,0.0);
802  Fluid_mesh_pt->boundary_node_pt(b,n)->set_value(2,r*(1.0 - exp(-20.0*time)));
803  }
804  }
805 }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
r
Definition: UniformPSDSelfTest.py:20

References b, Eigen::bfloat16_impl::exp(), n, and UniformPSDSelfTest::r.

◆ set_boundary_conditions() [2/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::set_boundary_conditions ( const double time)

Set boundary conditions on the walls.

◆ set_initial_condition() [1/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::set_initial_condition ( )
inlinevirtual

Set the initial conditions: all nodes have zero velocity.

Reimplemented from oomph::Problem.

364  {
365  const unsigned n_node = Fluid_mesh_pt->nnode();
366  for(unsigned n=0;n<n_node;n++)
367  {
368  for(unsigned i=0;i<3;i++)
369  {
370  Fluid_mesh_pt->node_pt(n)->set_value(i,0.0);
371  }
372  }
373  }

References i, and n.

◆ set_initial_condition() [2/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::set_initial_condition ( )
inlinevirtual

Set the initial conditions: all nodes have zero velocity.

Reimplemented from oomph::Problem.

263  {
264  const unsigned n_node = mesh_pt()->nnode();
265  for(unsigned n=0;n<n_node;n++)
266  {
267  for(unsigned i=0;i<3;i++)
268  {
269  mesh_pt()->node_pt(n)->set_value(i,0.0);
270  }
271  }
272  }

References i, and n.

◆ solve_system() [1/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::solve_system ( const double dt,
const unsigned nstep,
const std::string &  directory 
)

Function that is used to run the parameter study.

Solve the system for a number of different values of the Reynolds number.

816 {
817  using namespace Global_Physical_Variables;
818 
819  //Standard newton solve
820  this->steady_newton_solve(2);
821 
822  char filename[100];
823  std::ofstream file;
824  //Output data after the first timestep
825  //Create the filename, including the array index
826  sprintf(filename,"%s/soln_De%g_Delta%g_Mu%g.dat",directory.c_str(),Dean,
827  Delta,Mu);
828  //Actually, write the data
829  file.open(filename);
830  Fluid_mesh_pt->output(file,5);
831  file.close();
832 
833  Bifurcation_detection = true;
834 
835  //Crank up Dean number
836  double ds = 50.0;
837  for(unsigned i=0;i<50;i++)
838  {
839  //Delta += 0.1;
840  ds = this->arc_length_step_solve(&Dean,ds,1);
841  //this->steady_newton_solve(1);
842  this->Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
843 
844  sprintf(filename,"%s/soln_De%g_Delta%g_Mu%g.dat",directory.c_str(),Dean,
845  Delta,Mu);
846  //Actually, write the data
847  file.open(filename);
848  Fluid_mesh_pt->output(file,5);
849  file.close();
850  }
851 
852  //Now move shapes from circle to square
854  ds = +0.1;
855  bool exit_flag = false;
856  for(unsigned i=0;i<10;i++)
857  {
858  if(Mu > 1.0)
859  {
860  Mu = 1.0;
861  this->steady_newton_solve(1);
862  exit_flag = true;
863  }
864  else
865  {
866  //Mu -= 0.1;
867  //this->steady_newton_solve(1);
868  ds = this->arc_length_step_solve(&Mu,ds,1);
869  }
870 
871  this->Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
872 
873  sprintf(filename,"%s/soln_De%g_Delta%g_Mu%g.dat",directory.c_str(),Dean,
874  Delta,Mu);
875  //Actually, write the data
876  file.open(filename);
877  Fluid_mesh_pt->output(file,5);
878  file.close();
879 
880  if(exit_flag) {break;}
881  }
882 
883 }
bool Bifurcation_detection
Boolean to control bifurcation detection via determinant of Jacobian.
Definition: problem.h:790
void reset_arc_length_parameters()
Definition: problem.h:2409
void steady_newton_solve(unsigned const &max_adapt=0)
Definition: problem.cc:9292
double arc_length_step_solve(double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
Definition: problem.cc:10294
double Mu
Definition: pressure_driven_torus.cc:70
double Dean
The Dean number.
Definition: pressure_driven_torus.cc:55
double Delta
The curvature of the torus.
Definition: torus.cc:51
string filename
Definition: MergeRestartFiles.py:39

References Global_Physical_Variables::Dean, Global_Physical_Variables::Delta, MergeRestartFiles::filename, i, and Global_Physical_Variables::Mu.

◆ solve_system() [2/2]

template<class ELEMENT >
void UnstructuredTorusProblem< ELEMENT >::solve_system ( const double dt,
const unsigned nstep,
const std::string &  directory 
)

Function that is used to run the parameter study.

Member Data Documentation

◆ Backed_up_surface_mesh_pt

template<class ELEMENT >
Vector<BackupMeshForProjection<TElement<1,3> >*> UnstructuredTorusProblem< ELEMENT >::Backed_up_surface_mesh_pt

Pointer to the Backedup Surface mesh.

◆ Fluid_mesh_pt

template<class ELEMENT >
RefineableSolidTriangleMesh<ELEMENT>* UnstructuredTorusProblem< ELEMENT >::Fluid_mesh_pt

Pointer to Fluid_mesh.

◆ Lagrange_multiplier_mesh_pt

template<class ELEMENT >
Vector<SolidMesh*> UnstructuredTorusProblem< ELEMENT >::Lagrange_multiplier_mesh_pt

Pointers to mesh of Lagrange multiplier elements.


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