PolarNSProblem< ELEMENT > Class Template Reference

Driven cavity problem in rectangular domain. More...

+ Inheritance diagram for PolarNSProblem< ELEMENT >:

Public Member Functions

 PolarNSProblem ()
 Constructor. More...
 
 ~PolarNSProblem ()
 Destructor to clean up memory. More...
 
void fix_pressure (const unsigned int &e, const unsigned int &pdof, const double &pvalue)
 Fix pressure in element e at pressure dof pdof and set to pvalue. More...
 
void actions_after_solve ()
 Update the after solve (empty) More...
 
void actions_before_solve ()
 
void actions_before_adapt ()
 Before adaptation: More...
 
void actions_after_adapt ()
 After adaptation: Unpin all pressures and then pin redudant pressure dofs. More...
 
void pin_boundaries ()
 Pin boundaries. More...
 
void setup_external_pressure ()
 Set up external pressure and pass to traction elements. More...
 
void assign_external_pressure ()
 Set up external pressure and pass to traction elements. More...
 
jh_mesh< ELEMENT > * mesh_pt ()
 
void actions_before_newton_convergence_check ()
 
void element_output (std::ostream &outfile, unsigned e, const unsigned &nplot)
 Output an individual element. More...
 
double get_pext ()
 
void set_pext (double p)
 
void get_shear_stress (Vector< double > &shear_stress)
 
void pin_boundaries_to_zero ()
 
void output_streamfunction (DocInfo &doc_info, bool eigen)
 
void get_symmetry (DoubleVector &symmetry, double pressure_norm)
 
int get_Jacobian_sign ()
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
void header (ofstream &some_file)
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
OomphCommunicator * communicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicator * communicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolver * mass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Time * time_pt () const
 Return a pointer to the global time object (const version). More...
 
double & time ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeStepper * time_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
double & minimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
double & maximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsigned & max_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
double & max_residuals ()
 
bool & time_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
double & newton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
double * global_dof_pt (const unsigned &i)
 
double & dof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
double * dof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
bool & use_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual Problem * make_copy ()
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
double * bifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
int & sign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 

Private Attributes

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

Detailed Description

template<class ELEMENT>
class PolarNSProblem< ELEMENT >

Driven cavity problem in rectangular domain.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Further includes: ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

Constructor & Destructor Documentation

◆ PolarNSProblem()

template<class ELEMENT >
PolarNSProblem< ELEMENT >::PolarNSProblem

Constructor.

Constructor for PolarNS problem.

648 {
649  // Increace max residuals slightly
650  Max_residuals=20000;
652 
653  // Setup mesh
654 
655  // # of elements in x-direction
657 
658  // # of elements in y-direction
660 
661  // Build and assign mesh
662  Problem::mesh_pt() = new jh_mesh<ELEMENT>(Nx,Ny);
663 
664  // Set error estimator
666  //dynamic_cast<Refineable_r_mesh<ELEMENT>*>(mesh_pt())->
667  //spatial_error_estimator_pt()=error_estimator_pt;
668  mesh_pt()->spatial_error_estimator_pt()=error_estimator_pt;
669 
670  //pin the necessary boundaries
671  pin_boundaries();
672 
673  // Complete the build of all elements so they are fully functional
674 
675  //Find number of fluid elements in mesh
676  unsigned n_fluid = mesh_pt()->fluid_elt_length();
677 
678  // Loop over the elements to set up element-specific
679  // things that cannot be handled by constructor
680  for(unsigned e=0;e<n_fluid;e++)
681  {
682  // Upcast from GeneralisedElement to the present element
683  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
684 
685  //Set the Reynolds number
686  el_pt->re_pt() = &Global_Physical_Variables::Re;
687  //Set alpha
688  el_pt->alpha_pt() = &Global_Physical_Variables::Alpha;
689  //Set the re_st pointer
690  el_pt->re_st_pt() = &Global_Physical_Variables::Re;
691 
692  } // end loop over elements
693 
694  // Pin redudant pressure dofs
695  RefineablePolarNavierStokesEquations::
696  pin_redundant_nodal_pressures(mesh_pt()->fluid_elt_vector());
697 
698  //Determine whether we have traction elements at both ends
700 
701  // Now set the first pressure value in element 0 to 0.0
702  // But only if all B.C.s are Dirichlet
704 
705  // Setup equation numbering scheme
706  cout << "Number of equations: " << assign_eqn_numbers() << endl;
707 
708 } // end_of_constructor
Array< double, 1, 3 > e(1./3., 0.5, 2.)
jh_mesh< ELEMENT > * mesh_pt()
Definition: jeffery_hamel.cc:371
void setup_external_pressure()
Set up external pressure and pass to traction elements.
Definition: jeffery_hamel.cc:332
void pin_boundaries()
Pin boundaries.
Definition: jeffery_hamel.cc:276
void fix_pressure(const unsigned int &e, const unsigned int &pdof, const double &pvalue)
Fix pressure in element e at pressure dof pdof and set to pvalue.
Definition: jeffery_hamel.cc:147
unsigned Max_newton_iterations
Maximum number of Newton iterations.
Definition: problem.h:599
double Max_residuals
Definition: problem.h:610
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
Definition: error_estimator.h:266
My fluid mesh (with traction elements)
Definition: jh_includes.h:117
unsigned Nx
Number of elements in each direction (used by SimpleCubicMesh)
Definition: structured_cubic_point_source.cc:114
unsigned Ny
Definition: structured_cubic_point_source.cc:115
int ymesh
Definition: jeffery_hamel.cc:62
bool outlet_traction
Definition: jeffery_hamel.cc:82
int xmesh
Definition: jeffery_hamel.cc:61
double Alpha
Scaling factor for wall thickness (to be used in an exercise)
Definition: unsteady_ring.cc:73
bool inlet_traction
Definition: jeffery_hamel.cc:79
double Re
Reynolds number.
Definition: fibre.cc:55
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190

