PoissonProblem< ELEMENT > Class Template Reference

Micky mouse Poisson problem. More...

+ Inheritance diagram for PoissonProblem< ELEMENT >:

Public Member Functions

 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor. More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void actions_before_newton_convergence_check ()
 Bump up counter for number of Newton iterations. More...
 
unsigned newton_count ()
 Report number of Newton iterations taken. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution: doc_info contains labels/output directory etc. More...
 
RefineableRectangularQuadMesh< ELEMENT > * mesh_pt ()
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
RefineableRectangularQuadMesh< ELEMENT > * mesh_pt ()
 
void actions_before_newton_convergence_check ()
 Bump up counter for number of Newton iterations. More...
 
unsigned newton_count ()
 Report number of Newton iterations taken. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const string &mesh_file_name, const string &curve_file_name)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
GeompackQuadMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 3 >::PoissonSourceFctPt source_fct_pt, const string &node_file_name, const string &element_file_name, const string &face_file_name)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TetgenMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (const unsigned &nplot, DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const string &node_file_name, const string &element_file_name, const string &poly_file_name)
 Constructor for Poisson problem. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const string &node_file_name, const string &element_file_name, const string &poly_file_name)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const double element_size, const unsigned domain_configuration)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_before_adapt ()
 Apply actions before adapt (empty) More...
 
void actions_after_adapt ()
 Apply actions after adapt. More...
 
void actions_before_distribute ()
 Apply actions before distribute (same as actions before adapt) More...
 
void actions_after_distribute ()
 Apply actions after distribute (same as actions after adapt) More...
 
RefineableTriangleMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
void build_mesh ()
 Required function to perform load balancing, create the mesh. More...
 
void read_custom_distribution_from_file (Vector< unsigned > &output_distribution)
 Read the distribution data. More...
 
void save_custom_distribution_to_file (Vector< unsigned > &input_distribution)
 Saves the custom distribution to file. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_before_adapt ()
 
void actions_after_adapt ()
 Actions that are to be performed after a mesh adaptation. More...
 
RefineableTriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void actions_before_adapt ()
 
void actions_after_adapt ()
 Actions that are to be performed after a mesh adaptation. More...
 
RefineableTriangleMesh< ELEMENT > * mesh_pt ()
 Access function for the specific mesh. More...
 
void doc_solution (DocInfo &doc_info, ofstream &trace_file)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
RefineableRectangularQuadMesh< ELEMENT > * mesh_pt ()
 
void actions_before_newton_convergence_check ()
 Bump up counter for number of Newton iterations. More...
 
unsigned newton_count ()
 Report number of Newton iterations taken. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const unsigned &n_power)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void set_problem_is_nonlinear ()
 Treat the problem as being nonlinear. More...
 
void set_problem_is_linear ()
 Treat the problem as being linear. More...
 
bool is_problem_nonlinear () const
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const unsigned &n_power)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void set_problem_is_nonlinear ()
 Treat the problem as being nonlinear. More...
 
void set_problem_is_linear ()
 Treat the problem as being linear. More...
 
bool is_problem_nonlinear () const
 
void doc_solution (DocInfo &doc_info)
 
void run_it (DocInfo &doc_info)
 Run the probl. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt)
 Constructor: Pass pointer to source function. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const unsigned &nel_1d, const bool &mess_up_order)
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 
void actions_after_newton_solve ()
 Update the problem after solve (empty) More...
 
void doc_solution (DocInfo &doc_info)
 
 PoissonProblem (PoissonEquations< 3 >::PoissonSourceFctPt source_fct_pt, const string &node_file_name, const string &element_file_name, const string &face_file_name)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
TetgenMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (const unsigned &nplot, DocInfo &doc_info)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const unsigned &h_power)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
void doc_solution (DocInfo &doc_info, ostream &convergence_file)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 2 >::PoissonSourceFctPt source_fct_pt, const unsigned &h_power)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
SimpleRectangularTriMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (DocInfo &doc_info, ostream &convergence_file)
 Doc the solution. More...
 
 PoissonProblem (PoissonEquations< 3 >::PoissonSourceFctPt source_fct_pt, const unsigned &h_power)
 Constructor. More...
 
 ~PoissonProblem ()
 Destructor (empty) More...
 
void actions_before_newton_solve ()
 Update the problem specs before solve: (Re)set boundary conditions. More...
 
void actions_after_newton_solve ()
 Update the problem specs before solve (empty) More...
 
SimpleCubicTetMesh< ELEMENT > * mesh_pt ()
 
void doc_solution (DocInfo &doc_info, ostream &convergence_file)
 Doc the solution. More...
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
OomphCommunicator * communicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicator * communicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolver * mass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Time * time_pt () const
 Return a pointer to the global time object (const version). More...
 
double & time ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeStepper * time_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
double & minimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
double & maximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsigned & max_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
double & max_residuals ()
 
bool & time_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
double & newton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
double * global_dof_pt (const unsigned &i)
 
double & dof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
double * dof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
bool & use_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual Problem * make_copy ()
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
double * bifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
int & sign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 

Public Attributes

Z2ErrorEstimator * error_estimator_pt
 Error estimator. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 

Private Member Functions

void apply_boundary_conditions ()
 Apply boundary conditions. More...
 
void complete_problem_setup ()
 Complete problem setup. More...
 
void square_domain ()
 Builds the square domain mesh. More...
 
void half_circle_domain ()
 Builds the half circle domain. More...
 
void half_circle_domain_with_internal_boundaries ()
 Builds the half circle with straight internal boundaries. More...
 
void complex_domain_with_holes ()
 Builds a complex domain with holes. More...
 
void apply_boundary_conditions ()
 
void complete_problem_setup ()
 
void apply_boundary_conditions ()
 
void complete_problem_setup ()
 

Private Attributes

PoissonEquations< 2 >::PoissonSourceFctPt Source_fct_pt
 Pointer to source function. More...
 
unsigned Newton_count
 Number of Newton iterations. More...
 
ofstream Trace_file
 Trace file to document norm of solution. More...
 
PoissonEquations< 3 >::PoissonSourceFctPt Source_fct_pt
 Pointer to source function. More...
 
RefineableTriangleMesh< ELEMENT > * Bulk_mesh_pt
 
Z2ErrorEstimator * Error_estimator_pt
 
TriangleMeshParameters Triangle_mesh_parameters
 
double Element_size
 
unsigned Domain_configuration
 
RefineableTriangleMesh< ELEMENT > * My_mesh_pt
 
SingularPoissonSolutionElement< ELEMENT > * Singular_poisson_solution1_element_pt
 
SingularPoissonSolutionElement< ELEMENT > * Singular_poisson_solution2_element_pt
 
Mesh * Singular_poisson_solution_mesh_pt
 
Mesh * Poisson_mesh_pt
 Pointer to mesh with Poisson elements. More...
 
unsigned H_power
 Exponent for h scaling. More...
 

Additional Inherited Members

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

Detailed Description

template<class ELEMENT>
class PoissonProblem< ELEMENT >

Micky mouse Poisson problem.

Poisson problem.

2D Poisson problem on rectangular domain, discretised with 2D QPoisson elements. The specific type of element is specified via the template parameter.

Constructor & Destructor Documentation

