UnstructuredFluidProblem< ELEMENT > Class Template Reference

Unstructured Navier-Stokes ALE Problem. More...

+ Inheritance diagram for UnstructuredFluidProblem< ELEMENT >:

Public Member Functions

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

Public Attributes

TetgenMesh< ELEMENT > * Fluid_mesh_pt
 Bulk fluid mesh. More...
 
Vector< Mesh * > Fluid_traction_mesh_pt
 Meshes of fluid traction elements that apply pressure at in/outflow. More...
 
Vector< unsigned > Inflow_boundary_id
 
Vector< unsigned > Outflow_boundary_id
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 

Private Member Functions

void create_lagrange_multiplier_elements ()
 
void delete_lagrange_multiplier_elements ()
 
void create_parallel_outflow_lagrange_elements ()
 Create Lagrange multiplier elements that enforce parallel outflow. More...
 

Private Attributes

SolidMesh * Lagrange_multiplier_mesh_pt
 Pointers to mesh of Lagrange multiplier elements. More...
 
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
 Pointers to Fluid_mesh. More...
 
Vector< TriangleMeshPolygon * > Inner_hole_pt
 Vector storing pointer to the hole polygon. More...
 
TriangleMeshPolygon * Outer_boundary_polyline_pt
 Triangle mesh polygon for outer boundary. More...
 
ElasticTriangleMesh< ELEMENT > * Fluid_mesh_pt
 Fluid mesh. More...
 
Vector< Mesh * > Parallel_outflow_lagrange_multiplier_mesh_pt
 

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_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)
 
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 UnstructuredFluidProblem< ELEMENT >

Unstructured Navier-Stokes ALE Problem.

Unstructured fluid problem.

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

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

Constructor & Destructor Documentation

◆ UnstructuredFluidProblem() [1/4]

template<class ELEMENT >
UnstructuredFluidProblem< ELEMENT >::UnstructuredFluidProblem

Constructor.

Constructor for unstructured 3D fluid problem.

Constructor: build the first mesh with TriangleMeshPolygon and TriangleMeshPolygon object