References Global_Physical_Variables::Alpha, e(), MeshRefinement::error_estimator_pt, Global_Physical_Variables::inlet_traction, oomph::Locate_zeta_helpers::Max_newton_iterations, GlobalParameters::Nx, GlobalParameters::Ny, Global_Physical_Variables::outlet_traction, Global_Physical_Variables::Re, Global_Physical_Variables::xmesh, and Global_Physical_Variables::ymesh.

◆ ~PolarNSProblem()

template<class ELEMENT >
PolarNSProblem< ELEMENT >::~PolarNSProblem

Destructor to clean up memory.

Destructor for PolarNS problem.

716 {
717 
718  // Mesh gets killed in general problem destructor
719 
720 } // end_of_destructor

Member Function Documentation

◆ actions_after_adapt()

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

After adaptation: Unpin all pressures and then pin redudant pressure dofs.

Reimplemented from oomph::Problem.

246  {
247  //Reassign fluid elements to storage
248  mesh_pt()->assign_fluid_element_vector();
249 
250  //Reattach surface elements
251  if(Global_Physical_Variables::inlet_traction) mesh_pt()->make_traction_elements(false);
252  if(Global_Physical_Variables::outlet_traction) mesh_pt()->make_traction_elements(true);
254 
255  //Reattach shear elements
256  mesh_pt()->make_shear_elements();
257 
258  // Unpin all pressure dofs
259  RefineablePolarNavierStokesEquations::
260  unpin_all_pressure_dofs(mesh_pt()->fluid_elt_vector());
261 
262  // Pin redundant pressure dofs
263  RefineablePolarNavierStokesEquations::
264  pin_redundant_nodal_pressures(mesh_pt()->fluid_elt_vector());
265 
266  //Determine whether we have traction elements at both ends
268 
269  // Now set the first pressure value in element 0 to 0.0
270  // But only if all B.C.s are Dirichlet
272 
273  } // end_of_actions_after_adapt
void assign_external_pressure()
Set up external pressure and pass to traction elements.
Definition: jeffery_hamel.cc:347

References Global_Physical_Variables::inlet_traction, and Global_Physical_Variables::outlet_traction.

◆ actions_after_solve()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::actions_after_solve ( )
inline

Update the after solve (empty)

157 {}

◆ actions_before_adapt()

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

Before adaptation:

Reimplemented from oomph::Problem.

229  {
230  //Strip off all surface elements
231  mesh_pt()->remove_traction_elements();
232  mesh_pt()->remove_shear_elements();
233 
234  //Reset the external pressure data pointer if there is one
235  //using namespace Global_Physical_Variables;
236  //if(inlet_traction && outlet_traction)
237  //{delete External_pressure_data_pt;External_pressure_data_pt=0;}
238 
239  //Remove global data from problem
241 
242  }
void flush_global_data()
Definition: problem.h:1662

