33 #ifndef OOMPH_PROBLEM_CLASS_HEADER 34 #define OOMPH_PROBLEM_CLASS_HEADER 39 #include <oomph-lib-config.h> 71 class RefineableElement;
74 class PRefineableElement;
80 class GeneralisedElement;
89 class AssemblyHandler;
158 template<
unsigned NNODE_1D>
256 oomph_info <<
"Called empty hook fct with i=" << i << std::endl;
262 {Calculate_dparameter_analytic[parameter_pt] =
true;}
269 std::map<double*,bool>::iterator it =
270 Calculate_dparameter_analytic.find(parameter_pt);
272 if(it!=Calculate_dparameter_analytic.end())
274 Calculate_dparameter_analytic.erase(it);
285 return (Calculate_dparameter_analytic.find(parameter_pt)!=
286 Calculate_dparameter_analytic.end());
292 {Calculate_hessian_products_analytic =
true;}
297 {Calculate_hessian_products_analytic =
false;}
324 const double &epsilon,
325 const unsigned &max_adapt,
326 const unsigned& suppress_resolve_after_spatial_adapt,
328 const bool& shift=
true);
364 bool compressed_row_flag);
377 bool compressed_row_flag);
390 bool compressed_row_flag);
403 bool compressed_row_flag);
416 bool compressed_row_flag);
433 double*
const ¶meter_pt);
441 const unsigned &bifurcation_type,
442 const bool &actually_adapt=
true);
466 const unsigned &el_lo,
const unsigned &el_hi,
485 const bool& do_external_halos);
492 bool& actually_removed_some_data);
677 bool compressed_row_flag);
842 {Doc_imbalance_in_parallel_assembly=
true;}
847 {Doc_imbalance_in_parallel_assembly=
false;}
860 Must_recompute_load_balance_for_assembly=
true;
861 Elemental_assembly_time.clear();
888 unsigned& max_refinement_level_overall);
910 const unsigned& max_refinement_level_overall,
911 std::map<
unsigned,
Vector<unsigned> >& flat_packed_refinement_info_for_root);
929 const unsigned& max_refinement_level_overall,
974 First_el_for_assembly=first_el_for_assembly;
975 Last_el_plus_one_for_assembly=last_el_for_assembly;
976 unsigned n=last_el_for_assembly.size();
977 for (
unsigned i=0;
i<n;
i++)
979 Last_el_plus_one_for_assembly[
i]+=1;
992 unsigned n=last_el_for_assembly.size();
993 for (
unsigned i=0;
i<n;
i++)
995 last_el_for_assembly[
i]-=1;
1080 Empty_actions_before_read_unstructured_meshes_has_been_called=
true;
1094 Empty_actions_after_read_unstructured_meshes_has_been_called=
true;
1097 #ifdef OOMPH_HAS_MPI 1117 double*
const ¶meter_pt)
1152 if(!Use_continuation_timestepper)
1153 {
return Dof_derivative[
i];}
1155 {
return (*(Dof_pt[i]+Dof_derivative_offset));}
1162 if(!Use_continuation_timestepper)
1163 {
return Dof_current[
i];}
1165 {
return (*(Dof_pt[i]+Dof_current_offset));}
1174 std::ostringstream warn_message;
1176 <<
"Warning: We're using the default (empty) set_initial_condition().\n" 1177 <<
"If the initial conditions isn't re-assigned after a mesh adaption \n" 1178 <<
"the initial conditions will represent the interpolation of the \n" 1179 <<
"initial conditions that were assigned on the original coarse mesh.\n";
1181 "Problem::set_initial_condition()",
1182 OOMPH_EXCEPTION_LOCATION);
1191 Default_set_initial_condition_called =
true;
1205 "The global_temporal_error_norm function will be problem-specific:\n";
1207 "Please write your own in your Problem class";
1210 OOMPH_CURRENT_FUNCTION,
1211 OOMPH_EXCEPTION_LOCATION);
1275 if((Sub_mesh_pt.size()==0)&&(imesh==0)) {
return Mesh_pt;}
1276 else {
return Sub_mesh_pt[imesh];}
1284 if((Sub_mesh_pt.size()==0)&&(imesh==0)) {
return Mesh_pt;}
1285 else {
return Sub_mesh_pt[imesh];}
1295 Sub_mesh_pt.push_back(mesh_pt);
1296 return Sub_mesh_pt.size()-1;
1315 #ifdef OOMPH_HAS_MPI 1328 "You are likely to have reached this error from Problem::load_balance()\n";
1330 "The build_mesh() function is problem-specific and must be supplied:\n";
1332 "Please write your own in your Problem class, ensuring that\n";
1334 "any (sub)meshes are built before calling Problem::build_global_mesh().\n";
1336 OOMPH_CURRENT_FUNCTION,
1337 OOMPH_EXCEPTION_LOCATION);
1350 bool report_stats=
false;
1357 input_target_domain_for_local_non_halo_element);
1375 input_target_domain_for_local_non_halo_element);
1384 const bool& report_stats)
1391 input_target_domain_for_local_non_halo_element);
1402 const bool& report_stats,
1404 input_target_domain_for_local_non_halo_element);
1408 {Use_default_partition_in_load_balance=
true;}
1412 {Use_default_partition_in_load_balance=
false;}
1419 const unsigned& max_level_overall);
1455 double time()
const;
1462 if (Time_stepper_pt.size()==0)
1465 OOMPH_CURRENT_FUNCTION,
1466 OOMPH_EXCEPTION_LOCATION);
1468 return Time_stepper_pt[0];
1475 if (Time_stepper_pt.size()==0)
1478 OOMPH_CURRENT_FUNCTION,
1479 OOMPH_EXCEPTION_LOCATION);
1481 return Time_stepper_pt[0];
1486 {
return Time_stepper_pt[
i];}
1496 const bool &preserve_existing_data=
false);
1520 Problem_is_nonlinear = prob_lin;
1562 {Global_data_pt.push_back(global_data_pt);}
1575 {
return Dof_distribution_pt->
nrow();}
1589 {Store_local_dof_pt_in_elements=
true;}
1594 {Store_local_dof_pt_in_elements=
false;}
1603 assign_local_eqn_numbers=
true);
1616 {Discontinuous_element_formulation =
true;}
1623 {Discontinuous_element_formulation =
false;}
1650 #ifdef OOMPH_HAS_MPI 1652 if(Problem_has_been_distributed)
1655 if(Halo_scheme_pt==0)
1657 std::ostringstream error_stream;
1659 <<
"Direct access to global dofs in a distributed problem is only\n" 1660 <<
"possible if the function setup_dof_halo_scheme() has been called.\n" 1661 <<
"You can access local dofs via Problem::dof(i).\n";
1663 OOMPH_CURRENT_FUNCTION,
1664 OOMPH_EXCEPTION_LOCATION);
1670 const unsigned first_row_local =
1672 const unsigned n_row_local =
1676 if((i >= first_row_local) && (i < first_row_local + n_row_local))
1678 return this->Dof_pt[i-first_row_local];
1684 return Halo_dof_pt[Halo_scheme_pt->
local_index(i)];
1691 return this->Dof_pt[
i];
1698 return *(Dof_pt[
i]);
1702 double dof(
const unsigned&
i)
const 1704 return *(Dof_pt[
i]);
1711 double*
dof_pt(
const unsigned &
i)
const {
return Dof_pt[
i];}
1758 std::ostringstream error_stream;
1760 <<
"You must overload this function in your problem class to specify\n" 1761 <<
"which matrices should be summed to give the final Jacobian.";
1763 OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1805 Vector<std::complex<double> > &eigenvalue,
1807 const bool &steady=
true);
1815 Vector<std::complex<double> > &eigenvalue,
1816 const bool &steady=
true)
1827 const double &shift=0.0);
1854 Jacobian_reuse_is_enabled=
true;
1855 Jacobian_has_been_computed=
false;
1861 Jacobian_reuse_is_enabled=
false;
1862 Jacobian_has_been_computed=
false;
1882 Use_globally_convergent_newton_method=
true;
1888 Use_globally_convergent_newton_method=
false;
1895 const double& half_residual_squared_old,
1898 double& half_residual_squared,
1899 const double& stpmax);
1939 virtual void read(std::ifstream& restart_file,
bool& unsteady_restart);
1944 virtual void read(std::ifstream& restart_file)
1946 bool unsteady_restart;
1947 read(restart_file,unsteady_restart);
1952 virtual void dump(std::ofstream& dump_file)
const;
1958 std::ofstream dump_stream(dump_file_name.c_str());
1960 if(!dump_stream.is_open())
1962 std::string err =
"Couldn't open file "+dump_file_name;
1964 OOMPH_CURRENT_FUNCTION);
1970 #ifdef OOMPH_HAS_MPI 1986 const bool& do_external_halos);
2006 const bool& report_stats=
false);
2011 const bool& report_stats=
false);
2016 const bool& report_stats=
false);
2028 const bool& report_stats=
false);
2037 const bool& report_stats);
2167 const bool &block_solve=
true);
2172 double*
const ¶meter_pt,
2174 const bool &block_solve=
true);
2180 double*
const ¶meter_pt,
2183 const bool &block_solve=
true);
2204 const bool &block_solve=
true);
2215 const bool &block_solve=
true);
2228 const double &omega,
2231 const bool &block_solve=
true);
2251 const unsigned &max_adapt);
2271 const unsigned &max_adapt=0);
2283 const unsigned &data_index,
2285 const unsigned &max_adapt=0);
2295 Theta_squared = 1.0;
2296 Sign_of_jacobian = 0;
2297 Continuation_direction = 1.0;
2298 Parameter_derivative = 1.0;
2299 First_jacobian_sign_change=
false;
2300 Arc_length_step_taken=
false;
2301 Dof_derivative.resize(0);
2337 const unsigned &max_adapt,
2339 const bool& shift=
true);
2355 const double &epsilon,
2356 const unsigned &max_adapt,
2358 const bool& shift=
true)
2362 unsigned suppress_resolve_after_spatial_adapt_flag=0;
2367 suppress_resolve_after_spatial_adapt_flag,
2389 const double &epsilon,
2390 const unsigned &max_adapt,
2391 const unsigned& suppress_resolve_after_spatial_adapt_flag,
2393 const bool& shift=
true)
2400 suppress_resolve_after_spatial_adapt_flag,
2415 const double &epsilon);
2427 const double &epsilon,
2428 const bool &shift_values);
2497 unsigned nmesh=std::max(
unsigned(1),
nsub_mesh());
2510 unsigned nmesh=std::max(
unsigned(1),
nsub_mesh());
2564 "Problem::p_refine_uniformly_and_prune()",
2565 OOMPH_EXCEPTION_LOCATION);
2579 "Problem::p_refine_uniformly_and_prune()",
2580 OOMPH_EXCEPTION_LOCATION);
2590 unsigned nmesh=std::max(
unsigned(1),
nsub_mesh());
2604 "Problem::p_refine_uniformly_and_prune()",
2605 OOMPH_EXCEPTION_LOCATION);
2607 unsigned nmesh=std::max(
unsigned(1),
nsub_mesh());
2639 elements_to_be_refined);
2645 elements_to_be_refined_pt);
2651 elements_to_be_refined);
2657 elements_to_be_refined_pt);
2663 elements_to_be_refined);
2669 elements_to_be_refined_pt);
2675 elements_to_be_refined);
2681 elements_to_be_refined_pt);
2687 elements_to_be_refined);
2693 elements_to_be_refined_pt);
2699 elements_to_be_refined);
2705 elements_to_be_refined_pt);
2732 void adapt(
unsigned& n_refined,
unsigned& n_unrefined);
2743 unsigned n_refined, n_unrefined;
2744 adapt(n_refined,n_unrefined);
2754 void p_adapt(
unsigned& n_refined,
unsigned& n_unrefined);
2765 unsigned n_refined, n_unrefined;
2766 p_adapt(n_refined,n_unrefined);
2779 unsigned &n_unrefined,
2794 unsigned n_refined, n_unrefined;
2842 linear_solver_error(false), iterations(0), maxres(0.0) {}
2846 linear_solver_error(Passed_linear_failure), iterations(0), maxres(0.0) {}
2850 linear_solver_error(false), iterations(Passed_iterations),
2851 maxres(Passed_maxres) {}
void refine_uniformly(const unsigned &i_mesh)
Do uniform refinement for submesh i_mesh without documentation.
virtual void build_mesh()
Function to build the Problem's base mesh; this must be supplied by the user if they wish to use the ...
virtual void actions_after_explicit_timestep()
Actions that should be performed after each explicit time step.
A class to handle errors in the Newton solver.
void steady_newton_solve(unsigned const &max_adapt=0)
Solve a steady problem using adaptive Newton's method, but in the context of an overall unstady probl...
Vector< double * > Halo_dof_pt
Storage for the halo degrees of freedom (only required) when accessing via the global equation number...
EigenSolver * Default_eigen_solver_pt
Pointer to the default eigensolver.
Class of matrices containing doubles, and stored as a DenseMatrix<double>, but with solving functiona...
void remove_duplicate_data(Mesh *const &mesh_pt, bool &actually_removed_some_data)
Private helper function to remove repeated data in external haloed elements in specified mesh...
Vector< double > Max_res
Maximum residuals at start and after each newton iteration.
virtual void actions_after_parameter_increase(double *const ¶meter_pt)
Empty virtual function; provides hook to perform actions after the increase in the arclength paramete...
bool is_dparameter_calculated_analytically(double *const ¶meter_pt)
Function to determine whether the parameter derivatives are calculated analytically.
void get_dofs(DoubleVector &dofs) const
Return the vector of dofs, i.e. a vector containing the current values of all unknowns.
void newton_solve()
Use Newton method to solve the problem.
unsigned Sparse_assembly_method
Flag to determine which sparse assembly method to use By default we use assembly by vectors of pairs...
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
double Ds_current
Storage for the current step value.
virtual void get_inverse_mass_matrix_times_residuals(DoubleVector &Mres)
Return the residual vector multiplied by the inverse mass matrix Virtual so that it can be overloaded...
void disable_globally_convergent_newton_method()
disable globally convergent Newton method
Vector< TimeStepper * > Time_stepper_pt
The Vector of time steppers (there could be many different ones in multiphysics problems) ...
void delete_all_external_storage()
Wrapper function to delete external storage for each submesh of the problem.
double * global_dof_pt(const unsigned &i)
Return a pointer to the dof, indexed by global equation number which may be haloed or stored locally...
void p_refine_selected_elements(const Vector< unsigned > &elements_to_be_refined)
p-refine (one and only!) mesh by refining the elements identified by their numbers relative to the pr...
double Relaxation_factor
Relaxation fator for Newton method (only a fractional Newton correction is applied if this is less th...
bool Must_recompute_load_balance_for_assembly
Boolean indicating that the division of elements over processors during the assembly process must be ...
void remove_null_pointers_from_external_halo_node_storage()
Consolidate external halo node storage by removing nulled out pointers in external halo and haloed sc...
void refine_uniformly(const Vector< unsigned > &nrefine_for_mesh)
Refine refineable sub-meshes, each as many times as specified in the vector and rebuild problem...
virtual void actions_before_adapt()
Actions that are to be performed before a mesh adaptation. These might include removing any additiona...
void get_hessian_vector_products(DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
Return the product of the global hessian (derivative of Jacobian matrix with respect to all variables...
virtual ~Problem()
Virtual destructor to clean up memory.
void refine_uniformly_aux(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info, const bool &prune)
Helper function to do compund refinement of (all) refineable (sub)mesh(es) uniformly as many times as...
void adapt_based_on_error_estimates(unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double > > &elemental_error)
Adapt problem: Perform mesh adaptation for (all) refineable (sub)mesh(es), based on the error estimat...
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)
Protected helper function that is used to assemble the Jacobian matrix in the case when the storage i...
LinearSolver * Linear_solver_pt
Pointer to the linear solver for the problem.
void doc_errors()
Get max and min error for all elements in submeshes.
void refine_uniformly_and_prune(DocInfo &doc_info)
Refine (all) refineable (sub)mesh(es) uniformly and rebuild problem; doc refinement process...
virtual void sparse_assemble_row_or_column_compressed_with_maps(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)
Private helper function that is used to assemble the Jacobian matrix in the case when the storage is ...
void refine_uniformly_and_prune(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
Refine refineable sub-meshes, each as many times as specified in the vector and rebuild problem; doc ...
void set_default_first_and_last_element_for_assembly()
Set default first and last elements for parallel assembly of non-distributed problem.
double arc_length_step_solve_helper(double *const ¶meter_pt, const double &ds, const unsigned &max_adapt)
Private helper function that actually contains the guts of the arc-length stepping, parameter_pt is a pointer to the parameter that is traded for the arc-length constraint, ds is the desired arc length and max_adapt is the maximum number of spatial adaptations. The pointer to the parameter may be changed if this is called from the Data-based interface.
double Newton_solver_tolerance
The Tolerance below which the Newton Method is deemed to have converged.
virtual Problem * make_copy()
Make and return a pointer to the copy of the problem. A virtual function that must be filled in by th...
virtual double global_temporal_error_norm()
Function to calculate a global error norm, used in adaptive timestepping to control the change in tim...
void disable_store_local_dof_pt_in_elements()
Insist that local dof pointers are NOT set up in each element when equation numbering takes place (th...
virtual void dump(std::ofstream &dump_file) const
Dump refinement pattern of all refineable meshes and all generic Problem data to file for restart...
double doubly_adaptive_unsteady_newton_solve(const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
Unsteady "doubly" adaptive Newton solve: Does temporal adaptation first, i.e. we try to do a timestep...
static ContinuationStorageScheme Continuation_time_stepper
Storage for the single static continuation timestorage object.
virtual void actions_after_change_in_bifurcation_parameter()
Actions that are to be performed after a change in the parameter that is being varied as part of the ...
virtual void sparse_assemble_row_or_column_compressed_with_lists(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)
Private helper function that is used to assemble the Jacobian matrix in the case when the storage is ...
friend class BlockFoldLinearSolver
virtual void get_eigenproblem_matrices(CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
Get the matrices required by a eigensolver. If the shift parameter is non-zero the second matrix will...
bool First_jacobian_sign_change
Boolean to indicate whether a sign change has occured in the Jacobian.
double & max_residuals()
Access function to max residuals in Newton iterations before giving up.
void synchronise_dofs(const bool &do_halos, const bool &do_external_halos)
Synchronise the degrees of freedom by overwriting the haloed values with their non-halo counterparts ...
unsigned iterations
Max. # of iterations performed when the Newton solver died.
void assign_eigenvector_to_dofs(DoubleVector &eigenvector)
Assign the eigenvector passed to the function to the dofs in the problem so that it can be output by ...
Information for documentation of results: Directory and file number to enable output in the form RESL...
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)
Unsteady "doubly" adaptive Newton solve: Does temporal adaptation first, i.e. we try to do a timestep...
EigenSolver *& eigen_solver_pt()
Return a pointer to the eigen solver object.
std::map< double *, bool > Calculate_dparameter_analytic
Map used to determine whether the derivatives with respect to a parameter should be finite difference...
void enable_mass_matrix_reuse()
Enable recycling of the mass matrix in explicit timestepping schemes. Useful for timestepping on fixe...
virtual void actions_after_read_unstructured_meshes()
Actions that are to be performed before reading in restart data for problems involving unstructured b...
bool Bypass_increase_in_dof_check_during_pruning
Boolean to bypass check of increase in dofs during pruning.
void p_refine_uniformly_and_prune(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
p-refine p-refineable sub-meshes, each as many times as specified in the vector and rebuild problem; ...
unsigned long set_timestepper_for_all_data(TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
Set all problem data to have the same timestepper (timestepper_pt) Return the new number of dofs in t...
NewtonSolverError(unsigned Passed_iterations, double Passed_maxres)
Constructor that passes number of iterations and residuals.
double adaptive_unsteady_newton_solve(const double &dt_desired, const double &epsilon)
Attempt to advance timestep by dt_desired. If the solution fails the timestep will be halved until co...
Class to keep track of discrete/continous time. It is essential to have a single Time object when usi...
void get_first_and_last_element_for_assembly(Vector< unsigned > &first_el_for_assembly, Vector< unsigned > &last_el_for_assembly) const
Get first and last elements for parallel assembly of non-distributed problem.
unsigned ntime_stepper() const
Return the number of time steppers.
void copy(Problem *orig_problem_pt)
Copy Data values, nodal positions etc from specified problem. Note: This is not a copy constructor...
double DTSF_max_increase
Maximum possible increase of dt between time-steps in adaptive schemes.
void set_consistent_pinned_values_for_continuation()
Private helper function that is used to set the appropriate pinned values for continuation.
Vector< Mesh * > Sub_mesh_pt
Vector of pointers to submeshes.
virtual void actions_after_adapt()
Actions that are to be performed after a mesh adaptation.
bool Arc_length_step_taken
Boolean to indicate whether an arc-length step has been taken.
void flush_global_data()
Flush the Problem's global data – resizes container to zero. Data objects are not deleted! ...
void unset_analytic_dparameter(double *const ¶meter_pt)
Function to turn off analytic calculation of the parameter derivatives in continuation and bifurcatio...
void load_balance(DocInfo &doc_info, const bool &report_stats)
Balance the load of a (possibly non-uniformly refined) problem that has already been distributed...
double Max_permitted_error_for_halo_check
Threshold for error throwing in Problem::check_halo_schemes()
bool Discontinuous_element_formulation
Is the problem a discontinuous one, i.e. can the elemental contributions be treated independently...
LinearAlgebraDistribution * Dof_distribution_pt
The distribution of the DOFs in this problem. This object is created in the Problem constructor and s...
Vector< Data * > Global_data_pt
Vector of global data: "Nobody" (i.e. none of the elements etc.) is "in charge" of this Data so it wo...
double *& dof_pt(const unsigned &i)
Pointer to i-th dof in the problem.
void set_explicit_time_stepper_pt(ExplicitTimeStepper *const &explicit_time_stepper_pt)
Set the explicit timestepper for the problem. The function will automatically create or resize the Ti...
Vector< double > Dof_current
Storage for the present values of the variables.
void refine_distributed_base_mesh(Vector< Vector< Vector< unsigned > > > &to_be_refined_on_each_root, const unsigned &max_level_overall)
Load balance helper routine: refine each new base (sub)mesh based upon the elements to be refined wit...
bool Jacobian_reuse_is_enabled
Is re-use of Jacobian in Newton iteration enabled? Default: false.
LinearAlgebraDistribution *const & dof_distribution_pt() const
Return the pointer to the dof distribution (read-only)
bool Shut_up_in_newton_solve
Boolean to indicate if all output is suppressed in Problem::newton_solve(). Defaults to false...
virtual void actions_after_implicit_timestep_and_error_estimation()
Actions that should be performed after each implicit time step. This is needed if your actions_after_...
bool Calculate_hessian_products_analytic
Map used to determine whether the hessian products should be computed using finite differences...
Vector< GeneralisedElement * > Base_mesh_element_pt
Vector to store the correspondence between a root element and its element number within the global me...
Vector< double > elemental_assembly_time()
Return vector of most-recent elemental assembly times (used for load balancing). Zero sized if no Jac...
bool Use_globally_convergent_newton_method
Use the globally convergent newton method.
virtual void read(std::ifstream &restart_file, bool &unsteady_restart)
Read refinement pattern of all refineable meshes and refine them accordingly, then read all Data and ...
void get_derivative_wrt_global_parameter(double *const ¶meter_pt, DoubleVector &result)
Get the derivative of the entire residuals vector wrt a global parameter, used in continuation proble...
double Max_residuals
Maximum desired residual: if the maximum residual exceeds this value, the program will exit...
void describe_dofs(std::ostream &out=*(oomph_info.stream_pt())) const
Function to describe the dofs in terms of the global equation number, i.e. what type of value (nodal ...
void enable_discontinuous_formulation()
Indicate that the problem involves discontinuous elements This allows for a more efficiently assembly...
virtual void sparse_assemble_row_or_column_compressed_with_vectors_of_pairs(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)
Private helper function that is used to assemble the Jacobian matrix in the case when the storage is ...
bool Empty_actions_after_read_unstructured_meshes_has_been_called
Boolean to indicate that empty actions_after_read_unstructured_meshes() function has been called...
unsigned nrow() const
access function to the number of global rows.
double Parameter_current
Storage for the present value of the global parameter.
bool Empty_actions_before_read_unstructured_meshes_has_been_called
Boolean to indicate that empty actions_before_read_unstructured_meshes() function has been called...
unsigned first_row() const
access function for the first row on this processor. If not distributed then this is just zero...
Mesh *& mesh_pt()
Return a pointer to the global mesh.
void p_refine_uniformly(DocInfo &doc_info)
p-refine (all) p-refineable (sub)mesh(es) uniformly and rebuild problem; doc refinement process...
void p_refine_uniformly_aux(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info, const bool &prune)
Helper function to do compund p-refinement of (all) p-refineable (sub)mesh(es) uniformly as many time...
Distributed_problem_matrix_distribution & distributed_problem_matrix_distribution()
accesss function to the distributed matrix distribution method 1 - Automatic - the Problem distributi...
void disable_discontinuous_formulation()
Disable the use of a discontinuous-element formulation. Note that the methods will all still work eve...
void calculate_predictions()
Calculate predictions.
void copy_haloed_eqn_numbers_helper(const bool &do_halos, const bool &do_external_halos)
A private helper function to copy the haloed equation numbers into the halo equation numbers...
void set_dofs(const DoubleVector &dofs)
Set the values of the dofs.
unsigned & max_newton_iterations()
Access function to max Newton iterations before giving up.
void clear_elemental_assembly_time()
Clear storage of most-recent elemental assembly times (used for load balancing). Next load balancing ...
void synchronise_all_dofs()
Perform all required synchronisation in solvers.
Distributed_problem_matrix_distribution Dist_problem_matrix_distribution
The distributed matrix distribution method 1 - Automatic - the Problem distribution is employed...
unsigned unrefine_uniformly()
Refine (all) refineable (sub)mesh(es) uniformly and rebuild problem. Return 0 for success...
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
virtual void actions_after_change_in_global_parameter(double *const ¶meter_pt)
Actions that are to be performed when the global parameter addressed by parameter_pt has been changed...
double Minimum_dt
Minimum desired dt: if dt falls below this value, exit.
virtual void shift_time_values()
Shift all values along to prepare for next timestep.
void refine_uniformly(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
Refine refineable sub-meshes, each as many times as specified in the vector and rebuild problem; doc ...
EigenSolver *const & eigen_solver_pt() const
Return a pointer to the eigen solver object (const version)
void recompute_load_balanced_assembly()
Helper function to re-assign the first and last elements to be assembled by each processor during par...
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt()
bool & time_adaptive_newton_crash_on_solve_fail()
Access function for Time_adaptive_newton_crash_on_solve_fail.
void problem_is_nonlinear(const bool &prob_lin)
Access function to Problem_is_nonlinear.
double & minimum_dt()
Access function to min timestep in adaptive timestepping.
virtual void debug_hook_fct(const unsigned &i)
Hook for debugging. Can be overloaded in driver code; argument allows identification of where we're c...
bool Use_default_partition_in_load_balance
Flag to use "default partition" during load balance. Should only be set to true when run in validatio...
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking()
Virtual function that is used to symmetrise the problem so that the current solution exactly satisfie...
ExplicitTimeStepper * Explicit_time_stepper_pt
Pointer to a single explicit timestepper.
void enable_doc_imbalance_in_parallel_assembly()
Enable doc of load imbalance in parallel assembly of distributed problem.
virtual void read(std::ifstream &restart_file)
Read refinement pattern of all refineable meshes and refine them accordingly, then read all Data and ...
void p_refine_uniformly(const Vector< unsigned > &nrefine_for_mesh)
p-refine p-refineable sub-meshes, each as many times as specified in the vector and rebuild problem ...
NewtonSolverError(const bool &Passed_linear_failure)
Constructor that passes a failure of the linear solver.
void disable_info_in_newton_solve()
Disable the output of information when in the newton solver.
void p_unrefine_uniformly(DocInfo &doc_info)
p-unrefine (all) p-refineable (sub)mesh(es) uniformly and rebuild problem.
bool Mass_matrix_reuse_is_enabled
Is re-use of the mass matrix in explicit timestepping enabled Default:false.
bool & use_predictor_values_as_initial_guess()
Time * time_pt() const
Return a pointer to the global time object (const version).
virtual void sparse_assemble_row_or_column_compressed_with_two_vectors(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)
Private helper function that is used to assemble the Jacobian matrix in the case when the storage is ...
void set_analytic_dparameter(double *const ¶meter_pt)
Function to turn on analytic calculation of the parameter derivatives in continuation and bifurcation...
void add_time_stepper_pt(TimeStepper *const &time_stepper_pt)
Add a timestepper to the problem. The function will automatically create or resize the Time object so...
Mesh * Mesh_pt
The mesh pointer.
void refine_uniformly(DocInfo &doc_info)
Refine (all) refineable (sub)mesh(es) uniformly and rebuild problem; doc refinement process...
bool Bisect_to_find_bifurcation
Boolean to control wheter bisection is used to located bifurcation.
double Continuation_direction
The direction of the change in parameter that will ensure that a branch is followed in one direction ...
bool linear_solver_error
Error in the linear solver.
AssemblyHandler *& assembly_handler_pt()
Return a pointer to the assembly handler object.
Time * Time_pt
Pointer to global time for the problem.
void calculate_continuation_derivatives_helper(const DoubleVector &z)
A function that performs the guts of the continuation derivative calculation in arc length continuati...
unsigned setup_element_count_per_dof()
Function that populates the Element_counter_per_dof vector with the number of elements that contribut...
void disable_jacobian_reuse()
Disable recycling of Jacobian in Newton iteration.
virtual void get_dvaluesdt(DoubleVector &f)
Get the time derivative of all values (using get_inverse_mass_matrix_times_residuals(..) with all time steppers set to steady) e.g. for use in explicit time steps. The approach used is slighty hacky, beware if you have a residual which is non-linear or implicit in the derivative or if you have overloaded get_jacobian(...).
double Numerical_zero_for_sparse_assembly
A tolerance used to determine whether the entry in a sparse matrix is zero. If it is then storage nee...
virtual void get_jacobian(DoubleVector &residuals, SumOfMatrices &jacobian)
Dummy virtual function that must be overloaded by the problem to specify which matrices should be sum...
EigenSolver * Eigen_solver_pt
Pointer to the eigen solver for the problem.
double Desired_proportion_of_arc_length
Proportion of the arc-length to taken by the parameter.
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
unsigned Dof_current_offset
void refine_selected_elements(const Vector< unsigned > &elements_to_be_refined)
Refine (one and only!) mesh by splitting the elements identified by their numbers relative to the pro...
void assign_initial_values_impulsive()
Initialise data and nodal positions to simulate impulsive start from initial configuration/solution.
double & dof(const unsigned &i)
i-th dof in the problem
void disable_doc_imbalance_in_parallel_assembly()
Disable doc of load imbalance in parallel assembly of distributed problem.
double & dof_derivative(const unsigned &i)
Access function to the derivative of the i-th (local) dof with respect to the arc length...
double doubly_adaptive_unsteady_newton_solve_helper(const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt, const bool &first, const bool &shift=true)
Private helper function that actually performs the unsteady "doubly" adaptive Newton solve...
void prune_halo_elements_and_nodes(DocInfo &doc_info, const bool &report_stats)
(Irreversibly) prune halo(ed) elements and nodes, usually after another round of refinement, to get rid of excessively wide halo layers. Note that the current mesh will be now regarded as the base mesh and no unrefinement relative to it will be possible once this function has been called.
double & newton_solver_tolerance()
Access function to tolererance of the Newton solver, i.e. the maximum value of the residuals that wil...
OomphCommunicator * Communicator_pt
The communicator for this problem.
void store_current_dof_values()
Store the current values of the degrees of freedom.
unsigned Sparse_assemble_with_arrays_initial_allocation
the number of elements to initially allocate for a matrix row within the sparse_assembly_with_two_arr...
std::ostream *& stream_pt()
Access function for the stream pointer.
void enable_problem_distributed()
Enable problem distributed.
void set_pinned_values_to_zero()
Set all pinned values to zero. Used to set boundary conditions to be homogeneous in the copy of the p...
void calculate_continuation_derivatives_fd(double *const ¶meter_pt)
A function to calculate the derivatives with respect to the arc-length required for continuation by f...
void explicit_timestep(const double &dt, const bool &shift_values=true)
Take an explicit timestep of size dt and optionally shift any stored values of the time history...
double Theta_squared
Value of the scaling parameter required so that the parameter occupies the desired proportion of the ...
void(* SpatialErrorEstimatorFctPt)(Mesh *&mesh_pt, Vector< double > &elemental_error)
Function pointer for spatial error estimator.
AssemblyHandler *const & assembly_handler_pt() const
Return a pointer to the assembly handler object (const version)
void p_refine_uniformly_and_prune(const Vector< unsigned > &nrefine_for_mesh)
p-refine p-refineable sub-meshes, each as many times as specified in the vector and rebuild problem...
void prune_halo_elements_and_nodes(const bool &report_stats=false)
(Irreversibly) prune halo(ed) elements and nodes, usually after another round of refinement, to get rid of excessively wide halo layers. Note that the current mesh will be now regarded as the base mesh and no unrefinement relative to it will be possible once this function has been called.
double Parameter_derivative
Storage for the derivative of the global parameter wrt arc-length.
bool Doc_time_in_distribute
Protected boolean flag to provide comprehensive timimings during problem distribution. Initialised to false.
int & sign_of_jacobian()
Access function for the sign of the global jacobian matrix. This will be set by the linear solver...
void(* SpatialErrorEstimatorWithDocFctPt)(Mesh *&mesh_pt, Vector< double > &elemental_error, DocInfo &doc_info)
Function pointer for spatial error estimator with doc.
bool Time_adaptive_newton_crash_on_solve_fail
Bool to specify what to do if a Newton solve fails within a time adaptive solve. Default (false) is t...
void reset_assembly_handler_to_default()
Reset the system to the standard non-augemented state.
void get_all_error_estimates(Vector< Vector< double > > &elemental_error)
Return the error estimates computed by (all) refineable (sub)mesh(es) in the elemental_error structur...
double Maximum_dt
Maximum desired dt.
unsigned Sparse_assemble_with_arrays_allocation_increment
the number of elements to add to a matrix row when the initial allocation is exceeded within the spar...
double * bifurcation_parameter_pt() const
Return pointer to the parameter that is used in the bifurcation detection. If we are not tracking a b...
virtual void actions_before_explicit_timestep()
Actions that should be performed before each explicit time step.
bool Mass_matrix_has_been_computed
Has the mass matrix been computed (and can therefore be reused) Default: false.
virtual void actions_after_distribute()
Actions to be performed after a (mesh) distribution.
void p_refine_uniformly(const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
p-refine p-refineable sub-meshes, each as many times as specified in the vector and rebuild problem; ...
Mesh *const & mesh_pt() const
Return a pointer to the global mesh (const version)
unsigned Nnewton_iter_taken
Actual number of Newton iterations taken during the most recent iteration.
void get_flat_packed_refinement_pattern_for_load_balancing(const Vector< unsigned > &old_domain_for_base_element, const Vector< unsigned > &new_domain_for_base_element, const unsigned &max_refinement_level_overall, std::map< unsigned, Vector< unsigned > > &flat_packed_refinement_info_for_root)
Get flat-packed refinement pattern for each root element in current mesh (labeled by unique number of...
std::map< GeneralisedElement *, unsigned > Base_mesh_element_number_plus_one
Map which stores the correspondence between a root element and its element number (plus one) within t...
LinearSolver * mass_matrix_solver_for_explicit_timestepper_pt() const
unsigned nrow_local() const
access function for the num of local rows on this processor. If no MPI then Nrow is returned...
void reset_arc_length_parameters()
Reset the "internal" arc-length continuation parameters, so as to allow continuation in another param...
DoubleVectorWithHaloEntries Element_count_per_dof
Counter that records how many elements contribute to each dof. Used to determine the (discrete) arc-l...
void solve_eigenproblem(const unsigned &n_eval, Vector< std::complex< double > > &eigenvalue, const bool &steady=true)
Solve an eigenproblem as assembled by EigenElements, but only return the eigenvalues, not the eigenvectors. The boolean flag (default true) is used to specify whether the weighted mass-matrix terms from the timestepping scheme should be included in the jacobian.
double & maximum_dt()
Access function to max timestep in adaptive timestepping.
Time *& time_pt()
Return a pointer to the global time object.
A class that represents a collection of data; each Data object may contain many different individual ...
Mesh *const & mesh_pt(const unsigned &imesh) const
Return a pointer to the i-th submesh (const version)
void activate_pitchfork_tracking(double *const ¶meter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
Turn on pitchfork tracking using the augmented system specified in the PitchForkHandler class...
void activate_fold_tracking(double *const ¶meter_pt, const bool &block_solve=true)
Turn on fold tracking using the augmented system specified in the FoldHandler class. After a call to this function subsequent calls of the standard solution methods will converge to a fold (limit) point at a particular value of the variable addressed by parameter_pt. The system may not converge if the initial guess is sufficiently poor or, alternatively, if finite differencing is used to calculate the jacobian matrix in the elements. If the boolean flag block_solver is true (the default) then a block factorisation is used to solve the augmented system which is both faster and uses less memory.
NewtonSolverError()
Default constructor, does nothing.
virtual void get_residuals(DoubleVector &residuals)
Return the fully-assembled residuals Vector for the problem: Virtual so it can be overloaded in for m...
TimeStepper *& time_stepper_pt()
Access function for the pointer to the first (presumably only) timestepper.
bool Pause_at_end_of_sparse_assembly
Protected boolean flag to halt program execution during sparse assemble process to assess peak memory...
void setup_dof_halo_scheme()
Function that is used to setup the halo scheme.
void enable_info_in_newton_solve()
Enable the output of information when in the newton solver (Default)
Vector< unsigned > First_el_for_assembly
First element to be assembled by given processor for non-distributed problem (only kept up to date wh...
void get_fd_jacobian(DoubleVector &residuals, DenseMatrix< double > &jacobian)
Return the fully-assembled Jacobian and residuals, generated by finite differences.
void set_first_and_last_element_for_assembly(Vector< unsigned > &first_el_for_assembly, Vector< unsigned > &last_el_for_assembly)
Manually set first and last elements for parallel assembly of non-distributed problem.
Distributed_problem_matrix_distribution
enum for distribution of distributed jacobians. 1 - Automatic - the Problem distribution is employed...
LinearSolver * Default_linear_solver_pt
Pointer to the default linear solver.
void p_adapt()
p-adapt problem: Perform mesh adaptation for (all) refineable (sub)mesh(es), based on their own error...
void p_refine_uniformly(const unsigned &i_mesh)
Do uniform p-refinement for submesh i_mesh without documentation.
Vector< double > Elemental_assembly_time
Storage for assembly times (used for load balancing)
void p_refine_uniformly()
p-refine (all) p-refineable (sub)mesh(es) uniformly and rebuild problem
int Sign_of_jacobian
Storage for the sign of the global Jacobian.
A class that is used to define the functions used to assemble the elemental contributions to the resi...
virtual void sparse_assemble_row_or_column_compressed_with_two_arrays(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)
Private helper function that is used to assemble the Jacobian matrix in the case when the storage is ...
double & dof_current(const unsigned &i)
Access function to the current value of the i-th (local) dof at the start of a continuation step...
static bool Suppress_warning_about_actions_before_read_unstructured_meshes
Flag to allow suppression of warning messages re reading in unstructured meshes during restart...
bool Use_continuation_timestepper
Boolean to control original or new storage of dof stuff.
virtual void actions_before_newton_solve()
Any actions that are to be performed before a complete Newton solve (e.g. adjust boundary conditions)...
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
the number of elements in each row of a compressed matrix in the previous matrix assembly.
void disable_mass_matrix_reuse()
Turn off recyling of the mass matrix in explicit timestepping schemes.
Vector< double > * Saved_dof_pt
Pointer to vector for backup of dofs.
LinearSolver *const & linear_solver_pt() const
Return a pointer to the linear solver object (const version)
GeneralisedTimestepper used to store the arclength derivatives and pervious solutions required in con...
void get_my_eqns(AssemblyHandler *const &assembly_handler_pt, const unsigned &el_lo, const unsigned &el_hi, Vector< unsigned > &my_eqns)
Helper method that returns the (unique) global equations to which the elements in the range el_lo to ...
void get_data_to_be_sent_during_load_balancing(const Vector< unsigned > &element_domain_on_this_proc, Vector< int > &send_n, Vector< double > &send_data, Vector< int > &send_displacement, Vector< unsigned > &old_domain_for_base_element, Vector< unsigned > &new_domain_for_base_element, unsigned &max_refinement_level_overall)
Load balance helper routine: Get data to be sent to other processors during load balancing and other ...
bool does_pointer_correspond_to_problem_data(double *const ¶meter_pt)
Return a boolean flag to indicate whether the pointer parameter_pt refers to values stored in a Data ...
double Timestep_reduction_factor_after_nonconvergence
What it says: If temporally adaptive Newton solver fails to to converge, reduce timestep by this fact...
void check_halo_schemes()
Check the halo/haloed node/element schemes.
void initialise_dt(const double &dt)
Set all timesteps to the same value, dt, and assign weights for all timesteppers in the problem...
double FD_step_used_in_get_hessian_vector_products
unsigned local_index(const unsigned &global_eqn)
Return the local index associated with the global equation.
unsigned long ndof() const
Return the number of dofs.
unsigned add_sub_mesh(Mesh *const &mesh_pt)
Add a submesh to the problem and return its number, i, by which it can be accessed via mesh_pt(i)...
void unset_default_partition_in_load_balance()
Do not use the default partition in the load balance.
A class for compressed column matrices that store doubles.
void calculate_continuation_derivatives_fd_helper(double *const ¶meter_pt)
A function that performs the guts of the continuation derivative calculation in arc-length continuati...
virtual void get_jacobian(DoubleVector &residuals, DenseDoubleMatrix &jacobian)
Return the fully-assembled Jacobian and residuals for the problem Interface for the case when the Jac...
bool Keep_temporal_error_below_tolerance
Boolean to decide if a timestep is to be rejected if the error estimate post-solve (computed by globa...
void disable_problem_distributed()
Disable problem distributed.
void add_eigenvector_to_dofs(const double &epsilon, const DoubleVector &eigenvector)
Add the eigenvector passed to the function scaled by the constat epsilon to the dofs in the problem s...
void disable_doc()
Disable documentation.
double maxres
Max. residual when Newton solver died.
void flush_sub_meshes()
Flush the problem's collection of sub-meshes. Must be followed by call to rebuild_global_mesh().
Problem()
Constructor: Allocate space for one time stepper and set all pointers to NULL and set defaults for al...
double arc_length_step_solve(double *const ¶meter_pt, const double &ds, const unsigned &max_adapt=0)
Solve a steady problem using arc-length continuation, when the parameter that becomes a variable corr...
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
bool jacobian_reuse_is_enabled()
Is recycling of Jacobian in Newton iteration enabled?
void send_data_to_be_sent_during_load_balancing(Vector< int > &send_n, Vector< double > &send_data, Vector< int > &send_displacement)
Load balance helper routine: Send data to other processors during load balancing. ...
Mesh *& mesh_pt(const unsigned &imesh)
Return a pointer to the i-th submesh. If there are no submeshes, the 0-th submesh is the global mesh ...
bool Bifurcation_detection
Boolean to control bifurcation detection via determinant of Jacobian.
bool Use_finite_differences_for_continuation_derivatives
Assembly_method
Enumerated flags to determine which sparse assembly method is used.
void refine_uniformly_and_prune(const Vector< unsigned > &nrefine_for_mesh)
Refine refineable sub-meshes, each as many times as specified in the vector and rebuild problem...
Problem(const Problem &dummy)
Broken copy constructor.
void operator=(const Problem &)
Broken assignment operator.
bool Default_set_initial_condition_called
Has default set_initial_condition function been called? Default: false.
bool Jacobian_has_been_computed
Has a Jacobian been computed (and can therefore be re-used if required)? Default: false...
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Vector< double > Dof_derivative
Storage for the derivative of the problem variables wrt arc-length.
unsigned Max_newton_iterations
Maximum number of Newton iterations.
void load_balance(const bool &report_stats)
Balance the load of a (possibly non-uniformly refined) problem that has already been distributed...
Data *& global_data_pt(const unsigned &i)
Return a pointer to the the i-th global data object.
void unsteady_newton_solve(const double &dt)
Advance time by dt and solve by Newton's method. This version always shifts time values.
void bifurcation_adapt_helper(unsigned &n_refined, unsigned &n_unrefined, const unsigned &bifurcation_type, const bool &actually_adapt=true)
A function that is used to adapt a bifurcation-tracking problem, which requires separate interpolatio...
unsigned nglobal_data() const
Return the number of global data values.
virtual void partition_global_mesh(Mesh *&global_mesh_pt, DocInfo &doc_info, Vector< unsigned > &element_domain, const bool &report_stats=false)
Vector< unsigned > distribute(const Vector< unsigned > &element_partition, DocInfo &doc_info, const bool &report_stats=false)
Distribute the problem and doc, using the specified partition; returns a vector which details the par...
bool Use_predictor_values_as_initial_guess
Use values from the time stepper predictor as an initial guess.
void p_refine_uniformly_and_prune(DocInfo &doc_info)
p-refine (all) p-refineable (sub)mesh(es) uniformly and rebuild problem; doc refinement process...
unsigned newton_solve_continuation(double *const ¶meter_pt)
Perform a basic arc-length continuation step using Newton's method. Returns number of Newton steps ta...
void refine_uniformly()
Refine (all) refineable (sub)mesh(es) uniformly and rebuild problem.
void build_global_mesh()
Build the global mesh by combining the all the submeshes. Note: The nodes boundary information refers...
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Assign all equation numbers for problem: Deals with global data (= data that isn't attached to any el...
virtual void actions_before_newton_step()
Any actions that are to be performed before each individual Newton step. Most likely to be used for d...
AssemblyHandler * Default_assembly_handler_pt
Pointer to the default assembly handler.
bool Always_take_one_newton_step
Boolean to indicate whether a Newton step should be taken even if the initial residuals are below the...
void setup_base_mesh_info_after_pruning()
Helper function to re-setup the Base_mesh enumeration (used during load balancing) after pruning...
Vector< double * > Dof_pt
Vector of pointers to dofs.
void load_balance()
Balance the load of a (possibly non-uniformly refined) problem that has already been distributed...
DoubleVectorHaloScheme * Halo_scheme_pt
Pointer to the halo scheme for any global vectors that have the Dof_distribution. ...
virtual void set_initial_condition()
Set initial condition (incl previous timesteps). We need to establish this interface because I...
bool problem_has_been_distributed()
Access to Problem_has_been_distributed flag.
virtual void actions_before_newton_convergence_check()
Any actions that are to be performed before the residual is checked in the Newton method...
double DTSF_min_decrease
Minimum allowed decrease of dt between time-steps in adaptive schemes. Lower scaling values will reje...
bool mass_matrix_reuse_is_enabled()
Return whether the mass matrix is being reused.
virtual void actions_before_read_unstructured_meshes()
Actions that are to be performed before reading in restart data for problems involving unstructured b...
unsigned self_test()
Self-test: Check meshes and global data. Return 0 for OK.
A vector in the mathematical sense, initially developed for linear algebra type applications. If MPI then this vector can be distributed - its distribution is described by the LinearAlgebraDistribution object at Distribution_pt. Data is stored in a C-style pointer vector (double*)
void adapt_based_on_error_estimates(Vector< Vector< double > > &elemental_error)
Adapt problem: Perform mesh adaptation for (all) refineable (sub)mesh(es), based on the error estimat...
virtual void actions_before_distribute()
Actions to be performed before a (mesh) distribution.
bool are_hessian_products_calculated_analytically()
Function to determine whether the hessian products are calculated analytically.
LinearSolver * Mass_matrix_solver_for_explicit_timestepper_pt
bool Problem_is_nonlinear
Boolean flag indicating if we're dealing with a linear or nonlinear Problem – if set to false the Ne...
void get_bifurcation_eigenfunction(Vector< DoubleVector > &eigenfunction)
Return the eigenfunction calculated as part of a bifurcation tracking process. If we are not tracking...
long synchronise_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Classify any non-classified nodes into halo/haloed and synchronise equation numbers. Return the total number of degrees of freedom in the overall problem.
unsigned nsub_mesh() const
Return number of submeshes.
bool Store_local_dof_pt_in_elements
Boolean to indicate whether local dof pointers should be stored in the elements.
virtual void actions_after_newton_step()
Any actions that are to be performed after each individual Newton step. Most likely to be used for di...
void get_all_halo_data(std::map< unsigned, double *> &map_of_halo_data)
Get pointers to all possible halo data indexed by global equation number in a map.
AssemblyHandler * Assembly_handler_pt
double dof(const unsigned &i) const
i-th dof in the problem (const version)
void activate_bifurcation_tracking(double *const ¶meter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
Activate generic bifurcation tracking for a single (real) eigenvalue where the initial guess for the ...
unsigned Desired_newton_iterations_ds
The desired number of Newton Steps to reach convergence at each step along the arc.
void calculate_continuation_derivatives(double *const ¶meter_pt)
A function to calculate the derivatives wrt the arc-length. This version of the function actually doe...
void activate_hopf_tracking(double *const ¶meter_pt, const bool &block_solve=true)
Turn on Hopf bifurcation tracking using the augmented system specified in the HopfHandler class...
ExplicitTimeStepper *& explicit_time_stepper_pt()
Return a pointer to the explicit timestepper.
A Base class for explicit timesteppers.
void deactivate_bifurcation_tracking()
Deactivate all bifuraction tracking, by reseting the assembly handler to the default.
void unset_analytic_hessian_products()
Function to turn off analytic calculation of the parameter derivatives in continuation and bifurcatio...
virtual void actions_after_newton_solve()
Any actions that are to be performed after a complete Newton solve, e.g. post processing. CAREFUL: This step should (and if the FD-based LinearSolver FD_LU is used, must) only update values that are pinned!
Vector< Problem * > Copy_of_problem_pt
Vector of pointers to copies of the problem used in adaptive bifurcation tracking problems (ALH: TEMP...
unsigned Parallel_sparse_assemble_previous_allocation
The amount of data allocated during the previous parallel sparse assemble. Used to optimise the next ...
const OomphCommunicator * communicator_pt() const
access function to the oomph-lib communicator, const version
void solve_eigenproblem(const unsigned &n_eval, Vector< std::complex< double > > &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
Get derivative of an element in the problem wrt a global parameter, used in continuation problems...
void parallel_sparse_assemble(const LinearAlgebraDistribution *const &dist_pt, Vector< int * > &column_or_row_index, Vector< int * > &row_or_column_start, Vector< double * > &value, Vector< unsigned > &nnz, Vector< double * > &residuals)
Helper method to assemble CRDoubleMatrices from distributed on multiple processors.
void enable_store_local_dof_pt_in_elements()
Insist that local dof pointers are set up in each element when equation numbering takes place...
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Vector< unsigned > Last_el_plus_one_for_assembly
Last element (plus one) to be assembled by given processor for non-distributed problem (only kept up ...
A class for compressed row matrices. This is a distributable object.
void add_global_data(Data *const &global_data_pt)
Add Data to the Problem's global data – the Problem will perform equation numbering etc...
bool Problem_has_been_distributed
Has the problem been distributed amongst multiple processors?
LinearAlgebraDistribution *& distribution_pt()
Return the pointer to the distirbution used to setup the halo information.
void globally_convergent_line_search(const Vector< double > &x_old, const double &half_residual_squared_old, DoubleVector &gradient, DoubleVector &newton_dir, double &half_residual_squared, const double &stpmax)
Line search helper for globally convergent Newton method.
virtual void actions_after_implicit_timestep()
Actions that should be performed after each implicit time step. This is needed when one wants to solv...
void enable_jacobian_reuse()
Enable recycling of Jacobian in Newton iteration (if the linear solver allows it). Useful for linear problems with constant Jacobians or nonlinear problems where you're willing to risk the trade-off between faster solve times and degraded Newton convergence rate.
void send_refinement_info_helper(Vector< unsigned > &old_domain_for_base_element, Vector< unsigned > &new_domain_for_base_element, const unsigned &max_refinement_level_overall, std::map< unsigned, Vector< unsigned > > &refinement_info_for_root_local, Vector< Vector< Vector< unsigned > > > &refinement_info_for_root_elements)
Send refinement information between processors.
bool Doc_imbalance_in_parallel_assembly
Boolean to switch on assessment of load imbalance in parallel assembly of distributed problem...
void set_default_partition_in_load_balance()
Set the use of the default partition in the load balance.
void enable_globally_convergent_newton_method()
enable globally convergent Newton method
double * dof_pt(const unsigned &i) const
Pointer to i-th dof in the problem (const version)
void restore_dof_values()
Restore the stored values of the degrees of freedom.
void adapt()
Adapt problem: Perform mesh adaptation for (all) refineable (sub)mesh(es), based on their own error e...
void dump(const std::string &dump_file_name) const
Dump refinement pattern of all refineable meshes and all generic Problem data to file for restart...
double Minimum_dt_but_still_proceed
If Minimum_dt_but_still_proceed positive, then dt will not be reduced below this value during adaptiv...
void set_analytic_hessian_products()
Function to turn on analytic calculation of the parameter derivatives in continuation and bifurcation...
void rebuild_global_mesh()
If one of the submeshes has changed (e.g. by mesh adaptation) we need to update the global mesh...
double & time()
Return the current value of continuous time.
TimeStepper *& time_stepper_pt(const unsigned &i)
Return a pointer to the i-th timestepper.
virtual void actions_before_implicit_timestep()
Actions that should be performed before each implicit time step. This is needed when one wants to sol...
bool Scale_arc_length
Boolean to control whether arc-length should be scaled.
double Minimum_ds
Minimum desired value of arc-length.
void add_to_dofs(const double &lambda, const DoubleVector &increment_dofs)
Add lambda x incremenet_dofs[l] to the l-th dof.
unsigned Dof_derivative_offset
const TimeStepper * time_stepper_pt() const
Access function for the pointer to the first (presumably only) timestepper.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
void bifurcation_adapt_doc_errors(const unsigned &bifurcation_type)
A function that is used to document the errors used in the adaptive solution of bifurcation problems...