722 {
723  // Allow for rough startup
724  this->Problem::Max_residuals=1000.0;
725 
726  // Output directory
728 
729  // Allocate the timestepper -- this constructs the Problem's
730  // time object with a sufficient amount of storage to store the
731  // previous timsteps.
732  this->add_time_stepper_pt(new BDF<2>);
733 
734  // Define the boundaries: Polyline with 4 different
735  // boundaries for the outer boundary and 2 internal holes,
736  // egg shaped, with 2 boundaries each
737 
738  // Build the boundary segments for outer boundary, consisting of
739  //--------------------------------------------------------------
740  // four separeate polyline segments
741  //---------------------------------
742  Vector<TriangleMeshCurveSection*> boundary_segment_pt(4);
743 
744  // Initialize boundary segment
745  Vector<Vector<double> > bound_seg(2);
746  for(unsigned i=0;i<2;i++)
747  {
748  bound_seg[i].resize(2);
749  }
750 
751  // First boundary segment
752  bound_seg[0][0]=0.0;
753  bound_seg[0][1]=0.0;
754  bound_seg[1][0]=0.0;
755  bound_seg[1][1]=1.0;
756 
757  // Specify 1st boundary id
758  unsigned bound_id = 0;
759 
760  // Build the 1st boundary segment
761  boundary_segment_pt[0] = new TriangleMeshPolyLine(bound_seg,bound_id);
762 
763  // Second boundary segment
764  bound_seg[0][0]=0.0;
765  bound_seg[0][1]=1.0;
766  bound_seg[1][0]=2.0;
767  bound_seg[1][1]=1.0;
768 
769  // Specify 2nd boundary id
770  bound_id = 1;
771 
772  // Build the 2nd boundary segment
773  boundary_segment_pt[1] = new TriangleMeshPolyLine(bound_seg,bound_id);
774 
775  // Third boundary segment
776  bound_seg[0][0]=2.0;
777  bound_seg[0][1]=1.0;
778  bound_seg[1][0]=2.0;
779  bound_seg[1][1]=0.0;
780 
781  // Specify 3rd boundary id
782  bound_id = 2;
783 
784  // Build the 3rd boundary segment
785  boundary_segment_pt[2] = new TriangleMeshPolyLine(bound_seg,bound_id);
786 
787  // Fourth boundary segment
788  bound_seg[0][0]=2.0;
789  bound_seg[0][1]=0.0;
790  bound_seg[1][0]=0.0;
791  bound_seg[1][1]=0.0;
792 
793  // Specify 4th boundary id
794  bound_id = 3;
795 
796  // Build the 4th boundary segment
797  boundary_segment_pt[3] = new TriangleMeshPolyLine(bound_seg,bound_id);
798 
799  // Create the triangle mesh polygon for outer boundary using boundary segment
800  Outer_boundary_polyline_pt = new TriangleMeshPolygon(boundary_segment_pt);
801 
802 
803 
804 
805  // Now deal with the moving holes
806  //-------------------------------
807 
808  // We have two holes
809  Inner_hole_pt.resize(2);
810 
811  // Create Data objects that contains the three values (x-displacement,
812  // y-displacement and rotation angle) for the two polygons' centreline
813  // motion.
815  for(unsigned ihole=0;ihole<2;ihole++)
816  {
817  // Create time-dependent Data with three values
819  new Data(this->time_stepper_pt(),3);
820 
821  // For now pin all three values
825  }
826 
827 
828  // Build first hole
829  //-----------------
830  double x_center = 1.3;
831  double y_center = 0.5;
832  double A = 0.1;
833  double B = 0.25;
834  Ellipse * egg_hole_pt = new Ellipse(A,B);
835 
836  // Define the vector of angle value to build the hole
837  Vector<double> zeta(1);
838 
839  // Initialize the vector of coordinates
840  Vector<double> coord(2);
841 
842  // Number of points defining hole
843  unsigned ppoints = 8;
844  double unit_zeta = MathematicalConstants::Pi/double(ppoints-1);
845 
846  // This hole is bounded by two distinct boundaries, each
847  // represented by its own polyline
848  Vector<TriangleMeshCurveSection*> hole_segment_pt(2);
849 
850  // Vertex coordinates
851  Vector<Vector<double> > bound_hole(ppoints);
852 
853  // Create points on boundary
854  for(unsigned ipoint=0; ipoint<ppoints;ipoint++)
855  {
856  // Resize the vector
857  bound_hole[ipoint].resize(2);
858 
859  // Get the coordinates
860  zeta[0]=unit_zeta*double(ipoint);
861  egg_hole_pt->position(zeta,coord);
862  bound_hole[ipoint][0]=coord[0]+x_center;
863  bound_hole[ipoint][1]=coord[1]+y_center;
864  }
865 
866  // Inner hole center coordinates
867  Vector<double> hole_center(2);
868  hole_center[0]=x_center;
869  hole_center[1]=y_center;
870 
871  // Specify the hole boundary id
872  unsigned hole_id = 4;
873 
874  // Build the 1st hole polyline
875  hole_segment_pt[0] = new TriangleMeshPolyLine(bound_hole,hole_id);
876 
877  // Second boundary of hole
878  for(unsigned ipoint=0; ipoint<ppoints;ipoint++)
879  {
880  // Resize the vector
881  bound_hole[ipoint].resize(2);
882 
883  // Get the coordinates
884  zeta[0]=(unit_zeta*double(ipoint))+MathematicalConstants::Pi;
885  egg_hole_pt->position(zeta,coord);
886  bound_hole[ipoint][0]=coord[0]+x_center;
887  bound_hole[ipoint][1]=coord[1]+y_center;
888  }
889 
890  // Specify the hole boundary id
891  hole_id=5;
892 
893  // Build the 2nd hole polyline
894  hole_segment_pt[1] = new TriangleMeshPolyLine(bound_hole,hole_id);
895 
896 
897  // Fill in the vector of holes. Specify data that define centre's
898  // displacement
900  hole_center,hole_segment_pt,this->time_stepper_pt(),
902 
903  // Build the second hole
904  //----------------------
905  x_center = 0.5;
906  y_center = 0.6;
907  A = 0.1;
908  B = 0.2;
909  delete egg_hole_pt;
910  egg_hole_pt = new Ellipse(A,B);
911 
912  // Number of points defining the hole
913  ppoints = 8;
914  unit_zeta = MathematicalConstants::Pi/double(ppoints-1);
915 
916  // Create points on the boundary
917  for(unsigned ipoint=0; ipoint<ppoints;ipoint++)
918  {
919  // Resize the vector
920  bound_hole[ipoint].resize(2);
921 
922  // Get the coordinates
923  zeta[0]=unit_zeta*double(ipoint);
924  egg_hole_pt->position(zeta,coord);
925  bound_hole[ipoint][0]=coord[0]+x_center;
926  bound_hole[ipoint][1]=coord[1]+y_center;
927  }
928 
929  // Specify the hole boundary id
930  hole_id=6;
931 
932  // Build the 1st hole polyline
933  hole_segment_pt[0] = new TriangleMeshPolyLine(bound_hole,hole_id);
934 
935  // Create points on second boundary
936  for(unsigned ipoint=0; ipoint<ppoints;ipoint++)
937  {
938  // Resize the vector
939  bound_hole[ipoint].resize(2);
940 
941  // Get the coordinates
942  zeta[0]=(unit_zeta*double(ipoint))+MathematicalConstants::Pi;
943  egg_hole_pt->position(zeta,coord);
944  bound_hole[ipoint][0]=coord[0]+x_center;
945  bound_hole[ipoint][1]=coord[1]+y_center;
946  }
947 
948  // Inner hole center coordinates
949  hole_center[0]=x_center;
950  hole_center[1]=y_center;
951 
952  // Clean up
953  delete egg_hole_pt;
954 
955  // Specify the hole boundary id
956  hole_id=7;
957 
958  // Build the 2nd hole polyline
959  hole_segment_pt[1] = new TriangleMeshPolyLine(bound_hole,hole_id);
960 
961  // Fill in the second hole. Specify data that define centre's
962  // displacement
964  hole_center,hole_segment_pt,this->time_stepper_pt(),
966 
967  // Now build the mesh, based on the boundaries specified by
968  //---------------------------------------------------------
969  // polygons just created
970  //----------------------
971  double uniform_element_area=0.2;
972 
974  unsigned nh=Inner_hole_pt.size();
976  for (unsigned i=0;i<nh;i++)
977  {
978  hole_pt[i]=Inner_hole_pt[i];
979  }
980 
981  // Use the TriangleMeshParameters object for gathering all
982  // the necessary arguments for the TriangleMesh object
983  TriangleMeshParameters triangle_mesh_parameters(
984  closed_curve_pt);
985 
986  // Define the holes on the domain
987  triangle_mesh_parameters.internal_closed_curve_pt() =
988  hole_pt;
989 
990  // Define the maximum element area
991  triangle_mesh_parameters.element_area() =
992  uniform_element_area;
993 
994  // Create the mesh
995  Fluid_mesh_pt =
996  new RefineableSolidTriangleMesh<ELEMENT>(
997  triangle_mesh_parameters, this->time_stepper_pt());
998 
999  // Set error estimator for bulk mesh
1001  Fluid_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
1002 
1003 
1004  // Set targets for spatial adaptivity
1005  Fluid_mesh_pt->max_permitted_error()=0.005;
1006  Fluid_mesh_pt->min_permitted_error()=0.001;
1007  Fluid_mesh_pt->max_element_size()=0.2;
1008  Fluid_mesh_pt->min_element_size()=0.001;
1009 
1010  // Use coarser mesh during validation
1012  {
1013  Fluid_mesh_pt->min_element_size()=0.01;
1014  }
1015 
1016  // Output boundary and mesh
1017  this->Fluid_mesh_pt->output_boundaries("boundaries.dat");
1018  this->Fluid_mesh_pt->output("mesh.dat");
1019 
1020  // Set boundary condition, assign auxiliary node update fct,
1021  // complete the build of all elements, attach power elements that allow
1022  // computation of drag vector
1024 
1025  // Create Lagrange multiplier mesh for boundary motion
1026  //----------------------------------------------------
1027  // Construct the mesh of elements that enforce prescribed boundary motion
1028  // of pseudo-solid fluid mesh by Lagrange multipliers
1031 
1032  // Combine meshes
1033  //---------------
1034 
1035  // Add Fluid_mesh_pt sub meshes
1036  this->add_sub_mesh(Fluid_mesh_pt);
1037 
1038  // Add Lagrange_multiplier sub meshes
1040 
1041  // Build global mesh
1042  this->build_global_mesh();
1043 
1044  // Sanity check: Doc boundary coordinates from mesh and GeomObject
1046 
1047  // Setup equation numbering scheme
1048  cout <<"Number of equations: " << this->assign_eqn_numbers() << std::endl;
1049 
1050 } // end_of_constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
TriangleMeshPolygon * Outer_boundary_polyline_pt
Triangle mesh polygon for outer boundary.
Definition: unstructured_adaptive_ALE.cc:710
void complete_problem_setup()
Definition: unstructured_adaptive_ALE.cc:566
Vector< TriangleMeshPolygon * > Inner_hole_pt
Vector storing pointer to the hole polygon.
Definition: unstructured_adaptive_ALE.cc:707
void doc_boundary_coordinates()
Sanity check: Doc boundary coordinates from mesh and GeomObject.
Definition: unstructured_adaptive_ALE.cc:1060
void create_lagrange_multiplier_elements()
Definition: unstructured_adaptive_ALE.cc:1175
RefineableSolidTriangleMesh< ELEMENT > * Fluid_mesh_pt
Pointers to Fluid_mesh.
Definition: unstructured_adaptive_ALE.cc:704
SolidMesh * Lagrange_multiplier_mesh_pt
Pointers to mesh of Lagrange multiplier elements.
Definition: unstructured_adaptive_ALE.cc:701
Definition: nodes.h:86
void set_directory(const std::string &directory)
Definition: oomph_utilities.cc:298
Definition: geom_objects.h:644
void position(const Vector< double > &zeta, Vector< double > &r) const
Position Vector at Lagrangian coordinate zeta.
Definition: geom_objects.h:745
Definition: immersed_rigid_body_elements.h:664
Definition: matrices.h:74
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
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
TimeStepper *& time_stepper_pt()
Definition: problem.h:1524
Definition: mesh.h:2562
Base class defining a closed curve for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1339
Definition: triangle_mesh.template.h:94
Class defining a polyline for use in Triangle Mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:868
Class defining a closed polygon for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1451
Definition: oomph-lib/src/generic/Vector.h:58
Definition: error_estimator.h:266
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE const Eigen::CwiseBinaryOp< Eigen::internal::scalar_zeta_op< typename DerivedX::Scalar >, const DerivedX, const DerivedQ > zeta(const Eigen::ArrayBase< DerivedX > &x, const Eigen::ArrayBase< DerivedQ > &q)
Definition: SpecialFunctionsArrayAPI.h:152
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
DocInfo Doc_info
Doc info.
Definition: refineable_two_layer_interface.cc:291
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
Vector< Data * > Centre_displacement_data_pt
Definition: unstructured_adaptive_ALE.cc:64