◆ actions_before_newton_convergence_check()

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

Any actions that are to be performed before the residual is checked in the Newton method, e.g. update any boundary conditions that depend upon variables of the problem; update any ‘dependent’ variables; or perform an update of the nodal positions in SpineMeshes etc. CAREFUL: This step should (and if the FD-based LinearSolver FD_LU is used, must) only update values that are pinned!

Reimplemented from oomph::Problem.

380  {
382  }// End of actions_before_newton_convergence_check
void actions_before_solve()
Definition: jeffery_hamel.cc:161

◆ actions_before_solve()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::actions_before_solve ( )
inline

Update the problem specs before solve. Re-set velocity boundary conditions just to be on the safe side...

162  {
163  unsigned long start=1,end=4;
166 
168 
169  for(unsigned long ibound=start;ibound<end;ibound+=2)
170  {
171  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
172  for (unsigned inod=0;inod<num_nod;inod++)
173  {
174  //Get r
175  double r = mesh_pt()->boundary_node_pt(ibound,inod)->x(0);
176  double phi = mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
177 
178  //Use exact stokes solution if necessary
179  double exact_u;
181  {
182  double m=2.*A;
183  double mu=(1./(sin(m)-m*cos(m)));
184  exact_u=(mu/r)*(cos(m*phi)-cos(m));
185  }
186  else{exact_u=0.75*(1.-pow(phi,2.))/(A*r);}
187 
188  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,exact_u);
189  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
190  }
191  }//End of dirichlet inlet/outlet in u
192 
194  {
195  //If we haven't just pinned v at the inlet (end=2)
196  //then pin it here
197  if(end==2)
198  {
199  //Pin v at inlet
200  unsigned long ibound=3;
201  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
202  for (unsigned inod=0;inod<num_nod;inod++)
203  {
204  // No flow in azimuthal direction:
205  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
206  }
207  }
208  }//End of pinv
209 
210  // Loop over remaining boundaries (side walls)
211  unsigned num_bound = mesh_pt()->nboundary();
212 
213  // No penetration and no slip condition on remaining boundaries
214  for(unsigned long ibound=0;ibound<num_bound;ibound=ibound+2)
215  {
216  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
217  for (unsigned inod=0;inod<num_nod;inod++)
218  {
219  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.);
220  //No flow in theta direction
221  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.);
222  }
223  }//End of setting side walls to zero
224 
225  } // end_of_actions_before_solve
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
static constexpr lastp1_t end
Definition: IndexedViewHelper.h:79
int * m
Definition: level2_cplx_impl.h:294
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
std::complex< double > mu
Definition: time_harmonic_fourier_decomposed_linear_elasticity/cylinder/cylinder.cc:52
bool pinv
Definition: jeffery_hamel.cc:86
bool stokes
Definition: jeffery_hamel.cc:89
double exact_u(const double &time, const Vector< double > &x)
Exact solution.
Definition: two_d_linear_wave.cc:58
r
Definition: UniformPSDSelfTest.py:20
void start(const unsigned &i)
(Re-)start i-th timer
Definition: oomph_utilities.cc:243

References Global_Physical_Variables::Alpha, cos(), Eigen::placeholders::end, TanhSolnForLinearWave::exact_u(), Global_Physical_Variables::inlet_traction, m, Global_Parameters::mu, Global_Physical_Variables::outlet_traction, Global_Physical_Variables::pinv, Eigen::bfloat16_impl::pow(), UniformPSDSelfTest::r, sin(), oomph::CumulativeTimings::start(), and Global_Physical_Variables::stokes.

◆ assign_external_pressure()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::assign_external_pressure ( )
inline

Set up external pressure and pass to traction elements.

348  {
349  // Regard the external pressure as an unknown and add
350  // it to the problem's global data.
352 
353  //Can pin our external pressure if needed
354  //External_pressure_data_pt->pin(0);
355 
356  //pass flux element the external pressure data
357  FluxConstraint* flux_el_pt = this->mesh_pt()->flux_constraint_elt_pt();
358 
360 
361  //Need to pass pointer to external pressure to inlet traction elements
362  unsigned n_inlet = mesh_pt()->inlet_traction_elt_length();
363  for(unsigned e=0;e<n_inlet;e++)
364  {
365  this->mesh_pt()->inlet_traction_elt_pt(e)->set_external_pressure_data(External_pressure_data_pt);
366  }
367 
368  } // end of assign_external_pressure
Data * External_pressure_data_pt
Data object whose single value stores the external pressure.
Definition: jeffery_hamel.cc:136
Generalised element used to specify the mass flux (=1)
Definition: jh_includes.h:36
void set_pressure_data(Data *pext_pt)
Function for setting up external pressure.
Definition: jh_includes.h:60
void add_global_data(Data *const &global_data_pt)
Definition: problem.h:1654

