UnsteadyHeatProblem< ELEMENT > Class Template Reference

UnsteadyHeat problem. More...

+ Inheritance diagram for UnsteadyHeatProblem< ELEMENT >:

Public Member Functions

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

Private Types

enum  {
  Initial_time_boundary_id =0 , Lower_spatial_boundary_id =1 , Right_spatial_boundary_id =2 , Upper_spatial_boundary_id =3 ,
  Left_spatial_boundary_id =4 , Final_time_boundary_id =5
}
 
enum  { Diagonal_preconditioner =0 , Lower_triangular_preconditioner =1 }
 
enum  {
  Initial_time_boundary_id =0 , Lower_spatial_boundary_id =1 , Right_spatial_boundary_id =2 , Upper_spatial_boundary_id =3 ,
  Left_spatial_boundary_id =4 , Final_time_boundary_id =5
}
 
enum  { Diagonal_preconditioner =0 , Lower_triangular_preconditioner =1 }
 
enum  {
  Initial_time_boundary_id =0 , Lower_spatial_boundary_id =1 , Right_spatial_boundary_id =2 , Upper_spatial_boundary_id =3 ,
  Left_spatial_boundary_id =4 , Final_time_boundary_id =5
}
 
typedef SpaceTimeUnsteadyHeatEquations< 2 >::SpaceTimeUnsteadyHeatSourceFctPt SpaceTimeFunctionPt
 
typedef SpaceTimeUnsteadyHeatEquations< 2 >::SpaceTimeUnsteadyHeatSourceFctPt SpaceTimeFunctionPt
 
typedef SpaceTimeUnsteadyHeatMixedOrderEquations< 2 >::SpaceTimeUnsteadyHeatSourceFctPt SpaceTimeFunctionPt
 

Private Member Functions

void create_flux_elements ()
 Create flux elements. More...
 
void delete_flux_elements ()
 Delete flux elements. More...
 
void complete_problem_setup ()
 Complete problem setup: pass pointers to physical variables. More...
 

Private Attributes

RefineableTriangleMesh< ELEMENT > * Bulk_mesh_pt
 Pointers to specific mesh. More...
 
MeshSurface_melt_mesh_pt
 Pointer to the "surface" mesh. More...
 
MeshSurface_mesh_pt
 Pointer to the "surface" mesh. More...
 
unsigned Flux_boundary_id
 ID of flux boundary. More...
 
unsigned Melt_boundary_id
 ID of melt boundary. More...
 
ofstream Trace_file
 Trace file. More...
 
UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt Source_fct_pt
 Pointer to source function. More...
 
MeshBulk_mesh_pt
 Pointer to the "bulk" mesh. More...
 
NodeControl_node_pt
 Pointer to control node at which the solution is documented. More...
 
RefineableSimpleCubicMesh< ELEMENT > * Bulk_mesh_pt
 Pointer to the mesh. More...
 
SpaceTimeFunctionPt Source_fct_pt
 Pointer to source function. More...
 
bool Periodicity_has_been_enforced
 
IterativeLinearSolverSolver_pt
 Oomph-lib iterative linear solver. More...
 
PreconditionerPrec_pt
 Preconditioner. More...
 
unsigned N_space_time_slab
 

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

Detailed Description

template<class ELEMENT>
class UnsteadyHeatProblem< ELEMENT >

UnsteadyHeat problem.

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

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

Member Typedef Documentation

◆ SpaceTimeFunctionPt [1/3]

template<class ELEMENT >
typedef SpaceTimeUnsteadyHeatEquations<2>:: SpaceTimeUnsteadyHeatSourceFctPt UnsteadyHeatProblem< ELEMENT >::SpaceTimeFunctionPt
private

◆ SpaceTimeFunctionPt [2/3]

template<class ELEMENT >
typedef SpaceTimeUnsteadyHeatEquations<2>:: SpaceTimeUnsteadyHeatSourceFctPt UnsteadyHeatProblem< ELEMENT >::SpaceTimeFunctionPt
private

◆ SpaceTimeFunctionPt [3/3]

template<class ELEMENT >
typedef SpaceTimeUnsteadyHeatMixedOrderEquations<2>:: SpaceTimeUnsteadyHeatSourceFctPt UnsteadyHeatProblem< ELEMENT >::SpaceTimeFunctionPt
private

Member Enumeration Documentation

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Initial_time_boundary_id 
Lower_spatial_boundary_id 
Right_spatial_boundary_id 
Upper_spatial_boundary_id 
Left_spatial_boundary_id 
Final_time_boundary_id 
237  {
244  };
@ Upper_spatial_boundary_id
Definition: test_equal_order_galerkin.cc:241
@ Lower_spatial_boundary_id
Definition: test_equal_order_galerkin.cc:239
@ Initial_time_boundary_id
Definition: test_equal_order_galerkin.cc:238
@ Right_spatial_boundary_id
Definition: test_equal_order_galerkin.cc:240
@ Final_time_boundary_id
Definition: test_equal_order_galerkin.cc:243
@ Left_spatial_boundary_id
Definition: test_equal_order_galerkin.cc:242

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Diagonal_preconditioner 
Lower_triangular_preconditioner 
316  {
319  };
@ Lower_triangular_preconditioner
Definition: test_equal_order_galerkin_petrov.cc:318
@ Diagonal_preconditioner
Definition: test_equal_order_galerkin_petrov.cc:317

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Initial_time_boundary_id 
Lower_spatial_boundary_id 
Right_spatial_boundary_id 
Upper_spatial_boundary_id 
Left_spatial_boundary_id 
Final_time_boundary_id 

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Diagonal_preconditioner 
Lower_triangular_preconditioner 
338  {
341  };

◆ anonymous enum

template<class ELEMENT >
anonymous enum
private
Enumerator
Initial_time_boundary_id 
Lower_spatial_boundary_id 
Right_spatial_boundary_id 
Upper_spatial_boundary_id 
Left_spatial_boundary_id 
Final_time_boundary_id 

Constructor & Destructor Documentation