References oomph::Problem_Parameter::Centre_displacement_data_pt, oomph::CommandLineArgs::command_line_flag_has_been_set(), Problem_Parameter::Doc_info, oomph::TriangleMeshParameters::element_area(), MeshRefinement::error_estimator_pt, i, oomph::TriangleMeshParameters::internal_closed_curve_pt(), BiharmonicTestFunctions2::Pi, oomph::Ellipse::position(), oomph::DocInfo::set_directory(), and Eigen::zeta().

◆ ~UnstructuredFluidProblem() [1/4]

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

Destructor.

399  {
400  // Fluid timestepper
401  delete this->time_stepper_pt(0);
402 
403  // Kill hole displacement data
404  for(unsigned ihole=0;ihole<2;ihole++)
405  {
407  }
408 
409  // Kill data associated with outer boundary
411  for (unsigned j=0;j<n;j++)
412  {
414  }
416 
417 
418  //Kill data associated with inner holes
419  for(unsigned ihole=0;ihole<2;ihole++)
420  {
421  unsigned n=Inner_hole_pt[ihole]->npolyline();
422  for (unsigned j=0;j<n;j++)
423  {
424  delete Inner_hole_pt[ihole]->polyline_pt(j);
425  }
426  delete Inner_hole_pt[ihole];
427  }
428 
429  // Flush Lagrange multiplier mesh
432 
433  // Delete error estimator
434  delete Fluid_mesh_pt->spatial_error_estimator_pt();
435 
436  // Delete fluid mesh
437  delete Fluid_mesh_pt;
438 
439  // Kill const eqn
441 
442  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void delete_lagrange_multiplier_elements()
Definition: unstructured_adaptive_ALE.cc:683
unsigned npolyline() const
Number of constituent polylines.
Definition: unstructured_two_d_mesh_geometry_base.h:1482
TriangleMeshPolyLine * polyline_pt(const unsigned &i) const
Pointer to i-th constituent polyline.
Definition: unstructured_two_d_mesh_geometry_base.h:1488
ConstitutiveLaw * Constitutive_law_pt
Constitutive law used to determine the mesh deformation.
Definition: jeffery_orbit.cc:82
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

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

◆ UnstructuredFluidProblem() [2/4]

template<class ELEMENT >
UnstructuredFluidProblem< ELEMENT >::UnstructuredFluidProblem ( )

Constructor.

◆ ~UnstructuredFluidProblem() [2/4]

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

Destructor (empty)

155 {}

◆ UnstructuredFluidProblem() [3/4]

template<class ELEMENT >
UnstructuredFluidProblem< ELEMENT >::UnstructuredFluidProblem ( )

Constructor:

◆ ~UnstructuredFluidProblem() [3/4]

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

Destructor (empty)

106 {}

◆ UnstructuredFluidProblem() [4/4]

template<class ELEMENT >
UnstructuredFluidProblem< ELEMENT >::UnstructuredFluidProblem ( )

Constructor:

◆ ~UnstructuredFluidProblem() [4/4]

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

Destructor (empty)

77 {}

Member Function Documentation

◆ actions_after_adapt()

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

Actions after adapt: Rebuild the mesh of Lagrange multiplier elements.

Reimplemented from oomph::Problem.

458  {
459  //Reassign the lagrangian coordinates (an updated lagrangian approach)
460  Fluid_mesh_pt->set_lagrangian_nodal_coordinates();
461 
462  // Create the elements that impose the displacement constraint
464 
465  // Rebuild the Problem's global mesh from its various sub-meshes
466  this->rebuild_global_mesh();
467 
468  // Setup the problem again -- remember that fluid mesh has been
469  // completely rebuilt and its element's don't have any
470  // pointers to Re etc. yet
472 
473  // Output solution after adaptation/projection
474  bool doc_projection=true;
475  doc_solution("new mesh with projected solution",doc_projection);
476 
477  }// end of actions_after_adapt
void doc_solution(const std::string &comment="", const bool &project=false)
Doc the solution.
Definition: unstructured_adaptive_ALE.cc:1257
void rebuild_global_mesh()
Definition: problem.cc:1533

◆ actions_after_newton_solve() [1/2]

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

Update the after solve (empty)

Reimplemented from oomph::Problem.

557 {}

◆ actions_after_newton_solve() [2/2]

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

Update the problem specs before solve: empty.

Reimplemented from oomph::Problem.

83 {}

◆ actions_before_adapt()

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

Actions before adapt: Wipe the mesh of Lagrange multiplier elements.

Reimplemented from oomph::Problem.

446  {
447  // Kill the elements and wipe surface mesh
449 
450  // Rebuild the Problem's global mesh from its various sub-meshes
451  this->rebuild_global_mesh();
452 
453  }// end of actions_before_adapt

◆ actions_before_implicit_timestep()

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

Update before implicit timestep: Move hole boundary.

Reimplemented from oomph::Problem.

482  {
483  double time=this->time_pt()->time();
484  double ampl=0.5*(exp(-10.0*time*time)-
486 
487  // Assign the x increment of the holes using velocity and timestep
488  double dx=Problem_Parameter::
489  Block_x_velocity*ampl*this->time_pt()->dt();
490 
491  // Assign the y increment of the hole using velocity and timestep
492  double dy=Problem_Parameter::
493  Block_y_velocity*ampl*this->time_pt()->dt();
494 
495  // Assign the rotation of the hole using velocity and timestep
496  double ampl2=1.0-exp(-10.0*time*time);
497  double drotation=Problem_Parameter::
498  Block_rotation_velocity*ampl2*this->time_pt()->dt();
499 
500  // Update the geom object position
501  unsigned nhole=this->inner_hole_pt().size();
502  for(unsigned ihole=0;ihole<nhole;ihole++)
503  {
504  //Shift the values for the centre displacement
505  Problem_Parameter::Centre_displacement_data_pt[ihole]->time_stepper_pt()
506  ->shift_time_values(
508 
509  //Now backup
510  double old_x=
512  double old_y=
514  double old_angle=
516 
517 
518  // Update values
520  set_value(1,old_y+dy);
521 
522  // Rotate one hole clockwise the other anti-clockwise
523  if(ihole==0)
524  {
526  set_value(0,old_x-dx);
527 
529  set_value(1,old_y+dy);
530 
532  set_value(2,old_angle+drotation);
533  }
534  else
535  {
537  set_value(0,old_x+dx);
538 
540  set_value(1,old_y-dy);
541 
543  set_value(2,old_angle-drotation);
544  }
545  }
546  }
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
Vector< TriangleMeshPolygon * > & inner_hole_pt()
Get the TriangleMeshPolygon objects.
Definition: unstructured_adaptive_ALE.cc:671
Time *& time_pt()
Return a pointer to the global time object.
Definition: problem.h:1504
double & time()
Return the current value of continuous time.
Definition: problem.cc:11531
double & dt(const unsigned &t=0)
Definition: timesteppers.h:136
double & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615

References oomph::Problem_Parameter::Centre_displacement_data_pt, cos(), Eigen::bfloat16_impl::exp(), and BiharmonicTestFunctions2::Pi.

◆ actions_before_newton_convergence_check()

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

Re-apply the no slip condition (imposed indirectly via dependent velocities)

Reimplemented from oomph::Problem.

551  {
552  // Update mesh -- this applies the auxiliary node update function
553  Fluid_mesh_pt->node_update();
554  }

◆ actions_before_newton_solve() [1/2]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

560 {}

◆ actions_before_newton_solve() [2/2]

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

Update the problem specs before solve: empty.

Reimplemented from oomph::Problem.

80 {}

◆ complete_problem_setup()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::complete_problem_setup ( )
inline

Set boundary condition, assign auxiliary node update fct. Complete the build of all elements, attach power elements that allow computation of drag vector

567  {
568  // Set the boundary conditions for fluid problem: All nodes are
569  // free by default -- just pin the ones that have Dirichlet conditions
570  // here.
571  unsigned nbound=Fluid_mesh_pt->nboundary();
572  for(unsigned ibound=0;ibound<nbound;ibound++)
573  {
574  unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
575  for (unsigned inod=0;inod<num_nod;inod++)
576  {
577  // Get node
578  Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
579 
580  // Pin everywhere apart from in/outflow (boundaries 0 and 2)
581  // where we only impose parallel flow)
582  if ((ibound!=0)&&(ibound!=2))
583  {
584  nod_pt->pin(0);
585  }
586  nod_pt->pin(1);
587 
588  // Pin pseudo-solid positions apart from hole boundary we want to move
589  SolidNode* solid_node_pt = dynamic_cast<SolidNode*>(nod_pt);
590 
591  // Unpin the position of all the nodes on hole boundaries
592  // since they will be moved using Lagrange Multiplier
593  if(ibound > 3)
594  {
595  solid_node_pt->unpin_position(0);
596  solid_node_pt->unpin_position(1);
597 
598  // Assign auxiliary node update fct if we're dealing with a
599  // hole boundary
602  }
603  else
604  {
605  solid_node_pt->pin_position(0);
606  solid_node_pt->pin_position(1);
607  }
608  }
609 
610  } // end loop over boundaries
611 
612  // Complete the build of all elements so they are fully functional
613  unsigned n_element = Fluid_mesh_pt->nelement();
614  for(unsigned e=0;e<n_element;e++)
615  {
616  // Upcast from GeneralisedElement to the present element
617  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Fluid_mesh_pt->element_pt(e));
618 
619  // Set the Reynolds number
620  el_pt->re_pt() = &Problem_Parameter::Re;
621 
622  // Set the Womersley number (same as Re since St=1)
623  el_pt->re_st_pt() = &Problem_Parameter::Re;
624 
625  // Set the constitutive law for pseudo-elastic mesh deformation
626  el_pt->constitutive_law_pt()=Problem_Parameter::Constitutive_law_pt;
627 
628  // Set the "density" for pseudo-elastic mesh deformation
629  el_pt->lambda_sq_pt()=&Problem_Parameter::Lambda_sq;
630  }
631 
632  // Re-apply Dirichlet boundary conditions (projection ignores
633  // boundary conditions!)
634 
635  // Zero velocity and history values of velocity on walls
636  // (boundaries 1 and 3)
637  nbound=this->Fluid_mesh_pt->nboundary();
638  for(unsigned ibound=1;ibound<4;ibound=ibound+2)
639  {
640  unsigned num_nod=this->Fluid_mesh_pt->nboundary_node(ibound);
641  for (unsigned inod=0;inod<num_nod;inod++)
642  {
643  // Get node
644  Node* nod_pt=this->Fluid_mesh_pt->boundary_node_pt(ibound,inod);
645 
646  // Get number of previous (history) values
647  unsigned n_prev=nod_pt->time_stepper_pt()->nprev_values();
648 
649  // Zero all current and previous veloc values
650  for (unsigned t=0;t<=n_prev;t++)
651  {
652  nod_pt->set_value(t,0,0.0);
653  nod_pt->set_value(t,1,0.0);
654  }
655 
656  }
657  }
658  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: nodes.h:906
void set_auxiliary_node_update_fct_pt(AuxNodeUpdateFctPt aux_node_update_fct_pt)
Definition: nodes.h:1596
Definition: nodes.h:1686
void pin_position(const unsigned &i)
Pin the nodal position.
Definition: nodes.h:1816
void unpin_position(const unsigned &i)
Unpin the nodal position.
Definition: nodes.h:1829
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...
double Lambda_sq
Definition: jeffery_orbit.cc:79
double Re
Reynolds number.
Definition: jeffery_orbit.cc:59
void apply_no_slip_on_moving_wall(Node *node_pt)
Definition: fsi.cc:48
t
Definition: plotPSD.py:36

References oomph::FSI_functions::apply_no_slip_on_moving_wall(), Problem_Parameter::Constitutive_law_pt, e(), Problem_Parameter::Lambda_sq, oomph::TimeStepper::nprev_values(), oomph::Data::pin(), oomph::SolidNode::pin_position(), Problem_Parameter::Re, oomph::Node::set_auxiliary_node_update_fct_pt(), oomph::Data::set_value(), plotPSD::t, oomph::Data::time_stepper_pt(), and oomph::SolidNode::unpin_position().

◆ compute_error_estimate()

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

Compute the error estimates and assign to elements for plotting.

Compute error estimates and assign to elements for plotting.

1356 {
1357  // Get error estimator
1358  ErrorEstimator* err_est_pt=Fluid_mesh_pt->spatial_error_estimator_pt();
1359 
1360  // Get/output error estimates
1361  unsigned nel=Fluid_mesh_pt->nelement();
1362  Vector<double> elemental_error(nel);
1363 
1364  // We need a dynamic cast, get_element_errors from the Fluid_mesh_pt
1365  // Dynamic cast is used because get_element_errors require a Mesh* ans
1366  // not a SolidMesh*
1367  Mesh* fluid_mesh_pt=dynamic_cast<Mesh*>(Fluid_mesh_pt);
1368  err_est_pt->get_element_errors(fluid_mesh_pt,
1369  elemental_error);
1370 
1371  // Set errors for post-processing and find extrema
1372  max_err=0.0;
1373  min_err=DBL_MAX;
1374  for (unsigned e=0;e<nel;e++)
1375  {
1376  dynamic_cast<MyTaylorHoodElement*>(Fluid_mesh_pt->element_pt(e))->
1377  set_error(elemental_error[e]);
1378 
1379  max_err=std::max(max_err,elemental_error[e]);
1380  min_err=std::min(min_err,elemental_error[e]);
1381  }
1382 
1383 }
ElasticTriangleMesh< ELEMENT > *& fluid_mesh_pt()
Access function for the fluid mesh.
Definition: unstructured_two_d_fluid.cc:158
Base class for spatial error estimators.
Definition: error_estimator.h:40
void get_element_errors(Mesh *&mesh_pt, Vector< double > &elemental_error)
Definition: error_estimator.h:56
Definition: mesh.h:67
Overload TaylorHood element to modify output.
Definition: pressure_driven_torus.cc:98
#define min(a, b)
Definition: datatypes.h:22
#define max(a, b)
Definition: datatypes.h:23
void set_error(const double &error)
Set error value for post-processing.
Definition: overloaded_element_body.h:432

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

◆ create_fluid_traction_elements()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::create_fluid_traction_elements

Create fluid traction elements at inflow.

Create fluid traction elements.

314 {
315 
316  // Counter for number of fluid traction meshes
317  unsigned count=0;
318 
319  // Loop over inflow/outflow boundaries
320  for (unsigned in_out=0;in_out<2;in_out++)
321  {
322  // Loop over boundaries with fluid traction elements
324  if (in_out==1) n=nfluid_outflow_traction_boundary();
325  for (unsigned i=0;i<n;i++)
326  {
327  // Get boundary ID
328  unsigned b=0;
329  if (in_out==0)
330  {
332  }
333  else
334  {
336  }
337 
338  // How many bulk elements are adjacent to boundary b?
339  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
340 
341  // Loop over the bulk elements adjacent to boundary b
342  for(unsigned e=0;e<n_element;e++)
343  {
344  // Get pointer to the bulk element that is adjacent to boundary b
345  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
346  Fluid_mesh_pt->boundary_element_pt(b,e));
347 
348  //What is the index of the face of the element e along boundary b
349  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
350 
351  // Create new element
353  new NavierStokesTractionElement<ELEMENT>(bulk_elem_pt,
354  face_index);
355 
356  // Add it to the mesh
357  Fluid_traction_mesh_pt[count]->add_element_pt(el_pt);
358 
359  // Set the pointer to the prescribed traction function
360  if (in_out==0)
361  {
362  el_pt->traction_fct_pt() =
364  }
365  else
366  {
367  el_pt->traction_fct_pt() =
369  }
370  }
371  // Bump up counter
372  count++;
373  }
374  }
375 
376  } // end of create_traction_elements
Scalar * b
Definition: benchVecAdd.cpp:17
Vector< unsigned > Inflow_boundary_id
Definition: unstructured_three_d_fluid.cc:142
Vector< unsigned > Outflow_boundary_id
Definition: unstructured_three_d_fluid.cc:146
unsigned nfluid_inflow_traction_boundary()
Return total number of fluid inflow traction boundaries.
Definition: unstructured_three_d_fluid.cc:112
unsigned nfluid_outflow_traction_boundary()
Return total number of fluid outflow traction boundaries.
Definition: unstructured_three_d_fluid.cc:118
Vector< Mesh * > Fluid_traction_mesh_pt
Meshes of fluid traction elements that apply pressure at in/outflow.
Definition: unstructured_three_d_fluid.cc:138
Definition: fluid_traction_elements.h:55
void(*&)(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &result) traction_fct_pt()
Definition: fluid_traction_elements.h:186
void prescribed_outflow_traction(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Applied traction on fluid at the inflow boundary.
Definition: unstructured_three_d_fsi.cc:190
void prescribed_inflow_traction(const double &t, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Applied traction on fluid at the inflow boundary.
Definition: unstructured_three_d_fsi.cc:175

References b, e(), i, n, Global_Parameters::prescribed_inflow_traction(), Global_Parameters::prescribed_outflow_traction(), and oomph::NavierStokesTractionElement< ELEMENT >::traction_fct_pt.

◆ create_lagrange_multiplier_elements()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::create_lagrange_multiplier_elements
private

Create elements that enforce prescribed boundary motion for the pseudo-solid fluid mesh by Lagrange multipliers

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

1176 {
1177  // The idea is to apply Lagrange multipliers to the boundaries in the mesh
1178  // that have associated geometric objects
1179 
1180  //Find the number of boundaries
1181  unsigned n_boundary = Fluid_mesh_pt->nboundary();
1182 
1183  // Loop over the boundaries
1184  for(unsigned b=0;b<n_boundary;b++)
1185  {
1186  //Get the geometric object associated with the boundary
1187  GeomObject* boundary_geom_obj_pt =
1188  Fluid_mesh_pt->boundary_geom_object_pt(b);
1189 
1190  //Only bother to do anything if there is a geometric object
1191  if(boundary_geom_obj_pt!=0)
1192  {
1193  // How many bulk fluid elements are adjacent to boundary b?
1194  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
1195 
1196  // Loop over the bulk fluid elements adjacent to boundary b
1197  for(unsigned e=0;e<n_element;e++)
1198  {
1199  // Get pointer to the bulk fluid element that is
1200  // adjacent to boundary b
1201  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
1202  Fluid_mesh_pt->boundary_element_pt(b,e));
1203 
1204  //Find the index of the face of element e along boundary b
1205  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
1206 
1207  // Create new element. Note that we use different Lagrange
1208  // multiplier fields for each distinct boundary (here indicated
1209  // by b.
1212  bulk_elem_pt,face_index,b);
1213 
1214  // Add it to the mesh
1216 
1217  // Set the GeomObject that defines the boundary shape and set
1218  // which bulk boundary we are attached to (needed to extract
1219  // the boundary coordinate from the bulk nodes)
1221  boundary_geom_obj_pt,b);
1222 
1223  // Loop over the nodes to pin Lagrange multiplier
1224  unsigned nnod=el_pt->nnode();
1225  for(unsigned j=0;j<nnod;j++)
1226  {
1227  Node* nod_pt = el_pt->node_pt(j);
1228 
1229  // How many nodal values were used by the "bulk" element
1230  // that originally created this node?
1231  unsigned n_bulk_value=el_pt->nbulk_value(j);
1232 
1233  // Pin two of the four Lagrange multipliers at vertices
1234  // This is not totally robust, but will work in this application
1235  unsigned nval=nod_pt->nvalue();
1236  if (nval==7)
1237  {
1238  for (unsigned i=0;i<2;i++)
1239  {
1240  // Pin lagrangian multipliers
1241  nod_pt->pin(n_bulk_value+2+i);
1242  }
1243  }
1244  }
1245  } // end loop over the element
1246  } //End of case if there is a geometric object
1247  } //End of loop over boundaries
1248 
1249 }
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: geom_objects.h:101
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
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617

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().

◆ create_parallel_outflow_lagrange_elements()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::create_parallel_outflow_lagrange_elements
private

Create Lagrange multiplier elements that enforce parallel outflow.

Create Lagrange multiplier elements that impose parallel outflow.

330 {
331  // Counter for number of Lagrange multiplier meshes
332  unsigned count=0;
333 
334  // Loop over inflow/outflow boundaries
335  for (unsigned in_out=0;in_out<2;in_out++)
336  {
337  // Loop over boundaries with Lagrange multiplier elements
339  if (in_out==1) n=nfluid_outflow_traction_boundary();
340  for (unsigned i=0;i<n;i++)
341  {
342  // Get boundary ID
343  unsigned b=0;
344  if (in_out==0)
345  {
347  }
348  else
349  {
351  }
352 
353  // How many bulk elements are adjacent to boundary b?
354  unsigned n_element = Fluid_mesh_pt->nboundary_element(b);
355 
356  // Loop over the bulk elements adjacent to boundary b
357  for(unsigned e=0;e<n_element;e++)
358  {
359  // Get pointer to the bulk element that is adjacent to boundary b
360  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
361  Fluid_mesh_pt->boundary_element_pt(b,e));
362 
363  //What is the index of the face of the element e along boundary b
364  int face_index = Fluid_mesh_pt->face_index_at_boundary(b,e);
365 
366  // Build the corresponding lagrange element
368  ImposeParallelOutflowElement<ELEMENT>(bulk_elem_pt,face_index);
369 
370  // Add it to the mesh
372  add_element_pt(el_pt);
373 
374  // Set the pointer to the prescribed pressure
375  if (in_out==0)
376  {
378  }
379  else
380  {
382  }
383  }
384  // Bump up counter
385  count++;
386  }
387  }
388 
389 } // done
Vector< Mesh * > Parallel_outflow_lagrange_multiplier_mesh_pt
Definition: vmtk_fluid.cc:116
Definition: impose_parallel_outflow_element.h:46
double *& pressure_pt()
Access function for the pressure.
Definition: impose_parallel_outflow_element.h:129
double P_in
Fluid pressure on inflow boundary.
Definition: unsteady_vmtk_fsi.cc:76
double P_out
Fluid pressure on outflow boundary.
Definition: unsteady_vmtk_fsi.cc:79