References e(), and oomph::FluxConstraint::set_pressure_data().

◆ doc_solution()

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

Doc the solution.

727 {
728  ofstream some_file;
729  char filename[100];
730 
731  // Number of plot points
732  unsigned npts;
733  npts=3;
734 
735  // Output solution
736  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
737  doc_info.number());
738  some_file.open(filename);
739  header( some_file );
740  unsigned n_fluid = mesh_pt()->fluid_elt_length();
741  for(unsigned e=0;e<n_fluid;e++)
742  {
743  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
744  el_pt->output(some_file,npts);
745  }
746  some_file.close();
747 
748 } // end_of_doc_solution
void header(ofstream &some_file)
Definition: jeffery_hamel.cc:751
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
string filename
Definition: MergeRestartFiles.py:39

References oomph::DocInfo::directory(), e(), MergeRestartFiles::filename, and oomph::DocInfo::number().

◆ element_output()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::element_output ( std::ostream &  outfile,
unsigned  e,
const unsigned &  nplot 
)

Output an individual element.

421 {
422  // Upcast from GeneralisedElement to the present element
423  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
424 
425  el_pt->output(outfile,nplot);
426 
427 } // end_of_element_output

References e().

◆ fix_pressure()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::fix_pressure ( const unsigned int &  e,
const unsigned int &  pdof,
const double &  pvalue 
)
inline

Fix pressure in element e at pressure dof pdof and set to pvalue.

149  {
150  //Cast to full element type and fix the pressure at that element
151  dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e))->
152  fix_pressure(pdof,pvalue);
153  } // end of fix_pressure

References e().

◆ get_Jacobian_sign()

template<class ELEMENT >
int PolarNSProblem< ELEMENT >::get_Jacobian_sign
638 {
640  return sign;
641 } //End of get_Jacobian_sign
int Sign_of_jacobian
Storage for the sign of the global Jacobian.
Definition: problem.h:745
T sign(T x)
Definition: cxx11_tensor_builtins_sycl.cpp:172

References SYCL::sign().

◆ get_pext()

template<class ELEMENT >
double PolarNSProblem< ELEMENT >::get_pext
436 {
437  return External_pressure_data_pt->value(0);
438 }
double value(const unsigned &i) const
Definition: nodes.h:293

◆ get_shear_stress()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::get_shear_stress ( Vector< double > &  shear_stress)
456 {
457  //Find the number of shear elements
458  unsigned Nshear_lower = mesh_pt()->lower_stress_integral_elt_length();
459  unsigned Nshear_upper = mesh_pt()->upper_stress_integral_elt_length();
460 
461  //Storage for element pointer
463 
464  //Storage for answer
465  double lower=0.0,upper=0.0;
466 
467  for(unsigned e=0;e<Nshear_lower;e++)
468  {
469  el_pt = dynamic_cast<PolarStressIntegralElement<ELEMENT>*>(this->mesh_pt()->lower_stress_integral_elt_pt(e));
470  lower+= el_pt->get_shear_stress();
471  }
472  for(unsigned e=0;e<Nshear_upper;e++)
473  {
474  el_pt = dynamic_cast<PolarStressIntegralElement<ELEMENT>*>(this->mesh_pt()->upper_stress_integral_elt_pt(e));
475  upper+= el_pt->get_shear_stress();
476  }
477 
478  shear_stress[0]=lower;
479  shear_stress[1]=upper;
480 
481 } //End of get shear_stress
Definition: polar_stress_integral_elements.h:53
double get_shear_stress()
Function to calculate the shear stress along boundary.
Definition: polar_stress_integral_elements.h:224
std::string lower(std::string s)
returns the input string after converting upper-case characters to lower case
Definition: StringHelpers.cc:11

References e(), oomph::PolarStressIntegralElement< ELEMENT >::get_shear_stress(), and helpers::lower().

