18 #include "libmesh/adaptive_time_solver.h"    19 #include "libmesh/diff_system.h"    20 #include "libmesh/dof_map.h"    21 #include "libmesh/numeric_vector.h"    22 #include "libmesh/no_solution_history.h"    25 #include "libmesh/system_norm.h"    26 #include "libmesh/enum_norm_type.h"    36     target_tolerance(1.e-3),
    41     completed_timestep_size(s.deltat),
    42     global_tolerance(true)
   119   old_nonlinear_soln = nonlinear_solution;
   141    std::string old_adjoint_solution_name = 
"_old_adjoint_solution";
   142    old_adjoint_solution_name+= std::to_string(i);
   145    old_adjoint_solution_i = adjoint_solution_i;
 virtual Real calculate_norm(System &, NumericVector< Number > &)
A helper function to calculate error norms. 
Real time
For time-dependent problems, this is the time t at the beginning of the current timestep. 
Real completed_timestep_size
The adaptive time solver's have two notions of deltat. 
This class provides all data required for a physics package (e.g. 
virtual bool side_residual(bool get_jacobian, DiffContext &) override
This method is passed on to the core_time_solver. 
SystemNorm component_norm
Error calculations are done in this norm, DISCRETE_L2 by default. 
unsigned int n_qois() const
Number of currently active quantities of interest. 
virtual void adjoint_advance_timestep() override
This method advances the adjoint solution to the previous timestep, after an adjoint_solve() has been...
virtual Real error_order() const override
This method is passed on to the core_time_solver. 
virtual std::unique_ptr< DiffSolver > & diff_solver() override
An implicit linear or nonlinear solver to use at each timestep. 
The libMesh namespace provides an interface to certain functionality in the library. 
AdaptiveTimeSolver(sys_type &s)
Constructor. 
This class provides a specific system class. 
sys_type & _system
A reference to the system we are solving. 
Generic class from which first order UnsteadySolvers should subclass. 
std::shared_ptr< NumericVector< Number > > old_local_nonlinear_solution
Serial vector of _system.get_vector("_old_nonlinear_solution") This is a shared_ptr so that it can be...
'Save nothing' subclass of Solution History, this is the default. 
Real deltat
For time-dependent problems, this is the amount delta t to advance the solution in time...
Manages consistently variables, degrees of freedom, and coefficient vectors. 
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values. 
Real calculate_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
virtual bool nonlocal_residual(bool get_jacobian, DiffContext &) override
This method is passed on to the core_time_solver. 
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_solution_history(const SolutionHistory &_solution_history)
A setter function users will employ if they need to do something other than save no solution history...
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
NumericVector< Number > & get_adjoint_solution(unsigned int i=0)
virtual ~AdaptiveTimeSolver()
Destructor. 
virtual void reinit() override
The reinitialization function. 
virtual void retrieve_timestep() override
This method retrieves all the stored solutions at the current system.time. 
virtual void advance_timestep() override
This method advances the solution to the next timestep, after a solve() has been performed. 
virtual bool element_residual(bool get_jacobian, DiffContext &) override
This method is passed on to the core_time_solver. 
const DofMap & get_dof_map() const
std::unique_ptr< UnsteadySolver > core_time_solver
This object is used to take timesteps. 
virtual std::unique_ptr< LinearSolver< Number > > & linear_solver() override
An implicit linear solver to use for adjoint and sensitivity problems. 
const std::vector< dof_id_type > & get_send_list() const
SolutionHistory & get_solution_history()
A getter function that returns a reference to the solution history object owned by TimeSolver...
bool first_adjoint_step
A bool that will be true the first time adjoint_advance_timestep() is called, (when the primal soluti...
virtual void init() override
The initialization function. 
const NumericVector< Number > & get_vector(std::string_view vec_name) const
bool first_solve
A bool that will be true the first time solve() is called, and false thereafter. 
virtual void localize(std::vector< T > &v_local) const =0
Creates a copy of the global vector in the local vector v_local.