References b, e(), i, n, Global_Parameters::P_in, Global_Parameters::P_out, and oomph::ImposeParallelOutflowElement< ELEMENT >::pressure_pt().

◆ delete_lagrange_multiplier_elements()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::delete_lagrange_multiplier_elements ( )
inlineprivate

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

684  {
685  // How many surface elements are in the surface mesh
686  unsigned n_element = Lagrange_multiplier_mesh_pt->nelement();
687 
688  // Loop over the surface elements
689  for(unsigned e=0;e<n_element;e++)
690  {
691  // Kill surface element
693  }
694 
695  // Wipe the mesh
697 
698  } // end of delete_lagrange_multiplier_elements
void flush_element_and_node_storage()
Definition: mesh.h:407
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590

References e().

◆ doc_boundary_coordinates()

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::doc_boundary_coordinates

Sanity check: Doc boundary coordinates from mesh and GeomObject.

Doc boundary coordinates in mesh and plot GeomObject representation of inner boundary.

1061 {
1062 
1063  ofstream some_file;
1064  char filename[100];
1065 
1066  // Number of plot points
1067  unsigned npoints = 5;
1068 
1069  // Output solution and projection files
1070  sprintf(filename,"RESLT/inner_hole_boundary_from_geom_obj.dat");
1071  some_file.open(filename);
1072 
1073  //Initialize zeta and r
1074  Vector<double> zeta(1);
1075  zeta[0]=0;
1076 
1077  Vector<double> r(2);
1078  r[0]=0;
1079  r[1]=0;
1080 
1081  // Loop over the boundaries of the fluid mesh and print out geometric
1082  // objects associated with each
1083  unsigned n_boundary = Fluid_mesh_pt->nboundary();
1084  for(unsigned b=0;b<n_boundary;b++)
1085  {
1086  //Get geometric object for b-th bounday
1087  GeomObject* boundary_geom_obj_pt =
1088  Fluid_mesh_pt->boundary_geom_object_pt(b);
1089 
1090  //Only bother to do anything if there is a geometric object
1091  if(boundary_geom_obj_pt!=0)
1092  {
1093  // Zone label
1094  some_file << "ZONE T=boundary" << b << std::endl;
1095 
1096  //Get the coordinate limits
1097  Vector<double> zeta_limits =
1098  Fluid_mesh_pt->boundary_coordinate_limits(b);
1099 
1100  //Set the increment
1101  double zeta_inc =
1102  (zeta_limits[1] - zeta_limits[0])/(double)(npoints-1);
1103 
1104  for(unsigned i=0;i<npoints;i++)
1105  {
1106  // Get coordinate
1107  zeta[0] = zeta_limits[0] + i*zeta_inc;
1108  boundary_geom_obj_pt->position(zeta,r);
1109 
1110  // Print it
1111  some_file <<r[0]<<" "<<r[1]<<" "<<zeta[0]<<std::endl;
1112  }
1113  }
1114  }
1115  some_file.close();
1116 
1117  // Doc boundary coordinates using Lagrange_multiplier_mesh_pt
1118  std::ofstream the_file("RESLT/inner_hole_boundary_from_mesh.dat");
1119 
1120  // Initialise max/min boundary coordinate
1121  double zeta_min= DBL_MAX;
1122  double zeta_max=-DBL_MAX;
1123 
1124  // Loop over Lagrange_multiplier elements
1125  unsigned n_face_element = this->Lagrange_multiplier_mesh_pt->nelement();
1126 
1127  for(unsigned e=0;e<n_face_element;e++)
1128  {
1129 
1130  //Cast the element pointer
1134 
1135  // Doc boundary coordinate
1136  Vector<double> s(1);
1137  Vector<double> zeta(1);
1138  Vector<double> x(2);
1139  unsigned n_plot=5;
1140 
1141  the_file << el_pt->tecplot_zone_string(n_plot);
1142 
1143  // Loop over plot points
1144  unsigned num_plot_points=el_pt->nplot_points(n_plot);
1145  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
1146  {
1147  // Get local coordinates of plot point
1148  el_pt->get_s_plot(iplot,n_plot,s);
1149  el_pt->interpolated_zeta(s,zeta);
1150  el_pt->interpolated_x(s,x);
1151  for (unsigned i=0;i<2;i++)
1152  {
1153  the_file << x[i] << " ";
1154  }
1155  the_file << zeta[0] << " ";
1156 
1157  // Update max/min boundary coordinate
1158  if (zeta[0]<zeta_min) zeta_min=zeta[0];
1159  if (zeta[0]>zeta_max) zeta_max=zeta[0];
1160 
1161  the_file << std::endl;
1162  }
1163  }
1164  // Close doc file
1165  the_file.close();
1166 
1167 
1168 } //end doc_solid_zeta
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
void interpolated_zeta(const Vector< double > &s, Vector< double > &zeta) const
Definition: elements.cc:4675
virtual std::string tecplot_zone_string(const unsigned &nplot) const
Definition: elements.h:3161
virtual void get_s_plot(const unsigned &i, const unsigned &nplot, Vector< double > &s, const bool &shifted_to_interior=false) const
Definition: elements.h:3148
virtual unsigned nplot_points(const unsigned &nplot) const
Definition: elements.h:3186
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
RealScalar s
Definition: level1_cplx_impl.h:130
string filename
Definition: MergeRestartFiles.py:39
r
Definition: UniformPSDSelfTest.py:20
list x
Definition: plotDoE.py:28