◆ get_symmetry()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::get_symmetry ( DoubleVector &  symmetry,
double  pressure_norm 
)
577 {
578  // First store the current dof values
579  this->store_current_dof_values();
580 
581  //Loop over nodes and set nodal values according to symmetry
582  unsigned num_nod= mesh_pt()->nnode();
583  for (unsigned inod=0;inod<num_nod;inod++)
584  {
585  // Get coordinates of node
586  double r = mesh_pt()->node_pt(inod)->x(0);
587  double phi = mesh_pt()->node_pt(inod)->x(1);
588 
589  // Anti-symmetric in u, symmetric in v
590  mesh_pt()->node_pt(inod)->set_value(0,r*phi*(1.-phi*phi));
591  mesh_pt()->node_pt(inod)->set_value(1,(1.-phi*phi));
592  }
593 
594  //Loop over fluid elements to set pressure dofs
595  unsigned n_fluid = mesh_pt()->fluid_elt_length();
596  for(unsigned e=0;e<n_fluid;e++)
597  {
598  // Upcast from GeneralisedElement to the present element
599  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
600 
601  Vector<double> s(2,0.0);
602  double r = el_pt->interpolated_x(s,0);
603  double phi = el_pt->interpolated_x(s,1);
604  s[0]=-1.;double r_min = el_pt->interpolated_x(s,0);
605  s[0]=1.;double r_max = el_pt->interpolated_x(s,0);
606  s[1]=-1.;double phi_min = el_pt->interpolated_x(s,1);
607  s[1]=1.;double phi_max = el_pt->interpolated_x(s,1);
608 
609  double a = phi*(1.-phi*phi)*r*r;
610  double b = phi*(1.-phi*phi)*2.*r*(r_max-r_min)/2.;
611  double c = (1.-3.*phi*phi)*r*r*(phi_max-phi_min)/2.;
612 
613  //Set the pressure dofs to give an antisymmetric pressure
614  *el_pt->internal_data_pt(0)->value_pt(0) = a*pressure_norm;
615  *el_pt->internal_data_pt(0)->value_pt(1) = b*pressure_norm;
616  *el_pt->internal_data_pt(0)->value_pt(2) = c*pressure_norm;
617 
618  } // end loop over fluid elements
619 
620  //Finally set the value of pext (if appropriate)
623 
624  //Get the dofs
625  this->get_dofs(symmetry);
626 
627  // Finally restore the dof values
628  this->restore_dof_values();
629 
630 } //End of get_symmetry
Scalar * b
Definition: benchVecAdd.cpp:17
void set_pext(double p)
Definition: jeffery_hamel.cc:445
void get_dofs(DoubleVector &dofs) const
Definition: problem.cc:2479
void restore_dof_values()
Restore the stored values of the degrees of freedom.
Definition: problem.cc:8653
void store_current_dof_values()
Store the current values of the degrees of freedom.
Definition: problem.cc:8607
RealScalar s
Definition: level1_cplx_impl.h:130
const Scalar * a
Definition: level2_cplx_impl.h:32
double r_min
Definition: two_d_biharmonic.cc:237
double r_max
Definition: two_d_biharmonic.cc:238
int c
Definition: calibrate.py:100

References a, b, calibrate::c, e(), Global_Physical_Variables::inlet_traction, Global_Physical_Variables::outlet_traction, UniformPSDSelfTest::r, BiharmonicTestFunctions2::r_max, BiharmonicTestFunctions2::r_min, and s.

◆ header()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::header ( ofstream &  some_file)
752  {
753  using namespace Global_Physical_Variables;
754  some_file << "# Refineable mesh" << "\n";
755  some_file << "# Re = " << Re << " Alpha = " << Alpha << " R_l = " << R_l << "\n";
756  some_file << "# Initial xmesh = " << xmesh << " Initial ymesh = " << ymesh << "\n";
757  some_file << "# Uniform refinements: " << uniform << " Adaptive refinements: " << adaptive << "\n";
758  some_file << "# inlet_traction = " << inlet_traction << " eta_inlet = " << eta_inlet << "\n";
759  some_file << "# outlet_traction = " << outlet_traction << " eta_outlet = " << eta_outlet << "\n";
760  some_file << "# log_mesh = " << log_mesh << " new_outlet_region = " << new_outlet_region << "\n";
761  some_file << "# pinv = " << pinv << "\n";
762  some_file << "# Total equations = " << this->ndof() << "\n";
763  some_file << "\n";
764  }
unsigned long ndof() const
Return the number of dofs.
Definition: problem.h:1674
double Re
Reynolds number.
Definition: axisym_navier_stokes/counter_rotating_disks/counter_rotating_disks.cc:61
Global variables.
Definition: TwenteMeshGluing.cpp:60
int adaptive
Definition: jeffery_hamel.cc:106
bool new_outlet_region
Definition: jeffery_hamel.cc:93
bool log_mesh
Definition: jeffery_hamel.cc:92
int uniform
Definition: jeffery_hamel.cc:106
double R_l
Definition: jeffery_hamel.cc:57
double eta_inlet
Definition: jeffery_hamel.cc:80
double eta_outlet
Definition: jeffery_hamel.cc:83
double Alpha
Parameter for steepness of step.
Definition: two_d_adv_diff_adapt.cc:53