◆ UnsteadyHeatProblem() [1/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem

Constructor.

Constructor for UnsteadyHeat problem in square domain.

316 {
317 
318  // Open trace file
319  Trace_file.open("RESLT/trace.dat");
320 
321  // Allow for crap initial guess
322  Problem::Max_residuals=10000.0;
324 
325  // Allocate the timestepper -- this constructs the Problem's
326  // time object with a sufficient amount of storage to store the
327  // previous timsteps.
329 
330  // Pointer to the closed curve that defines the outer boundary
331  TriangleMeshClosedCurve* closed_curve_pt=0;
332 
333  // Build outer boundary as Polygon
334 
335  // The boundary is bounded by three distinct boundaries, each
336  // represented by its own polyline
337  Vector<TriangleMeshCurveSection*> boundary_polyline_pt(3);
338 
339  // Vertex coordinates on boundary
340  Vector<Vector<double> > bound_coords(4);
341 
342  // First part of the boundary
343  //---------------------------
344  bound_coords[0].resize(2);
345  bound_coords[0][0]=0.0;
346  bound_coords[0][1]=0.0;
347 
348  bound_coords[1].resize(2);
349  bound_coords[1][0]=1.0;
350  bound_coords[1][1]=0.0;
351 
352  bound_coords[2].resize(2);
353  bound_coords[2][0]=1.0;
354  bound_coords[2][1]=1.0;
355 
356  bound_coords[3].resize(2);
357  bound_coords[3][0]=0.0;
358  bound_coords[3][1]=1.0;
359 
360  // Build the 1st boundary polyline
361  unsigned boundary_id=0;
362  boundary_polyline_pt[0]=new TriangleMeshPolyLine(bound_coords,boundary_id);
363 
364  // Second part of the boundary
365  //----------------------------
366  bound_coords.resize(2);
367  bound_coords[0].resize(2);
368  bound_coords[0][0]=0.0;
369  bound_coords[0][1]=1.0;
370 
371  bound_coords[1].resize(2);
372  bound_coords[1][0]=0.0;
373  bound_coords[1][1]=0.5;
374 
375 
376  // Flux boundary
378 
379  // Build the 2nd boundary polyline
380  boundary_polyline_pt[1]=new TriangleMeshPolyLine(bound_coords,
382 
383 
384  // Third part of the boundary
385  //----------------------------
386  bound_coords.resize(2);
387  bound_coords[0].resize(2);
388  bound_coords[0][0]=0.0;
389  bound_coords[0][1]=0.5;
390 
391  bound_coords[1].resize(2);
392  bound_coords[1][0]=0.0;
393  bound_coords[1][1]=0.0;
394 
395 
396  // Flux boundary
398 
399  // Build the 3rd boundary polyline
400  boundary_polyline_pt[2]=new TriangleMeshPolyLine(bound_coords,
402 
403  // Create the triangle mesh polygon for outer boundary
404  //----------------------------------------------------
405  TriangleMeshPolygon *outer_polygon =
406  new TriangleMeshPolygon(boundary_polyline_pt);
407 
408  // Set the pointer
409  closed_curve_pt = outer_polygon;
410 
411  // Now build the mesh
412  //===================
413 
414  // Use the TriangleMeshParameters object for helping on the manage of the
415  // TriangleMesh parameters
416  TriangleMeshParameters triangle_mesh_parameters(closed_curve_pt);
417 
418  // Specify the maximum area element
419  double uniform_element_area=0.002;
420  triangle_mesh_parameters.element_area() = uniform_element_area;
421 
422  // Create the mesh
423  Bulk_mesh_pt=new RefineableTriangleMesh<ELEMENT>(triangle_mesh_parameters,
424  time_stepper_pt());
425 
426  // Set error estimator for bulk mesh
428  Bulk_mesh_pt->spatial_error_estimator_pt()=error_estimator_pt;
429 
430  // Set element size limits
431  Bulk_mesh_pt->max_element_size()=0.2;
432  Bulk_mesh_pt->min_element_size()=0.000002;
433 
434  // Create the surface mesh as an empty mesh
436  Surface_mesh_pt=new Mesh;
437 
438  // Build 'em
440 
441  // Set boundary condition and complete the build of all elements
443 
444  // Add the two sub meshes to the problem
448 
449  // Combine all submeshes into a single global Mesh
451 
452  // Set the initial conditions
453  unsigned nnod = Bulk_mesh_pt->nnode();
454  for(unsigned j=0;j<nnod;j++)
455  {
456  Bulk_mesh_pt->node_pt(j)->set_value(0,-0.5);
457  }
458 
459  // Do equation numbering
460  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
461 
462 } // end of constructor
unsigned Melt_boundary_id
ID of melt boundary.
Definition: pretend_melt.cc:303
void complete_problem_setup()
Complete problem setup: pass pointers to physical variables.
Definition: pretend_melt.cc:229
unsigned Flux_boundary_id
ID of flux boundary.
Definition: pretend_melt.cc:300
Mesh * Surface_melt_mesh_pt
Pointer to the "surface" mesh.
Definition: pretend_melt.cc:294
ofstream Trace_file
Trace file.
Definition: pretend_melt.cc:306
void create_flux_elements()
Create flux elements.
Definition: pretend_melt.cc:129
Mesh * Surface_mesh_pt
Pointer to the "surface" mesh.
Definition: pretend_melt.cc:297
RefineableTriangleMesh< ELEMENT > * Bulk_mesh_pt
Pointers to specific mesh.
Definition: pretend_melt.cc:291
Definition: mesh.h:67
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
Unstructured refineable Triangle Mesh.
Definition: triangle_mesh.template.h:2249
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
Z2ErrorEstimator * error_estimator_pt
Definition: MortaringCantileverCompareToNonMortaring.cpp:190
unsigned Max_newton_iterations
Maximum number of newton iterations.
Definition: elements.cc:1654
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References oomph::TriangleMeshParameters::element_area(), MeshRefinement::error_estimator_pt, j, oomph::Locate_zeta_helpers::Max_newton_iterations, and oomph::Problem_Parameter::Trace_file.

◆ ~UnsteadyHeatProblem() [1/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::~UnsteadyHeatProblem
inline

Destructor (empty)

Destructor for UnsteadyHeat problem in cubic domain.

88 {}

◆ UnsteadyHeatProblem() [2/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt  source_fct_pt)

Constructor.

Constructor for UnsteadyHeat problem in square domain.

166  :
168 {
169 
170  // Allocate the timestepper -- this constructs the Problem's
171  // time object with a sufficient amount of storage to store the
172  // previous timsteps.
174 
175  // Setup parameters for exact solution
176  // -----------------------------------
177 
178  // Decay parameter
180 
181  // Setup mesh
182  //-----------
183 
184  // Number of elements in x and y directions
185  unsigned nx=5;
186  unsigned ny=5;
187 
188  // Lengths in x and y directions
189  double lx=1.0;
190  double ly=1.0;
191 
192  // Build mesh
194 
195  // Create the surface mesh as an empty mesh
196  Surface_mesh_pt=new Mesh;
197 
198  // Create prescribed-flux elements
200 
201  // Add meshes and build global mesh
205 
206  // Choose a control node at which the solution is documented
207  //----------------------------------------------------------
208  // Total number of elements
209  unsigned n_el=Bulk_mesh_pt->nelement();
210 
211  // Choose an element in the middle
212  unsigned control_el=unsigned(n_el/2);
213 
214  // Choose its first node as the control node
215  Control_node_pt=Bulk_mesh_pt->finite_element_pt(control_el)->node_pt(0);
216 
217  cout << "Recording trace of the solution at: "
218  << Control_node_pt->x(0) << " "
219  << Control_node_pt->x(1) << std::endl;
220 
221 
222  // Set the boundary conditions for this problem:
223  // ---------------------------------------------
224  // All nodes are free by default -- just pin the ones that have
225  // Dirichlet conditions here.
226  unsigned n_bound = Bulk_mesh_pt->nboundary();
227 
228  // Skip boundary 0 where we apply flux boundary conditions
229  for(unsigned b=1;b<n_bound;b++)
230  {
231  unsigned n_node = Bulk_mesh_pt->nboundary_node(b);
232  for (unsigned n=0;n<n_node;n++)
233  {
234  Bulk_mesh_pt->boundary_node_pt(b,n)->pin(0);
235  }
236  } // end of set boundary conditions
237 
238 
239  // Complete the build of all elements so they are fully functional
240  //----------------------------------------------------------------
241 
242  // Find number of elements in mesh
243  unsigned n_element = Bulk_mesh_pt->nelement();
244 
245  // Loop over the elements to set up element-specific
246  // things that cannot be handled by constructor
247  for(unsigned i=0;i<n_element;i++)
248  {
249  // Upcast from FiniteElement to the present element
250  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(i));
251 
252  //Set the source function pointer
253  el_pt->source_fct_pt() = Source_fct_pt;
254  }
255 
256  // Do equation numbering
257  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
258 
259 } // end of constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Scalar * b
Definition: benchVecAdd.cpp:17
UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt Source_fct_pt
Pointer to source function.
Definition: heat_transfer_and_melting/two_d_unsteady_heat_melt/two_d_unsteady_heat.cc:147
Node * Control_node_pt
Pointer to control node at which the solution is documented.
Definition: heat_transfer_and_melting/two_d_unsteady_heat_melt/two_d_unsteady_heat.cc:156
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
Definition: rectangular_quadmesh.template.h:59
double K
Decay factor.
Definition: heat_transfer_and_melting/two_d_unsteady_heat_melt/two_d_unsteady_heat.cc:58
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31
GeneralisedAxisymAdvectionDiffusionSourceFctPt & source_fct_pt()
Access function: Pointer to source function.
Definition: gen_axisym_advection_diffusion_elements.h:229

References oomph::Problem::add_sub_mesh(), oomph::Problem::add_time_stepper_pt(), oomph::Problem::assign_eqn_numbers(), b, oomph::Problem::build_global_mesh(), UnsteadyHeatProblem< ELEMENT >::Bulk_mesh_pt, UnsteadyHeatProblem< ELEMENT >::Control_node_pt, UnsteadyHeatProblem< ELEMENT >::create_flux_elements(), i, ExactSolnForUnsteadyHeat::K, Mesh_Parameters::lx, Mesh_Parameters::ly, n, Mesh_Parameters::nx, Mesh_Parameters::ny, UnsteadyHeatProblem< ELEMENT >::Source_fct_pt, UnsteadyHeatProblem< ELEMENT >::Surface_mesh_pt, oomph::Problem::time_stepper_pt(), and oomph::Node::x().

◆ ~UnsteadyHeatProblem() [2/9]

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

Destructor (empty)

119 {}

◆ UnsteadyHeatProblem() [3/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt  source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [3/9]

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

Destructor (empty)

101 {}

◆ UnsteadyHeatProblem() [4/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( const SpaceTimeFunctionPt source_fct_pt)

Constructor.

Constructor for UnsteadyHeat problem in cubic domain.

253  :
254  Bulk_mesh_pt(0),
257 {
258  // Generate the space-time mesh (stored as Bulk_mesh_pt)
260 
261  // Assign the appropriate boundary conditions
263 
264  // Complete the setup of the elements
266 
267  // Do equation numbering
268  oomph_info << "\nNumber of equations: " << assign_eqn_numbers() << std::endl;
269 } // End of UnsteadyHeatProblem
void create_spacetime_mesh()
Definition: test_equal_order_galerkin.cc:299
void apply_boundary_conditions()
Assign the Dirichlet and maybe time-periodic BCs.
Definition: test_equal_order_galerkin.cc:360
bool Periodicity_has_been_enforced
Definition: test_equal_order_galerkin.cc:233
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References UnsteadyHeatProblem< ELEMENT >::apply_boundary_conditions(), oomph::Problem::assign_eqn_numbers(), UnsteadyHeatProblem< ELEMENT >::complete_problem_setup(), UnsteadyHeatProblem< ELEMENT >::create_spacetime_mesh(), and oomph::oomph_info.

◆ ~UnsteadyHeatProblem() [4/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::~UnsteadyHeatProblem ( )

Destructor (empty)

◆ UnsteadyHeatProblem() [5/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( const SpaceTimeFunctionPt source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [5/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::~UnsteadyHeatProblem ( )

Destructor (empty)

◆ UnsteadyHeatProblem() [6/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( const SpaceTimeFunctionPt source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [6/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::~UnsteadyHeatProblem ( )

Destructor (empty)

◆ UnsteadyHeatProblem() [7/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt  source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [7/9]

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

Destructor (empty)

101 {}

◆ UnsteadyHeatProblem() [8/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt  source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [8/9]

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

Destructor (empty)

101 {}

◆ UnsteadyHeatProblem() [9/9]

template<class ELEMENT >
UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem ( UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt  source_fct_pt)

Constructor.

◆ ~UnsteadyHeatProblem() [9/9]

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

Destructor (empty)

114 {}

Member Function Documentation

◆ actions_after_adapt() [1/4]

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

Actions after adapt: Setup the problem again – remember that the mesh has been completely rebuilt and its element's don't have any pointers to source fcts etc. yet

Reimplemented from oomph::Problem.

111  {
112  // Create flux elements
114 
115  // Rebuild the Problem's global mesh from its various sub-meshes
117 
118  // Rebuild elements
120  }
void rebuild_global_mesh()
Definition: problem.cc:1533

◆ actions_after_adapt() [2/4]

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

Update the problem specs after solve.

Reimplemented from oomph::Problem.

193  {
194  // Assign the appropriate boundary conditions
196 
197  // Complete the setup of the elements
199  } // End of actions_after_adapt

◆ actions_after_adapt() [3/4]

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

Update the problem specs after solve.

Reimplemented from oomph::Problem.

218  {
219  // Assign the appropriate boundary conditions
221 
222  // Re-assign time-slab IDs and wipe the old solver/preconditioner and
223  // create a new one based on the (possibly) updated dof-to-block map
225 
226  // Complete the setup of the elements
228  } // End of actions_after_adapt
void update_block_preconditioner_after_refinement()
Definition: test_equal_order_galerkin_petrov.cc:511

◆ actions_after_adapt() [4/4]

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

Update the problem specs after solve.

Reimplemented from oomph::Problem.

218  {
219  // Unpin all of the dofs; don't worry, the boundary dofs will be pinned
220  // again in apply_boundary_conditions(...) and the appropriate nodes in
221  // each element will be pinned in pin_redundant_temporal_nodes(...)
222  unpin_all_dofs();
223 
224  // Assign the appropriate boundary conditions
226 
227  // Pin the redundant temporal nodes that should not be proper dofs
228  // (because of the time discretisation we're using)
230 
231  // Re-assign time-slab IDs and wipe the old solver/preconditioner and
232  // create a new one based on the (possibly) updated dof-to-block map
234 
235  // Complete the setup of the elements
237  } // End of actions_after_adapt
void unpin_all_dofs()
Unpin all of the dofs in the mesh.
Definition: test_mixed_order_galerkin_petrov.cc:275
void pin_redundant_temporal_nodes()
Definition: test_mixed_order_galerkin_petrov.cc:492

◆ actions_after_implicit_timestep() [1/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_after_implicit_timestep ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

128 {}

◆ actions_after_implicit_timestep() [2/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_after_implicit_timestep ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

110 {}

◆ actions_after_implicit_timestep() [3/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_after_implicit_timestep ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

110 {}

◆ actions_after_implicit_timestep() [4/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_after_implicit_timestep ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

110 {}

◆ actions_after_implicit_timestep() [5/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_after_implicit_timestep ( )
inlinevirtual

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

123 {}

◆ actions_after_newton_solve() [1/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

91 {}

◆ actions_after_newton_solve() [2/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

122 {}

◆ actions_after_newton_solve() [3/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [4/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

186 {}

◆ actions_after_newton_solve() [5/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

211 {}

◆ actions_after_newton_solve() [6/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

211 {}

◆ actions_after_newton_solve() [7/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [8/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [9/9]

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

Update the problem specs after solve (empty)

Reimplemented from oomph::Problem.

117 {}

◆ actions_before_adapt() [1/4]

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

Actions before adapt: wipe flux elements.

Reimplemented from oomph::Problem.

98  {
99  // Kill the elements and wipe surface mesh
101 
102  // Rebuild the Problem's global mesh from its various sub-meshes
104  }
void delete_flux_elements()
Delete flux elements.
Definition: pretend_melt.cc:197

◆ actions_before_adapt() [2/4]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

189 {}

◆ actions_before_adapt() [3/4]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

214 {}

◆ actions_before_adapt() [4/4]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

214 {}

◆ actions_before_implicit_timestep() [1/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_before_implicit_timestep
virtual

Update the problem specs before next timestep: Set Dirchlet boundary conditions from exact solution.

Actions before timestep: update the domain, then reset the boundary conditions for the current time.

Reimplemented from oomph::Problem.

308 {
309  // Get current time
310  double time=time_pt()->time();
311 
312  //Loop over the boundaries
313  unsigned num_bound = Bulk_mesh_pt->nboundary();
314  for(unsigned ibound=0;ibound<num_bound;ibound++)
315  {
316  // Loop over the nodes on boundary
317  unsigned num_nod=Bulk_mesh_pt->nboundary_node(ibound);
318  for (unsigned inod=0;inod<num_nod;inod++)
319  {
320  Node* nod_pt=Bulk_mesh_pt->boundary_node_pt(ibound,inod);
321  double u;
322  Vector<double> x(2);
323  x[0]=nod_pt->x(0);
324  x[1]=nod_pt->x(1);
325  // Get current values of the boundary conditions from the
326  // exact solution
328  nod_pt->set_value(0,u);
329  }
330  }
331 } // end of actions_before_implicit_timestep
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: nodes.h:906
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 & time()
Return the current value of the continuous time.
Definition: timesteppers.h:123
void get_exact_u(const double &time, const Vector< double > &x, Vector< double > &u)
Exact solution as a Vector.
Definition: heat_transfer_and_melting/two_d_unsteady_heat_melt/two_d_unsteady_heat.cc:64
list x
Definition: plotDoE.py:28

References ExactSolnForUnsteadyHeat::get_exact_u(), oomph::Data::set_value(), plotDoE::x, and oomph::Node::x().

◆ actions_before_implicit_timestep() [2/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_before_implicit_timestep ( )
virtual

Update the problem specs before next timestep: Set Dirchlet boundary conditions from exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_implicit_timestep() [3/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_before_implicit_timestep ( )
virtual

Update the problem specs before next timestep: Set Dirchlet boundary conditions from exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_implicit_timestep() [4/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_before_implicit_timestep ( )
virtual

Update the problem specs before next timestep: Set Dirchlet boundary conditions from exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_implicit_timestep() [5/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::actions_before_implicit_timestep ( )
virtual

Update the problem specs before next timestep: Set Dirchlet boundary conditions from exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [1/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

94 {}

◆ actions_before_newton_solve() [2/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

125 {}

◆ actions_before_newton_solve() [3/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

107 {}

◆ actions_before_newton_solve() [4/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

183 {}

◆ actions_before_newton_solve() [5/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

208 {}

◆ actions_before_newton_solve() [6/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

208 {}

◆ actions_before_newton_solve() [7/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

107 {}

◆ actions_before_newton_solve() [8/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

107 {}

◆ actions_before_newton_solve() [9/9]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

120 {}

◆ adapt() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::adapt ( )
inline

A wrapper around the Problem's adapt(...) function; issue a warning that adaptation doesn't work for these elements

246  {
247  // Create an output stream
248  std::ostringstream warning_message_stream;
249 
250  // Create an error message
251  warning_message_stream << "Hey, adaptation doesn't work properly with "
252  << "Petrov-Galerkin elements!\nI'm not going to "
253  << "stop the simulation because you may already "
254  << "know this\nbut if you didn't, consider "
255  << "yourself warned!" << std::endl;
256 
257  // Throw an error
258  OomphLibWarning(warning_message_stream.str(),
261 
262  // Call the Problem's implementation of refine_uniformly(...)
263  Problem::adapt();
264  } // End of adapt
Definition: oomph_definitions.h:267
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::Problem::adapt(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ adapt() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::adapt ( )
inline

A wrapper around the Problem's adapt(...) function; issue a warning that adaptation doesn't work for these elements

254  {
255  // Create an output stream
256  std::ostringstream warning_message_stream;
257 
258  // Create an error message
259  warning_message_stream << "Hey, adaptation doesn't work properly with "
260  << "Petrov-Galerkin elements!\nI'm not going to "
261  << "stop the simulation because you may already "
262  << "know this\nbut if you didn't, consider "
263  << "yourself warned!" << std::endl;
264 
265  // Throw an error
266  OomphLibWarning(warning_message_stream.str(),
269 
270  // Call the Problem's implementation of refine_uniformly(...)
271  Problem::adapt();
272  } // End of adapt

References oomph::Problem::adapt(), OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ apply_boundary_conditions() [1/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::apply_boundary_conditions

Assign the Dirichlet and maybe time-periodic BCs.

Apply the Dirichlet conditions on the spatial boundaries and the initial time boundary, if specified, otherwise apply time-periodic boundary conditions on the time boundaries. More explicitly: Boundary 0 (t=0) – Dirichlet or time-periodic BCs Boundary 1 (y=0) – Dirichlet Boundary 2 (x=1) – Dirichlet Boundary 3 (y=1) – Dirichlet Boundary 4 (x=0) – Dirichlet Boundary 5 (t=1) – Do nothing!

361 {
362  // Number of spatial dimensions
363  unsigned n_dim=2;
364 
365  // Storage for the time
366  double time=0.0;
367 
368  // Storage for the spatial coordinates
369  Vector<double> spatial_coordinates(n_dim,0.0);
370 
371  // Storage for the solution
372  double u_exact=0.0;
373 
374  // Get the number of boundaries in the mesh
375  unsigned n_bound=Bulk_mesh_pt->nboundary();
376 
377  // Loop over the boundaries
378  for (unsigned b=0; b<n_bound; b++)
379  {
380  // Get the number of nodes on the b-th boundary
381  unsigned n_node=Bulk_mesh_pt->nboundary_node(b);
382 
383  // Don't do anything on the final time boundary
385  {
386  // If we're applying time-periodic boundary conditions and we're
389  {
390  // We need to apply time-periodic BCs
392  }
393  // Otherwise apply Dirichlet boundary conditions
394  else
395  {
396  // Loop over the nodes on the b-th boundary
397  for (unsigned n=0; n<n_node; n++)
398  {
399  // Get a pointer to the n-th node on the b-th boundary
400  Node* node_pt=Bulk_mesh_pt->boundary_node_pt(b,n);
401 
402  // Pin the (one and only) dof at this node!
403  node_pt->pin(0);
404 
405  // Loop over the coordinates
406  for (unsigned i=0; i<n_dim; i++)
407  {
408  // Get the i-th coordinate of the node
409  spatial_coordinates[i]=node_pt->x(i);
410  }
411 
412  // Get the current time
413  time=node_pt->x(n_dim);
414 
415  // Get the exact solution at this node
416  SinSolution::get_exact_u(time,spatial_coordinates,u_exact);
417 
418  // Set the value of the solution
419  node_pt->set_value(0,u_exact);
420  }
421  } // if ((GlobalParameters::Apply_time_periodic_boundary_conditions)&&
422  } // if (b!=Final_time_boundary_id)
423  } // for (unsigned b=0;b<n_bound;b++)
424 } // End of apply_boundary_conditions
void enforce_time_periodic_boundary_conditions()
Definition: test_equal_order_galerkin.cc:439
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
bool Apply_time_periodic_boundary_conditions
Should we apply time-periodic boundary conditions?
Definition: test_equal_order_galerkin.cc:83
void get_exact_u(const double &t, const Vector< double > &x, Vector< double > &u)
Exact solution as a vector.
Definition: test_equal_order_galerkin.cc:114

References GlobalParameters::Apply_time_periodic_boundary_conditions, b, SinSolution::get_exact_u(), i, n, oomph::Data::pin(), oomph::Data::set_value(), and oomph::Node::x().

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ apply_boundary_conditions() [2/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::apply_boundary_conditions ( )

Assign the Dirichlet and maybe time-periodic BCs.

◆ apply_boundary_conditions() [3/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::apply_boundary_conditions ( )

Assign the Dirichlet and maybe time-periodic BCs.

◆ assign_time_slab_id() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::assign_time_slab_id

Helper function when space-time block preconditioning is being used.

Assign the time slice IDs to each BlockPreconditionable element.

460 {
461  // Number of dimensions
462  const unsigned n_dim=3;
463 
464  // The ID of the coordinate we want, i.e. the ID of the time-direction
465  const unsigned t_index=n_dim-1;
466 
467  // Space for the local coordinates (at the center of the element)
468  Vector<double> s(n_dim,0.0);
469 
470  // Space for the (Eulerian) coordinates
471  double t=0.0;
472 
473  // Get the number of elements in the mesh
474  const unsigned n_element=Bulk_mesh_pt->nelement();
475 
476  // Loop over the elements
477  for (unsigned i=0; i<n_element; i++)
478  {
479  // Upcast the element
480  ELEMENT* const el_pt=dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(i));
481 
482  // Get the interpolated time value at the center of the element
483  t=el_pt->interpolated_x(s,t_index);
484 
485  // The idea is to group all dofs in each space-time slab together, by
486  // making sure that elements in the same space-time slab have the same ID
487 
488  // To ensure this is done correctly, we provide an offset. Note, however
489  unsigned id=std::floor((double(N_space_time_slab)*t)/
491 
492  // Upcast and assign the time slice ID
493  el_pt->set_time_slab_id(id);
494 
495  // We're grouping dofs in each space-time slab together and there are only
496  // "N_space_time_slab" space-time slabs
498 
499  // Finally, tell it how many dof types there are in the mesh
500  el_pt->set_ndof_types(GlobalParameters::N_dof_type);
501  } // for (unsigned i=0;i<n_element;i++)
502 } // End of assign_time_slab_id
unsigned N_space_time_slab
Definition: test_equal_order_galerkin_petrov.cc:327
RealScalar s
Definition: level1_cplx_impl.h:130
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 floor(const bfloat16 &a)
Definition: BFloat16.h:643
double L_t
The length of the mesh in the time direction.
Definition: space_time_oscillating_cylinder.cc:691
unsigned N_dof_type
Definition: space_time_oscillating_cylinder.cc:729
t
Definition: plotPSD.py:36

References Eigen::bfloat16_impl::floor(), i, GlobalParameters::L_t, GlobalParameters::N_dof_type, s, and plotPSD::t.

◆ assign_time_slab_id() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::assign_time_slab_id ( )

Helper function when space-time block preconditioning is being used.

◆ complete_problem_setup() [1/4]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::complete_problem_setup
inlineprivate

Complete problem setup: pass pointers to physical variables.

Helper function to (re-)set boundary condition and complete the build of all elements

230  {
231  // Loop over the flux elements to pass pointer to prescribed flux function
232  unsigned n_element=Surface_melt_mesh_pt->nelement();
233  for(unsigned e=0;e<n_element;e++)
234  {
235  // Upcast from GeneralisedElement to UnsteadyHeat flux element
239 
240  // Set the pointer to the prescribed flux function
242 
243  // Set melt temperature
245 
246  // Suppress melting?
247  if (CommandLineArgs::command_line_flag_has_been_set("--disable_melting"))
248  {
249  el_pt->disable_melting();
250  }
251  }
252 
253  // Loop over the flux elements to pass pointer to prescribed flux function
254  n_element=Surface_mesh_pt->nelement();
255  for(unsigned e=0;e<n_element;e++)
256  {
257  if (CommandLineArgs::command_line_flag_has_been_set("--melt_everywhere"))
258  {
259  // Upcast from GeneralisedElement to UnsteadyHeat flux element
263 
264  // Set the pointer to the prescribed flux function
266 
267  // Set melt temperature
269 
270  // Suppress melting?
271  if (CommandLineArgs::command_line_flag_has_been_set("--disable_melting"))
272  {
273  el_pt->disable_melting();
274  }
275  }
276  else
277  {
278  // Upcast from GeneralisedElement to UnsteadyHeat flux element
280  dynamic_cast<UnsteadyHeatFluxElement<ELEMENT>*>(
282 
283  // Set the pointer to the prescribed flux function
285  }
286  }
287 
288  }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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
Definition: unsteady_heat_flux_elements.h:56
UnsteadyHeatPrescribedFluxFctPt & flux_fct_pt()
Broken assignment operator.
Definition: unsteady_heat_flux_elements.h:82
Definition: unsteady_heat_flux_pseudo_melt_elements.h:67
double *& melt_temperature_pt()
Pointer to (non-default) melt temperature.
Definition: unsteady_heat_flux_pseudo_melt_elements.h:309
UnsteadyHeatPrescribedFluxFctPt & flux_fct_pt()
Access function for the prescribed-flux function pointer.
Definition: unsteady_heat_flux_pseudo_melt_elements.h:89
void disable_melting()
Switch off melting by pinning melting dofs.
Definition: unsteady_heat_flux_pseudo_melt_elements.h:316
void flux(const double &time, const Vector< double > &x, double &flux)
Get flux applied along boundary x=0.
Definition: pretend_melt.cc:59
double Melt_temperature
Melt-temperature.
Definition: circular_boulder_melt.cc:67
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501

References oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::disable_melting(), e(), ProblemParameters::flux(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::flux_fct_pt(), oomph::UnsteadyHeatFluxElement< ELEMENT >::flux_fct_pt(), ProblemParameters::Melt_temperature, and oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::melt_temperature_pt().

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ complete_problem_setup() [2/4]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::complete_problem_setup ( )

Complete problem setup; make all the elements fully functional by passing pointers to all physical parameters

◆ complete_problem_setup() [3/4]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::complete_problem_setup ( )

Complete problem setup; make all the elements fully functional by passing pointers to all physical parameters

◆ complete_problem_setup() [4/4]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::complete_problem_setup ( )

Complete problem setup; make all the elements fully functional by passing pointers to all physical parameters

◆ create_flux_elements() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::create_flux_elements
inlineprivate

Create flux elements.

130  {
131  // How many bulk elements are adjacent to boundary b?
132  unsigned b=Melt_boundary_id;
133  unsigned n_element = Bulk_mesh_pt->nboundary_element(b);
134 
135  // Loop over the bulk elements adjacent to boundary b?
136  for(unsigned e=0;e<n_element;e++)
137  {
138  // Get pointer to the bulk element that is adjacent to boundary b
139  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
140  Bulk_mesh_pt->boundary_element_pt(b,e));
141 
142  //What is the face index of element e along boundary b
143  int face_index = Bulk_mesh_pt->face_index_at_boundary(b,e);
144 
145  // Build the corresponding prescribed-flux element
146  UnsteadyHeatFluxPseudoMeltElement<ELEMENT>* flux_element_pt = new
147  UnsteadyHeatFluxPseudoMeltElement<ELEMENT>(bulk_elem_pt,face_index);
148 
149  //Add the prescribed-flux element to the surface mesh
150  Surface_melt_mesh_pt->add_element_pt(flux_element_pt);
151 
152  } //end of loop over bulk elements adjacent to boundary b
153 
154 
155  // How many bulk elements are adjacent to boundary b?
157  n_element = Bulk_mesh_pt->nboundary_element(b);
158 
159  // Loop over the bulk elements adjacent to boundary b?
160  for(unsigned e=0;e<n_element;e++)
161  {
162  // Get pointer to the bulk element that is adjacent to boundary b
163  ELEMENT* bulk_elem_pt = dynamic_cast<ELEMENT*>(
164  Bulk_mesh_pt->boundary_element_pt(b,e));
165 
166  //What is the face index of element e along boundary b
167  int face_index = Bulk_mesh_pt->face_index_at_boundary(b,e);
168 
169  if (CommandLineArgs::command_line_flag_has_been_set("--melt_everywhere"))
170  {
171  // Build the corresponding prescribed-flux element
172  UnsteadyHeatFluxPseudoMeltElement<ELEMENT>* flux_element_pt = new
173  UnsteadyHeatFluxPseudoMeltElement<ELEMENT>(bulk_elem_pt,face_index);
174 
175  //Add the prescribed-flux element to the surface mesh
176  Surface_mesh_pt->add_element_pt(flux_element_pt);
177  }
178  else
179  {
180  // Build the corresponding prescribed-flux element
181  UnsteadyHeatFluxElement<ELEMENT>* flux_element_pt = new
182  UnsteadyHeatFluxElement<ELEMENT>(bulk_elem_pt,face_index);
183 
184  //Add the prescribed-flux element to the surface mesh
185  Surface_mesh_pt->add_element_pt(flux_element_pt);
186  }
187 
188 
189 
190  } //end of loop over bulk elements adjacent to boundary b
191 
192  }
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617

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

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ create_flux_elements() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::create_flux_elements ( )

Create flux elements.

◆ create_spacetime_mesh() [1/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::create_spacetime_mesh

Create the space-time mesh with the chosen number of elements in the time direction and the chosen spatial resolution

Helper function to create the space-time mesh (to be assigned to Bulk_mesh_pt) with the chosen number of elements in the time direction and an appropriate spatial resolution (to capture the time-periodic solution properly).

300 {
301  // Build the refineable mesh
305 
306  // Assign the mesh pointer
308 
309  // Add an error estimator
310  Bulk_mesh_pt->spatial_error_estimator_pt()=new Z2ErrorEstimator;
311 
312  // Maximum permitted errors
313  Bulk_mesh_pt->max_permitted_error()=1.0e-03;
314 
315  // Minimum permitted errors
316  Bulk_mesh_pt->min_permitted_error()=1.0e-04;
317 } // End of create_spacetime_mesh
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1280
Refineable version of simple cubic 3D Brick mesh class.
Definition: simple_cubic_mesh.template.h:169
double L_x
------------------—Unsteady Heat Parameters---------------------—
Definition: test_equal_order_galerkin.cc:62
unsigned N_y
Number of elements in the y-direction.
Definition: test_equal_order_galerkin.cc:74
unsigned N_t
The number of elements in the time direction.
Definition: space_time_oscillating_cylinder.cc:694
unsigned N_x
Number of elements in the x-direction.
Definition: test_equal_order_galerkin.cc:71
double L_y
Length of the mesh in the y-direction.
Definition: test_equal_order_galerkin.cc:65

References GlobalParameters::L_t, GlobalParameters::L_x, GlobalParameters::L_y, GlobalParameters::N_t, GlobalParameters::N_x, and GlobalParameters::N_y.

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ create_spacetime_mesh() [2/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::create_spacetime_mesh ( )

Create the space-time mesh with the chosen number of elements in the time direction and the chosen spatial resolution

◆ create_spacetime_mesh() [3/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::create_spacetime_mesh ( )

Create the space-time mesh with the chosen number of elements in the time direction and the chosen spatial resolution

◆ delete_flux_elements()

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::delete_flux_elements ( )
inlineprivate

Delete flux elements.

198  {
199  // How many surface elements are in the surface mesh
200  unsigned n_element = Surface_melt_mesh_pt->nelement();
201 
202  // Loop over the surface elements
203  for(unsigned e=0;e<n_element;e++)
204  {
205  // Kill surface element
207  }
208 
209  // Wipe the mesh
211 
212  // How many surface elements are in the surface mesh
213  n_element = Surface_mesh_pt->nelement();
214 
215  // Loop over the surface elements
216  for(unsigned e=0;e<n_element;e++)
217  {
218  // Kill surface element
219  delete Surface_mesh_pt->element_pt(e);
220  }
221 
222  // Wipe the mesh
224  }
void flush_element_and_node_storage()
Definition: mesh.h:407

References e().

◆ disable_ALE()

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::disable_ALE ( )
inline

Switch off ALE terms.

125  {
126  std::cout << "Disabling ALE " << std::endl;
127 
128  // Loop over the elements
129  unsigned n_element = mesh_pt()->nelement();
130  for(unsigned i=0;i<n_element;i++)
131  {
132  // Upcast from FiniteElement to the present element
133  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
134 
135  //Set the source function pointer
136  el_pt->disable_ALE();
137  }
138  }

References i.

◆ doc_solution() [1/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( const bool doc_error = false)

Doc the solution.

Document the solution.

866 {
867  // Make an ofstream object to output the solution
868  ofstream some_file;
869 
870  // Storage for the filename
871  char filename[100];
872 
873  // The number of plot points
874  unsigned n_plot_point=2;
875 
876  // The filename suffix added depending on the BCs we're using
877  std::string filename_suffix="";
878 
879  // If we're solving the time-periodic problem
881  {
882  // Set the suffix
883  filename_suffix="_pbc";
884  }
885  // If we're solving the initial-value problem
886  else
887  {
888  // Set the suffix
889  filename_suffix="_ic";
890  }
891 
892  //----------------
893  // Output solution
894  //----------------
895  // If we're solving the time-periodic problem
897  {
898  // Output the (numerically) approximated solution
899  sprintf(filename,"%s/soln%s%i.dat",
900  GlobalParameters::Doc_info.directory().c_str(),
901  filename_suffix.c_str(),
903  }
904  // If we're solving the initial-value problem
905  else
906  {
907  // Output the (numerically) approximated solution
908  sprintf(filename,"%s/soln_ic%i.dat",
909  GlobalParameters::Doc_info.directory().c_str(),
910  GlobalParameters::Doc_info.number());
911  }
912 
913  // Open the file
914  some_file.open(filename);
915 
916  // Output the solution
917  Bulk_mesh_pt->output(some_file,n_plot_point);
918 
919  // Now close the file
920  some_file.close();
921 
922  //----------------------
923  // Output exact solution
924  //----------------------
925  // Output the exact solution
926  sprintf(filename,"%s/exact_soln%i.dat",
927  GlobalParameters::Doc_info.directory().c_str(),
928  GlobalParameters::Doc_info.number());
929 
930  // Open the file
931  some_file.open(filename);
932 
933  // Dummy time value
934  double dummy_time=0.0;
935 
936  // Output the exact solution
937  Bulk_mesh_pt->output_fct(some_file,
938  n_plot_point,
939  dummy_time,
941 
942  // Now close the file
943  some_file.close();
944 
945  //-------------------
946  // Document the error
947  //-------------------
948  // Storage for the norm and the solution and the error
949  double norm=0.0, error=0.0;
950 
951  // Output the error
952  sprintf(filename,"%s/error%s%i.dat",
953  GlobalParameters::Doc_info.directory().c_str(),
954  filename_suffix.c_str(),
956 
957  // Open the file
958  some_file.open(filename);
959 
960  // Compute the error in the solution
961  Bulk_mesh_pt->compute_error(some_file,
963  dummy_time,
964  error,norm);
965 
966  // Now close the file
967  some_file.close();
968 
969  //------------------------
970  // Doc. solution and error
971  //------------------------
972  // Calculate the norm value we want
973  norm=std::sqrt(norm);
974 
975  // Square root the error value
977 
978  // Output the solution norm and error values
979  oomph_info << "Solution norm : " << norm << std::endl;
980  oomph_info << "Absolute error: " << error << std::endl;
981  oomph_info << "Relative error: " << error/norm << std::endl;
982 
983  // Increment counter for solutions
985 } // End of doc_solution
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
DocInfo Doc_info
Helper for documenting.
Definition: extrude_triangle_generated_mesh.cc:57
string filename
Definition: MergeRestartFiles.py:39
int error
Definition: calibrate.py:297
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References GlobalParameters::Apply_time_periodic_boundary_conditions, GlobalParameters::Doc_info, calibrate::error, MergeRestartFiles::filename, SinSolution::get_exact_u(), oomph::DocInfo::number(), oomph::oomph_info, sqrt(), and oomph::Global_string_for_annotation::string().

◆ doc_solution() [2/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( const bool doc_error = false)

Doc the solution.

◆ doc_solution() [3/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( const bool doc_error = false)

Doc the solution.

◆ doc_solution() [4/9]

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

Doc the solution.

471 {
472  ofstream some_file;
473  char filename[100];
474 
475  // Number of plot points
476  unsigned npts;
477  npts=5;
478 
479  cout << std::endl;
480  cout << "=================================================" << std::endl;
481  cout << "Docing solution for t=" << time_pt()->time() << std::endl;
482  cout << "=================================================" << std::endl;
483 
484 
485  // Output solution
486  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
487  doc_info.number());
488  some_file.open(filename);
489  Bulk_mesh_pt->output(some_file,npts);
490  some_file.close();
491 
492  // Output solution coarsely (only element vertices for easier
493  // mesh visualisation)
494  sprintf(filename,"%s/coarse_soln%i.dat",doc_info.directory().c_str(),
495  doc_info.number());
496  some_file.open(filename);
497  Bulk_mesh_pt->output(some_file,2);
498  some_file.close();
499 
500  // Output flux with melt
501  sprintf(filename,"%s/flux_with_melt%i.dat",doc_info.directory().c_str(),
502  doc_info.number());
503  some_file.open(filename);
504  unsigned nnod=dynamic_cast<UnsteadyHeatFluxPseudoMeltElement<ELEMENT>*>(
505  Surface_melt_mesh_pt->element_pt(0))->nnode();
506  Surface_melt_mesh_pt->output(some_file,nnod);
507  if (CommandLineArgs::command_line_flag_has_been_set("--melt_everywhere"))
508  {
509  Surface_mesh_pt->output(some_file,nnod);
510  }
511  some_file.close();
512 
513 
514  // Output Number of Newton iterations in form that can be visualised
515  // as vector in paraview
516  sprintf(filename,"%s/newton_iter%i.dat",doc_info.directory().c_str(),
517  doc_info.number());
518  some_file.open(filename);
519  some_file << "0 0 0 " << Nnewton_iter_taken << std::endl;
520  some_file.close();
521 
522  // Write norm of solution to trace file
523  double norm=0.0;
524  Bulk_mesh_pt->compute_norm(norm);
525  Trace_file << norm << std::endl;
526 
527 } // end of doc_solution
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
unsigned Nnewton_iter_taken
Definition: problem.h:603

References oomph::CommandLineArgs::command_line_flag_has_been_set(), oomph::DocInfo::directory(), MergeRestartFiles::filename, oomph::DocInfo::number(), and oomph::Problem_Parameter::Trace_file.

◆ doc_solution() [5/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( DocInfo doc_info,
ofstream &  trace_file 
)

Doc the solution.

407 {
408  ofstream some_file;
409  char filename[100];
410 
411  // Number of plot points
412  unsigned npts;
413  npts=5;
414 
415 
416  cout << std::endl;
417  cout << "=================================================" << std::endl;
418  cout << "Docing solution for t=" << time_pt()->time() << std::endl;
419  cout << "=================================================" << std::endl;
420 
421 
422  // Output solution
423  //-----------------
424  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
425  doc_info.number());
426  some_file.open(filename);
427  Bulk_mesh_pt->output(some_file,npts);
428 
429  // Write file as a tecplot text object
430  some_file << "TEXT X=2.5,Y=93.6,F=HELV,HU=POINT,C=BLUE,H=26,T=\"time = "
431  << time_pt()->time() << "\"";
432  // ...and draw a horizontal line whose length is proportional
433  // to the elapsed time
434  some_file << "GEOMETRY X=2.5,Y=98,T=LINE,C=BLUE,LT=0.4" << std::endl;
435  some_file << "1" << std::endl;
436  some_file << "2" << std::endl;
437  some_file << " 0 0" << std::endl;
438  some_file << time_pt()->time()*20.0 << " 0" << std::endl;
439  some_file.close();
440 
441 
442  // Output exact solution
443  //----------------------
444  sprintf(filename,"%s/exact_soln%i.dat",doc_info.directory().c_str(),
445  doc_info.number());
446  some_file.open(filename);
447  Bulk_mesh_pt->output_fct(some_file,npts,time_pt()->time(),
449  some_file.close();
450 
451  // Doc error
452  //----------
453  double error,norm;
454  sprintf(filename,"%s/error%i.dat",doc_info.directory().c_str(),
455  doc_info.number());
456  some_file.open(filename);
457  Bulk_mesh_pt->compute_error(some_file,
459  time_pt()->time(),
460  error,norm);
461  some_file.close();
462 
463  // Doc solution and error
464  //-----------------------
465  cout << "error: " << error << std::endl;
466  cout << "norm : " << norm << std::endl << std::endl;
467 
468  // Get exact solution at control node
469  Vector<double> x_ctrl(2);
470  x_ctrl[0]=Control_node_pt->x(0);
471  x_ctrl[1]=Control_node_pt->x(1);
472  double u_exact;
474  trace_file << time_pt()->time() << " "
475  << Control_node_pt->value(0) << " "
476  << u_exact << " "
477  << error << " "
478  << norm << std::endl;
479 
480 } // end of doc_solution
double value(const unsigned &i) const
Definition: nodes.cc:2408

References oomph::DocInfo::directory(), calibrate::error, MergeRestartFiles::filename, ExactSolnForUnsteadyHeat::get_exact_u(), and oomph::DocInfo::number().

◆ doc_solution() [6/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( DocInfo doc_info,
ofstream &  trace_file 
)

Doc the solution.

◆ doc_solution() [7/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( DocInfo doc_info,
ofstream &  trace_file 
)

Doc the solution.

◆ doc_solution() [8/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( DocInfo doc_info,
ofstream &  trace_file 
)

Doc the solution.

◆ doc_solution() [9/9]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::doc_solution ( DocInfo doc_info,
ofstream &  trace_file 
)

Doc the solution.

◆ dump_it() [1/2]

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

Dump problem to disk to allow for restart.

Dump the solution to disk to allow for restart.

497 {
498 
499  // Call generic dump()
500  Problem::dump(dump_file);
501 
502 } // end of dump_it

◆ dump_it() [2/2]

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

Dump problem to disk to allow for restart.

◆ enforce_time_periodic_boundary_conditions() [1/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::enforce_time_periodic_boundary_conditions

Assign the appropriate boundary conditions and enforce periodicity in the time direction

Assign the appropriate boundary conditions, i.e. periodicity in the t-direction. In the x and y-direction apply Dirichlet boundary conditions. In summary: Boundary 0 (t=0) – Periodic in time (w.r.t. boundary 5) Boundary 1 (y=0) – Dirichlet Boundary 2 (x=1) – Dirichlet Boundary 3 (y=1) – Dirichlet Boundary 4 (x=0) – Dirichlet Boundary 5 (t=1) – Periodic in time (w.r.t. boundary 0)

440 {
441  // If we need to set up periodicity
443  {
444  // Number of dimensions
445  unsigned n_dim=3;
446 
447  // Index of the t=0 boundary
448  unsigned boundary0_index=0;
449 
450  // Index of the t=1 boundary
451  unsigned boundary1_index=5;
452 
453  // Number of nodes on t=0 boundary
454  unsigned n_boundary0_node=Bulk_mesh_pt->nboundary_node(boundary0_index);
455 
456  // Number of nodes on t=1 boundary
457  unsigned n_boundary1_node=Bulk_mesh_pt->nboundary_node(boundary1_index);
458 
459  //----------------------------
460  // Establish nodal periodicity
461  //----------------------------
462  // Make sure there are as many nodes on boundary 0 as there are on
463  // boundary (n_boundary-1)
464  if (n_boundary0_node!=n_boundary1_node)
465  {
466  // Create an output stream
467  std::ofstream output_file;
468 
469  // Open a file
470  output_file.open("RESLT/nodes_b0.csv");
471 
472  // Loop over the nodes on the t=0 boundary
473  for (unsigned i=0; i<n_boundary0_node; i++)
474  {
475  // Output the coordinates of the i-th node on the t=0 boundary
476  Bulk_mesh_pt->boundary_node_pt(boundary0_index,i)->output(output_file);
477  }
478 
479  // Close the file
480  output_file.close();
481 
482  // Open a file
483  output_file.open("RESLT/nodes_b1.csv");
484 
485  // Loop over the nodes on the t=0 boundary
486  for (unsigned i=0; i<n_boundary1_node; i++)
487  {
488  // Output the coordinates of the i-th node on the t=1 boundary
489  Bulk_mesh_pt->boundary_node_pt(boundary1_index,i)->output(output_file);
490  }
491 
492  // Close the file
493  output_file.close();
494 
495  // Create an output stream
496  std::ostringstream error_message_stream;
497 
498  // Create an error message
499  error_message_stream << "Different number of nodes on t=0 and t=1 "
500  << "boundary!\nThere are " << n_boundary0_node
501  << " nodes on boundary " << boundary0_index
502  << " and " << n_boundary1_node
503  << " nodes on boundary " << boundary1_index
504  << "!" << std::endl;
505 
506  // Throw an error
507  throw OomphLibError(error_message_stream.str(),
510  }
511 
512  // Loop over the nodes on the t=0 boundary
513  for (unsigned i=0; i<n_boundary0_node; i++)
514  {
515  // Get the pointer to the associated node
516  Node* node0_pt=Bulk_mesh_pt->boundary_node_pt(boundary0_index,i);
517 
518  // Boolean to indicate whether or not the neighbour has been found
519  bool has_neighbour_node_been_found=false;
520 
521  // Loop over the nodes on the t=1 boundary
522  for (unsigned j=0; i<n_boundary1_node; j++)
523  {
524  // Get the pointer to the associated node
525  Node* node1_pt=Bulk_mesh_pt->boundary_node_pt(boundary1_index,j);
526 
527  // Distance value
528  double distance=0.0;
529 
530  // Loop over the entries of x
531  for (unsigned k=0; k<n_dim-1; k++)
532  {
533  // Update the distance (2 norm)
534  distance+=pow(((node0_pt->x(k))-(node1_pt->x(k))),2.0);
535  }
536 
537  // Square root it
538  distance=std::sqrt(distance);
539 
540  // Check if it matches to within a reasonable tolerance
541  if (std::fabs(distance)<Tree::max_neighbour_finding_tolerance())
542  {
543  // Make the nodes periodic; the node on the t=1 boundary now points
544  // to the node on the t=0 boundary.
545  //node1_pt->make_periodic(node0_pt);
546 
547  // DRAIG: NEW ORDER!!!
548  node0_pt->make_periodic(node1_pt);
549 
550  // We've found the neighbouring node
551  has_neighbour_node_been_found=true;
552 
553  // We're done; break out!
554  break;
555  }
556  } // for (unsigned i=0;i<n_boundary0_node;i++)
557 
558  // If we get here and we haven't found the neighbouring node, something's
559  // wrong so throw an error
560  if (!has_neighbour_node_been_found)
561  {
562  // Throw an error
563  throw OomphLibError("Couldn't find neighbouring node!",
566  }
567  } // for (unsigned i=0;i<n_boundary0_node;i++)
568 
569  //--------------------------------
570  // Establish elemental periodicity
571  //--------------------------------
572  // Number of elements on t=0 boundary
573  unsigned n_boundary0_element=
574  Bulk_mesh_pt->nboundary_element(boundary0_index);
575 
576  // Number of elements on t=1 boundary
577  unsigned n_boundary1_element=
578  Bulk_mesh_pt->nboundary_element(boundary1_index);
579 
580  // Make sure there are as many nodes on boundary 0 as there are on
581  // boundary (n_boundary-1)
582  if (n_boundary0_element!=n_boundary1_element)
583  {
584  // Throw an error
585  throw OomphLibError("Different number of elements on time boundaries!",
588  }
589 
590  // Storage for the local coordinates of the centre of the face of the
591  // element on the t=0 boundary
592  Vector<double> s_back(n_dim,0.0);
593 
594  // Storage for the local coordinates of the centre of the face of the
595  // element on the t=1 boundary
596  Vector<double> s_front(n_dim,0.0);
597 
598  // The t=0 boundary corresponds to the s[n_dim-1]=-1 (in the
599  // appropriate element)
600  s_back[n_dim-1]=-1.0;
601 
602  // The t=1 boundary corresponds to the s[n_dim-1]=1 (in the
603  // appropriate element)
604  s_front[n_dim-1]=1.0;
605 
606  // Loop over the elements on t=0 boundary
607  for (unsigned i=0; i<n_boundary0_element; i++)
608  {
609  // Get a pointer to the associated element
610  FiniteElement* el0_pt=Bulk_mesh_pt->boundary_element_pt(boundary0_index,i);
611 
612  // Boolean to indicate whether or not the neighbour has been found
613  bool has_neighbour_element_been_found=false;
614 
615  // Loop over the elements on t=1 boundary
616  for (unsigned j=0; j<n_boundary1_element; j++)
617  {
618  // Get a pointer to the associated element
619  FiniteElement* el1_pt=Bulk_mesh_pt->boundary_element_pt(boundary1_index,j);
620 
621  // Distance value
622  double distance=0.0;
623 
624  // Loop over the entries of x
625  for (unsigned k=0; k<n_dim-1; k++)
626  {
627  // Update the distance (2 norm)
628  distance+=pow((el0_pt->interpolated_x(s_back,k))-
629  (el1_pt->interpolated_x(s_front,k)),2.0);
630  }
631 
632  // Square root it
633  distance=std::sqrt(distance);
634 
635  // Check if it matches to within a reasonable tolerance
636  if (std::fabs(distance)<Tree::max_neighbour_finding_tolerance())
637  {
638  //-----------------------------------------------------------
639  // ...FACE NEIGHBOURS...
640  //-----------------------------------------------------------
641  //-----------------------------------------------------------
642  // First task: Set the periodicity in the face direction
643  // and assign the neighbour pointers.
644  //-----------------------------------------------------------
645  // Variable to hold the face direction of the neighbouring element
646  // from the perspective of the current element (t=1 boundary element)
647  int direction1=OcTreeNames::F;
648 
649  // Set the periodicity between the neighbouring OcTree objects and
650  // set the up/right equivalents of the elements (it is assumed that
651  // the elements are both oriented in the same way -- seems reasonable
652  // for an extruded mesh)
654  direction1);
655 
656  //-----------------------------------------------------------
657  // ...EDGE NEIGHBOURS...
658  //-----------------------------------------------------------
659  //-----------------------------------------------------------
660  // First task: Find an element on the t=0 boundary and its
661  // corresponding element on the t=1 boundary in a given edge
662  // direction. We already have a pointer to the element on the
663  // back face (t=0 boundary) pointed to by el0_pt so we don't
664  // need to calculate that. To get the edge neighbours (on the
665  // t=1 boundary) we can simply use the OcTree data structure.
666  //-----------------------------------------------------------
667  // Pointer to the tree root associated with the element on
668  // the t=0 boundary
669  OcTreeRoot* octree0_pt=
670  dynamic_cast<OcTreeRoot*>
671  (dynamic_cast<ELEMENT*>(el0_pt)->tree_pt()->root_pt());
672 
673  // First edge direction
674  direction1=OcTreeNames::LF;
675 
676  // If there's an face neighbour in the given direction
677  if (octree0_pt->neighbour_pt(OcTreeNames::L)!=0)
678  {
679  // Get a pointer to the LF edge neighbour of the t=1 boundary element
680  el0_pt=octree0_pt->neighbour_pt(OcTreeNames::L)->object_pt();
681 
682  // Set the periodicity between the neighbouring OcTree objects and
683  // set the up/right equivalents of the elements (it is assumed that
684  // the elements are both oriented in the same way -- seems reasonable
685  // for an extruded mesh)
687  el1_pt,el0_pt,direction1);
688  }
689 
690  // Second edge direction
691  direction1=OcTreeNames::RF;
692 
693  // If there's an face neighbour in the given direction
694  if (octree0_pt->neighbour_pt(OcTreeNames::R)!=0)
695  {
696  // Get a pointer to the RF edge neighbour of the t=1 boundary element
697  el0_pt=octree0_pt->neighbour_pt(OcTreeNames::R)->object_pt();
698 
699  // Set the periodicity between the neighbouring OcTree objects and
700  // set the up/right equivalents of the elements
702  el1_pt,el0_pt,direction1);
703  }
704 
705  // Third edge direction
706  direction1=OcTreeNames::DF;
707 
708  // If there's an face neighbour in the given direction
709  if (octree0_pt->neighbour_pt(OcTreeNames::D)!=0)
710  {
711  // Get a pointer to the DF edge neighbour of the t=1 boundary element
712  el0_pt=octree0_pt->neighbour_pt(OcTreeNames::D)->object_pt();
713 
714  // Set the periodicity between the neighbouring OcTree objects and
715  // set the up/right equivalents of the elements
717  el1_pt,el0_pt,direction1);
718  }
719 
720  // Fourth edge direction
721  direction1=OcTreeNames::UF;
722 
723  // If there's an face neighbour in the given direction
724  if (octree0_pt->neighbour_pt(OcTreeNames::U)!=0)
725  {
726  // Get a pointer to the UF edge neighbour of the t=1 boundary element
727  el0_pt=octree0_pt->neighbour_pt(OcTreeNames::U)->object_pt();
728 
729  // Set the periodicity between the neighbouring OcTree objects and
730  // set the up/right equivalents of the elements
732  el1_pt,el0_pt,direction1);
733  }
734 
735  // We've found the neighbouring node
736  has_neighbour_element_been_found=true;
737 
738  // We're done; break out!
739  break;
740  }
741  } // for (unsigned j=0;j<n_boundary1_element;j++)
742 
743  // If we get here and we haven't found the neighbouring element,
744  // something's wrong
745  if (!has_neighbour_element_been_found)
746  {
747  // Throw an error
748  throw OomphLibError("Couldn't find neighbouring element!",
751  }
752  } // for (unsigned i=0;i<n_boundary0_element;i++)
753 
754  // Notify user
755  oomph_info << "\nFinished enforcing periodicity!" << std::endl;
756 
757  // If we've got here then the periodicity has been set up
759  } // if (!Periodicity_has_been_enforced)
760 } // End of enforce_time_periodic_boundary_conditions
dominoes D
Definition: Domino.cpp:55
MatrixXd L
Definition: LLT_example.cpp:6
@ R
Definition: StatisticsVector.h:21
void set_neighbour_periodic_and_up_right_equivalents(FiniteElement *el0_pt, FiniteElement *el1_pt, const int &direction0)
Definition: test_equal_order_galerkin.cc:771
Definition: elements.h:1313
virtual double interpolated_x(const Vector< double > &s, const unsigned &i) const
Return FE interpolated coordinate x[i] at local coordinate s.
Definition: elements.cc:3962
virtual void make_periodic(Node *const &node_pt)
Definition: nodes.cc:2257
Definition: octree.h:611
Definition: oomph_definitions.h:222
TreeRoot *& neighbour_pt(const int &direction)
Definition: tree.h:357
RefineableElement * object_pt() const
Definition: tree.h:88
char char char int int * k
Definition: level2_impl.h:374
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
double U
Swimming speed.
Definition: two_d_variable_diff_adapt.cc:53
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
@ DF
Definition: octree.h:67
@ UF
Definition: octree.h:68
@ F
Definition: octree.h:74
@ LF
Definition: octree.h:65
@ RF
Definition: octree.h:66

References D, oomph::OcTreeNames::DF, oomph::OcTreeNames::F, boost::multiprecision::fabs(), i, oomph::FiniteElement::interpolated_x(), j, k, L, oomph::OcTreeNames::LF, oomph::Node::make_periodic(), oomph::TreeRoot::neighbour_pt(), oomph::Tree::object_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, Eigen::ArrayBase< Derived >::pow(), R, oomph::OcTreeNames::RF, sqrt(), RachelsAdvectionDiffusion::U, oomph::OcTreeNames::UF, and oomph::Node::x().

◆ enforce_time_periodic_boundary_conditions() [2/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::enforce_time_periodic_boundary_conditions ( )

Assign the appropriate boundary conditions and enforce periodicity in the time direction

◆ enforce_time_periodic_boundary_conditions() [3/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::enforce_time_periodic_boundary_conditions ( )

Assign the appropriate boundary conditions and enforce periodicity in the time direction

◆ global_temporal_error_norm()

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

Global error norm for adaptive time-stepping.

Global error norm for adaptive timestepping: RMS error, based on difference between predicted and actual value at all nodes.

Reimplemented from oomph::Problem.

574 {
575  double global_error = 0.0;
576 
577  //Find out how many nodes there are in the problem
578  unsigned n_node = mesh_pt()->nnode();
579 
580  //Loop over the nodes and calculate the estimated error in the values
581  for(unsigned i=0;i<n_node;i++)
582  {
583  // Get error in solution: Difference between predicted and actual
584  // value for nodal value 0
585  double error = mesh_pt()->node_pt(i)->time_stepper_pt()->
586  temporal_error_in_value(mesh_pt()->node_pt(i),0);
587 
588  //Add the square of the individual error to the global error
589  global_error += error*error;
590  }
591 
592  // Divide by the number of nodes
593  global_error /= double(n_node);
594 
595  // Return square root...
596  return sqrt(global_error);
597 
598 } // end of global_temporal_error_norm
TimeStepper *& time_stepper_pt()
Return the pointer to the timestepper.
Definition: nodes.h:238
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436

References calibrate::error, i, and sqrt().

◆ pin_redundant_temporal_nodes()

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::pin_redundant_temporal_nodes

The mixed order elements use linear interpolation in time so the only nodes which contribute to the unknowns in the system are those that lie on the temporal boundaries of the elements. Thus, all nodes that do not lie on these boundaries need to be pinned (otherwise we'd get zero rows in the system matrix making it singular...).

493 {
494  // Number of nodes in each direction
495  unsigned n_node_1d=Bulk_mesh_pt->finite_element_pt(0)->nnode_1d();
496 
497  // Number of nodes in a space-time element
498  unsigned n_el_node=Bulk_mesh_pt->finite_element_pt(0)->nnode();
499 
500  // Get the number of elements in the mesh
501  unsigned n_element=Bulk_mesh_pt->nelement();
502 
503  unsigned i_nod_s=n_node_1d*n_node_1d;
504  unsigned i_nod_e=n_el_node-n_node_1d*n_node_1d;
505 
506  // Loop over the elements
507  for (unsigned i=0; i<n_element; i++)
508  {
509  // Loop over the nodes
510  for (unsigned j=i_nod_s; j<i_nod_e; j++)
511  {
512  // Get a pointer to the j-th node in the i-th element
513  Node* node_pt=Bulk_mesh_pt->finite_element_pt(i)->node_pt(j);
514 
515  // Pin the (only) unknown at this node
516  node_pt->pin(0);
517  }
518  } // for (unsigned i=0;i<n_element;i++)
519 } // End of pin_redundant_temporal_nodes

References i, j, and oomph::Data::pin().

◆ refine_uniformly() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::refine_uniformly ( )
inline

A wrapper around the Problem's refine_uniformly(...) function; update the number of space-time slabs after a uniform refinement so that the preconditioner solve the system more efficiently. NOTE: We don't implement this for

235  {
236  // The number of space-time slabs will double after this refinement
238 
239  // Call the Problem's implementation of refine_uniformly(...)
240  Problem::refine_uniformly();
241  } // End of refine_uniformly

References oomph::Problem::refine_uniformly().

◆ refine_uniformly() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::refine_uniformly ( )
inline

A wrapper around the Problem's refine_uniformly(...) function; update the number of space-time slabs after a uniform refinement so that the preconditioner solve the system more efficiently.

243  {
244  // The number of space-time slabs will double after this refinement
246 
247  // Call the Problem's implementation of refine_uniformly(...)
248  Problem::refine_uniformly();
249  } // End of refine_uniformly

References oomph::Problem::refine_uniformly().

◆ restart() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::restart ( ifstream &  restart_file)

Read problem for restart from specified restart file.

Read solution from disk for restart.

511 {
512 
513  // Read the generic problem data from restart file
514  Problem::read(restart_file);
515 
516 } // end of restart
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::enable_if_t< PacketLoad, PacketType > read(const TensorMapper &tensorMapper, const StorageIndex &NCIndex, const StorageIndex &CIndex, const StorageIndex &ld)
read, a template function used for loading the data from global memory. This function is used to guar...
Definition: TensorContractionSycl.h:162

References Eigen::TensorSycl::internal::read().

◆ restart() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::restart ( ifstream &  restart_file)

Read problem for restart from specified restart file.

◆ set_initial_condition() [1/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_initial_condition
virtual

Set initial condition (incl previous timesteps) according to specified function.

Set initial condition: Assign previous and current values from exact solution.

Set initial condition: Assign previous and current values from exact solution or from restart file.

Reimplemented from oomph::Problem.

341 {
342  // Backup time in global Time object
343  double backed_up_time=time_pt()->time();
344 
345  // Past history needs to be established for t=time0-deltat, ...
346  // Then provide current values (at t=time0) which will also form
347  // the initial guess for the first solve at t=time0+deltat
348 
349  // Vector of exact solution value
350  Vector<double> soln(1);
351  Vector<double> x(2);
352 
353  //Find number of nodes in mesh
354  unsigned num_nod = Bulk_mesh_pt->nnode();
355 
356  // Set continuous times at previous timesteps:
357  // How many previous timesteps does the timestepper use?
358  int nprev_steps=time_stepper_pt()->nprev_values();
359  Vector<double> prev_time(nprev_steps+1);
360  for (int t=nprev_steps;t>=0;t--)
361  {
362  prev_time[t]=time_pt()->time(unsigned(t));
363  }
364 
365  // Loop over current & previous timesteps
366  for (int t=nprev_steps;t>=0;t--)
367  {
368  // Continuous time
369  double time=prev_time[t];
370  cout << "setting IC at time =" << time << std::endl;
371 
372  // Loop over the nodes to set initial guess everywhere
373  for (unsigned n=0;n<num_nod;n++)
374  {
375  // Get nodal coordinates
376  x[0]=Bulk_mesh_pt->node_pt(n)->x(0);
377  x[1]=Bulk_mesh_pt->node_pt(n)->x(1);
378 
379  // Get exact solution at previous time
381 
382  // Assign solution
383  Bulk_mesh_pt->node_pt(n)->set_value(t,0,soln[0]);
384 
385  // Loop over coordinate directions: Mesh doesn't move, so
386  // previous position = present position
387  for (unsigned i=0;i<2;i++)
388  {
389  Bulk_mesh_pt->node_pt(n)->x(t,i)=x[i];
390  }
391  }
392  }
393 
394  // Reset backed up time for global timestepper
395  time_pt()->time()=backed_up_time;
396 
397 } // end of set_initial_condition
virtual unsigned nprev_values() const =0
Number of previous values available: 0 for static, 1 for BDF<1>,...

References ExactSolnForUnsteadyHeat::get_exact_u(), i, n, plotPSD::t, and plotDoE::x.

◆ set_initial_condition() [2/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_initial_condition ( )
virtual

Set initial condition (incl previous timesteps) according to specified function.

Reimplemented from oomph::Problem.

◆ set_initial_condition() [3/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_initial_condition ( )
virtual

Set initial condition (incl previous timesteps) according to specified function.

Reimplemented from oomph::Problem.

◆ set_initial_condition() [4/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_initial_condition ( )
virtual

Set initial condition (incl previous timesteps) according to specified function.

Reimplemented from oomph::Problem.

◆ set_initial_condition() [5/5]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_initial_condition ( )
virtual

Set initial condition (incl previous timesteps) according to specified function.

Reimplemented from oomph::Problem.

◆ set_neighbour_periodic_and_up_right_equivalents() [1/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents ( FiniteElement el0_pt,
FiniteElement el1_pt,
const int direction0 
)

Function to set the periodicity between two octrees and assign the up and right equivalents to both elements

Function to set the periodicity between two octrees and assign the up and right equivalents to both elements. The arguments are the current element, the (i,j,k) coordinates of the neighbouring element and the direction to the neighbouring element.

774 {
775  // The direction from the element on the other face/edge
776  int direction1=0;
777 
778  // If we're on a face
779  if ((direction0>=OcTreeNames::L)&&(direction0<=OcTreeNames::F))
780  {
781  // Calculate the reflected face direction
782  direction1=OcTree::Reflect_face[direction0];
783  }
784  // If we're on a edge
785  else if ((direction0>=OcTreeNames::LB)&&(direction0<=OcTreeNames::UF))
786  {
787  // Calculate the reflected edge direction
788  direction1=OcTree::Reflect_edge[direction0];
789  }
790  // We should never reach here
791  else
792  {
793  // Throw an error
794  throw OomphLibError("Not looking for a face or edge, something's wrong!",
797  }
798 
799  // Get the tree root of the second element
800  OcTreeRoot* octree0_pt=dynamic_cast<OcTreeRoot*>
801  (dynamic_cast<ELEMENT*>(el0_pt)->tree_pt()->root_pt());
802 
803  // Get the tree root of the second element
804  OcTreeRoot* octree1_pt=dynamic_cast<OcTreeRoot*>
805  (dynamic_cast<ELEMENT*>(el1_pt)->tree_pt()->root_pt());
806 
807  //--------------------------------------------------------------------
808  // Set the periodicity between the neighbouring OcTree objects and
809  // set the up/right equivalents of the elements (it is assumed that
810  // the elements are both oriented in the same way -- seems reasonable
811  // for a uniform cube mesh)
812  //--------------------------------------------------------------------
813  // The first element (at t=0) will be periodic in the direction direction0
814  octree0_pt->set_neighbour_periodic(direction0);
815 
816  // The second element (at t=1) will be periodic in the direction direction1
817  octree1_pt->set_neighbour_periodic(direction1);
818 
819  // If we're on a face
820  if ((direction0>=OcTreeNames::L)&&(direction0<=OcTreeNames::F))
821  {
822  // Pass the tree root of the neighbouring element
823  octree0_pt->neighbour_pt(direction0)=octree1_pt;
824 
825  // Pass the tree root of the neighbouring element
826  octree1_pt->neighbour_pt(direction1)=octree0_pt;
827  }
828  // If we're on an edge
829  else if ((direction0>=OcTreeNames::LB)&&(direction0<=OcTreeNames::UF))
830  {
831  // Pass the tree root of the neighbouring element
832  octree0_pt->add_edge_neighbour_pt(octree1_pt,direction0);
833 
834  // Pass the tree root of the neighbouring element
835  octree1_pt->add_edge_neighbour_pt(octree0_pt,direction1);
836  }
837 
838  //----------------------------------------------------------------
839  // Now the appropriate OcTree objects are aware of each other,
840  // they need to know their relative orientations. Specifically,
841  // they need to know their up and right direction relative to each
842  // other. This is painful to do by calling the function
843  // construct_up_right_equivalents()
844  // from the Forest pointer of the mesh so just hardcode it (hacky,
845  // I know...).
846  //----------------------------------------------------------------
847  // Set the up equivalent
848  octree0_pt->set_up_equivalent(octree1_pt,OcTreeNames::U);
849 
850  // Set the up equivalent
851  octree1_pt->set_up_equivalent(octree0_pt,OcTreeNames::U);
852 
853  // Set the right equivalent
854  octree0_pt->set_right_equivalent(octree1_pt,OcTreeNames::R);
855 
856  // Set the right equivalent
857  octree1_pt->set_right_equivalent(octree0_pt,OcTreeNames::R);
858 } // End of set_neighbour_periodic_and_up_right_equivalents
void set_up_equivalent(TreeRoot *tree_root_pt, const int &dir)
Definition: octree.h:779
void add_edge_neighbour_pt(TreeRoot *oc_tree_root_pt, const unsigned &edge_direction)
Definition: octree.h:716
void set_right_equivalent(TreeRoot *tree_root_pt, const int &dir)
Definition: octree.h:806
void set_neighbour_periodic(const int &direction)
Set the neighbour in particular direction to be periodic.
Definition: tree.h:370
@ LB
Definition: octree.h:57

References oomph::OcTreeRoot::add_edge_neighbour_pt(), oomph::OcTreeNames::F, L, oomph::OcTreeNames::LB, oomph::TreeRoot::neighbour_pt(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, R, oomph::TreeRoot::set_neighbour_periodic(), oomph::OcTreeRoot::set_right_equivalent(), oomph::OcTreeRoot::set_up_equivalent(), RachelsAdvectionDiffusion::U, and oomph::OcTreeNames::UF.

◆ set_neighbour_periodic_and_up_right_equivalents() [2/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents ( FiniteElement el0_pt,
FiniteElement el1_pt,
const int direction0 
)

Function to set the periodicity between two octrees and assign the up and right equivalents to both elements

◆ set_neighbour_periodic_and_up_right_equivalents() [3/3]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_neighbour_periodic_and_up_right_equivalents ( FiniteElement el0_pt,
FiniteElement el1_pt,
const int direction0 
)

Function to set the periodicity between two octrees and assign the up and right equivalents to both elements

◆ set_up_spacetime_solver() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver

Assign the chosen solver (and preconditioner if so desired)

Set up the solver for this Problem object.

547 {
548  // Create oomph-lib iterative linear solver
550 
551  // Use LHS preconditioning
552  dynamic_cast<GMRES<CRDoubleMatrix>*>(Solver_pt)->set_preconditioner_RHS();
553 
554  // Set the tolerance
555  Solver_pt->tolerance()=1.0e-12;
556 
557  // Maximum number of iterations
558  Solver_pt->max_iter()=200;
559 
560  // Set linear solver
562 
563  //-----------------------------------------
564  // Create the master-level preconditioners:
565  //-----------------------------------------
566  // Solve the diagonal blocks associated with each time-slice separately
568  {
569  // Create a new instance of the space-time preconditioner
571  }
572  // Solve the block lower-triangular part of the system matrix
574  {
575  // Create a new instance of the space-time preconditioner
577 
578  // Create a new instance of the space-time preconditioner
581  Prec_pt);
582 
583  // Indicate that we're using a block lower triangular solve
584  st_block_prec_pt->lower_triangular();
585 
586  // The block bandwidth for the preconditioner; because we group dofs by
587  // their space-time-slab, the bandwidth will be one (we only have diagonal
588  // blocks and subdiagonal blocks in the block-organised system matrix for
589  // the backwards-looking mixed order discretisation).
590  // NOTE: Don't delete this as this drastically reduces the time taken to
591  // to extract blocks during the preconditioner setup.
592  bool bandwidth=1;
593 
594  // Provide the bandwidth; only subdiagonal block entries
595  st_block_prec_pt->set_block_bandwidth(bandwidth);
596 
597  // Do we want to document the memory usage?
598  bool document_memory_usage=true;
599 
600  // If we want to document the memory usage
601  if (document_memory_usage)
602  {
603  // Tell the block preconditioner that we want it to doc. the memory usage
604  st_block_prec_pt->enable_doc_memory_usage();
605  }
606  }
607  // If the user provided an invalid input
608  else
609  {
610  // Throw an error
611  throw OomphLibError("Invalid choice of preconditioner.",
614  } // if (GlobalParameters::Preconditioner==Diagonal_preconditioner)
615 
616  // Allocate space for the DOF to block map; this tells the master block
617  // preconditioner which DOF types to aggregate
618  Vector<unsigned> dof_to_block_map;
619 
620  // Call the auxiliary function which sets up the mapping
622 
623  // Create an upcasted pointer to the master preconditioner
624  GeneralPurposeBlockPreconditioner<CRDoubleMatrix>* upcasted_master_prec_pt=
626 
627  // Build silently!
628  upcasted_master_prec_pt->enable_silent_preconditioner_setup();
629 
630  // Pass the DOF-to-block map to the preconditioner
631  upcasted_master_prec_pt->set_dof_to_block_map(dof_to_block_map);
632 
633  // Pass a pointer to the (space-time) mesh
634  upcasted_master_prec_pt->add_mesh(Bulk_mesh_pt);
635 
636  // Now assign the preconditioner to the linear solver
638 } // End of set_up_spacetime_solver
Preconditioner * Prec_pt
Preconditioner.
Definition: test_equal_order_galerkin_petrov.cc:312
IterativeLinearSolver * Solver_pt
Oomph-lib iterative linear solver.
Definition: test_equal_order_galerkin_petrov.cc:309
Definition: general_purpose_space_time_block_preconditioner.h:199
void enable_doc_memory_usage()
Document the memory usage.
Definition: general_purpose_space_time_block_preconditioner.h:311
void lower_triangular()
Use as a lower triangular preconditioner.
Definition: general_purpose_space_time_block_preconditioner.h:295
void set_block_bandwidth(const int &block_bandwidth)
Set the block bandwidth of the preconditioner.
Definition: general_purpose_space_time_block_preconditioner.h:271
Definition: general_purpose_block_preconditioners.h:321
The GMRES method.
Definition: iterative_linear_solver.h:1227
Definition: general_purpose_block_preconditioners.h:77
void set_dof_to_block_map(Vector< unsigned > &dof_to_block_map)
Specify a DOF to block map.
Definition: general_purpose_block_preconditioners.h:182
void add_mesh(const Mesh *mesh_pt, const bool &allow_multiple_element_type_in_mesh=false)
Definition: general_purpose_block_preconditioners.h:191
Preconditioner *& preconditioner_pt()
Access function to preconditioner.
Definition: iterative_linear_solver.h:95
double & tolerance()
Access to convergence tolerance.
Definition: iterative_linear_solver.h:107
unsigned & max_iter()
Access to max. number of iterations.
Definition: iterative_linear_solver.h:113
void enable_silent_preconditioner_setup()
Set up the block preconditioner quietly!
Definition: preconditioner.h:127
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
Definition: problem.h:1466
void set_up_dof_to_block_mapping(Vector< unsigned > &dof_to_block_map)
Definition: space_time_oscillating_cylinder.cc:735
unsigned Preconditioner
----------------------—Domain Properties------------------------—
Definition: space_time_oscillating_cylinder.cc:725

References oomph::GeneralPurposeBlockPreconditioner< MATRIX >::add_mesh(), oomph::BandedBlockTriangularPreconditioner< MATRIX >::enable_doc_memory_usage(), oomph::Preconditioner::enable_silent_preconditioner_setup(), oomph::BandedBlockTriangularPreconditioner< MATRIX >::lower_triangular(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, GlobalParameters::Preconditioner, oomph::BandedBlockTriangularPreconditioner< MATRIX >::set_block_bandwidth(), oomph::GeneralPurposeBlockPreconditioner< MATRIX >::set_dof_to_block_map(), and GlobalParameters::set_up_dof_to_block_mapping().

◆ set_up_spacetime_solver() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::set_up_spacetime_solver ( )

Assign the chosen solver (and preconditioner if so desired)

◆ unpin_all_dofs()

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::unpin_all_dofs ( )
inline

Unpin all of the dofs in the mesh.

276  {
277  // The number of nodes in the mesh
278  unsigned n_node=Bulk_mesh_pt->nnode();
279 
280  // Unpin all dofs
281  for (unsigned n=0; n<n_node; n++)
282  {
283  // Unpin the only dof at the n-th node
284  Bulk_mesh_pt->node_pt(n)->unpin(0);
285  }
286  } // End of unpin_all_dofs

References n.

◆ update_block_preconditioner_after_refinement() [1/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::update_block_preconditioner_after_refinement

Helper function to update the block preconditioner after, what seems like, a uniform refinement

512 {
513  // Make sure we're even using the preconditioner
514  if (Prec_pt!=0)
515  {
516  // Set the time-slab id
518 
519  // Don't waste time, just kill the old solver
520  // and set up a new one. God knows why it's
521  // struggling with me trying to replace the
522  // current dof-to-block map...
523 
524  // Kill the preconditioner
525  delete Prec_pt;
526 
527  // Kill the solver
528  delete Solver_pt;
529 
530  // Make the reference to the preconditioner a null pointer
531  Prec_pt=0;
532 
533  // Make the reference to the solver a null pointer
534  Solver_pt=0;
535 
536  // Set up a new solver and preconditioner
538  }
539 } // End of update_block_preconditioner_after_refinement
void set_up_spacetime_solver()
Assign the chosen solver (and preconditioner if so desired)
Definition: test_equal_order_galerkin_petrov.cc:546
void assign_time_slab_id()
Helper function when space-time block preconditioning is being used.
Definition: test_equal_order_galerkin_petrov.cc:459

◆ update_block_preconditioner_after_refinement() [2/2]

template<class ELEMENT >
void UnsteadyHeatProblem< ELEMENT >::update_block_preconditioner_after_refinement ( )

Helper function to update the block preconditioner after, what seems like, a uniform refinement

Member Data Documentation

◆ Bulk_mesh_pt [1/3]

template<class ELEMENT >
RefineableSimpleCubicMesh< ELEMENT > * UnsteadyHeatProblem< ELEMENT >::Bulk_mesh_pt
private

Pointers to specific mesh.

Pointer to the mesh.

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ Bulk_mesh_pt [2/3]

template<class ELEMENT >
Mesh* UnsteadyHeatProblem< ELEMENT >::Bulk_mesh_pt
private

Pointer to the "bulk" mesh.

◆ Bulk_mesh_pt [3/3]

template<class ELEMENT >
RefineableSimpleCubicMesh<ELEMENT>* UnsteadyHeatProblem< ELEMENT >::Bulk_mesh_pt
private

Pointer to the mesh.

◆ Control_node_pt

template<class ELEMENT >
Node * UnsteadyHeatProblem< ELEMENT >::Control_node_pt
private

Pointer to control node at which the solution is documented.

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ Flux_boundary_id

template<class ELEMENT >
unsigned UnsteadyHeatProblem< ELEMENT >::Flux_boundary_id
private

ID of flux boundary.

◆ Melt_boundary_id

template<class ELEMENT >
unsigned UnsteadyHeatProblem< ELEMENT >::Melt_boundary_id
private

ID of melt boundary.

◆ N_space_time_slab

template<class ELEMENT >
unsigned UnsteadyHeatProblem< ELEMENT >::N_space_time_slab
private

The number of space-time slabs in the mesh; this is essentially a copy of N_t in the GlobalParameters namespace but will be updated when we complete a uniform refinement

◆ Periodicity_has_been_enforced

template<class ELEMENT >
bool UnsteadyHeatProblem< ELEMENT >::Periodicity_has_been_enforced
private

◆ Prec_pt

template<class ELEMENT >
Preconditioner * UnsteadyHeatProblem< ELEMENT >::Prec_pt
private

Preconditioner.

◆ Solver_pt

template<class ELEMENT >
IterativeLinearSolver * UnsteadyHeatProblem< ELEMENT >::Solver_pt
private

Oomph-lib iterative linear solver.

◆ Source_fct_pt [1/2]

template<class ELEMENT >
UnsteadyHeatEquations< 2 >::UnsteadyHeatSourceFctPt UnsteadyHeatProblem< ELEMENT >::Source_fct_pt
private

Pointer to source function.

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ Source_fct_pt [2/2]

template<class ELEMENT >
SpaceTimeFunctionPt UnsteadyHeatProblem< ELEMENT >::Source_fct_pt
private

Pointer to source function.

◆ Surface_melt_mesh_pt

template<class ELEMENT >
Mesh* UnsteadyHeatProblem< ELEMENT >::Surface_melt_mesh_pt
private

Pointer to the "surface" mesh.

◆ Surface_mesh_pt

template<class ELEMENT >
Mesh * UnsteadyHeatProblem< ELEMENT >::Surface_mesh_pt
private

Pointer to the "surface" mesh.

Referenced by UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem().

◆ Trace_file

template<class ELEMENT >
ofstream UnsteadyHeatProblem< ELEMENT >::Trace_file
private

Trace file.


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