References b, e(), MergeRestartFiles::filename, oomph::FiniteElement::get_s_plot(), i, oomph::FaceElement::interpolated_x(), oomph::FiniteElement::interpolated_zeta(), oomph::FiniteElement::nplot_points(), oomph::GeomObject::position(), UniformPSDSelfTest::r, s, oomph::FiniteElement::tecplot_zone_string(), plotDoE::x, and Eigen::zeta().

◆ doc_solution() [1/4]

template<class ELEMENT >
void UnstructuredFluidProblem< ELEMENT >::doc_solution ( const std::string &  comment = "",
const bool &  project = false 
)

Doc the solution.

1260 {
1261 
1262  oomph_info << "Docing step: " << Problem_Parameter::Doc_info.number()
1263  << std::endl;
1264 
1265 
1266  oomph_info
1267  << "Docing step: " << Problem_Parameter::Doc_info.number()
1268  << "\n cenrelinedispl = "
1270  << "centre of mass: "
1271  << dynamic_cast<ImmersedRigidBodyTriangleMeshPolygon*>(
1272  Inner_hole_pt[0])->initial_centre_of_mass(0)
1273  << std::endl;
1274 
1275 
1276  ofstream some_file;
1277  char filename[100];
1278 
1279  // Number of plot points
1280  unsigned npts;
1281  npts=5;
1282 
1283 
1284  // Compute errors and assign to each element for plotting
1285  double max_err;
1286  double min_err;
1287  compute_error_estimate(max_err,min_err);
1288 
1289  // Output solution and projection files
1290  if(!project)
1291  {
1292  sprintf(filename,"%s/soln%i.dat",
1293  Problem_Parameter::Doc_info.directory().c_str(),
1294  Problem_Parameter::Doc_info.number());
1295  }
1296  else
1297  {
1298  sprintf(filename,"%s/proj%i.dat",
1299  Problem_Parameter::Doc_info.directory().c_str(),
1300  Problem_Parameter::Doc_info.number()-1);
1301  }
1302 
1303 
1304  // Assemble square of L2 norm
1305  double square_of_l2_norm=0.0;
1306  unsigned nel=Fluid_mesh_pt->nelement();
1307  for (unsigned e=0;e<nel;e++)
1308  {
1310  dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(e))->
1312  }
1313  Problem_Parameter::Norm_file << sqrt(square_of_l2_norm) << "\n";
1314 
1315 
1316  some_file.open(filename);
1317  some_file << dynamic_cast<ELEMENT*>(this->Fluid_mesh_pt->element_pt(0))
1318  ->variable_identifier();
1319  this->Fluid_mesh_pt->output(some_file,npts);
1320  some_file << "TEXT X = 25, Y = 78, CS=FRAME T = \"Global Step "
1321  << Problem_Parameter::Doc_info.number() << " "
1322  << comment << "\"\n";
1323  some_file.close();
1324 
1325  // No trace file writing after projection
1326  if(project) return;
1327 
1328  // Get max/min area
1329  double max_area;
1330  double min_area;
1331  Fluid_mesh_pt->max_and_min_element_size(max_area, min_area);
1332 
1333  // Write trace file
1335  << this->time_pt()->time() << " "
1336  << Fluid_mesh_pt->nelement() << " "
1337  << max_area << " "
1338  << min_area << " "
1339  << max_err << " "
1340  << min_err << " "
1341  << sqrt(square_of_l2_norm) << " "
1342  << std::endl;
1343 
1344  // Increment the doc_info number
1346 
1347 
1348 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
void compute_error_estimate(double &max_err, double &min_err)
Compute the error estimates and assign to elements for plotting.
Definition: unstructured_adaptive_ALE.cc:1354
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
ofstream Norm_file
Definition: refineable_two_layer_interface.cc:341
ofstream Trace_file
Trace file.
Definition: refineable_two_layer_interface.cc:335
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
double square_of_l2_norm()
Get square of L2 norm of velocity.
Definition: overloaded_element_body.h:1031

