16 #ifndef _d2k_ida_interface_h 17 #define _d2k_ida_interface_h 19 #include <deal2lkit/config.h> 29 #ifdef D2K_WITH_SUNDIALS 35 #include <ida/ida_spils.h> 36 #include <ida/ida_spgmr.h> 37 #include <ida/ida_spbcgs.h> 38 #include <ida/ida_sptfqmr.h> 39 #include <nvector/nvector_serial.h> 40 #include <sundials/sundials_math.h> 41 #include <sundials/sundials_types.h> 43 #ifdef DEAL_II_WITH_MPI 133 template<
typename VEC=Vector<
double> >
138 #ifdef DEAL_II_WITH_MPI 143 const MPI_Comm mpi_comm = MPI_COMM_WORLD);
182 std::function<int(
const double t,
190 std::function<int(
const double t,
203 std::function<void (
const double t,
213 std::function<bool (
const double t,
311 #ifdef DEAL_II_WITH_MPI bool verbose
Show the progress of time steps.
Interface to SUNDIALS IDA library.
N_Vector yp
Ida solution derivative vector.
std::function< bool(const double t, VEC &sol, VEC &sol_dot)> solver_should_restart
Evaluate wether the mesh should be refined or not.
unsigned int local_system_size
N_Vector diff_id
Ida differential components vector.
A parameter acceptor base class.
unsigned int solve_dae(VEC &solution, VEC &solution_dot)
Evolve.
N_Vector yy
Ida solution vector.
static ParameterHandler prm
Static parameter.
~IDAInterface()
House cleaning.
std::string reset_type
Type of conditions to be used after a solver restart.
void set_initial_time(const double &t)
Set initial time equal to t disregarding what is written in the parameter file.
bool is_initialized
Initialization flag.
double rel_tol
Relative error tolerance for adaptive time stepping.
double ic_alpha
Alpha to use in Newton method for IC calculation.
void reset_dae(const double t, VEC &y, VEC &yp, double h, bool first_step)
Clear internal memory, and start with clean objects.
unsigned int max_order
Maximum order of BDF.
double min_step_size
Minimum step size.
std::function< VEC &()> get_local_tolerances
Return a vector whose components are the weights used by IDA to compute the vector norm...
double final_time
Final time.
double initial_step_size
Initial step size.
ConditionalOStream pcout
Output stream.
std::function< void(const double t, const VEC &sol, const VEC &sol_dot, const unsigned int step_number)> output_step
Store solutions to file.
virtual void declare_parameters(ParameterHandler &prm)
Declare parameters for this class to function properly.
unsigned int max_non_linear_iterations
Maximum number of iterations for Newton method during time advancement.
std::function< VEC &()> differential_components
Return a vector whose component are 1 if the corresponding dof is differential, 0 if algebraic...
bool use_local_tolerances
Use local tolerances when computing absolute tolerance.
std::string ic_type
Type of initial conditions.
std::function< int(const double t, const VEC &y, const VEC &y_dot, VEC &res)> residual
Compute residual.
double abs_tol
Absolute error tolerance for adaptive time stepping.
bool ignore_algebraic_terms_for_errors
Ignore algebraic terms for errors.
std::function< int(const VEC &rhs, VEC &dst)> solve_jacobian_system
Solve linear system.
std::function< int(const double t, const VEC &y, const VEC &y_dot, const double alpha)> setup_jacobian
Compute Jacobian.
IDAInterface(const std::string name="", const MPI_Comm mpi_comm=MPI_COMM_WORLD)
Constructor for the IDAInterface class.
void * ida_mem
Ida memory object.
void set_functions_to_trigger_an_assert()
This function is executed at construction time to set the std::function above to trigger an assert if...
unsigned ic_max_iter
Maximum number of iterations for Newton method in IC calculation.
double outputs_period
Seconds between each output.
double initial_time
Initial time for the ode.
N_Vector abs_tolls
Ida absolute tolerances vector.
std::function< shared_ptr< VEC >)> create_new_vector
Return a shared_ptr<VEC>.