References Global_Physical_Variables::adaptive, TanhSolnForAdvectionDiffusion::Alpha, Global_Physical_Variables::eta_inlet, Global_Physical_Variables::eta_outlet, Global_Physical_Variables::inlet_traction, Global_Physical_Variables::log_mesh, Global_Physical_Variables::new_outlet_region, Global_Physical_Variables::outlet_traction, Global_Physical_Variables::pinv, Global_Physical_Variables::R_l, GlobalPhysicalVariables::Re, Global_Physical_Variables::uniform, Global_Physical_Variables::xmesh, and Global_Physical_Variables::ymesh.

◆ mesh_pt()

template<class ELEMENT >
jh_mesh<ELEMENT>* PolarNSProblem< ELEMENT >::mesh_pt ( )
inline
372  {
373  // Upcast from pointer to the Mesh base class to the specific
374  // element type that we're using here.
375  return dynamic_cast<jh_mesh<ELEMENT>*>(Problem::mesh_pt());
376  }

◆ output_streamfunction()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::output_streamfunction ( DocInfo &  doc_info,
bool  eigen 
)
511 {
512  //Create a streamfunction problem
513  // This needs to know if its solving for the flow or the eigenfunction
514  StreamfunctionProblem stream_problem(eigen);
515 
516  // Document the refines to date
517  Vector<Vector<unsigned> > refinement_pattern;
518  cout << "Obtaining refinement pattern of mesh" << endl;
519  this->mesh_pt()->get_refinement_pattern(refinement_pattern);
520  cout << "Refining streamfunction mesh to same level" << endl;
521  stream_problem.actions_before_adapt();
522  stream_problem.mesh_pt()->refine_base_mesh(refinement_pattern);
523  stream_problem.actions_after_adapt();
524  cout << "Streamfunction mesh refined to same level" << endl;
525  cout << "Number of (streamfunction) equations:" << stream_problem.assign_eqn_numbers() << endl;
526  cout << "Assigning velocities to streamfunction problem" << endl;
527  clock_t start=clock();
528 
529  unsigned num_nod1 = this->mesh_pt()->nnode();
530  unsigned num_nod2 = stream_problem.mesh_pt()->nnode();
531  cout << "num_nod1: " << num_nod1 << endl;
532  cout << "num_nod2: " << num_nod2 << endl;
533  for(unsigned i=0;i<num_nod2;i++)
534  {
535  double r2 = stream_problem.mesh_pt()->node_pt(i)->x(0);
536  double phi2 = stream_problem.mesh_pt()->node_pt(i)->x(1);
537 
538  int found=-1;int j=0;
539  double u=0.;double v=0.;
540  while(found<0)
541  {
542  double r = this->mesh_pt()->node_pt(j)->x(0);
543  double phi = this->mesh_pt()->node_pt(j)->x(1);
544  if((abs(r-r2)<1.e-8) && (abs(phi-phi2)<1.e-8))
545  {
546  u = this->mesh_pt()->node_pt(j)->value(0);
547  v = this->mesh_pt()->node_pt(j)->value(1);
548  found=1;
549  }
550  j+=1;
551  }
552 
553  // Transfer values across from old node to new node
554  stream_problem.mesh_pt()->node_pt(i)->set_value(1,u);
555  stream_problem.mesh_pt()->node_pt(i)->set_value(2,v);
556  }
557 
558  clock_t end=clock();
559  cout << "This took "<<(double(end-start))/CLOCKS_PER_SEC<<" seconds."<<endl;
560 
561  stream_problem.newton_solve();
562  stream_problem.doc_solution(doc_info);
563  //Select output file
564  char file_name[100];
565  sprintf(file_name,"my_streamfunction%i.dat",doc_info.number());
566  stream_problem.my_output(201,81,false,file_name);
567 
568 } //End of output_streamfunction
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Polar Streamfunction problem class.
Definition: streamfunction_include.h:161
bool found
Definition: MergeRestartFiles.py:24
string file_name
Definition: Particles2023AnalysisHung.py:321
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References abs(), oomph::StreamfunctionProblem::actions_after_adapt(), oomph::StreamfunctionProblem::actions_before_adapt(), oomph::Problem::assign_eqn_numbers(), oomph::StreamfunctionProblem::doc_solution(), Eigen::placeholders::end, Particles2023AnalysisHung::file_name, MergeRestartFiles::found, i, j, oomph::StreamfunctionProblem::mesh_pt(), oomph::StreamfunctionProblem::my_output(), oomph::Problem::newton_solve(), oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::DocInfo::number(), UniformPSDSelfTest::r, oomph::TreeBasedRefineableMeshBase::refine_base_mesh(), oomph::Data::set_value(), oomph::CumulativeTimings::start(), v, and oomph::Node::x().