References oomph::Problem_Parameter::Centre_displacement_data_pt, Problem_Parameter::Doc_info, e(), MergeRestartFiles::filename, Problem_Parameter::Norm_file, oomph::DocInfo::number(), oomph::oomph_info, sqrt(), square_of_l2_norm(), and Problem_Parameter::Trace_file.

◆ doc_solution() [2/4]

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

Doc the solution.

340 {
341  ofstream some_file;
342  char filename[100];
343 
344  // Number of plot points
345  unsigned npts;
346  npts=5;
347 
348  // Output solution
349  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
350  doc_info.number());
351  some_file.open(filename);
352  fluid_mesh_pt()->output(some_file,npts);
353  some_file.close();
354 } //end_of_doc_solution
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524

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

◆ doc_solution() [3/4]

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

Doc the solution.

◆ doc_solution() [4/4]

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

Doc the solution.

◆ fluid_mesh_pt()

template<class ELEMENT >
ElasticTriangleMesh<ELEMENT>*& UnstructuredFluidProblem< ELEMENT >::fluid_mesh_pt ( )
inline

Access function for the fluid mesh.

159  {
160  return Fluid_mesh_pt;
161  }

◆ inner_hole_pt()

template<class ELEMENT >
Vector<TriangleMeshPolygon*>& UnstructuredFluidProblem< ELEMENT >::inner_hole_pt ( )
inline