◆ PoissonProblem() [1/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

Constructor for Poisson problem.

Constructor for Poisson problem: Pass pointer to source function.

Boundary conditions

End of boundary conditions

146 {
147  // The problem is linear
148  //Problem_is_nonlinear = false;
149 
150  // Setup mesh
151 
152  // # of elements in x-direction
153  unsigned n_x=10;
154 
155  // # of elements in y-direction
156  unsigned n_y=10;
157 
158  // Domain length in x-direction
159  double l_x=1.0;
160 
161  // Domain length in y-direction
162  double l_y=2.0;
163 
164  // Build and assign mesh
165  Problem::mesh_pt() =
166  new RefineableRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
167 
168  // Create/set error estimator
169  mesh_pt()->spatial_error_estimator_pt()=new Z2ErrorEstimator;
170 
171  // Set the boundary conditions for this problem: All nodes are
172  // free by default -- only need to pin the ones that have Dirichlet conditions
173  // here.
174  unsigned n_bound = mesh_pt()->nboundary();
175  for(unsigned i=0;i<n_bound;i++)
176  {
177  unsigned n_node = mesh_pt()->nboundary_node(i);
178  for (unsigned n=0;n<n_node;n++)
179  {
180  mesh_pt()->boundary_node_pt(i,n)->pin(0);
181  }
182  }
183 
184  // Complete the build of all elements so they are fully functional
185 
186  // Loop over the elements to set up element-specific
187  // things that cannot be handled by the (argument-free!) ELEMENT
188  // constructor: Pass pointer to source function
189  unsigned n_element = mesh_pt()->nelement();
190  for(unsigned i=0;i<n_element;i++)
191  {
192  // Upcast from GeneralsedElement to the present element
193  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
194 
195  //Set the source function pointer
196  el_pt->source_fct_pt() = Source_fct_pt;
197  }
198 
199 
200  // Setup equation numbering scheme
201  cout <<"Number of equations: " << assign_eqn_numbers() << endl;
202 
203 } // end of constructor
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
RefineableRectangularQuadMesh< ELEMENT > * mesh_pt()
Definition: HypreSolver_test.cc:119
PoissonEquations< 2 >::PoissonSourceFctPt Source_fct_pt
Pointer to source function.
Definition: HypreSolver_test.cc:129
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
Definition: rectangular_quadmesh.template.h:326
Definition: error_estimator.h:266
GeneralisedAxisymAdvectionDiffusionSourceFctPt & source_fct_pt()
Access function: Pointer to source function.
Definition: gen_axisym_advection_diffusion_elements.h:229

References oomph::Problem::assign_eqn_numbers(), i, PoissonProblem< ELEMENT >::mesh_pt(), n, and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [1/24]

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

Destructor.

90  {
91  delete mesh_pt()->spatial_error_estimator_pt();
92  delete mesh_pt();
93 
94  }

◆ PoissonProblem() [2/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [2/24]

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

Destructor (empty)

90  {
91  delete mesh_pt()->spatial_error_estimator_pt();
92  delete mesh_pt();
93  }

◆ PoissonProblem() [3/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [3/24]

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

Destructor (empty)

93 {}

◆ PoissonProblem() [4/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [4/24]

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

Destructor (empty)

93 {}

◆ PoissonProblem() [5/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const string &  mesh_file_name,
const string &  curve_file_name 
)

Constructor.

Constructor for Poisson problem.

161 {
162 
163  // Setup parameters for exact tanh solution
164 
165  // Steepness of step
167 
168  // Orientation of step
170 
171  //Create mesh
172  Problem::mesh_pt() = new GeompackQuadMesh<ELEMENT>(mesh_file_name,
173  curve_file_name);
174 
175  // Set the boundary conditions for this problem: All nodes are
176  // free by default -- just pin the ones that have Dirichlet conditions
177  // here.
178  unsigned num_bound = mesh_pt()->nboundary();
179  for(unsigned ibound=0;ibound<num_bound;ibound++)
180  {
181  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
182  for (unsigned inod=0;inod<num_nod;inod++)
183  {
184  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
185  }
186  }
187 
188  // Complete the build of all elements so they are fully functional
189 
190  //Find number of elements in mesh
191  unsigned n_element = mesh_pt()->nelement();
192 
193  // Loop over the elements to set up element-specific
194  // things that cannot be handled by constructor
195  for(unsigned i=0;i<n_element;i++)
196  {
197  // Upcast from GeneralElement to the present element
198  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
199 
200  //Set the source function pointer
201  el_pt->source_fct_pt() = Source_fct_pt;
202  }
203 
204  // Setup equation numbering scheme
205  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
206 
207 }
Definition: geompack_mesh.template.h:42
double Beta
Parameter for angle of step.
Definition: mesh_from_geompack_poisson.cc:55
double Alpha
Parameter for steepness of step.
Definition: extrude_with_macro_element_representation.cc:185

References TanhSolnForPoisson::Alpha, oomph::Problem::assign_eqn_numbers(), TanhSolnForPoisson::Beta, i, PoissonProblem< ELEMENT >::mesh_pt(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [5/24]

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

Destructor (empty)

105 {}

◆ PoissonProblem() [6/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function and names of two triangle input files

◆ ~PoissonProblem() [6/24]

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

Destructor (empty)

104 {}

◆ PoissonProblem() [7/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function and names of two triangle input files

◆ ~PoissonProblem() [7/24]

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

Destructor (empty)

104 {}

◆ PoissonProblem() [8/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 3 >::PoissonSourceFctPt  source_fct_pt,
const string &  node_file_name,
const string &  element_file_name,
const string &  face_file_name 
)

Constructor.

Constructor for Poisson problem.

199 {
200 
201  // Setup parameters for exact tanh solution
202 
203  // Steepness of step
205 
206 
207  //Create mesh
208  Problem::mesh_pt() = new TetgenMesh<ELEMENT>(node_file_name,
209  element_file_name,
210  face_file_name);
211 
212  // Set the boundary conditions for this problem: All nodes are
213  // free by default -- just pin the ones that have Dirichlet conditions
214  // here.
215  unsigned num_bound = mesh_pt()->nboundary();
216  for(unsigned ibound=0;ibound<num_bound;ibound++)
217  {
218  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
219  for (unsigned inod=0;inod<num_nod;inod++)
220  {
221  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
222  }
223  }
224 
225  // Complete the build of all elements so they are fully functional
226 
227  //Find number of elements in mesh
228  unsigned n_element = mesh_pt()->nelement();
229 
230  // Loop over the elements to set up element-specific
231  // things that cannot be handled by constructor
232  for(unsigned i=0;i<n_element;i++)
233  {
234  // Upcast from GeneralElement to the present element
235  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
236 
237  //Set the source function pointer
238  el_pt->source_fct_pt() = Source_fct_pt;
239  }
240 
241  // Setup equation numbering scheme
242  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
243 
244 }
Definition: tetgen_mesh.template.h:52

References TanhSolnForPoisson::Alpha, oomph::Problem::assign_eqn_numbers(), i, PoissonProblem< ELEMENT >::mesh_pt(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [8/24]

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

Destructor (empty)

141 {}

◆ PoissonProblem() [9/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const string &  node_file_name,
const string &  element_file_name,
const string &  poly_file_name 
)

Constructor for Poisson problem.

Constructor: Pass pointer to source function and names of two triangle input files

184 {
185 
186  // Setup parameters for exact tanh solution
187 
188  // Steepness of step
190 
191  // Orientation of step
193 
194 #ifdef ADAPT
195  //Create mesh
196  Bulk_mesh_pt = new RefineableTriangleMesh<ELEMENT>(node_file_name,
197  element_file_name,
198  poly_file_name);
199 
200  // Set error estimator for bulk mesh
202  Bulk_mesh_pt->spatial_error_estimator_pt() = error_estimator_pt;
203 
204  // Set the problem mesh pointer to the bulk mesh
205  Problem::mesh_pt() = Bulk_mesh_pt;
206 
207 #else
208  //Create mesh
209  Problem::mesh_pt() = new TriangleMesh<ELEMENT>(node_file_name,
210  element_file_name,
211  poly_file_name);
212 #endif
213 
214  // Set the boundary conditions for this problem: All nodes are
215  // free by default -- just pin the ones that have Dirichlet conditions
216  // here.
217  unsigned num_bound = mesh_pt()->nboundary();
218  for(unsigned ibound=0;ibound<num_bound;ibound++)
219  {
220  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
221  for (unsigned inod=0;inod<num_nod;inod++)
222  {
223  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
224  }
225  }
226 
227  // Complete the build of all elements so they are fully functional
228 
229  //Find number of elements in mesh
230  unsigned n_element = mesh_pt()->nelement();
231 
232  // Loop over the elements to set up element-specific
233  // things that cannot be handled by constructor
234  for(unsigned i=0;i<n_element;i++)
235  {
236  // Upcast from GeneralElement to the present element
237  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
238 
239  //Set the source function pointer
240  el_pt->source_fct_pt() = Source_fct_pt;
241  }
242 
243  // Setup equation numbering scheme
244  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
245 
246 }
RefineableTriangleMesh< ELEMENT > * Bulk_mesh_pt
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:214
Z2ErrorEstimator * error_estimator_pt
Error estimator.
Definition: unstructured_adaptive_mesh_two_outer_boundaries.cc:127
Unstructured refineable Triangle Mesh.
Definition: triangle_mesh.template.h:2249
Definition: triangle_mesh.template.h:424

References TanhSolnForPoisson::Alpha, oomph::Problem::assign_eqn_numbers(), TanhSolnForPoisson::Beta, PoissonProblem< ELEMENT >::Bulk_mesh_pt, PoissonProblem< ELEMENT >::error_estimator_pt, i, PoissonProblem< ELEMENT >::mesh_pt(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [9/24]

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

Destructor (empty)

107 {}

◆ PoissonProblem() [10/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const string &  node_file_name,
const string &  element_file_name,
const string &  poly_file_name 
)

Constructor: Pass pointer to source function and names of two triangle input files

◆ ~PoissonProblem() [10/24]

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

Destructor (empty)

134 {}

◆ PoissonProblem() [11/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const double  element_size,
const unsigned  domain_configuration 
)

Constructor.

Constructor for Poisson problem.

250  Element_size(element_size),
251  Domain_configuration(domain_configuration)
252 {
253 
254  // Setup parameters for exact tanh solution
255 
256  // Steepness of step
258 
259  // Orientation of step
261 
262  if (Domain_configuration == 1)
263  {
264  square_domain();
265  }
266  else if (Domain_configuration == 2)
267  {
269  }
270  else if (Domain_configuration == 3)
271  {
273  }
274  else if (Domain_configuration == 4)
275  {
277  }
278  else
279  {
280  std::ostringstream error_message;
281  error_message
282  << "The choosen domain configuration is not implemented\n"
283  << "You chose ("<<Domain_configuration<<")";
284  throw OomphLibError(error_message.str(),
287  }
288 
289  // At this point the Triangle_mesh_parameters object stores the
290  // domain geometry. We next specify the element size
291 
292  // Set the element size
294 
295  // Create the error estimator object for the bulk mesh
297 
298  // Build the mesh
299  build_mesh();
300 
301 }
double Element_size
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:228
void half_circle_domain()
Builds the half circle domain.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:458
TriangleMeshParameters Triangle_mesh_parameters
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:225
Z2ErrorEstimator * Error_estimator_pt
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:217
void build_mesh()
Required function to perform load balancing, create the mesh.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:307
void half_circle_domain_with_internal_boundaries()
Builds the half circle with straight internal boundaries.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:528
unsigned Domain_configuration
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:231
void square_domain()
Builds the square domain mesh.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:343
void complex_domain_with_holes()
Builds a complex domain with holes.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:717
Definition: oomph_definitions.h:222
double element_area() const
Helper function for getting the element area.
Definition: triangle_mesh.template.h:189
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References TanhSolnForPoisson::Alpha, TanhSolnForPoisson::Beta, PoissonProblem< ELEMENT >::build_mesh(), PoissonProblem< ELEMENT >::complex_domain_with_holes(), PoissonProblem< ELEMENT >::Domain_configuration, oomph::TriangleMeshParameters::element_area(), PoissonProblem< ELEMENT >::Element_size, PoissonProblem< ELEMENT >::Error_estimator_pt, PoissonProblem< ELEMENT >::half_circle_domain(), PoissonProblem< ELEMENT >::half_circle_domain_with_internal_boundaries(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, PoissonProblem< ELEMENT >::square_domain(), and PoissonProblem< ELEMENT >::Triangle_mesh_parameters.

◆ ~PoissonProblem() [11/24]

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

Destructor (empty)

125 {}

◆ PoissonProblem() [12/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function and names of two triangle input files

◆ ~PoissonProblem() [12/24]

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

Destructor (empty)

98  {
99 
100  }

◆ PoissonProblem() [13/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function and names of two triangle input files

◆ ~PoissonProblem() [13/24]

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

Destructor (empty)

98  {
99 
100  }

◆ PoissonProblem() [14/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [14/24]

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

Destructor (empty)

94  {
95  delete mesh_pt()->spatial_error_estimator_pt();
96  delete mesh_pt();
97  }

◆ PoissonProblem() [15/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  h_power 
)

Constructor: Pass pointer to source function Mesh has 2^|n_power| x 2^|n_power| elements.

Constructor for Poisson problem: Pass pointer to source function. Mesh has 2^|n_power| x 2^|n_power| elements.

Constructor for Poisson problem

139 {
140  // Setup mesh
141 
142  // # of elements in x-direction
143  unsigned n_x=unsigned(pow(2.0,int(n_power)));
144 
145  // # of elements in y-direction
146  unsigned n_y=unsigned(pow(2.0,int(n_power)));
147 
148  // Domain length in x-direction
149  double l_x=1.0;
150 
151  // Domain length in y-direction
152  double l_y=2.0;
153 
154 
155  cout << " Building a " << n_x << " x " << n_y << " mesh."
156  << std::endl;
157 
158  // Initialise timers
159  clock_t t_start = clock();
160 
161  // Build and assign mesh
162  Problem::mesh_pt() = new SimpleRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
163 
164  // Finish/doc timing
165  clock_t t_end = clock();
166  double total_time=double(t_end-t_start)/CLOCKS_PER_SEC;
167  cout << std::endl;
168  cout << "======================================================= " << std::endl;
169  cout << "Total time for Mesh setup [sec]: " << total_time << std::endl;
170  cout << "======================================================= " << std::endl;
171  cout << std::endl;
172 
173  // Set the boundary conditions for this problem: All nodes are
174  // free by default -- only need to pin the ones that have Dirichlet conditions
175  // here.
176  unsigned n_bound = mesh_pt()->nboundary();
177  for(unsigned i=0;i<n_bound;i++)
178  {
179  unsigned n_node = mesh_pt()->nboundary_node(i);
180  for (unsigned n=0;n<n_node;n++)
181  {
182  mesh_pt()->boundary_node_pt(i,n)->pin(0);
183  }
184  }
185 
186  // Complete the build of all elements so they are fully functional
187 
188  // Loop over the elements to set up element-specific
189  // things that cannot be handled by the (argument-free!) ELEMENT
190  // constructor: Pass pointer to source function
191  unsigned n_element = mesh_pt()->nelement();
192  for(unsigned i=0;i<n_element;i++)
193  {
194  // Upcast from GeneralsedElement to the present element
195  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
196 
197  //Set the source function pointer
198  el_pt->source_fct_pt() = Source_fct_pt;
199  }
200 
201 
202  // Setup equation numbering scheme
203  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
204 
205 } // end of constructor
Definition: simple_rectangular_quadmesh.template.h:58
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625

References oomph::Problem::assign_eqn_numbers(), i, PoissonProblem< ELEMENT >::mesh_pt(), n, Eigen::bfloat16_impl::pow(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [15/24]

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

Destructor (empty)

97 {}

◆ PoissonProblem() [16/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  n_power 
)

Constructor: Pass pointer to source function Mesh has 2^|n_power| x 2^|n_power| elements.

◆ ~PoissonProblem() [16/24]

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

Destructor (empty)

95 {}

◆ PoissonProblem() [17/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [17/24]

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

Destructor (empty)

360 {}

◆ PoissonProblem() [18/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [18/24]

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

Destructor (empty)

93 {}

◆ PoissonProblem() [19/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt)

Constructor: Pass pointer to source function.

◆ ~PoissonProblem() [19/24]

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

Destructor (empty)

95 {}

◆ PoissonProblem() [20/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  nel_1d,
const bool &  mess_up_order 
)

Constructor: Pass pointer to source function and flag to indicate if order of elements should be messed up. nel_1d is the number of elements along the 1d mesh edges – total number of elements is nel_1d x nel_1d.

Constructor for Poisson problem: Pass pointer to source function and a flag that specifies if the order of the elements should be messed up. nel_1d is the number of elements along the 1d mesh edges – total number of elements is nel_1d x nel_1d.

131 {
132 
133  // Setup mesh
134 
135  // # of elements in x-direction
136  unsigned n_x=nel_1d;
137 
138  // # of elements in y-direction
139  unsigned n_y=nel_1d;
140 
141  // Domain length in x-direction
142  double l_x=1.0;
143 
144  // Domain length in y-direction
145  double l_y=2.0;
146 
147  // Build and assign mesh
148  Problem::mesh_pt() = new SimpleRectangularQuadMesh<ELEMENT>(n_x,n_y,l_x,l_y);
149 
150 
151 
152  // Mess up order of elements in the Problem's mesh:
153  //-------------------------------------------------
154  if (mess_up_order)
155  {
156  unsigned n_element=mesh_pt()->nelement();
157 
158  // Make copy
159  Vector<ELEMENT*> tmp_element_pt(n_element);
160  for (unsigned e=0;e<n_element;e++)
161  {
162  tmp_element_pt[e]=dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(e));
163  }
164 
165  // Reorder
166  unsigned e_half=unsigned(0.5*double(n_element));
167  unsigned e_lo=e_half-3;
168  unsigned e_up=n_element-e_lo;
169  unsigned count=0;
170  for (unsigned e=0;e<e_lo;e++)
171  {
172  mesh_pt()->element_pt(count)=tmp_element_pt[e];
173  count++;
174  mesh_pt()->element_pt(count)=tmp_element_pt[n_element-e-1];
175  count++;
176  }
177  for (unsigned e=e_lo;e<e_up;e++)
178  {
179  mesh_pt()->element_pt(count)=tmp_element_pt[e];
180  count++;
181  }
182  }
183 
184  // Set the boundary conditions for this problem: All nodes are
185  // free by default -- only need to pin the ones that have Dirichlet conditions
186  // here.
187  unsigned num_bound = mesh_pt()->nboundary();
188  for(unsigned ibound=0;ibound<num_bound;ibound++)
189  {
190  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
191  for (unsigned inod=0;inod<num_nod;inod++)
192  {
193  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
194  }
195  }
196 
197  // Complete the build of all elements so they are fully functional
198 
199  // Loop over the elements to set up element-specific
200  // things that cannot be handled by the (argument-free!) ELEMENT
201  // constructor: Pass pointer to source function
202  unsigned n_element = mesh_pt()->nelement();
203  for(unsigned i=0;i<n_element;i++)
204  {
205  // Upcast from GeneralsedElement to the present element
206  ELEMENT *el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
207 
208  //Set the source function pointer
209  el_pt->source_fct_pt() = Source_fct_pt;
210  }
211 
212 
213  // Setup equation numbering scheme
214  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
215 
216 } // end of constructor
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Definition: oomph-lib/src/generic/Vector.h:58

References oomph::Problem::assign_eqn_numbers(), e(), i, PoissonProblem< ELEMENT >::mesh_pt(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [20/24]

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

Destructor (empty)

97 {}

◆ PoissonProblem() [21/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 3 >::PoissonSourceFctPt  source_fct_pt,
const string &  node_file_name,
const string &  element_file_name,
const string &  face_file_name 
)

Constructor.

◆ ~PoissonProblem() [21/24]

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

Destructor (empty)

143 {}

◆ PoissonProblem() [22/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  h_power 
)

Constructor.

◆ ~PoissonProblem() [22/24]

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

Destructor (empty)

94 {};

◆ PoissonProblem() [23/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 2 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  h_power 
)

Constructor.

◆ ~PoissonProblem() [23/24]

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

Destructor (empty)

94 {};

◆ PoissonProblem() [24/24]

template<class ELEMENT >
PoissonProblem< ELEMENT >::PoissonProblem ( PoissonEquations< 3 >::PoissonSourceFctPt  source_fct_pt,
const unsigned &  h_power 
)

Constructor.

Constructor for Poisson problem

200  H_power(h_power)
201 
202 {
203 
204  Problem::Problem_is_nonlinear=false;
205 
206  //FiniteElement::Accept_negative_jacobian=true;
207 
208  //Create mesh and assign element lengthscale h
209  unsigned nx=unsigned(pow(2.0,int(h_power)));
210  unsigned ny=unsigned(pow(2.0,int(h_power)));
211  unsigned nz=unsigned(pow(2.0,int(h_power)));
212  double lx=4.0;
213  double ly=4.0;
214  double lz=4.0;
215  Problem::mesh_pt() = new SimpleCubicTetMesh<ELEMENT>(nx,ny,nz,lx,ly,lz);
216 
217 // unsigned nelem=mesh_pt()->nelement();
218 // for (unsigned e=0;e<nelem;e++)
219 // {
220 // Node* node_pt=mesh_pt()->finite_element_pt(e)->node_pt(0);
221 // mesh_pt()->finite_element_pt(e)->node_pt(0)=
222 // mesh_pt()->finite_element_pt(e)->node_pt(1);
223 // mesh_pt()->finite_element_pt(e)->node_pt(1)=node_pt;
224 // }
225 
226  // Set the boundary conditions for this problem: All nodes are
227  // free by default -- just pin the ones that have Dirichlet conditions
228  // here.
229  unsigned num_bound = mesh_pt()->nboundary();
230  for(unsigned long ibound=0;ibound<num_bound;ibound++)
231  {
232  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
233  for (unsigned inod=0;inod<num_nod;inod++)
234  {
235  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
236  }
237  }
238 
239  // Complete the build of all elements so they are fully functional
240 
241  //Find number of elements in mesh
242  unsigned n_element = mesh_pt()->nelement();
243 
244  // Loop over the elements to set up element-specific
245  // things that cannot be handled by constructor
246  for(unsigned i=0;i<n_element;i++)
247  {
248  // Upcast from GeneralElement to the present element
249  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
250 
251  //Set the source function pointer
252  el_pt->source_fct_pt() = Source_fct_pt;
253  }
254 
255  // Setup equation numbering scheme
256  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
257 }
unsigned H_power
Exponent for h scaling.
Definition: q_convergence_2d.cc:131
MySimple 3D tet mesh for TElements.
Definition: simple_cubic_tet_mesh.template.h:40
const unsigned nz
Definition: ConstraintElementsUnitTest.cpp:32
const double ly
Definition: ConstraintElementsUnitTest.cpp:34
const double lx
Definition: ConstraintElementsUnitTest.cpp:33
const unsigned nx
Definition: ConstraintElementsUnitTest.cpp:30
const double lz
Definition: ConstraintElementsUnitTest.cpp:35
const unsigned ny
Definition: ConstraintElementsUnitTest.cpp:31

References oomph::Problem::assign_eqn_numbers(), i, Mesh_Parameters::lx, Mesh_Parameters::ly, Mesh_Parameters::lz, PoissonProblem< ELEMENT >::mesh_pt(), Mesh_Parameters::nx, Mesh_Parameters::ny, Mesh_Parameters::nz, Eigen::bfloat16_impl::pow(), and PoissonProblem< ELEMENT >::Source_fct_pt.

◆ ~PoissonProblem() [24/24]

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

Destructor (empty)

143 {};

Member Function Documentation

◆ actions_after_adapt() [1/3]

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

Apply actions after adapt.

Reimplemented from oomph::Problem.

141  {
143  }
void complete_problem_setup()
Complete problem setup.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:1118

◆ actions_after_adapt() [2/3]

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

Actions that are to be performed after a mesh adaptation.

Reimplemented from oomph::Problem.

113  {
115  }

◆ actions_after_adapt() [3/3]

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

Actions that are to be performed after a mesh adaptation.

Reimplemented from oomph::Problem.

113  {
115  }

◆ actions_after_distribute()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_after_distribute ( )
inline

Apply actions after distribute (same as actions after adapt)

153  {
154  // BEGIN --- Only required if calling load_balance() ----------------
155 
156  // After calling load_balance() we need to re-establish the
157  // pointers of the unstructured meshes (ONLY). This is because the
158  // meshes created by the build_mesh() called from the
159  // load_balance() method (to replicate the behaviour of the
160  // structured load balance case) were deleted as part of the load
161  // balancing process.
162 
163  // Get the mesh pointer from mesh_pt() and set it on the
164  // corresponding unstructured mesh pointer.
165  Bulk_mesh_pt = mesh_pt();
166 
167  // Make the mesh_pt() from problem point to the corresponding
168  // mesh. This is similar to what we do in the build_mesh() method
169  Problem::mesh_pt() = Bulk_mesh_pt;
170 
171  // END --- Only required if calling load_balance() ----------------
172 
173  // Then we can safely call actions_after_adapt(). If we do not do
174  // the previous two steps after calling load_balance() then the
175  // pointer 'Bulk_mesh_pt' would be pointing to NULL, thus causing an
176  // error.
178  }
void actions_after_adapt()
Apply actions after adapt.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:140

◆ actions_after_newton_solve() [1/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

101 {}

◆ actions_after_newton_solve() [2/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

100 {}

◆ actions_after_newton_solve() [3/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

100 {}

◆ actions_after_newton_solve() [4/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

100 {}

◆ actions_after_newton_solve() [5/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

131  {}

◆ actions_after_newton_solve() [6/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

130  {}

◆ actions_after_newton_solve() [7/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

130  {}

◆ actions_after_newton_solve() [8/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

168 {}

◆ actions_after_newton_solve() [9/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

133  {}

◆ actions_after_newton_solve() [10/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

161  {}

◆ actions_after_newton_solve() [11/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

134 {}

◆ actions_after_newton_solve() [12/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

109 {}

◆ actions_after_newton_solve() [13/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

109 {}

◆ actions_after_newton_solve() [14/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [15/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [16/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

102 {}

◆ actions_after_newton_solve() [17/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

367 {}

◆ actions_after_newton_solve() [18/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

100 {}

◆ actions_after_newton_solve() [19/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

102 {}

◆ actions_after_newton_solve() [20/24]

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

Update the problem after solve (empty)

Reimplemented from oomph::Problem.

104 {}

◆ actions_after_newton_solve() [21/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

170 {}

◆ actions_after_newton_solve() [22/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

120  {}

◆ actions_after_newton_solve() [23/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

120  {}

◆ actions_after_newton_solve() [24/24]

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

Update the problem specs before solve (empty)

Reimplemented from oomph::Problem.

170  {}

◆ actions_before_adapt() [1/3]

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

Apply actions before adapt (empty)

Reimplemented from oomph::Problem.

137 {}

◆ actions_before_adapt() [2/3]

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

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

Reimplemented from oomph::Problem.

111 {}

◆ actions_before_adapt() [3/3]

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

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

Reimplemented from oomph::Problem.

111 {}

◆ actions_before_distribute()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_distribute ( )
inline

Apply actions before distribute (same as actions before adapt)

147  {
149  }
void actions_before_adapt()
Apply actions before adapt (empty)
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:137

◆ actions_before_newton_convergence_check() [1/3]

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

Bump up counter for number of Newton iterations.

Reimplemented from oomph::Problem.

105  {
106  Newton_count++;
107  }
unsigned Newton_count
Number of Newton iterations.
Definition: HypreSolver_test.cc:132

◆ actions_before_newton_convergence_check() [2/3]

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

Bump up counter for number of Newton iterations.

Reimplemented from oomph::Problem.

118  {
119  Newton_count++;
120  }

◆ actions_before_newton_convergence_check() [3/3]

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

Bump up counter for number of Newton iterations.

Reimplemented from oomph::Problem.

122  {
123  Newton_count++;
124  }

◆ actions_before_newton_solve() [1/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Update the problem specs before solve: Set nodal values to zero and (Re-)set boundary conditions to the values from the exact solution

Update the problem specs before solve: (Re-)set boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

214 {
215 
216  // Reset counter
217  Newton_count=0;
218 
219  // Loop over nodes and set values to zero
220  unsigned n_node=mesh_pt()->nnode();
221  for (unsigned j=0; j<n_node; j++)
222  {
223  Node* node_pt=mesh_pt()->node_pt(j);
224  node_pt->set_value(0,0.0);
225  }
226 
227  // How many boundaries are there?
228  unsigned n_bound = mesh_pt()->nboundary();
229 
230  //Loop over the boundaries
231  for(unsigned i=0;i<n_bound;i++)
232  {
233  // How many nodes are there on this boundary?
234  unsigned n_node = mesh_pt()->nboundary_node(i);
235 
236  // Loop over the nodes on boundary
237  for (unsigned n=0;n<n_node;n++)
238  {
239  // Get pointer to node
240  Node* nod_pt=mesh_pt()->boundary_node_pt(i,n);
241 
242  // Extract nodal coordinates from node:
243  Vector<double> x(2);
244  x[0]=nod_pt->x(0);
245  x[1]=nod_pt->x(1);
246 
247  // Compute the value of the exact solution at the nodal point
248  Vector<double> u(1);
250 
251  // Assign the value to the one (and only) nodal value at this node
252  nod_pt->set_value(0,u[0]);
253  }
254  }
255 } // end of actions before solve
void set_value(const unsigned &i, const double &value_)
Definition: nodes.h:271
Definition: nodes.h:906
double & x(const unsigned &i)
Return the i-th nodal coordinate.
Definition: nodes.h:1060
void get_exact_u(const Vector< double > &x, Vector< double > &u)
Exact solution as a Vector.
Definition: extrude_with_macro_element_representation.cc:206
list x
Definition: plotDoE.py:28
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References TanhSolnForPoisson::get_exact_u(), i, j, n, oomph::Data::set_value(), plotDoE::x, and oomph::Node::x().

◆ actions_before_newton_solve() [2/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [3/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [4/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [5/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

109  {
110  //Loop over the boundaries
111  unsigned num_bound = mesh_pt()->nboundary();
112  for(unsigned ibound=0;ibound<num_bound;ibound++)
113  {
114  // Loop over the nodes on boundary
115  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
116  for (unsigned inod=0;inod<num_nod;inod++)
117  {
118  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
119  double u;
120  Vector<double> x(2);
121  x[0]=nod_pt->x(0);
122  x[1]=nod_pt->x(1);
124  nod_pt->set_value(0,u);
125  }
126  }
127  }

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

◆ actions_before_newton_solve() [6/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

108  {
109  //Loop over the boundaries
110  unsigned num_bound = mesh_pt()->nboundary();
111  for(unsigned ibound=0;ibound<num_bound;ibound++)
112  {
113  // Loop over the nodes on boundary
114  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
115  for (unsigned inod=0;inod<num_nod;inod++)
116  {
117  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
118  double u;
119  Vector<double> x(2);
120  x[0]=nod_pt->x(0);
121  x[1]=nod_pt->x(1);
123  nod_pt->set_value(0,u);
124  }
125  }
126  }

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

◆ actions_before_newton_solve() [7/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

108  {
109  //Loop over the boundaries
110  unsigned num_bound = mesh_pt()->nboundary();
111  for(unsigned ibound=0;ibound<num_bound;ibound++)
112  {
113  // Loop over the nodes on boundary
114  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
115  for (unsigned inod=0;inod<num_nod;inod++)
116  {
117  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
118  double u;
119  Vector<double> x(2);
120  x[0]=nod_pt->x(0);
121  x[1]=nod_pt->x(1);
123  nod_pt->set_value(0,u);
124  }
125  }
126  }

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

◆ actions_before_newton_solve() [8/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

146  {
147  //Loop over the boundaries
148  unsigned num_bound = mesh_pt()->nboundary();
149  for(unsigned ibound=0;ibound<num_bound;ibound++)
150  {
151  // Loop over the nodes on boundary
152  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
153  for (unsigned inod=0;inod<num_nod;inod++)
154  {
155  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
156  double u;
157  Vector<double> x(3);
158  x[0]=nod_pt->x(0);
159  x[1]=nod_pt->x(1);
160  x[2]=nod_pt->x(2);
162  nod_pt->set_value(0,u);
163  }
164  }
165  }

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

◆ actions_before_newton_solve() [9/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

111  {
112  //Loop over the boundaries
113  unsigned num_bound = mesh_pt()->nboundary();
114  for(unsigned ibound=0;ibound<num_bound;ibound++)
115  {
116  // Loop over the nodes on boundary
117  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
118  for (unsigned inod=0;inod<num_nod;inod++)
119  {
120  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
121  double u;
122  Vector<double> x(2);
123  x[0]=nod_pt->x(0);
124  x[1]=nod_pt->x(1);
126  nod_pt->set_value(0,u);
127  }
128  }
129  }

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

◆ actions_before_newton_solve() [10/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

139  {
140  //Loop over the boundaries
141  unsigned num_bound = mesh_pt()->nboundary();
142  for(unsigned ibound=0;ibound<num_bound;ibound++)
143  {
144  // Loop over the nodes on boundary
145  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
146  for (unsigned inod=0;inod<num_nod;inod++)
147  {
148  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
149  double u;
150  Vector<double> x(2);
151  x[0]=nod_pt->x(0);
152  x[1]=nod_pt->x(1);
154  nod_pt->set_value(0,u);
155  }
156  }
157  }

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

◆ actions_before_newton_solve() [11/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

129  {
131  }
void apply_boundary_conditions()
Apply boundary conditions.
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:1163

◆ actions_before_newton_solve() [12/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

104  {
106  }

◆ actions_before_newton_solve() [13/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

104  {
106  }

◆ actions_before_newton_solve() [14/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [15/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [16/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [17/24]

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

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

364 {}

◆ actions_before_newton_solve() [18/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [19/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [20/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::actions_before_newton_solve ( )
virtual

Update the problem specs before solve: Reset boundary conditions to the values from the exact solution.

Reimplemented from oomph::Problem.

◆ actions_before_newton_solve() [21/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

148  {
149  //Loop over the boundaries
150  unsigned num_bound = mesh_pt()->nboundary();
151  for(unsigned ibound=0;ibound<num_bound;ibound++)
152  {
153  // Loop over the nodes on boundary
154  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
155  for (unsigned inod=0;inod<num_nod;inod++)
156  {
157  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
158  double u;
159  Vector<double> x(3);
160  x[0]=nod_pt->x(0);
161  x[1]=nod_pt->x(1);
162  x[2]=nod_pt->x(2);
164  nod_pt->set_value(0,u);
165  }
166  }
167  }

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

◆ actions_before_newton_solve() [22/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

98  {
99  //Loop over the boundaries
100  unsigned num_bound = mesh_pt()->nboundary();
101  for(unsigned long ibound=0;ibound<num_bound;ibound++)
102  {
103  // Loop over the nodes on boundary
104  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
105  for (unsigned inod=0;inod<num_nod;inod++)
106  {
107  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
108  double u;
109  Vector<double> x(2);
110  x[0]=nod_pt->x(0);
111  x[1]=nod_pt->x(1);
113  nod_pt->set_value(0,u);
114  }
115  }
116  }

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

◆ actions_before_newton_solve() [23/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

98  {
99  //Loop over the boundaries
100  unsigned num_bound = mesh_pt()->nboundary();
101  for(unsigned long ibound=0;ibound<num_bound;ibound++)
102  {
103  // Loop over the nodes on boundary
104  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
105  for (unsigned inod=0;inod<num_nod;inod++)
106  {
107  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
108  double u;
109  Vector<double> x(2);
110  x[0]=nod_pt->x(0);
111  x[1]=nod_pt->x(1);
113  nod_pt->set_value(0,u);
114  }
115  }
116  }

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

◆ actions_before_newton_solve() [24/24]

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

Update the problem specs before solve: (Re)set boundary conditions.

Reimplemented from oomph::Problem.

147  {
148  //Loop over the boundaries
149  unsigned num_bound = mesh_pt()->nboundary();
150  for(unsigned long ibound=0;ibound<num_bound;ibound++)
151  {
152  // Loop over the nodes on boundary
153  unsigned num_nod=mesh_pt()->nboundary_node(ibound);
154  for (unsigned inod=0;inod<num_nod;inod++)
155  {
156  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
157  double u;
158  Vector<double> x(3);
159  x[0]=nod_pt->x(0);
160  x[1]=nod_pt->x(1);
161  x[2]=nod_pt->x(2);
163  nod_pt->set_value(0,u);
164  }
165  }
166  }

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

◆ apply_boundary_conditions() [1/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::apply_boundary_conditions
private

Apply boundary conditions.

1164 {
1165  const unsigned num_bound = mesh_pt()->nboundary();
1166 
1167  for(unsigned ibound=0;ibound<num_bound;ibound++)
1168  {
1169  // Loop over the nodes on boundary
1170  const unsigned num_nod=mesh_pt()->nboundary_node(ibound);
1171  for (unsigned inod=0;inod<num_nod;inod++)
1172  {
1173  Node* nod_pt=mesh_pt()->boundary_node_pt(ibound,inod);
1174  double u;
1175  Vector<double> x(2);
1176  x[0]=nod_pt->x(0);
1177  x[1]=nod_pt->x(1);
1179  nod_pt->set_value(0,u);
1180  }
1181  }
1182 }

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

◆ apply_boundary_conditions() [2/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::apply_boundary_conditions ( )
private

◆ apply_boundary_conditions() [3/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::apply_boundary_conditions ( )
private

◆ build_mesh()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::build_mesh

Required function to perform load balancing, create the mesh.

Required function ONLY to perform load balancing. However, it is a good practice to implement this function and build the mesh in there

308 {
309  // Create the mesh (using the geometry stored in the
310  // Triangle_mesh_parameters object)
312 
313  // ... and set the just created mesh as the mesh in the problem object
314  Problem::mesh_pt() = Bulk_mesh_pt;
315 
316  // Set the error estimator
317  Bulk_mesh_pt->spatial_error_estimator_pt() = Error_estimator_pt;
318 
319  // Establish the max. and min. permitted errors for adaptation
320  Bulk_mesh_pt->max_permitted_error() =
321  TestArguments::Max_permitted_error; // refine if error is larger
322  // than this
323 
324  Bulk_mesh_pt->min_permitted_error() =
325  TestArguments::Min_permitted_error; // unrefine if error is smaller
326  // than this
327 
328  // Set the maximum element size
329  Bulk_mesh_pt->max_element_size() = TestArguments::Element_size;
330 
331  // Set the minimum element size
332  Bulk_mesh_pt->min_element_size() = TestArguments::Min_element_size;
333 
334  // Make all the elements fully funtional and set boundary conditions
336 
337 }
double Min_permitted_error
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:95
double Min_element_size
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:97
double Element_size
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:92
double Max_permitted_error
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:94

References TestArguments::Element_size, TestArguments::Max_permitted_error, TestArguments::Min_element_size, and TestArguments::Min_permitted_error.

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

◆ complete_problem_setup() [1/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::complete_problem_setup
private

Complete problem setup.

1119 {
1120 
1121  // Set the boundary conditions for this problem: All nodes are
1122  // free by default -- just pin the ones that have Dirichlet conditions
1123  // here.
1124 
1125  const unsigned num_bound = mesh_pt()->nboundary();
1126 
1127  for(unsigned ibound=0;ibound<num_bound;ibound++)
1128  {
1129  unsigned num_nod= mesh_pt()->nboundary_node(ibound);
1130  for (unsigned inod=0;inod<num_nod;inod++)
1131  {
1132  mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
1133  }
1134  }
1135 
1136  // Complete the build of all elements so they are fully functional
1137 
1138  //Find number of elements in mesh
1139  const unsigned n_element = mesh_pt()->nelement();
1140 
1141  // Loop over the elements to set up element-specific
1142  // things that cannot be handled by constructor
1143  for(unsigned i=0;i<n_element;i++)
1144  {
1145  // Upcast from GeneralElement to the present element
1146  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt()->element_pt(i));
1147 
1148  //Set the source function pointer
1149  el_pt->source_fct_pt() = Source_fct_pt;
1150  }
1151 
1152  // Setup equation numbering scheme
1153  cout <<"Number of equations: " << assign_eqn_numbers() << std::endl;
1154 
1156 
1157 }

References i, and oomph::Source_fct_pt.

◆ complete_problem_setup() [2/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::complete_problem_setup ( )
private

◆ complete_problem_setup() [3/3]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::complete_problem_setup ( )
private

◆ complex_domain_with_holes()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::complex_domain_with_holes
private

Builds a complex domain with holes.

718 {
719  unsigned boundary_id;
720 
721  // ---------------------------------------------------------------------
722  // >> Boundary 0
723  const unsigned num_vertices_b0 = 6;
724 
725  Vector<Vector <double> > vertices_b0(num_vertices_b0);
726 
727  for (unsigned i = 0; i < num_vertices_b0; i++)
728  vertices_b0[i].resize(2);
729 
730  vertices_b0[0][0] = 0;
731  vertices_b0[0][1] = 0;
732 
733  vertices_b0[1][0] = 7.5;
734  vertices_b0[1][1] = 0;
735 
736  vertices_b0[2][0] = 7.5;
737  vertices_b0[2][1] = 5;
738 
739  vertices_b0[3][0] = 12.5;
740  vertices_b0[3][1] = 5;
741 
742  vertices_b0[4][0] = 12.5;
743  vertices_b0[4][1] = 0;
744 
745  vertices_b0[5][0] = 20;
746  vertices_b0[5][1] = 0;
747 
748  boundary_id = 0;
749  TriangleMeshPolyLine *boundary0_pt =
750  new TriangleMeshPolyLine(vertices_b0, boundary_id);
751 
752  // ---------------------------------------------------------------------
753  // >> Boundary 1
754  const unsigned num_segments_b1 = 10;
755  double x_centre_b1 = 10.0;
756  double y_centre_b1 = 0.0;
757  double r_circle_b1 = 10.0;
758 
759  Circle *boundary_circle_b1_pt =
760  new Circle(x_centre_b1, y_centre_b1, r_circle_b1);
761 
762  double z_start_b1 = 0.0;
763  double z_end_b1 = MathematicalConstants::Pi;
764 
765  boundary_id = 1;
766  TriangleMeshCurviLine *boundary1_pt =
767  new TriangleMeshCurviLine(boundary_circle_b1_pt,
768  z_start_b1,
769  z_end_b1,
770  num_segments_b1,
771  boundary_id);
772 
773  // ---------------------------------------------------------------------
774  // >> Building the OUTER BOUNDARY
775 
776  // >> Setting up the domain with PolyLines
777 
778  Vector<TriangleMeshCurveSection*> outer_boundary_curve_section_pt(2);
779 
780  outer_boundary_curve_section_pt[0] = boundary0_pt;
781  outer_boundary_curve_section_pt[1] = boundary1_pt;
782 
783  // We have only one outer boundary (one outer polygon)
784  Vector<TriangleMeshClosedCurve *> outer_boundary_pt(1);
785  outer_boundary_pt[0] =
786  new TriangleMeshClosedCurve(outer_boundary_curve_section_pt);
787 
788  // Now create an internal polygon that will represent a hole
789  // ---------------------------------------------------------------------
790  // This hole has a similar geometry as the outer domain but rotated 90'
791 
792  // >> Boundary 2
793  const unsigned num_vertices_b2 = 6;
794 
795  Vector<Vector <double> > vertices_b2(num_vertices_b2);
796 
797  for (unsigned i = 0; i < num_vertices_b2; i++)
798  vertices_b2[i].resize(2);
799 
800  vertices_b2[0][0] = 14;
801  vertices_b2[0][1] = 7;
802 
803  vertices_b2[1][0] = 14;
804  vertices_b2[1][1] = 5;
805 
806  vertices_b2[2][0] = 15;
807  vertices_b2[2][1] = 5;
808 
809  vertices_b2[3][0] = 15;
810  vertices_b2[3][1] = 3;
811 
812  vertices_b2[4][0] = 14;
813  vertices_b2[4][1] = 3;
814 
815  vertices_b2[5][0] = 14;
816  vertices_b2[5][1] = 1;
817 
818  boundary_id = 2;
819  TriangleMeshPolyLine *boundary2_pt =
820  new TriangleMeshPolyLine(vertices_b2, boundary_id);
821 
822  // ---------------------------------------------------------------------
823  // >> Boundary 3
824  const unsigned num_segments_b3 = 10;
825  double x_centre_b3 = 14.0;
826  double y_centre_b3 = 4.0;
827  double r_circle_b3 = 3.0;
828 
829  Circle *boundary_circle_b3_pt=new Circle(x_centre_b3,y_centre_b3,r_circle_b3);
830 
831  double z_start_b3 = MathematicalConstants::Pi * (3.0 / 2.0);
832  double z_end_b3 = MathematicalConstants::Pi * (5.0 / 2.0);
833 
834  boundary_id = 3;
835  TriangleMeshCurviLine *boundary3_pt =
836  new TriangleMeshCurviLine(boundary_circle_b3_pt,
837  z_start_b3,
838  z_end_b3,
839  num_segments_b3,
840  boundary_id);
841 
842  // ---------------------------------------------------------------------
843  // Another internal polygon (hole). A hole shaped as a square
844  // >> Boundary 4
845  const unsigned num_vertices_b4 = 3;
846 
847  Vector<Vector <double> > vertices_b4(num_vertices_b4);
848 
849  for (unsigned i = 0; i < num_vertices_b4; i++)
850  vertices_b4[i].resize(2);
851 
852  vertices_b4[0][0] = 3;
853  vertices_b4[0][1] = 1;
854 
855  vertices_b4[1][0] = 3;
856  vertices_b4[1][1] = 2.5;
857 
858  vertices_b4[2][0] = 3;
859  vertices_b4[2][1] = 4;
860 
861  boundary_id = 4;
862  TriangleMeshPolyLine *boundary4_pt =
863  new TriangleMeshPolyLine(vertices_b4, boundary_id);
864 
865  // ---------------------------------------------------------------------
866  // >> Boundary 5
867  const unsigned num_vertices_b5 = 3;
868 
869  Vector<Vector <double> > vertices_b5(num_vertices_b5);
870 
871  for (unsigned i = 0; i < num_vertices_b5; i++)
872  vertices_b5[i].resize(2);
873 
874  vertices_b5[0][0] = 3;
875  vertices_b5[0][1] = 4;
876 
877  vertices_b5[1][0] = 4.5;
878  vertices_b5[1][1] = 4;
879 
880  vertices_b5[2][0] = 6;
881  vertices_b5[2][1] = 4;
882 
883  boundary_id = 5;
884  TriangleMeshPolyLine *boundary5_pt =
885  new TriangleMeshPolyLine(vertices_b5, boundary_id);
886 
887  // ---------------------------------------------------------------------
888  // >> Boundary 6
889  const unsigned num_vertices_b6 = 3;
890 
891  Vector<Vector <double> > vertices_b6(num_vertices_b6);
892 
893  for (unsigned i = 0; i < num_vertices_b6; i++)
894  vertices_b6[i].resize(2);
895 
896  vertices_b6[0][0] = 6;
897  vertices_b6[0][1] = 4;
898 
899  vertices_b6[1][0] = 6;
900  vertices_b6[1][1] = 2.5;
901 
902  vertices_b6[2][0] = 6;
903  vertices_b6[2][1] = 1;
904 
905  boundary_id = 6;
906  TriangleMeshPolyLine *boundary6_pt =
907  new TriangleMeshPolyLine(vertices_b6, boundary_id);
908 
909  // ---------------------------------------------------------------------
910  // >> Boundary 7
911  const unsigned num_vertices_b7 = 3;
912 
913  Vector<Vector <double> > vertices_b7(num_vertices_b7);
914 
915  for (unsigned i = 0; i < num_vertices_b7; i++)
916  vertices_b7[i].resize(2);
917 
918  vertices_b7[0][0] = 6;
919  vertices_b7[0][1] = 1;
920 
921  vertices_b7[1][0] = 4.5;
922  vertices_b7[1][1] = 1;
923 
924  vertices_b7[2][0] = 3;
925  vertices_b7[2][1] = 1;
926 
927  boundary_id = 7;
928  TriangleMeshPolyLine *boundary7_pt =
929  new TriangleMeshPolyLine(vertices_b7, boundary_id);
930 
931  // ---------------------------------------------------------------------
932  // Another hole (internal polygon), created as a circle
933  // >> Boundary 8
934  const unsigned num_segments_b8 = 10;
935  double x_centre_b8 = 10.0;
936  double y_centre_b8 = 7.5;
937  double r_circle_b8 = 1.0;
938 
939  Circle *boundary_circle_b8_pt=new Circle(x_centre_b8,y_centre_b8,r_circle_b8);
940 
941  double z_start_b8 = 0.0;
942  double z_end_b8 = MathematicalConstants::Pi;
943 
944  boundary_id = 8;
945  TriangleMeshCurviLine *boundary8_pt =
946  new TriangleMeshCurviLine(boundary_circle_b8_pt,
947  z_start_b8,
948  z_end_b8,
949  num_segments_b8,
950  boundary_id);
951 
952  // ---------------------------------------------------------------------
953  // >> Boundary 9
954  const unsigned num_segments_b9 = 10;
955  double x_centre_b9 = 10.0;
956  double y_centre_b9 = 7.5;
957  double r_circle_b9 = 1.0;
958 
959  Circle *boundary_circle_b9_pt=new Circle(x_centre_b9,y_centre_b9,r_circle_b9);
960 
961  double z_start_b9 = MathematicalConstants::Pi;
962  double z_end_b9 = 2.0 * MathematicalConstants::Pi;
963 
964  boundary_id = 9;
965  TriangleMeshCurviLine *boundary9_pt =
966  new TriangleMeshCurviLine(boundary_circle_b9_pt,
967  z_start_b9,
968  z_end_b9,
969  num_segments_b9,
970  boundary_id);
971 
972  // ---------------------------------------------------------------------
973  // ---------------------------------------------------------------------
974  // >> Building the INTERNAL BOUNDARIES
975 
976  // Set the holes information (indicate the number of holes)
977  const unsigned nholes = 3;
978 
979  Vector<TriangleMeshClosedCurve*> inner_boundaries_pt(nholes);
981  inner_boundary_curve_section_pt(nholes);
982 
983  // -----------------
984  // 1st hole
985  inner_boundary_curve_section_pt[0].resize(2);
986 
987  inner_boundary_curve_section_pt[0][0] = boundary2_pt;
988  inner_boundary_curve_section_pt[0][1] = boundary3_pt;
989 
990  // Set the coordinates to mark the holes (1st hole)
991  Vector<double> hole1(2);
992  hole1[0] = 16.0;
993  hole1[1] = 4.0;
994 
995  // -----------------
996  // 2nd hole
997  inner_boundary_curve_section_pt[1].resize(4);
998 
999  inner_boundary_curve_section_pt[1][0] = boundary4_pt;
1000  inner_boundary_curve_section_pt[1][1] = boundary5_pt;
1001  inner_boundary_curve_section_pt[1][2] = boundary6_pt;
1002  inner_boundary_curve_section_pt[1][3] = boundary7_pt;
1003 
1004  // Set the coordinates to mark the holes (1st hole)
1005  Vector<double> hole2(2);
1006  hole2[0] = 4.5;
1007  hole2[1] = 2.5;
1008 
1009  // -----------------
1010  // 3rd hole
1011  inner_boundary_curve_section_pt[2].resize(2);
1012 
1013  inner_boundary_curve_section_pt[2][0] = boundary8_pt;
1014  inner_boundary_curve_section_pt[2][1] = boundary9_pt;
1015 
1016  // Set the coordinates to mark the holes (1st hole)
1017  Vector<double> hole3(2);
1018  hole3[0] = 10.0;
1019  hole3[1] = 7.5;
1020 
1021  // Store the holes geometries
1022  inner_boundaries_pt[0] =
1023  new TriangleMeshClosedCurve(inner_boundary_curve_section_pt[0],hole1);
1024 
1025  inner_boundaries_pt[1] =
1026  new TriangleMeshClosedCurve(inner_boundary_curve_section_pt[1],hole2);
1027 
1028  inner_boundaries_pt[2] =
1029  new TriangleMeshClosedCurve(inner_boundary_curve_section_pt[2],hole3);
1030 
1031  // ---------------------------------------------------------------------
1032  // Store the geometry of the domain in the Triangle_mesh_parameters
1033  // object
1034 
1035  // ---------------------------------------------------------------------
1036  // Create the TriangleMeshParameters object and set the outer
1037  // boundary
1038  Triangle_mesh_parameters.outer_boundary_pt() = outer_boundary_pt;
1039  // Set the pointer to internal boundaries (holes)
1040  Triangle_mesh_parameters.internal_closed_curve_pt() = inner_boundaries_pt;
1041 
1042 }
v resize(3)
Definition: geom_objects.h:873
Base class defining a closed curve for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1339
Definition: unstructured_two_d_mesh_geometry_base.h:662
Vector< TriangleMeshClosedCurve * > internal_closed_curve_pt() const
Helper function for getting the internal closed boundaries.
Definition: triangle_mesh.template.h:163
Vector< TriangleMeshClosedCurve * > outer_boundary_pt() const
Helper function for getting the outer boundary.
Definition: triangle_mesh.template.h:139
Class defining a polyline for use in Triangle Mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:868
double Pi
Definition: two_d_biharmonic.cc:235

References i, BiharmonicTestFunctions2::Pi, and resize().

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

◆ doc_solution() [1/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::doc_solution ( const unsigned &  nplot,
DocInfo &  doc_info 
)

Doc the solution.

254 {
255 
256  ofstream some_file;
257  char filename[100];
258 
259 
260  // Doc local node numbering
261  //-------------------------
262  sprintf(filename,"%s/node_numbering%i.dat",doc_info.directory().c_str(),
263  doc_info.number());
264  some_file.open(filename);
265  FiniteElement* el_pt=mesh_pt()->finite_element_pt(0);
266  unsigned nnode=el_pt->nnode();
267  unsigned ndim=el_pt->node_pt(0)->ndim();
268  for (unsigned j=0;j<nnode;j++)
269  {
270  for (unsigned i=0;i<ndim;i++)
271  {
272  some_file << el_pt->node_pt(j)->x(i) << " " ;
273  }
274  some_file << j << std::endl;
275  }
276  some_file.close();
277 
278  // Output boundaries
279  //------------------
280  sprintf(filename,"%s/boundaries%i.dat",doc_info.directory().c_str(),
281  doc_info.number());
282  some_file.open(filename);
283  mesh_pt()->output_boundaries(some_file);
284  some_file.close();
285 
286 
287  // Output solution
288  //----------------
289  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
290  doc_info.number());
291  some_file.open(filename);
292  mesh_pt()->output(some_file,nplot);
293  some_file.close();
294 
295 
296  // Output exact solution
297  //----------------------
298  sprintf(filename,"%s/exact_soln%i.dat",doc_info.directory().c_str(),
299  doc_info.number());
300  some_file.open(filename);
301  mesh_pt()->output_fct(some_file,nplot,TanhSolnForPoisson::get_exact_u);
302  some_file.close();
303 
304  // Doc error
305  //----------
306  double error,norm;
307  sprintf(filename,"%s/error%i.dat",doc_info.directory().c_str(),
308  doc_info.number());
309  some_file.open(filename);
310  mesh_pt()->compute_error(some_file,TanhSolnForPoisson::get_exact_u,
311  error,norm);
312  some_file.close();
313  cout << "error: " << sqrt(error) << std::endl;
314  cout << "norm : " << sqrt(norm) << std::endl << std::endl;
315 
316 } // end of doc
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
std::string directory() const
Output directory.
Definition: oomph_utilities.h:524
unsigned & number()
Number used (e.g.) for labeling output files.
Definition: oomph_utilities.h:554
Definition: elements.h:1313
Node *& node_pt(const unsigned &n)
Return a pointer to the local node n.
Definition: elements.h:2175
unsigned nnode() const
Return the number of nodes.
Definition: elements.h:2210
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
string filename
Definition: MergeRestartFiles.py:39
int error
Definition: calibrate.py:297

References oomph::DocInfo::directory(), calibrate::error, MergeRestartFiles::filename, TanhSolnForPoisson::get_exact_u(), i, j, oomph::Node::ndim(), oomph::FiniteElement::nnode(), oomph::FiniteElement::node_pt(), oomph::DocInfo::number(), sqrt(), and oomph::Node::x().

◆ doc_solution() [2/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::doc_solution ( const unsigned &  nplot,
DocInfo &  doc_info 
)

Doc the solution.

◆ doc_solution() [3/24]

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

Doc the solution: doc_info contains labels/output directory etc.

Doc the solution.

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

264 {
265 
266  ofstream some_file;
267  char filename[100];
268 
269  // Number of plot points: npts x npts
270  unsigned npts=5;
271 
272  // Output solution
273  //-----------------
274  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
275  doc_info.number());
276  some_file.open(filename);
277  mesh_pt()->output(some_file,npts);
278  some_file.close();
279 
280 
281  // Output exact solution
282  //----------------------
283  sprintf(filename,"%s/exact_soln%i.dat",doc_info.directory().c_str(),
284  doc_info.number());
285  some_file.open(filename);
286  mesh_pt()->output_fct(some_file,npts,TanhSolnForPoisson::get_exact_u);
287  some_file.close();
288 
289  // Doc error and return of the square of the L2 error
290  //---------------------------------------------------
291  double error,norm;
292  sprintf(filename,"%s/error%i.dat",doc_info.directory().c_str(),
293  doc_info.number());
294  some_file.open(filename);
295  mesh_pt()->compute_error(some_file,TanhSolnForPoisson::get_exact_u,
296  error,norm);
297  some_file.close();
298 
299  // Doc L2 error and norm of solution
300  cout << "\nNorm of error : " << sqrt(error) << endl;
301  cout << "Norm of solution: " << sqrt(norm) << endl << endl;
302 
303 } // end of doc

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

◆ doc_solution() [4/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [5/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [6/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [7/24]

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

Doc the solution.

◆ doc_solution() [8/24]

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

Doc the solution.

◆ doc_solution() [9/24]

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

Doc the solution.

◆ doc_solution() [10/24]

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

Doc the solution.

◆ doc_solution() [11/24]

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

Doc the solution.

◆ doc_solution() [12/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [13/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [14/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [15/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [16/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [17/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [18/24]

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

Doc the solution. DocInfo object stores flags/labels for where the output gets written to

◆ doc_solution() [19/24]

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

Doc the solution.

Doc the solution (when working in parallel each processor creates output files, thus we must be careful with the naming of the output files)

1050 {
1051  ofstream some_file;
1052  char filename[100];
1053 
1054  // Number of plot points
1055  unsigned npts;
1056  npts=2;
1057 
1058  // Disable the output of halo element so that in the output we only
1059  // see those elements that the processor is in charge
1060  mesh_pt()->disable_output_of_halo_elements();
1061 
1062  // Output solution (be careful with the naming of the output files,
1063  // each file can be identified by the processor id
1064  // ----------------
1065  sprintf(filename,"%s/soln%i_proc%i.dat",
1066  doc_info.directory().c_str(),
1067  doc_info.number(),
1068  this->communicator_pt()->my_rank());
1069 
1070  some_file.open(filename);
1071  mesh_pt()->output(some_file,npts);
1072  some_file.close();
1073 
1074  // Output exact solution (output files in parallel)
1075  //----------------
1076  sprintf(filename,"%s/exact_soln%i_proc%i.dat",
1077  doc_info.directory().c_str(),
1078  doc_info.number(),
1079  this->communicator_pt()->my_rank());
1080 
1081  some_file.open(filename);
1082  mesh_pt()->output_fct(some_file,npts,TanhSolnForPoisson::get_exact_u);
1083  some_file.close();
1084 
1085  // Doc error (local to the processor, only consider the elements that
1086  // the processor is in charge)
1087  // -----------
1088  double error,norm;
1089  mesh_pt()->compute_error(some_file,TanhSolnForPoisson::get_exact_u,
1090  error,norm);
1091  cout << "error: " << sqrt(error) << std::endl;
1092  cout << "norm : " << sqrt(norm) << std::endl << std::endl;
1093 
1094  // Because we want the global norm we need to send/receive
1095  // information to/from the other processors
1096  double norm_soln=0.0;
1097  mesh_pt()->compute_norm(norm_soln);
1098 #ifdef OOMPH_HAS_MPI
1099  if (mesh_pt()->is_mesh_distributed())
1100  {
1101  double norm_reduced = 0.0;
1102  MPI_Allreduce(&norm_soln, &norm_reduced, 1, MPI_DOUBLE, MPI_SUM,
1103  this->communicator_pt()->mpi_comm());
1104 
1105  cout << "norm reduced: " << sqrt(norm_reduced) << std::endl << std::endl;
1106 
1107  // Output the global norm which considers all processors
1108  trace_file << sqrt(norm_reduced) << std::endl;
1109  }
1110 #endif
1111 
1112 }
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
Definition: problem.h:1246

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

◆ doc_solution() [20/24]

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

Doc the solution.

◆ doc_solution() [21/24]

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

Doc the solution.

◆ doc_solution() [22/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::doc_solution ( DocInfo &  doc_info,
ostream &  convergence_file 
)

Doc the solution.

210 {
211 
212  ofstream some_file;
213  char filename[100];
214 
215  // Number of plot points
216  unsigned npts;
217  npts=5;
218 
219 
220  // Switch on full validation during self test
221  if (CommandLineArgs::Argc>1)
222  {
223  // Output boundaries
224  //------------------
225  sprintf(filename,"%s/boundaries.dat",doc_info.directory().c_str());
226  some_file.open(filename);
227  mesh_pt()->output_boundaries(some_file);
228  some_file.close();
229 
230  // Output solution
231  //----------------
232  sprintf(filename,"%s/soln%i.dat",doc_info.directory().c_str(),
233  doc_info.number());
234  some_file.open(filename);
235  mesh_pt()->output(some_file,npts);
236  some_file.close();
237 
238  // Output exact solution
239  //----------------------
240  sprintf(filename,"%s/exact_soln%i.dat",doc_info.directory().c_str(),
241  doc_info.number());
242  some_file.open(filename);
243  mesh_pt()->output_fct(some_file,npts,TanhSolnForPoisson::get_exact_u);
244  some_file.close();
245  }
246 
247  // Doc error
248  //----------
249  double error,norm;
250  sprintf(filename,"%s/error%i.dat",doc_info.directory().c_str(),
251  doc_info.number());
252  some_file.open(filename);
253  mesh_pt()->compute_error(some_file,TanhSolnForPoisson::get_exact_u,
254  error,norm);
255  some_file.close();
256  cout << "error: " << sqrt(error) << std::endl;
257  cout << "norm : " << sqrt(norm) << std::endl << std::endl;
258 
259  double log_h=log(1.0/double(pow(2.0,int(H_power))));
260  convergence_file << log_h << " "
261  << log(sqrt(error)) << " ";
262 
263  unsigned nnode_1d=mesh_pt()->finite_element_pt(0)->nnode_1d();
264  switch (nnode_1d)
265  {
266  case 2:
267  convergence_file << 2.0*log_h+4.0 << " ";
268  break;
269 
270  case 3:
271  convergence_file << 3.0*log_h+4.0 << " ";
272  break;
273 
274  case 4:
275  convergence_file << 4.0*log_h+4.0 << " ";
276  break;
277 
278  default:
279  throw OomphLibError("Never get here",
282  }
283 
284  convergence_file << sqrt(norm) << std::endl;
285 }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
int Argc
Number of arguments + 1.
Definition: oomph_utilities.cc:407

References oomph::CommandLineArgs::Argc, oomph::DocInfo::directory(), calibrate::error, MergeRestartFiles::filename, TanhSolnForPoisson::get_exact_u(), Eigen::bfloat16_impl::log(), oomph::DocInfo::number(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, Eigen::ArrayBase< Derived >::pow(), and sqrt().

◆ doc_solution() [23/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::doc_solution ( DocInfo &  doc_info,
ostream &  convergence_file 
)

Doc the solution.

◆ doc_solution() [24/24]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::doc_solution ( DocInfo &  doc_info,
ostream &  convergence_file 
)

Doc the solution.

◆ half_circle_domain()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::half_circle_domain
private

Builds the half circle domain.

459 {
460  unsigned boundary_id;
461 
462  // ---------------------------------------------------------------------
463  // >> Boundary 0
464  const unsigned num_vertices_b0 = 2;
465 
466  Vector<Vector <double> > vertices_b0(num_vertices_b0);
467 
468  for (unsigned i = 0; i < num_vertices_b0; i++)
469  vertices_b0[i].resize(2);
470 
471  vertices_b0[0][0] = 0;
472  vertices_b0[0][1] = 0;
473 
474  vertices_b0[1][0] = 2;
475  vertices_b0[1][1] = 0;
476 
477  boundary_id = 0;
478  TriangleMeshPolyLine *boundary0_pt =
479  new TriangleMeshPolyLine(vertices_b0, boundary_id);
480 
481  // ---------------------------------------------------------------------
482  // >> Boundary 1
483  const unsigned num_segments_b1 = 10;
484  double x_centre_b1 = 1.0;
485  double y_centre_b1 = 0.0;
486  double r_circle_b1 = 1.0;
487 
488  Circle *boundary_circle_b1_pt =
489  new Circle(x_centre_b1, y_centre_b1, r_circle_b1);
490 
491  double z_start_b1 = 0.0;
492  double z_end_b1 = MathematicalConstants::Pi;
493 
494  boundary_id = 1;
495  TriangleMeshCurviLine *boundary1_pt =
496  new TriangleMeshCurviLine(boundary_circle_b1_pt,
497  z_start_b1,
498  z_end_b1,
499  num_segments_b1,
500  boundary_id);
501 
502  // ---------------------------------------------------------------------
503  // >> Building the OUTER BOUNDARY
504 
505  // >> Setting up the domain with PolyLines
506 
507  Vector<TriangleMeshCurveSection*> outer_boundary_curve_section_pt(2);
508 
509  outer_boundary_curve_section_pt[0] = boundary0_pt;
510  outer_boundary_curve_section_pt[1] = boundary1_pt;
511 
512  // We have only one outer boundary (one outer polygon)
513  Vector<TriangleMeshClosedCurve *> outer_boundary_pt(1);
514  outer_boundary_pt[0] =
515  new TriangleMeshClosedCurve(outer_boundary_curve_section_pt);
516 
517  // ---------------------------------------------------------------------
518  // Store the domain configuration in the Triangle_mesh_parameters
519  // object
520  Triangle_mesh_parameters.outer_boundary_pt() = outer_boundary_pt;
521 
522 }

References i, BiharmonicTestFunctions2::Pi, and resize().

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

◆ half_circle_domain_with_internal_boundaries()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::half_circle_domain_with_internal_boundaries
private

Builds the half circle with straight internal boundaries.

529 {
530  unsigned boundary_id;
531 
532  // ---------------------------------------------------------------------
533  // >> Boundary 0
534  const unsigned num_vertices_b0 = 6;
535 
536  Vector<Vector <double> > vertices_b0(num_vertices_b0);
537 
538  for (unsigned i = 0; i < num_vertices_b0; i++)
539  vertices_b0[i].resize(2);
540 
541  vertices_b0[0][0] = 0;
542  vertices_b0[0][1] = 0;
543 
544  vertices_b0[1][0] = 7.5;
545  vertices_b0[1][1] = 0;
546 
547  vertices_b0[2][0] = 7.5;
548  vertices_b0[2][1] = 5;
549 
550  vertices_b0[3][0] = 12.5;
551  vertices_b0[3][1] = 5;
552 
553  vertices_b0[4][0] = 12.5;
554  vertices_b0[4][1] = 0;
555 
556  vertices_b0[5][0] = 20;
557  vertices_b0[5][1] = 0;
558 
559  boundary_id = 0;
560  TriangleMeshPolyLine *boundary0_pt =
561  new TriangleMeshPolyLine(vertices_b0, boundary_id);
562 
563  // ---------------------------------------------------------------------
564  // >> Boundary 1
565  const unsigned num_segments = 10;
566  const double x_centre = 10.0;
567  const double y_centre = 0.0;
568  const double r_circle = 10.0;
569 
570  Circle *boundary_circle_pt = new Circle(x_centre, y_centre, r_circle);
571 
572  const double z_start = 0.0;
573  const double z_end = MathematicalConstants::Pi;
574 
575  boundary_id = 1;
576  TriangleMeshCurviLine *boundary1_pt =
577  new TriangleMeshCurviLine(boundary_circle_pt,
578  z_start,
579  z_end,
580  num_segments,
581  boundary_id);
582 
583  // ---------------------------------------------------------------------
584  // ---------------------------------------------------------------------
585  // Internal boundaries (open curves)
586  // ---------------------------------------------------------------------
587  // >> Boundary 2
588  const unsigned num_vertices_b2 = 3;
589  Vector<Vector<double> > verticesb2(num_vertices_b2);
590 
591  for (unsigned i = 0; i < num_vertices_b2; i++)
592  verticesb2[i].resize(2);
593 
594  verticesb2[0][0] = 6;
595  verticesb2[0][1] = 6;
596 
597  verticesb2[1][0] = 7.5;
598  verticesb2[1][1] = 6;
599 
600  verticesb2[2][0] = 9;
601  verticesb2[2][1] = 6;
602 
603  boundary_id = 2;
604  TriangleMeshPolyLine *boundary2_pt =
605  new TriangleMeshPolyLine(verticesb2, boundary_id);
606 
607  // ---------------------------------------------------------------------
608  // >> Boundary 3
609  const unsigned num_vertices_b3 = 3;
610  Vector<Vector<double> > verticesb3(num_vertices_b3);
611 
612  for (unsigned i = 0; i < num_vertices_b3; i++)
613  verticesb3[i].resize(2);
614 
615  verticesb3[0][0] = 9;
616  verticesb3[0][1] = 6;
617 
618  verticesb3[1][0] = 10;
619  verticesb3[1][1] = 6;
620 
621  verticesb3[2][0] = 11;
622  verticesb3[2][1] = 6;
623 
624  boundary_id = 3;
625  TriangleMeshPolyLine *boundary3_pt =
626  new TriangleMeshPolyLine(verticesb3, boundary_id);
627 
628  // ---------------------------------------------------------------------
629  // >> Boundary 4
630  const unsigned num_vertices_b4 = 3;
631  Vector<Vector<double> > verticesb4(num_vertices_b4);
632 
633  for (unsigned i = 0; i < num_vertices_b4; i++)
634  verticesb4[i].resize(2);
635 
636  verticesb4[0][0] = 11;
637  verticesb4[0][1] = 6;
638 
639  verticesb4[1][0] = 12.5;
640  verticesb4[1][1] = 6;
641 
642  verticesb4[2][0] = 14;
643  verticesb4[2][1] = 6;
644 
645  boundary_id = 4;
646  TriangleMeshPolyLine *boundary4_pt =
647  new TriangleMeshPolyLine(verticesb4, boundary_id);
648 
649  // ---------------------------------------------------------------------
650  // >> Boundary 5
651  const unsigned num_vertices_b5 = 3;
652  Vector<Vector<double> > verticesb5(num_vertices_b5);
653 
654  for (unsigned i = 0; i < num_vertices_b5; i++)
655  verticesb5[i].resize(2);
656 
657  verticesb5[0][0] = 7;
658  verticesb5[0][1] = 7;
659 
660  verticesb5[1][0] = 10;
661  verticesb5[1][1] = 7;
662 
663  verticesb5[2][0] = 13;
664  verticesb5[2][1] = 7;
665 
666  boundary_id = 5;
667  TriangleMeshPolyLine *boundary5_pt =
668  new TriangleMeshPolyLine(verticesb5, boundary_id);
669 
670  // ---------------------------------------------------------------------
671  // >> Building the OUTER BOUNDARY
672  Vector<TriangleMeshCurveSection*> outer_boundary_polylines_pt(2);
673 
674  outer_boundary_polylines_pt[0] = boundary0_pt;
675  outer_boundary_polylines_pt[1] = boundary1_pt;
676 
677  // We have only one outer boundary (one outer polygon)
678  Vector<TriangleMeshClosedCurve *> outer_boundary_pt(1);
679  outer_boundary_pt[0] =
680  new TriangleMeshClosedCurve(outer_boundary_polylines_pt);
681 
682  // ---------------------------------------------------------------------
683  // >> Building the OPEN BOUNDARIES
684 
685  // We have two open curves
686  Vector<TriangleMeshOpenCurve *> open_curve_pt(2);
687 
688  // The first open curve is formed by the following boundaries
689  Vector<TriangleMeshCurveSection*> open_curve_one_pt(3);
690  open_curve_one_pt[0] = boundary2_pt;
691  open_curve_one_pt[1] = boundary3_pt;
692  open_curve_one_pt[2] = boundary4_pt;
693 
694  open_curve_pt[0] = new TriangleMeshOpenCurve(open_curve_one_pt);
695 
696  // The second open curve is formed by only one boundary
697  Vector<TriangleMeshCurveSection*> open_curve_two_pt(1);
698  open_curve_two_pt[0] = boundary5_pt;
699 
700  open_curve_pt[1] = new TriangleMeshOpenCurve(open_curve_two_pt);
701 
702  // ---------------------------------------------------------------------
703  // Store the geometry of the domain in the Triangle_mesh_parameters
704  // object
705 
706  // >> Create the TriangleMeshParameters object
707  Triangle_mesh_parameters.outer_boundary_pt() = outer_boundary_pt;
708  // Set the pointer to internal open boundaries
710 
711 }
Definition: unstructured_two_d_mesh_geometry_base.h:1642
Vector< TriangleMeshOpenCurve * > internal_open_curves_pt() const
Helper function for getting the internal open boundaries.
Definition: triangle_mesh.template.h:176

References i, BiharmonicTestFunctions2::Pi, and resize().

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

◆ is_problem_nonlinear() [1/2]

template<class ELEMENT >
bool PoissonProblem< ELEMENT >::is_problem_nonlinear ( ) const
inline

Return the flag to determine whether the problem is being treated as linear or nonlinear

114 {return Problem::Problem_is_nonlinear;}

◆ is_problem_nonlinear() [2/2]

template<class ELEMENT >
bool PoissonProblem< ELEMENT >::is_problem_nonlinear ( ) const
inline

Return the flag to determine whether the problem is being treated as linear or nonlinear

112 {return Problem::Problem_is_nonlinear;}

◆ mesh_pt() [1/15]

template<class ELEMENT >
RefineableRectangularQuadMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh object to the actual mesh type.

120  {
121  return dynamic_cast<RefineableRectangularQuadMesh<ELEMENT>*>(
122  Problem::mesh_pt());
123  }

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

◆ mesh_pt() [2/15]

template<class ELEMENT >
RefineableRectangularQuadMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh object to the actual mesh type.

110  {
111  return dynamic_cast<RefineableRectangularQuadMesh<ELEMENT>*>(
112  Problem::mesh_pt());
113  }

◆ mesh_pt() [3/15]

template<class ELEMENT >
GeompackQuadMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
136  {
137  return dynamic_cast<GeompackQuadMesh<ELEMENT>*>(Problem::mesh_pt());
138  }

◆ mesh_pt() [4/15]

template<class ELEMENT >
TriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

135  {
136  return dynamic_cast<TriangleMesh<ELEMENT>*>(Problem::mesh_pt());
137  }

◆ mesh_pt() [5/15]

template<class ELEMENT >
TriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

135  {
136  return dynamic_cast<TriangleMesh<ELEMENT>*>(Problem::mesh_pt());
137  }

◆ mesh_pt() [6/15]

template<class ELEMENT >
TetgenMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
173  {
174  return dynamic_cast<TetgenMesh<ELEMENT>*>(Problem::mesh_pt());
175  }

◆ mesh_pt() [7/15]

template<class ELEMENT >
TriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

149  {
150  return dynamic_cast<TriangleMesh<ELEMENT>*>(Problem::mesh_pt());
151  }

◆ mesh_pt() [8/15]

template<class ELEMENT >
TriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Access function for the specific mesh.

166  {
167  return dynamic_cast<TriangleMesh<ELEMENT>*>(Problem::mesh_pt());
168  }

◆ mesh_pt() [9/15]

template<class ELEMENT >
RefineableTriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
182  {
183  return dynamic_cast<RefineableTriangleMesh<ELEMENT>*>(Problem::mesh_pt());
184  }

◆ mesh_pt() [10/15]

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

Access function for the specific mesh.

119  {
120  return dynamic_cast<RefineableTriangleMesh<ELEMENT>*>(Problem::mesh_pt());
121  }

◆ mesh_pt() [11/15]

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

Access function for the specific mesh.

119  {
120  return dynamic_cast<RefineableTriangleMesh<ELEMENT>*>(Problem::mesh_pt());
121  }

◆ mesh_pt() [12/15]

template<class ELEMENT >
RefineableRectangularQuadMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline

Overloaded version of the problem's access function to the mesh. Recasts the pointer to the base Mesh object to the actual mesh type.

114  {
115  return dynamic_cast<RefineableRectangularQuadMesh<ELEMENT>*>(
116  Problem::mesh_pt());
117  }

◆ mesh_pt() [13/15]

template<class ELEMENT >
TetgenMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
175  {
176  return dynamic_cast<TetgenMesh<ELEMENT>*>(Problem::mesh_pt());
177  }

◆ mesh_pt() [14/15]

template<class ELEMENT >
SimpleRectangularTriMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
124  {
125  return dynamic_cast<SimpleRectangularTriMesh<ELEMENT>*>(Problem::mesh_pt());
126  }
Simple 2D triangular mesh for TElements.
Definition: simple_rectangular_tri_mesh.template.h:49

◆ mesh_pt() [15/15]

template<class ELEMENT >
SimpleCubicTetMesh<ELEMENT>* PoissonProblem< ELEMENT >::mesh_pt ( )
inline
174  {
175  return dynamic_cast<SimpleCubicTetMesh<ELEMENT>*>(Problem::mesh_pt());
176  }

◆ newton_count() [1/3]

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::newton_count ( )
inline

Report number of Newton iterations taken.

110 {return Newton_count-1;}

◆ newton_count() [2/3]

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::newton_count ( )
inline

Report number of Newton iterations taken.

123 {return Newton_count-1;}

◆ newton_count() [3/3]

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::newton_count ( )
inline

Report number of Newton iterations taken.

127 {return Newton_count-1;}

◆ read_custom_distribution_from_file()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::read_custom_distribution_from_file ( Vector< unsigned > &  output_distribution)

Read the distribution data.

1190 {
1191  // Get the rank of the processor
1192  const unsigned my_rank = this->communicator_pt()->my_rank();
1193 
1194  // Pointer for the file
1195  FILE *file_pt;
1196  // Store the file name
1197  char file_name[500];
1198  sprintf(file_name, "%s/input_distribution_%i.dat",
1200  my_rank);
1201 
1202  oomph_info << "Read custom distribution from file: " << file_name
1203  << std::endl;
1204 
1205  // Try to open the file
1206  file_pt = fopen(file_name, "r");
1207  if (file_pt == 0)
1208  {
1209  // Error, the file could not be opened
1210  std::ostringstream error_stream;
1211  error_stream << "Input file could not be opened: "
1212  << file_name << std::endl;
1213  throw OomphLibError(error_stream.str(),
1216  }
1217 
1218  // Read the number of data
1219  unsigned n_data = 0;
1220  int iret = fscanf(file_pt, "NDATA:(%i)\n", &n_data);
1221  // Increase iret to avoid warning
1222  iret++;
1223  // Read the number of meshes
1224  unsigned tmp_n_mesh = 0;
1225  iret = fscanf(file_pt, "NMESHES:(%i)\n", &tmp_n_mesh);
1226 
1227  // Get the number of meshes in the current problem
1228  const unsigned n_sub_mesh = nsub_mesh();
1229  if (tmp_n_mesh != n_sub_mesh)
1230  {
1231  std::ostringstream error_message;
1232  error_message
1233  << "The number of sub-meshes in the input file is different from the "
1234  << "number of sub-meshes in the current problem\n"
1235  << "N.submeshes in problem: (" << n_sub_mesh << ")\n"
1236  << "N.submeshes in input file (" << tmp_n_mesh << ")";
1237  throw OomphLibError(error_message.str(),
1240  }
1241 
1242  // Clear the output data and resize according to the number of data
1243  // to read
1244  output_distribution.clear();
1245  output_distribution.resize(n_data);
1246 
1247  // Finally, after all test have been successful loop and read over
1248  // the data
1249  for (unsigned e = 0; e < n_data; e++)
1250  {
1251  unsigned counter = 0;
1252  iret = fscanf(file_pt, "ELEMENT(%i):PROCESSOR(%i)\n",
1253  &counter, &output_distribution[e]);
1254  }
1255 
1256  // Close the file
1257  fclose(file_pt);
1258 
1259  oomph_info << "Read custom distribution from file: " << file_name
1260  << " [DONE]" << std::endl;
1261 
1262 }
int my_rank() const
my rank
Definition: communicator.h:176
unsigned nsub_mesh() const
Return number of submeshes.
Definition: problem.h:1323
string file_name
Definition: Particles2023AnalysisHung.py:321
std::string Folder_distribution_file
Definition: two_d_parallel_unstructured_adaptive_poisson.cc:105
OomphInfo oomph_info
Definition: oomph_definitions.cc:319

References e(), Particles2023AnalysisHung::file_name, TestArguments::Folder_distribution_file, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::oomph_info.

◆ run_it()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::run_it ( DocInfo &  doc_info)

Run the probl.

Run the problem.

295 {
296 
297  // Repeated assembly of Jacobian -- stored shape functions only
298  // pay of on subsequent solves.
299  DoubleVector residuals;
300  CRDoubleMatrix jacobian;
301 
302  unsigned n_assemble=10;
303  for (unsigned i=0;i<n_assemble;i++)
304  {
305 
306  // Initialise timers
307  clock_t t_start = clock();
308 
309  // Assemble Jacobian and residual vector
310  get_jacobian(residuals,jacobian);
311 
312  // Finish/doc timing
313  clock_t t_end = clock();
314  double total_time=double(t_end-t_start)/CLOCKS_PER_SEC;
315  cout << " ======================================================= "
316  << std::endl;
317  cout << " Time for " << i << "th jac/residual computation [sec]: "
318  << total_time << std::endl;
319  cout << " ======================================================= "
320  << std::endl;
321  }
322 
323 
324 
325  // Solve as linear problem only
326  this->set_problem_is_linear();
327 
328  // Initialise timers
329  clock_t t_start = clock();
330 
331  // Solve the problem
332  newton_solve();
333 
334  // Finish/doc timing
335  clock_t t_end = clock();
336  double total_time=double(t_end-t_start)/CLOCKS_PER_SEC;
337  cout << "======================================================= " << std::endl;
338  cout << "Total time for Newton solve [sec]: " << total_time << std::endl;
339  cout << "======================================================= " << std::endl;
340 
341  //Output the solution
342  doc_solution(doc_info);
343 
344  //Increment counter for solutions
345  doc_info.number()++;
346 
347  // Give user a chance to check the memory usage
348  cout << std::endl << std::endl;
349  cout << "Execution is paused while problem is in core" << std::endl;
350  pause("Have a look at the memory usage now");
351 
352 
353 }
void set_problem_is_linear()
Treat the problem as being linear.
Definition: optimisation/linear_vs_nonlinear/two_d_poisson.cc:110
void doc_solution(DocInfo &doc_info)
Doc the solution: doc_info contains labels/output directory etc.
Definition: HypreSolver_test.cc:263
Definition: matrices.h:888
Definition: double_vector.h:58
void newton_solve()
Use Newton method to solve the problem.
Definition: problem.cc:8783
virtual void get_jacobian(DoubleVector &residuals, DenseDoubleMatrix &jacobian)
Definition: problem.cc:3890
void pause(std::string message)
Pause and display message.
Definition: oomph_utilities.cc:1265

References i, oomph::DocInfo::number(), and oomph::pause().

◆ save_custom_distribution_to_file()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::save_custom_distribution_to_file ( Vector< unsigned > &  input_distribution)

Saves the custom distribution to file.

Saves the custom (input) distribution to file.

1270 {
1271  // Get the rank of the processor
1272  const unsigned my_rank = this->communicator_pt()->my_rank();
1273 
1274  // Get the number of elements in the custom distribution
1275  const unsigned n_ele_custom_distribution = input_distribution.size();
1276 
1277  // Get the number of meshes in the current problem
1278  const unsigned n_sub_meshes = nsub_mesh();
1279 
1280  // Char for the output file name
1281  char file_name[500];
1282  // Set the name of the file
1283  sprintf(file_name, "DISTRIBUTION/input_distribution_%i.dat", my_rank);
1284 
1285  oomph_info << "Save custom distribution to file: " << file_name
1286  << std::endl;
1287 
1288  // Open the file
1289  FILE* file_pt = fopen(file_name, "w");
1290  if (file_pt != NULL)
1291  {
1292  // Store the number of elements (DATA) in the mesh(es)
1293  fprintf(file_pt, "NDATA:(%i)\n", n_ele_custom_distribution);
1294  // Store the number of meshes
1295  fprintf(file_pt, "NMESHES:(%i)\n", n_sub_meshes);
1296 
1297  // Loop over the elements in the custom distribution and save it to
1298  // file
1299  for (unsigned e = 0; e < n_ele_custom_distribution; e++)
1300  {
1301  fprintf(file_pt, "ELEMENT(%i):PROCESSOR(%i)\n", e, input_distribution[e]);
1302  } // for (i < n_ele_custom_distribution)
1303 
1304  }
1305  else
1306  {
1307  // Error, the file could not be opened
1308  std::ostringstream error_stream;
1309  error_stream << "Output file could not be opened: "
1310  << file_name << std::endl;
1311  throw OomphLibError(error_stream.str(),
1314  }
1315 
1316  // Close the output file
1317  fclose(file_pt);
1318 
1319  oomph_info << "Save custom distribution to file: " << file_name
1320  << " [DONE]" << std::endl;
1321 
1322 }

References e(), Particles2023AnalysisHung::file_name, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::oomph_info.

◆ set_problem_is_linear() [1/2]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::set_problem_is_linear ( )
inline

Treat the problem as being linear.

110 {Problem::Problem_is_nonlinear = false;}

◆ set_problem_is_linear() [2/2]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::set_problem_is_linear ( )
inline

Treat the problem as being linear.

108 {Problem::Problem_is_nonlinear = false;}

◆ set_problem_is_nonlinear() [1/2]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::set_problem_is_nonlinear ( )
inline

Treat the problem as being nonlinear.

107 {Problem::Problem_is_nonlinear = true;}

◆ set_problem_is_nonlinear() [2/2]

template<class ELEMENT >
void PoissonProblem< ELEMENT >::set_problem_is_nonlinear ( )
inline

Treat the problem as being nonlinear.

105 {Problem::Problem_is_nonlinear = true;}

◆ square_domain()

template<class ELEMENT >
void PoissonProblem< ELEMENT >::square_domain
private

Builds the square domain mesh.

344 {
345  // Square domain
346  unsigned boundary_id;
347  const double length = 1.0;
348 
349  // ---------------------------------------------------------------------
350  // >> Boundary 0
351  const unsigned num_vertices_b0 = 2;
352 
353  Vector<Vector <double> > vertices(num_vertices_b0);
354 
355  for (unsigned i = 0; i < num_vertices_b0; i++)
356  {
357  vertices[i].resize(2);
358  }
359 
360  vertices[0][0] = 0;
361  vertices[0][1] = 0;
362 
363  vertices[1][0] = 0;
364  vertices[1][1] = length;
365 
366  boundary_id = 0;
367  TriangleMeshPolyLine *boundary0_pt =
368  new TriangleMeshPolyLine(vertices, boundary_id);
369 
370  // ---------------------------------------------------------------------
371  // >> Boundary 1
372  const unsigned num_vertices_b1 = 2;
373 
374  vertices.resize(num_vertices_b1);
375  for (unsigned i = 0; i < num_vertices_b1; i++)
376  {
377  vertices[i].resize(2);
378  }
379 
380  vertices[0][0] = 0;
381  vertices[0][1] = length;
382 
383  vertices[1][0] = length;
384  vertices[1][1] = length;
385 
386  boundary_id = 1;
387  TriangleMeshPolyLine *boundary1_pt =
388  new TriangleMeshPolyLine(vertices, boundary_id);
389 
390  // ---------------------------------------------------------------------
391  // >> Boundary 2
392  const unsigned num_vertices_b2 = 2;
393 
394  vertices.resize(num_vertices_b2);
395  for (unsigned i = 0; i < num_vertices_b2; i++)
396  {
397  vertices[i].resize(2);
398  }
399 
400  vertices[0][0] = length;
401  vertices[0][1] = length;
402 
403  vertices[1][0] = length;
404  vertices[1][1] = 0;
405 
406  boundary_id = 2;
407  TriangleMeshPolyLine *boundary2_pt =
408  new TriangleMeshPolyLine(vertices, boundary_id);
409 
410  // ---------------------------------------------------------------------
411  // >> Boundary 3
412  const unsigned num_vertices_b3 = 2;
413 
414  vertices.resize(num_vertices_b3);
415  for (unsigned i = 0; i < num_vertices_b3; i++)
416  {
417  vertices[i].resize(2);
418  }
419 
420  vertices[0][0] = length;
421  vertices[0][1] = 0;
422 
423  vertices[1][0] = 0;
424  vertices[1][1] = 0;
425 
426  boundary_id = 3;
427  TriangleMeshPolyLine *boundary3_pt =
428  new TriangleMeshPolyLine(vertices, boundary_id);
429 
430  // ---------------------------------------------------------------------
431  // >> Building the OUTER BOUNDARY
432 
433  // >> Setting up the domain with PolyLines
434 
435  Vector<TriangleMeshCurveSection*> outer_boundary_polylines_pt(4);
436 
437  outer_boundary_polylines_pt[0] = boundary0_pt;
438  outer_boundary_polylines_pt[1] = boundary1_pt;
439  outer_boundary_polylines_pt[2] = boundary2_pt;
440  outer_boundary_polylines_pt[3] = boundary3_pt;
441 
442  // We have only one outer boundary (one outer polygon)
443  Vector<TriangleMeshClosedCurve *> outer_boundary_pt(1);
444  outer_boundary_pt[0] =
445  new TriangleMeshPolygon(outer_boundary_polylines_pt);
446 
447  // ---------------------------------------------------------------------
448  // Store the domain configuration in the Triangle_mesh_parameters
449  // object
450  Triangle_mesh_parameters.outer_boundary_pt() = outer_boundary_pt;
451 
452 }
Class defining a closed polygon for the Triangle mesh generation.
Definition: unstructured_two_d_mesh_geometry_base.h:1451

References i.

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

Member Data Documentation

◆ Bulk_mesh_pt

template<class ELEMENT >
RefineableTriangleMesh<ELEMENT>* PoissonProblem< ELEMENT >::Bulk_mesh_pt
private

◆ Domain_configuration

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::Domain_configuration
private

◆ Element_size

template<class ELEMENT >
double PoissonProblem< ELEMENT >::Element_size
private

◆ Error_estimator_pt

template<class ELEMENT >
Z2ErrorEstimator* PoissonProblem< ELEMENT >::Error_estimator_pt
private

◆ error_estimator_pt

template<class ELEMENT >
Z2ErrorEstimator * PoissonProblem< ELEMENT >::error_estimator_pt

Error estimator.

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

◆ H_power

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::H_power
private

Exponent for h scaling.

◆ My_mesh_pt

template<class ELEMENT >
RefineableTriangleMesh< ELEMENT > * PoissonProblem< ELEMENT >::My_mesh_pt
private

◆ Newton_count

template<class ELEMENT >
unsigned PoissonProblem< ELEMENT >::Newton_count
private

Number of Newton iterations.

◆ Poisson_mesh_pt

template<class ELEMENT >
Mesh* PoissonProblem< ELEMENT >::Poisson_mesh_pt
private

Pointer to mesh with Poisson elements.

◆ Singular_poisson_solution1_element_pt

template<class ELEMENT >
SingularPoissonSolutionElement<ELEMENT>* PoissonProblem< ELEMENT >::Singular_poisson_solution1_element_pt
private

Pointer to the element defining the unknown C1 (Note: eqn element is templated by the wrapped element!)

◆ Singular_poisson_solution2_element_pt

template<class ELEMENT >
SingularPoissonSolutionElement<ELEMENT>* PoissonProblem< ELEMENT >::Singular_poisson_solution2_element_pt
private

Pointer to the element defining the unknown C2 (Note: eqn element is templated by the wrapped element!)

◆ Singular_poisson_solution_mesh_pt

template<class ELEMENT >
Mesh* PoissonProblem< ELEMENT >::Singular_poisson_solution_mesh_pt
private

Pointer to the C mesh associated with the elements defining the unknowns C1 and C2

◆ Source_fct_pt [1/2]

template<class ELEMENT >
PoissonEquations< 3 >::PoissonSourceFctPt PoissonProblem< ELEMENT >::Source_fct_pt
private

Pointer to source function.

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

◆ Source_fct_pt [2/2]

template<class ELEMENT >
PoissonEquations<3>::PoissonSourceFctPt PoissonProblem< ELEMENT >::Source_fct_pt
private

Pointer to source function.

◆ Trace_file

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

Trace file to document norm of solution.

◆ Triangle_mesh_parameters

template<class ELEMENT >
TriangleMeshParameters PoissonProblem< ELEMENT >::Triangle_mesh_parameters
private

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