◆ pin_boundaries()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::pin_boundaries ( )
inline

Pin boundaries.

277  {
278  // Inlet/Outlet perturbation
279  //Which ends do we need to pin both u and v at?
280  unsigned long start=1,end=4;
283 
284  for(unsigned long ibound=start;ibound<end;ibound+=2)
285  {
286  cout << "Pinning u on boundary: " << ibound << endl;
287  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
288  for (unsigned inod=0;inod<num_nod;inod++)
289  {
290  //pin u velocity
291  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
292  //pin v velocity
293  mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
294  }
295  } // End pinning of inlet and outlet
296 
298  {
299  //If we haven't just pinned v at the inlet (end=2)
300  //then pin it here
301  if(end==2)
302  {
303  unsigned long ibound=3;
304  cout << "Pinning v at inlet. " << endl;
305  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
306  for (unsigned inod=0;inod<num_nod;inod++)
307  {
308  //pin u velocity
309  mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
310  }
311  }
312  } // end pin v at inlet
313 
314  //Pin velocities on side walls to zero
315  unsigned num_bound = mesh_pt()->nboundary();
316  for(unsigned ibound=0;ibound<num_bound;ibound+=2)
317  {
318  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
319  for (unsigned inod=0;inod<num_nod;inod++)
320  {
321  // Loop over values (u and v velocities)
322  for (unsigned i=0;i<2;i++)
323  {
324  mesh_pt()->boundary_node_pt(ibound,inod)->pin(i);
325  }
326  }
327  } // end loop over side walls
328 
329  } // end_of_pin_boundaries

References Eigen::placeholders::end, i, Global_Physical_Variables::inlet_traction, Global_Physical_Variables::outlet_traction, Global_Physical_Variables::pinv, and oomph::CumulativeTimings::start().

◆ pin_boundaries_to_zero()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::pin_boundaries_to_zero
488 {
489  //Initially set to zero both inlet and outlet
490  unsigned long start=1,end=4;
491  //But which ends have we pinned u at?
494  for(unsigned long ibound=start;ibound<end;ibound+=2)
495  {
496  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
497  for (unsigned inod=0;inod<num_nod;inod++)
498  {
499  //Pin to zero
500  mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
501  }
502  }//End of dirichlet inlet/outlet in u
503 
504 } //End of pin_boundaries_to_zero

References Eigen::placeholders::end, Global_Physical_Variables::inlet_traction, Global_Physical_Variables::outlet_traction, and oomph::CumulativeTimings::start().

◆ set_pext()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::set_pext ( double  p)
447 {
449 }
float * p
Definition: Tutorial_Map_using.cpp:9
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271

References p.

◆ setup_external_pressure()

template<class ELEMENT >
void PolarNSProblem< ELEMENT >::setup_external_pressure ( )
inline

Set up external pressure and pass to traction elements.

333  {
334  //Create a Data object whose single value stores the
335  //external pressure
337 
338  // Set external pressure
340 
341  //Now assign it to the problem
343 
344  } // end of setup_external_pressure
Definition: nodes.h:86

References oomph::Data::set_value().

Member Data Documentation

◆ External_pressure_data_pt

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

Data object whose single value stores the external pressure.


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