Get the TriangleMeshPolygon objects.

672  {return Inner_hole_pt;}

◆ nfluid_inflow_traction_boundary() [1/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_inflow_traction_boundary ( )
inline

Return total number of fluid inflow traction boundaries.

113  {
114  return Inflow_boundary_id.size();
115  }

◆ nfluid_inflow_traction_boundary() [2/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_inflow_traction_boundary ( )
inline

Return total number of fluid inflow traction boundaries.

90  {
91  return Inflow_boundary_id.size();
92  }

◆ nfluid_outflow_traction_boundary() [1/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_outflow_traction_boundary ( )
inline

Return total number of fluid outflow traction boundaries.

119  {
120  return Outflow_boundary_id.size();
121  }

◆ nfluid_outflow_traction_boundary() [2/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_outflow_traction_boundary ( )
inline

Return total number of fluid outflow traction boundaries.

96  {
97  return Outflow_boundary_id.size();
98  }

◆ nfluid_traction_boundary() [1/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_traction_boundary ( )
inline

Return total number of fluid outflow traction boundaries.

125  {
126  return Inflow_boundary_id.size()+Outflow_boundary_id.size();
127  }

◆ nfluid_traction_boundary() [2/2]

template<class ELEMENT >
unsigned UnstructuredFluidProblem< ELEMENT >::nfluid_traction_boundary ( )
inline

Return total number of fluid outflow traction boundaries.

102  {
103  return Inflow_boundary_id.size()+Outflow_boundary_id.size();
104  }

◆ set_boundary_conditions()

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

Set the boundary conditions.

Set the boundary conditions for the problem and document the boundary nodes

215 {
216  // Doc pinned nodes
217  std::ofstream solid_bc_file("pinned_solid_nodes.dat");
218  std::ofstream u_bc_file("pinned_u_nodes.dat");
219  std::ofstream v_bc_file("pinned_v_nodes.dat");
220 
221  // Set the boundary conditions for fluid problem: All nodes are
222  // free by default -- just pin the ones that have Dirichlet conditions
223  // here.
224  unsigned nbound=Fluid_mesh_pt->nboundary();
225  for(unsigned ibound=0;ibound<nbound;ibound++)
226  {
227  unsigned num_nod=Fluid_mesh_pt->nboundary_node(ibound);
228  for (unsigned inod=0;inod<num_nod;inod++)
229  {
230  // Get node
231  Node* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
232 
233  // Pin velocity everywhere apart from outlet where we
234  // have parallel outflow
235  if (ibound!=2)
236  {
237  // Pin it
238  nod_pt->pin(0);
239  // Doc it as pinned
240  u_bc_file << nod_pt->x(0) << " " << nod_pt->x(1) << std::endl;
241  }
242  // Pin it
243  nod_pt->pin(1);
244  // Doc it as pinned
245  v_bc_file << nod_pt->x(0) << " " << nod_pt->x(1) << std::endl;
246 
247  // Pin pseudo-solid positions everywhere
248  for(unsigned i=0;i<2;i++)
249  {
250  // Pin the node
251  SolidNode* nod_pt=Fluid_mesh_pt->boundary_node_pt(ibound,inod);
252  nod_pt->pin_position(i);
253 
254  // Doc it as pinned
255  solid_bc_file << nod_pt->x(i) << " ";
256  }
257  solid_bc_file << std::endl;
258  }
259  } // end loop over boundaries
260 
261  // Close
262  solid_bc_file.close();
263 
264  // Complete the build of all elements so they are fully functional
265  unsigned n_element = fluid_mesh_pt()->nelement();
266  for(unsigned e=0;e<n_element;e++)
267  {
268  // Upcast from GeneralisedElement to the present element
269  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(fluid_mesh_pt()->element_pt(e));
270 
271  //Set the Reynolds number
272  el_pt->re_pt() = &Global_Physical_Variables::Re;
273 
274  // Set the constitutive law
275  el_pt->constitutive_law_pt() =
277  }
278 
279 
280  // Apply fluid boundary conditions: Poiseuille at inflow
281  //------------------------------------------------------
282 
283  // Find max. and min y-coordinate at inflow
284  unsigned ibound=1;
285  //Initialise y_min and y_max to y-coordinate of first node on boundary
286  double y_min=fluid_mesh_pt()->boundary_node_pt(ibound,0)->x(1);
287  double y_max=y_min;
288  //Loop over the rest of the nodes
289  unsigned num_nod= fluid_mesh_pt()->nboundary_node(ibound);
290  for (unsigned inod=1;inod<num_nod;inod++)
291  {
292  double y=fluid_mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
293  if (y>y_max)
294  {
295  y_max=y;
296  }
297  if (y<y_min)
298  {
299  y_min=y;
300  }
301  }
302  double y_mid=0.5*(y_min+y_max);
303 
304  // Loop over all boundaries
305  for (unsigned ibound=0;ibound<fluid_mesh_pt()->nboundary();ibound++)
306  {
307  unsigned num_nod= fluid_mesh_pt()->nboundary_node(ibound);
308  for (unsigned inod=0;inod<num_nod;inod++)
309  {
310  // Parabolic inflow at the left boundary (boundary 1)
311  if (ibound==1)
312  {
313  double y=fluid_mesh_pt()->boundary_node_pt(ibound,inod)->x(1);
314  double veloc=1.5/(y_max-y_min)*
315  (y-y_min)*(y_max-y)/((y_mid-y_min)*(y_max-y_mid));
316  fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,veloc);
317  fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
318  }
319  // Zero flow elsewhere apart from x-velocity on outflow boundary
320  else
321  {
322  if(ibound!=2)
323  {
324  fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(0,0.0);
325  }
326  fluid_mesh_pt()->boundary_node_pt(ibound,inod)->set_value(1,0.0);
327  }
328  }
329  }
330 } // end_of_set_boundary_conditions
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
Scalar * y
Definition: level1_cplx_impl.h:128
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: TwenteMeshGluing.cpp:65
double Re
Reynolds number.
Definition: fibre.cc:55

References Global_Physical_Variables::Constitutive_law_pt, e(), i, oomph::Data::pin(), oomph::SolidNode::pin_position(), Global_Physical_Variables::Re, oomph::Node::x(), and y.

Member Data Documentation

◆ Fluid_mesh_pt [1/3]

template<class ELEMENT >
TetgenMesh< ELEMENT > * UnstructuredFluidProblem< ELEMENT >::Fluid_mesh_pt
private

Pointers to Fluid_mesh.

Bulk fluid mesh.

◆ Fluid_mesh_pt [2/3]

template<class ELEMENT >
ElasticTriangleMesh<ELEMENT>* UnstructuredFluidProblem< ELEMENT >::Fluid_mesh_pt
private

Fluid mesh.

◆ Fluid_mesh_pt [3/3]

template<class ELEMENT >
TetgenMesh<ELEMENT>* UnstructuredFluidProblem< ELEMENT >::Fluid_mesh_pt

Bulk fluid mesh.

◆ Fluid_traction_mesh_pt

template<class ELEMENT >
Vector<Mesh*> UnstructuredFluidProblem< ELEMENT >::Fluid_traction_mesh_pt

Meshes of fluid traction elements that apply pressure at in/outflow.

◆ Inflow_boundary_id

template<class ELEMENT >
Vector< unsigned > UnstructuredFluidProblem< ELEMENT >::Inflow_boundary_id

IDs of fluid mesh boundaries along which inflow boundary conditions are applied

◆ Inner_hole_pt

template<class ELEMENT >
Vector<TriangleMeshPolygon*> UnstructuredFluidProblem< ELEMENT >::Inner_hole_pt
private

Vector storing pointer to the hole polygon.

◆ Lagrange_multiplier_mesh_pt

template<class ELEMENT >
SolidMesh* UnstructuredFluidProblem< ELEMENT >::Lagrange_multiplier_mesh_pt
private

Pointers to mesh of Lagrange multiplier elements.

◆ Outer_boundary_polyline_pt

template<class ELEMENT >
TriangleMeshPolygon* UnstructuredFluidProblem< ELEMENT >::Outer_boundary_polyline_pt
private

Triangle mesh polygon for outer boundary.

◆ Outflow_boundary_id

template<class ELEMENT >
Vector< unsigned > UnstructuredFluidProblem< ELEMENT >::Outflow_boundary_id

IDs of fluid mesh boundaries along which inflow boundary conditions are applied

◆ Parallel_outflow_lagrange_multiplier_mesh_pt

template<class ELEMENT >
Vector<Mesh*> UnstructuredFluidProblem< ELEMENT >::Parallel_outflow_lagrange_multiplier_mesh_pt
private

Meshes of FaceElements imposing parallel outflow and a pressure at the in/outflow


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