AxiPoroProblem< ELEMENT, TIMESTEPPER > Class Template Reference

Problem class. More...

+ Inheritance diagram for AxiPoroProblem< ELEMENT, TIMESTEPPER >:

Public Member Functions

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

Private Member Functions

void create_pressure_elements ()
 Allocate traction/pressure elements. More...
 

Private Attributes

TriangleMesh< ELEMENT > * Bulk_mesh_pt
 Pointer to the "bulk" mesh. More...
 
Mesh * Surface_mesh_pt
 Mesh for traction/pressure elements. More...
 
std::ofstream Trace_file
 Trace file. More...
 
TIMESTEPPER * My_time_stepper_pt
 

Additional Inherited Members

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

Detailed Description

template<class ELEMENT, class TIMESTEPPER>
class AxiPoroProblem< ELEMENT, TIMESTEPPER >

Problem class.

Constructor & Destructor Documentation

◆ AxiPoroProblem()

template<class ELEMENT , class TIMESTEPPER >
AxiPoroProblem< ELEMENT, TIMESTEPPER >::AxiPoroProblem

Constructor.

684 {
685 
686  // Problem is linear
687  Problem::Problem_is_nonlinear=false;
688 
689  // Allocate the timestepper
690  My_time_stepper_pt=new TIMESTEPPER;
692 
693  // disable warnings in assign initial data values
694  My_time_stepper_pt->disable_warning_in_assign_initial_data_values();
695 
696  // Remember it
698 
699  // Solid mesh
700  //-----------
701 
702  TriangleMeshClosedCurve *outer_boundary_pt=0;
703 
704  // Internal boundary to prevent problem with flux B.C.s
705  Vector<TriangleMeshOpenCurve*> inner_open_boundary_pt;
706 
707  // Temporary storage for coords in required format
708  Vector<Vector<double> > temp_coord(2,Vector<double>(2));
709 
710  // Bottom small arc
711  Circle* outer_boundary_lower_circle_pt=
715 
716  // Large arc
717  Circle* outer_boundary_right_circle_pt=
720 
721  // Top small arc
722  Circle* outer_boundary_upper_circle_pt=
726 
727  // Storage for the individual boundary sections
728  Vector<TriangleMeshCurveSection*> outer_curvilinear_boundary_pt(4);
729 
730  // First bit
731  double zeta_start=MathematicalConstants::Pi/2.0;
732  double zeta_end=0;
733  unsigned nsegment=
734  (unsigned)max(
735  3.0,
738  outer_curvilinear_boundary_pt[0]=
739  new TriangleMeshCurviLine(outer_boundary_lower_circle_pt, zeta_start,
740  zeta_end, nsegment, 0);
741 
742  // Second bit
743  zeta_start=-atan(2.0);
744  zeta_end=atan(2.0);
745  nsegment=
746  (unsigned)max(
747  3.0,
751  outer_curvilinear_boundary_pt[1]=
752  new TriangleMeshCurviLine(outer_boundary_right_circle_pt, zeta_start,
753  zeta_end, nsegment, 1);
754 
755  // Third bit
756  zeta_start=2.0*MathematicalConstants::Pi;
757  zeta_end=3.0*MathematicalConstants::Pi/2.0;
758  nsegment=
759  (unsigned)max(
760  3.0,
763  outer_curvilinear_boundary_pt[2]=
764  new TriangleMeshCurviLine(outer_boundary_upper_circle_pt, zeta_start,
765  zeta_end, nsegment, 2);
766 
767  // Fourth bit
768  temp_coord[0][0]=ProblemParameters::Inner_radius;
769  temp_coord[0][1]=ProblemParameters::Domain_radius;
770  temp_coord[1][0]=ProblemParameters::Inner_radius;
771  temp_coord[1][1]=-ProblemParameters::Domain_radius;
772 
773  outer_curvilinear_boundary_pt[3]=
774  new TriangleMeshPolyLine(temp_coord,3);
775 
776  // Make the solid outer boundary
777  outer_boundary_pt=
778  new TriangleMeshClosedCurve(outer_curvilinear_boundary_pt);
779 
780 
781  // Add four internal boundaries emanating from corners to make sure
782  // that no elements have faces on two boundaries.
783  inner_open_boundary_pt.resize(4);
784 
785  // First inner boundary
786  temp_coord[0][0]=ProblemParameters::Inner_radius;
787  temp_coord[0][1]=-ProblemParameters::Domain_radius;
788  temp_coord[1][0]=ProblemParameters::Inner_radius+
790  temp_coord[1][1]=-0.75*ProblemParameters::Domain_radius;
791 
792  Vector<TriangleMeshCurveSection*> inner_open_polyline1_curve_section_pt(1);
793  inner_open_polyline1_curve_section_pt[0]=
794  new TriangleMeshPolyLine(temp_coord,4);
795 
796  inner_open_polyline1_curve_section_pt[0]->
797  connect_initial_vertex_to_curviline(
798  dynamic_cast<TriangleMeshCurviLine*>(outer_curvilinear_boundary_pt[0]),
800 
801  inner_open_boundary_pt[0]=
802  new TriangleMeshOpenCurve(inner_open_polyline1_curve_section_pt);
803 
804  // Second inner boundary
805  temp_coord[0][0]=ProblemParameters::Inner_radius+
807  temp_coord[0][1]=-2.0*ProblemParameters::Domain_radius;
808  temp_coord[1][0]=ProblemParameters::Inner_radius+
810  temp_coord[1][1]=-1.5*ProblemParameters::Domain_radius;
811 
812  TriangleMeshPolyLine *inner_open_polyline2_pt=
813  new TriangleMeshPolyLine(temp_coord,5);
814 
815  inner_open_polyline2_pt->connect_initial_vertex_to_curviline(
816  dynamic_cast<TriangleMeshCurviLine*>(outer_curvilinear_boundary_pt[1]),
817  -atan(2.0));
818 
819  Vector<TriangleMeshCurveSection*> inner_open_polyline2_curve_section_pt(1);
820  inner_open_polyline2_curve_section_pt[0]=inner_open_polyline2_pt;
821 
822  inner_open_boundary_pt[1]=
823  new TriangleMeshOpenCurve(inner_open_polyline2_curve_section_pt);
824 
825  // Third inner boundary
826  temp_coord[0][0]=ProblemParameters::Inner_radius+
828  temp_coord[0][1]=2.0*ProblemParameters::Domain_radius;
829  temp_coord[1][0]=ProblemParameters::Inner_radius+
831  temp_coord[1][1]=1.5*ProblemParameters::Domain_radius;
832 
833  TriangleMeshPolyLine *inner_open_polyline3_pt=
834  new TriangleMeshPolyLine(temp_coord,6);
835 
836  inner_open_polyline3_pt->connect_initial_vertex_to_curviline(
837  dynamic_cast<TriangleMeshCurviLine*>(outer_curvilinear_boundary_pt[1]),
838  atan(2.0));
839 
840  Vector<TriangleMeshCurveSection*> inner_open_polyline3_curve_section_pt(1);
841  inner_open_polyline3_curve_section_pt[0]=inner_open_polyline3_pt;
842 
843  inner_open_boundary_pt[2]=
844  new TriangleMeshOpenCurve(inner_open_polyline3_curve_section_pt);
845 
846  // Fourth inner boundary
847  temp_coord[0][0]=ProblemParameters::Inner_radius;
848  temp_coord[0][1]=ProblemParameters::Domain_radius;
849  temp_coord[1][0]=ProblemParameters::Inner_radius+
851  temp_coord[1][1]=0.75*ProblemParameters::Domain_radius;
852 
853  Vector<TriangleMeshCurveSection*> inner_open_polyline4_curve_section_pt(1);
854  inner_open_polyline4_curve_section_pt[0]=
855  new TriangleMeshPolyLine(temp_coord,7);
856 
857  inner_open_polyline4_curve_section_pt[0]->connect_initial_vertex_to_polyline(
858  dynamic_cast<TriangleMeshPolyLine*>(outer_curvilinear_boundary_pt[3]),
859  0);
860 
861  inner_open_boundary_pt[3]=
862  new TriangleMeshOpenCurve(inner_open_polyline4_curve_section_pt);
863 
864  // Use the TriangleMeshParameters object for gathering all
865  // the necessary arguments for the TriangleMesh object
866  TriangleMeshParameters triangle_mesh_parameters(
867  outer_boundary_pt);
868 
869  // Set the inner boundaries
870  triangle_mesh_parameters.internal_open_curves_pt()=
871  inner_open_boundary_pt;
872 
873  // Target area for triangle
874  triangle_mesh_parameters.element_area() = ProblemParameters::Element_area;
875 
876 #ifdef ADAPTIVE
877 
878  // Build adaptive "bulk" mesh
879  Bulk_mesh_pt=new RefineableTriangleMesh<ELEMENT>(triangle_mesh_parameters,
880  time_stepper_pt());
881 
882  // Create/set error estimator
883  Bulk_mesh_pt->spatial_error_estimator_pt()=new Z2ErrorEstimator;
884 
885  // Choose error tolerances
886  Bulk_mesh_pt->min_permitted_error()=1.0e-4;
887  Bulk_mesh_pt->max_permitted_error()=1.0e-3;
888 
889  Bulk_mesh_pt->max_element_size()=ProblemParameters::Element_area;
890  Bulk_mesh_pt->min_element_size()=1.0e-20;
891 
892  // Actions before projection
893  Bulk_mesh_pt->mesh_update_fct_pt()=
894  &ProblemParameters::edge_sign_setup<ELEMENT>;
895 
896 #else
897 
898  // Create the buk mesh
899  Bulk_mesh_pt = new TriangleMesh<ELEMENT>(triangle_mesh_parameters,
900  time_stepper_pt());
901 
902 #endif
903 
904  // Setup the signs for the fluxes
905  ProblemParameters::edge_sign_setup<ELEMENT>(Bulk_mesh_pt);
906 
907  // Create the surface mesh
908  Surface_mesh_pt = new Mesh;
909 
910  // Assign the traction/pressure elements
912 
913  // Add the submeshes to the global mesh
916 
917  // Build the global mesh
919 
920  // Complete the problem set up
922 
923  // Temporary filename string
924  char filename[500];
925 
926  // Trace filename
927  sprintf(filename,"%s/trace.dat",ProblemParameters::Directory.c_str());
928 
929  // Open the trace file
930  Trace_file.open(filename);
931 
932  // Assign and doc number of eqns
933  oomph_info << "Number of equations: " << assign_eqn_numbers() << std::endl;
934 
935 } // end of problem constructor
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
void complete_problem_setup()
Complete problem setup.
Definition: unstructured_two_d_curved.cc:942
void create_pressure_elements()
Allocate traction/pressure elements.
Definition: unstructured_two_d_curved.cc:1005
Mesh * Surface_mesh_pt
Mesh for traction/pressure elements.
Definition: unstructured_two_d_curved.cc:669
TIMESTEPPER * My_time_stepper_pt
Definition: unstructured_two_d_curved.cc:675
std::ofstream Trace_file
Trace file.
Definition: unstructured_two_d_curved.cc:672
TriangleMesh< ELEMENT > * Bulk_mesh_pt
Pointer to the "bulk" mesh.
Definition: unstructured_two_d_curved.cc:664
Definition: geom_objects.h:873
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
void connect_initial_vertex_to_curviline(TriangleMeshCurviLine *curviline_pt, const double &s_value, const double &tolerance_for_connection=1.0e-14)
Definition: unstructured_two_d_mesh_geometry_base.cc:1259
Definition: unstructured_two_d_mesh_geometry_base.h:662
Definition: unstructured_two_d_mesh_geometry_base.h:1642
Definition: triangle_mesh.template.h:94
Class defining a polyline for use in Triangle Mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:868
Definition: triangle_mesh.template.h:424
Definition: error_estimator.h:266
#define max(a, b)
Definition: datatypes.h:23
double Pi
Definition: two_d_biharmonic.cc:235
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atan(const bfloat16 &a)
Definition: BFloat16.h:636
string filename
Definition: MergeRestartFiles.py:39
double Domain_radius
Radius of the smaller arcs in the curved mesh.
Definition: unstructured_two_d_curved.cc:105
TimeStepper * Internal_time_stepper_pt
Pointer to timestepper for internal dofs.
Definition: unstructured_two_d_curved.cc:480
string Directory
Output directory.
Definition: oscillating_sphere.cc:59
double Element_area
Target area for initial mesh.
Definition: unstructured_two_d_curved.cc:474
double Inner_radius
Definition: unstructured_two_d_curved.cc:108
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References Eigen::bfloat16_impl::atan(), oomph::TriangleMeshCurveSection::connect_initial_vertex_to_curviline(), ProblemParameters::Directory, ProblemParameters::Domain_radius, ProblemParameters::Element_area, oomph::TriangleMeshParameters::element_area(), MergeRestartFiles::filename, ProblemParameters::Inner_radius, oomph::TriangleMeshParameters::internal_open_curves_pt(), ProblemParameters::Internal_time_stepper_pt, max, oomph::oomph_info, oomph::MathematicalConstants::Pi, oomph::Problem::Problem_is_nonlinear, sqrt(), and oomph::Problem_Parameter::Trace_file.

Member Function Documentation

◆ actions_after_newton_solve()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::actions_after_newton_solve ( )
inlinevirtual

Actions after newton solve (empty)

Reimplemented from oomph::Problem.

598 {}

◆ actions_before_implicit_timestep()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::actions_before_implicit_timestep ( )
inlinevirtual

Actions before implicit timestep – update boundary conditions.

Reimplemented from oomph::Problem.

602  {
604  }
void set_boundary_values()
Set the time-dependent boundary values.
Definition: unstructured_two_d_curved.cc:1035

◆ actions_before_newton_solve()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::actions_before_newton_solve ( )
inlinevirtual

Actions before newton solve (empty)

Reimplemented from oomph::Problem.

595 {}

◆ complete_problem_setup()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::complete_problem_setup

Complete problem setup.

943 {
944 
945  // Loop over all elements to set parameters
946  //-----------------------------------------
947  unsigned n_element = Bulk_mesh_pt->nelement();
948  for(unsigned e=0;e<n_element;e++)
949  {
950  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(e));
951 
952  el_pt->nu_pt()=&ProblemParameters::Nu;
953  el_pt->solid_body_force_fct_pt()=ProblemParameters::Solid_body_force;
954  el_pt->fluid_body_force_fct_pt()=ProblemParameters::Fluid_body_force;
955  el_pt->mass_source_fct_pt()=ProblemParameters::Mass_source;
956  el_pt->lambda_sq_pt()=&ProblemParameters::Lambda_sq;
957  el_pt->density_ratio_pt()=&ProblemParameters::Density_ratio;
958  el_pt->permeability_pt()=&ProblemParameters::Permeability;
959  el_pt->alpha_pt()=&ProblemParameters::Alpha;
960  el_pt->porosity_pt()=&ProblemParameters::Porosity;
961 
962  // Set the internal q dofs' timestepper to the problem timestepper
963  el_pt->set_q_internal_timestepper(time_stepper_pt());
964 
965  } // end of loop over elements
966 
967 
968  // Pin flux and solid displacement along selected boundaries
969  // ----------------------------------------------------------
970  std::vector<unsigned> pinned_boundaries;
971 
972  // Leave outflow boundary traction free ("do nothing") for "real"
973  // run. Pin and apply flux and displacement for validation case
975  {
976  pinned_boundaries.push_back(0);
977  }
978  pinned_boundaries.push_back(1);
979  pinned_boundaries.push_back(3);
980  unsigned n_boundary=pinned_boundaries.size();
981  for(unsigned ibound=0;ibound<n_boundary;ibound++)
982  {
983  unsigned n_node = Bulk_mesh_pt->nboundary_node(pinned_boundaries[ibound]);
984  for(unsigned i=0;i<n_node;i++)
985  {
986  Node* nod_pt=Bulk_mesh_pt->boundary_node_pt(pinned_boundaries[ibound],i);
987 
988  // Pin all of them: i=0: u_r; i=1: u_z. Subsequent entries
989  // only exist for midside nodes where the remaining entries
990  // represent the Darcy flux at the "flux interpolation points".
991  unsigned n_value=nod_pt->nvalue();
992  for(unsigned i=0;i<n_value;i++)
993  {
994  nod_pt->pin(i);
995  }
996  }
997  }
998 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
void pin(const unsigned &i)
Pin the i-th stored variable.
Definition: nodes.h:385
unsigned nvalue() const
Return number of values stored in data object (incl pinned ones).
Definition: nodes.h:483
Definition: nodes.h:906
double Permeability
Permeability.
Definition: unstructured_two_d_curved.cc:57
double Alpha
Alpha, the Biot parameter.
Definition: unstructured_two_d_curved.cc:68
double Density_ratio
Ratio of pore fluid density to solid matrix density.
Definition: unstructured_two_d_curved.cc:74
double Porosity
Porosity.
Definition: unstructured_two_d_curved.cc:71
double Nu
Poisson's ratio.
Definition: unstructured_two_d_curved.cc:65
void Mass_source(const double &time, const Vector< double > &x, double &f)
Source term for continuity.
Definition: unstructured_two_d_curved.cc:413
double Lambda_sq
Timescale ratio (non-dim density)
Definition: unstructured_two_d_curved.cc:54
void Fluid_body_force(const double &time, const Vector< double > &x, Vector< double > &f)
Fluid body force.
Definition: unstructured_two_d_curved.cc:386
void Solid_body_force(const double &time, const Vector< double > &x, Vector< double > &b)
Solid body force.
Definition: unstructured_two_d_curved.cc:361
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501

References ProblemParameters::Alpha, oomph::CommandLineArgs::command_line_flag_has_been_set(), ProblemParameters::Density_ratio, e(), ProblemParameters::Fluid_body_force(), i, ProblemParameters::Lambda_sq, ProblemParameters::Mass_source(), ProblemParameters::Nu, oomph::Data::nvalue(), ProblemParameters::Permeability, oomph::Data::pin(), ProblemParameters::Porosity, and ProblemParameters::Solid_body_force().

◆ create_pressure_elements()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::create_pressure_elements
private

Allocate traction/pressure elements.

Make traction elements along the top boundary of the bulk mesh.

1006 {
1007  // How many bulk elements are next to boundary 2 (the top boundary)?
1008  unsigned ibound=2;
1009  unsigned n_neigh = Bulk_mesh_pt->nboundary_element(ibound);
1010 
1011  // Now loop over bulk elements and create the face elements
1012  for(unsigned n=0;n<n_neigh;n++)
1013  {
1014  // Create the face element
1017  (Bulk_mesh_pt->boundary_element_pt(ibound,n),
1018  Bulk_mesh_pt->face_index_at_boundary(ibound,n));
1019 
1020  // Add to mesh
1021  Surface_mesh_pt->add_element_pt(pressure_element_pt);
1022 
1023  // Set function pointers
1024  pressure_element_pt->pressure_fct_pt()=&ProblemParameters::boundary_pressure;
1025  pressure_element_pt->traction_fct_pt()=&ProblemParameters::boundary_traction;
1026  }
1027 
1028 } // end of assign_traction_elements
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: axisym_poroelasticity_face_elements.h:95
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, double &pressure) pressure_fct_pt()
Reference to the pressure function pointer.
Definition: axisym_poroelasticity_face_elements.h:212
void(*&)(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction) traction_fct_pt()
Reference to the traction function pointer.
Definition: axisym_poroelasticity_face_elements.h:202
void add_element_pt(GeneralisedElement *const &element_pt)
Add a (pointer to) an element to the mesh.
Definition: mesh.h:617
void boundary_pressure(const double &time, const Vector< double > &x, const Vector< double > &n, double &result)
Pressure around the boundary of the domain.
Definition: unstructured_two_d_curved.cc:426
void boundary_traction(const double &time, const Vector< double > &x, const Vector< double > &n, Vector< double > &traction)
Boundary traction.
Definition: unstructured_two_d_curved.cc:445

References ProblemParameters::boundary_pressure(), ProblemParameters::boundary_traction(), n, oomph::AxisymmetricPoroelasticityTractionElement< ELEMENT >::pressure_fct_pt, and oomph::AxisymmetricPoroelasticityTractionElement< ELEMENT >::traction_fct_pt.

◆ doc_solution()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::doc_solution ( const unsigned &  label)

Doc the solution.

Write the solution and exact solution to file, and calculate the error.

1229 {
1230 
1231  oomph_info << "Outputting solution " << label
1232  << " for time " << time_pt()->time() << std::endl;
1233 
1234  ofstream some_file;
1235  char filename[100];
1236 
1237  unsigned npts=5;
1238  sprintf(filename,"%s/soln%i.dat",ProblemParameters::Directory.c_str(),label);
1239  some_file.open(filename);
1240  Bulk_mesh_pt->output(some_file,npts);
1241  some_file.close();
1242 
1243  // Output coarse solution
1244  //-----------------------
1245  unsigned npts_coarse=2;
1246  sprintf(filename,"%s/coarse_soln%i.dat",ProblemParameters::Directory.c_str(),label);
1247  some_file.open(filename);
1248  Bulk_mesh_pt->output(some_file,npts_coarse);
1249  some_file.close();
1250 
1251  // Output boundary condition elements
1252  //-----------------------------------
1253  sprintf(filename,"%s/bc_elements%i.dat",ProblemParameters::Directory.c_str(),label);
1254  some_file.open(filename);
1255  Surface_mesh_pt->output(some_file,npts);
1256  some_file.close();
1257 
1259  {
1260 
1261  // Output exact solution
1262  //----------------------
1263  sprintf(filename,"%s/exact_soln%i.dat",ProblemParameters::Directory.c_str(),label);
1264  some_file.open(filename);
1265  Bulk_mesh_pt->output_fct(some_file,
1266  npts,
1267  time(),
1269  some_file.close();
1270 
1271  // Doc error
1272  //----------
1273  Vector<double> norm(3,0.0);
1274  Vector<double> error(3,0.0);
1275  sprintf(filename,"%s/error%i.dat",ProblemParameters::Directory.c_str(),label);
1276  some_file.open(filename);
1277  Bulk_mesh_pt->compute_error(some_file,
1279  time(),
1280  error,norm);
1281  some_file.close();
1282 
1283  // Doc error norm:
1284  oomph_info << std::endl;
1285  oomph_info << "Norm of exact u : " << sqrt(norm[0]) << std::endl;
1286  oomph_info << "Norm of exact q : " << sqrt(norm[1]) << std::endl;
1287  oomph_info << "Norm of exact p : " << sqrt(norm[2]) << std::endl
1288  << std::endl;
1289 
1290  oomph_info << "Norm of u error : " << sqrt(error[0]) << std::endl;
1291  oomph_info << "Norm of q error : " << sqrt(error[1]) << std::endl;
1292  oomph_info << "Norm of p error : " << sqrt(error[2]) << std::endl;
1293  oomph_info << std::endl << std::endl;
1294 
1295  Trace_file << ndof() << " "
1297  << ProblemParameters::Dt << " "
1298  << sqrt(error[0]) << " "
1299  << sqrt(error[1]) << " "
1300  << sqrt(error[2]) << " "
1301  << sqrt(norm[0]) << " "
1302  << sqrt(norm[1]) << " "
1303  << sqrt(norm[2]) << std::endl;
1304  }
1305  else
1306  {
1307  Trace_file << time_pt()->time() << " "
1309  << std::endl;
1310  }
1311 
1312 }
void output(std::ostream &outfile)
Output for all elements.
Definition: mesh.cc:2027
unsigned long ndof() const
Return the number of dofs.
Definition: problem.h:1674
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 exact_soln(const double &time, const Vector< double > &x, Vector< double > &soln)
Definition: unstructured_two_d_curved.cc:301
double pressure_magnitude(const double &time)
Get time-dep pressure magnitude.
Definition: unstructured_two_d_curved.cc:420
double Dt
Timestep.
Definition: unstructured_two_d_curved.cc:51
label
Definition: UniformPSDSelfTest.py:24
int error
Definition: calibrate.py:297

References oomph::CommandLineArgs::command_line_flag_has_been_set(), ProblemParameters::Directory, ProblemParameters::Dt, ProblemParameters::Element_area, calibrate::error, ProblemParameters::exact_soln(), MergeRestartFiles::filename, UniformPSDSelfTest::label, oomph::oomph_info, ProblemParameters::pressure_magnitude(), sqrt(), and oomph::Problem_Parameter::Trace_file.

◆ my_time_stepper_pt()

template<class ELEMENT , class TIMESTEPPER >
TIMESTEPPER* AxiPoroProblem< ELEMENT, TIMESTEPPER >::my_time_stepper_pt ( )
inline

Access to timestepper.

647  {
648  return My_time_stepper_pt;
649  }

◆ set_boundary_values()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::set_boundary_values

Set the time-dependent boundary values.

Set the time dependent boundary values.

1036 {
1037  Vector<double> x(2);
1038 
1040  value_fct(2);
1042  veloc_fct(2);
1044  accel_fct(2);
1045 
1046  // Assign values for analytical value, veloc and accel:
1049 
1052 
1055 
1056 
1057  // Get the nodal index at which values representing edge fluxes
1058  // at flux interpolation points are stored
1059  ELEMENT *el_pt=dynamic_cast<ELEMENT*>(Bulk_mesh_pt->element_pt(0));
1060 
1061  // How many flux interpolation points do we have?
1062  unsigned n=el_pt->nedge_flux_interpolation_point();
1063 
1064  // Provide storage; null out the ones we don't need
1066  flux_fct(2+n,0);
1068  flux_ddt_fct(2+n,0);
1070  flux_d2dt2_fct(2+n,0);
1071 
1072  // Where are the flux values stored?
1073  Vector<unsigned> q_index(n);
1074  for (unsigned j=0;j<n;j++)
1075  {
1076  q_index[j]=el_pt->q_edge_index(j);
1077  flux_fct[q_index[j]]=&ProblemParameters::zero_fct;
1078  flux_ddt_fct[q_index[j]]=&ProblemParameters::zero_fct;
1079  flux_d2dt2_fct[q_index[j]]=&ProblemParameters::zero_fct;
1080  }
1081 
1082 
1083  TIMESTEPPER* timestepper_pt=
1084  dynamic_cast<TIMESTEPPER*>(time_stepper_pt());
1085 
1086  // Assign current (and history) values for solid displacements as well as
1087  // ----------------------------------------------------------------------
1088  // flux along pinned boundaries
1089  //-----------------------------
1090  std::vector<unsigned> pinned_boundaries;
1091 
1092  // Leave outer boundary traction free ("do nothing") for "real"
1093  // run. Pin and apply flux and displacement for validation case
1095  {
1096  pinned_boundaries.push_back(0);
1097  }
1098  pinned_boundaries.push_back(1);
1099  pinned_boundaries.push_back(3);
1100  unsigned n_boundary=pinned_boundaries.size();
1101  for(unsigned ibound=0;ibound<n_boundary;ibound++)
1102  {
1103 
1104  // Assign current (and history) values for solid displacements
1105  //------------------------------------------------------------
1106  // (ignores the flux ones)
1107  //------------------------
1108  unsigned n_node = Bulk_mesh_pt->nboundary_node(pinned_boundaries[ibound]);
1109  for(unsigned i=0;i<n_node;i++)
1110  {
1111  Node* nod_pt=Bulk_mesh_pt->boundary_node_pt(pinned_boundaries[ibound],i);
1112  timestepper_pt->assign_initial_data_values(nod_pt,
1113  value_fct,
1114  veloc_fct,
1115  accel_fct);
1116  }
1117 
1118  // Assign flux
1119  //------------
1120 
1121  // Coordinate vector
1122  Vector<double> x(2);
1123 
1124  // Get the number of elements along boundary
1125  unsigned n_boundary_element=
1126  Bulk_mesh_pt->nboundary_element(pinned_boundaries[ibound]);
1127 
1128  // Loop over the elements along boundary ibound
1129  for(unsigned e=0;e<n_boundary_element;e++)
1130  {
1131  // Upcast the current element to the actual type
1132  ELEMENT *el_pt=
1133  dynamic_cast<ELEMENT*>(Bulk_mesh_pt->
1134  boundary_element_pt(pinned_boundaries[ibound],e));
1135 
1136  // Loop over the edges
1137  for(unsigned edge=0;edge<3;edge++)
1138  {
1139  // Get pointer to node that stores the edge flux dofs for this edge
1140  Node* nod_pt=el_pt->edge_flux_node_pt(edge);
1141 
1142  // Set values for the flux degrees of freedom
1143  if (nod_pt->is_on_boundary(pinned_boundaries[ibound]))
1144  {
1145  // Get face index of face associated with edge
1146  unsigned f=el_pt->face_index_of_edge(edge);
1147 
1148  // Build a temporary face element from which we'll extract
1149  // the outer unit normal
1152 
1153  // Loop over the flux interpolation points
1154  unsigned n_flux_interpolation_points=
1155  el_pt->nedge_flux_interpolation_point();
1156  for(unsigned g=0;g<n_flux_interpolation_points;g++)
1157  {
1158  // Get the global coords of the flux_interpolation point
1159  el_pt->edge_flux_interpolation_point_global(edge,g,x);
1160 
1161  // Get the exact solution
1162  Vector<double> exact_soln(13,0.0);
1164 
1165  // Get unit normal at this flux interpolation point
1166  Vector<double> s(1);
1167  el_pt->face_local_coordinate_of_flux_interpolation_point(edge,g,s);
1168  Vector<double> unit_normal(2);
1169  face_el_pt->outer_unit_normal(s,unit_normal);
1170 
1171 #ifdef PARANOID
1172  // Sanity check
1173  Vector<double> x_face(2);
1174  face_el_pt->interpolated_x(s,x_face);
1175  if ((x_face[0]-x[0])*(x_face[0]-x[0])+
1176  (x_face[1]-x[1])*(x_face[1]-x[1])>1.0e-3)
1177  {
1178  std::stringstream error;
1179  error
1180  << "Discrepancy in coordinate of flux interpolation point\n"
1181  << "(computed by bulk and face elements) for edge " << e
1182  << " and flux int pt " << g << "\n"
1183  << "Face thinks node is at: "
1184  << x_face[0] << " " << x_face[1] << "\n"
1185  << "Bulk thinks node is at: "
1186  << x[0] << " " << x[1] << "\n";
1187  throw OomphLibError(
1188  error.str(),
1191  }
1192 #endif
1194  {
1195  // Set the boundary flux -- only does the current values;
1196  // should really do the history values, but it's messy...
1197  nod_pt->set_value(q_index[g],
1198  exact_soln[2]*unit_normal[0]+
1199  exact_soln[3]*unit_normal[1]);
1200  }
1201  else
1202  {
1203  // assign zero
1204  timestepper_pt->assign_initial_data_values(nod_pt,
1205  flux_fct,
1206  flux_ddt_fct,
1207  flux_d2dt2_fct);
1208  }
1209 
1210  } // End of loop over flux interpolation points
1211 
1212  // Don't need face element on that edge any more
1213  delete face_el_pt;
1214 
1215  } // End if for edge on required boundary
1216  } // End of loop over edges
1217 
1218  } // End of loop over boundary elements
1219  } // End of loop over boundaries
1220  }
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
void outer_unit_normal(const Vector< double > &s, Vector< double > &unit_normal) const
Compute outer unit normal at the specified local coordinate.
Definition: elements.cc:6006
double interpolated_x(const Vector< double > &s, const unsigned &i) const
Definition: elements.h:4528
virtual bool is_on_boundary() const
Definition: nodes.h:1373
Definition: oomph_definitions.h:222
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
double zero_fct(const double &time, const Vector< double > &x)
Definition: unstructured_two_d_curved.cc:112
double boundary_accel_0(const double &time, const Vector< double > &x)
Imposed boundary accel in r-direction.
Definition: unstructured_two_d_curved.cc:178
double boundary_accel_1(const double &time, const Vector< double > &x)
Imposed boundary accel in z-direction.
Definition: unstructured_two_d_curved.cc:193
double boundary_veloc_0(const double &time, const Vector< double > &x)
Imposed boundary velocity in r-direction.
Definition: unstructured_two_d_curved.cc:148
double boundary_displ_1(const double &time, const Vector< double > &x)
Imposed boundary displacement in z-direction.
Definition: unstructured_two_d_curved.cc:134
double boundary_veloc_1(const double &time, const Vector< double > &x)
Imposed boundary velocity in z-direction.
Definition: unstructured_two_d_curved.cc:163
double boundary_displ_0(const double &time, const Vector< double > &x)
Imposed boundary displacement in r-direction.
Definition: unstructured_two_d_curved.cc:119
list x
Definition: plotDoE.py:28
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References ProblemParameters::boundary_accel_0(), ProblemParameters::boundary_accel_1(), ProblemParameters::boundary_displ_0(), ProblemParameters::boundary_displ_1(), ProblemParameters::boundary_veloc_0(), ProblemParameters::boundary_veloc_1(), oomph::CommandLineArgs::command_line_flag_has_been_set(), e(), calibrate::error, ProblemParameters::exact_soln(), f(), i, oomph::FaceElement::interpolated_x(), oomph::Node::is_on_boundary(), j, n, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::FaceElement::outer_unit_normal(), s, oomph::Data::set_value(), plotDoE::x, and ProblemParameters::zero_fct().

◆ set_initial_condition()

template<class ELEMENT , class TIMESTEPPER >
void AxiPoroProblem< ELEMENT, TIMESTEPPER >::set_initial_condition ( )
inlinevirtual

Set the initial conditions.

Reimplemented from oomph::Problem.

552  {
553 
555  {
557  }
558  else
559  {
561  initial_value_fct(2);
563  initial_veloc_fct(2);
565  initial_accel_fct(2);
566 
567  // Assign values for analytical value, veloc and accel:
568  initial_value_fct[0]=&ProblemParameters::boundary_displ_0;
569  initial_value_fct[1]=&ProblemParameters::boundary_displ_1;
570 
571  initial_veloc_fct[0]=&ProblemParameters::boundary_veloc_0;
572  initial_veloc_fct[1]=&ProblemParameters::boundary_veloc_1;
573 
574  initial_accel_fct[0]=&ProblemParameters::boundary_accel_0;
575  initial_accel_fct[1]=&ProblemParameters::boundary_accel_1;
576 
577  TIMESTEPPER* timestepper_pt=dynamic_cast<TIMESTEPPER*>(time_stepper_pt());
578 
579  unsigned n_node=Bulk_mesh_pt->nnode();
580  for(unsigned n=0;n<n_node;n++)
581  {
582  Node *nod_pt=Bulk_mesh_pt->node_pt(n);
583  timestepper_pt->assign_initial_data_values(nod_pt,
584  initial_value_fct,
585  initial_veloc_fct,
586  initial_accel_fct);
587  }
588  }
589  }
void assign_initial_values_impulsive()
Definition: problem.cc:11499

References ProblemParameters::boundary_accel_0(), ProblemParameters::boundary_accel_1(), ProblemParameters::boundary_displ_0(), ProblemParameters::boundary_displ_1(), ProblemParameters::boundary_veloc_0(), ProblemParameters::boundary_veloc_1(), oomph::CommandLineArgs::command_line_flag_has_been_set(), and n.

Member Data Documentation

◆ Bulk_mesh_pt

template<class ELEMENT , class TIMESTEPPER >
TriangleMesh<ELEMENT>* AxiPoroProblem< ELEMENT, TIMESTEPPER >::Bulk_mesh_pt
private

Pointer to the "bulk" mesh.

◆ My_time_stepper_pt

template<class ELEMENT , class TIMESTEPPER >
TIMESTEPPER* AxiPoroProblem< ELEMENT, TIMESTEPPER >::My_time_stepper_pt
private

◆ Surface_mesh_pt

template<class ELEMENT , class TIMESTEPPER >
Mesh* AxiPoroProblem< ELEMENT, TIMESTEPPER >::Surface_mesh_pt
private

Mesh for traction/pressure elements.

◆ Trace_file

template<class ELEMENT , class TIMESTEPPER >
std::ofstream AxiPoroProblem< ELEMENT, TIMESTEPPER >::Trace_file
private

Trace file.


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