From f88de494d19a1d0795e04e913bf9af3c3d96b3a2 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 6 Sep 2017 14:38:46 +0200 Subject: [PATCH] Renamed IDAInterface to IDA. --- .../sundials/{ida_interface.h => ida.h} | 42 +++++------ source/sundials/CMakeLists.txt | 2 +- source/sundials/{ida_interface.cc => ida.cc} | 74 +++++++++---------- tests/quick_tests/sundials-ida.cc | 4 +- tests/sundials/harmonic_oscillator_01.cc | 4 +- 5 files changed, 63 insertions(+), 63 deletions(-) rename include/deal.II/sundials/{ida_interface.h => ida.h} (94%) rename source/sundials/{ida_interface.cc => ida.cc} (86%) diff --git a/include/deal.II/sundials/ida_interface.h b/include/deal.II/sundials/ida.h similarity index 94% rename from include/deal.II/sundials/ida_interface.h rename to include/deal.II/sundials/ida.h index da37f7f587..a5e1130d30 100644 --- a/include/deal.II/sundials/ida_interface.h +++ b/include/deal.II/sundials/ida.h @@ -13,8 +13,8 @@ // //--------------------------------------------------------------- -#ifndef dealii_sundials_ida_interface_h -#define dealii_sundials_ida_interface_h +#ifndef dealii_sundials_ida_h +#define dealii_sundials_ida_h #include #ifdef DEAL_II_WITH_SUNDIALS @@ -128,7 +128,7 @@ namespace SUNDIALS * @author Luca Heltai, Alberto Sartori, 2017. */ template > - class IDAInterface + class IDA { public: @@ -176,28 +176,28 @@ namespace SUNDIALS * @param verbose Show output of time steps * @param use_local_tolerances Use local tolerances */ - IDAInterface(const MPI_Comm mpi_comm = MPI_COMM_WORLD, - const double &initial_time = 0.0, - const double &final_time = 1.0, - const double &initial_step_size = 1e-4, - const double &min_step_size = 1e-6, - const double &abs_tol = 1e-6, - const double &rel_tol = 1e-5, - const unsigned int &max_order = 5, - const double &output_period = .1, - const bool &ignore_algebraic_terms_for_errors = true, - const std::string &ic_type = "none", - const std::string &reset_type = "none", - const double &ic_alpha = .33, - const unsigned int &ic_max_iter = 5, - const unsigned int &max_non_linear_iterations = 10, - const bool &verbose = true, - const bool &use_local_tolerances = false); + IDA(const MPI_Comm mpi_comm = MPI_COMM_WORLD, + const double &initial_time = 0.0, + const double &final_time = 1.0, + const double &initial_step_size = 1e-4, + const double &min_step_size = 1e-6, + const double &abs_tol = 1e-6, + const double &rel_tol = 1e-5, + const unsigned int &max_order = 5, + const double &output_period = .1, + const bool &ignore_algebraic_terms_for_errors = true, + const std::string &ic_type = "none", + const std::string &reset_type = "none", + const double &ic_alpha = .33, + const unsigned int &ic_max_iter = 5, + const unsigned int &max_non_linear_iterations = 10, + const bool &verbose = true, + const bool &use_local_tolerances = false); /** * House cleaning. */ - ~IDAInterface(); + ~IDA(); /** * Add all internal parameters to the given ParameterHandler object. When diff --git a/source/sundials/CMakeLists.txt b/source/sundials/CMakeLists.txt index 714f24ba31..437bf07466 100644 --- a/source/sundials/CMakeLists.txt +++ b/source/sundials/CMakeLists.txt @@ -16,7 +16,7 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) SET(_src - ida_interface.cc + ida.cc copy.cc ) diff --git a/source/sundials/ida_interface.cc b/source/sundials/ida.cc similarity index 86% rename from source/sundials/ida_interface.cc rename to source/sundials/ida.cc index cca559a2f2..e5b5c312db 100644 --- a/source/sundials/ida_interface.cc +++ b/source/sundials/ida.cc @@ -14,7 +14,7 @@ //----------------------------------------------------------- -#include +#include #include #ifdef DEAL_II_WITH_SUNDIALS @@ -48,7 +48,7 @@ namespace SUNDIALS int t_dae_residual(realtype tt, N_Vector yy, N_Vector yp, N_Vector rr, void *user_data) { - IDAInterface &solver = *static_cast *>(user_data); + IDA &solver = *static_cast *>(user_data); std::shared_ptr src_yy = solver.create_new_vector(); std::shared_ptr src_yp = solver.create_new_vector(); @@ -79,7 +79,7 @@ namespace SUNDIALS (void) tmp2; (void) tmp3; (void) resp; - IDAInterface &solver = *static_cast *>(IDA_mem->ida_user_data); + IDA &solver = *static_cast *>(IDA_mem->ida_user_data); std::shared_ptr src_yy = solver.create_new_vector(); std::shared_ptr src_yp = solver.create_new_vector(); @@ -107,7 +107,7 @@ namespace SUNDIALS (void) yy; (void) yp; (void) resp; - IDAInterface &solver = *static_cast *>(IDA_mem->ida_user_data); + IDA &solver = *static_cast *>(IDA_mem->ida_user_data); std::shared_ptr dst = solver.create_new_vector(); std::shared_ptr src = solver.create_new_vector(); @@ -122,23 +122,23 @@ namespace SUNDIALS } template - IDAInterface::IDAInterface(const MPI_Comm mpi_comm, - const double &initial_time, - const double &final_time, - const double &initial_step_size, - const double &min_step_size, - const double &abs_tol, - const double &rel_tol, - const unsigned int &max_order, - const double &output_period, - const bool &ignore_algebraic_terms_for_errors, - const std::string &ic_type, - const std::string &reset_type, - const double &ic_alpha, - const unsigned int &ic_max_iter, - const unsigned int &max_non_linear_iterations, - const bool &verbose, - const bool &use_local_tolerances) : + IDA::IDA(const MPI_Comm mpi_comm, + const double &initial_time, + const double &final_time, + const double &initial_step_size, + const double &min_step_size, + const double &abs_tol, + const double &rel_tol, + const unsigned int &max_order, + const double &output_period, + const bool &ignore_algebraic_terms_for_errors, + const std::string &ic_type, + const std::string &reset_type, + const double &ic_alpha, + const unsigned int &ic_max_iter, + const unsigned int &max_non_linear_iterations, + const bool &verbose, + const bool &use_local_tolerances) : initial_time(initial_time), final_time(final_time), initial_step_size(initial_step_size), @@ -163,7 +163,7 @@ namespace SUNDIALS } template - IDAInterface::~IDAInterface() + IDA::~IDA() { if (ida_mem) IDAFree(&ida_mem); @@ -171,7 +171,7 @@ namespace SUNDIALS } template - void IDAInterface::add_parameters(ParameterHandler &prm) + void IDA::add_parameters(ParameterHandler &prm) { prm.add_parameter("Initial step size",initial_step_size); @@ -228,8 +228,8 @@ namespace SUNDIALS template - unsigned int IDAInterface::solve_dae(VectorType &solution, - VectorType &solution_dot) + unsigned int IDA::solve_dae(VectorType &solution, + VectorType &solution_dot) { unsigned int system_size = solution.size(); @@ -335,10 +335,10 @@ namespace SUNDIALS } template - void IDAInterface::reset(const double ¤t_time, - const double ¤t_time_step, - VectorType &solution, - VectorType &solution_dot) + void IDA::reset(const double ¤t_time, + const double ¤t_time_step, + VectorType &solution, + VectorType &solution_dot) { unsigned int system_size; @@ -508,13 +508,13 @@ namespace SUNDIALS } template - void IDAInterface::set_initial_time(const double &t) + void IDA::set_initial_time(const double &t) { initial_time = t; } template - void IDAInterface::set_functions_to_trigger_an_assert() + void IDA::set_functions_to_trigger_an_assert() { create_new_vector = []() ->std::unique_ptr @@ -582,19 +582,19 @@ namespace SUNDIALS }; } - template class IDAInterface >; - template class IDAInterface >; + template class IDA >; + template class IDA >; #ifdef DEAL_II_WITH_MPI #ifdef DEAL_II_WITH_TRILINOS - template class IDAInterface; - template class IDAInterface; + template class IDA; + template class IDA; #endif #ifdef DEAL_II_WITH_PETSC - template class IDAInterface; - template class IDAInterface; + template class IDA; + template class IDA; #endif #endif diff --git a/tests/quick_tests/sundials-ida.cc b/tests/quick_tests/sundials-ida.cc index 2f7c20c58a..de6ad8b982 100644 --- a/tests/quick_tests/sundials-ida.cc +++ b/tests/quick_tests/sundials-ida.cc @@ -13,7 +13,7 @@ // //----------------------------------------------------------- -#include +#include #include #include #include @@ -138,7 +138,7 @@ public: y[1] = kappa; time_stepper.solve_dae(y,y_dot); } - SUNDIALS::IDAInterface > time_stepper; + SUNDIALS::IDA > time_stepper; private: Vector y; Vector y_dot; diff --git a/tests/sundials/harmonic_oscillator_01.cc b/tests/sundials/harmonic_oscillator_01.cc index 8bded1027b..f048672014 100644 --- a/tests/sundials/harmonic_oscillator_01.cc +++ b/tests/sundials/harmonic_oscillator_01.cc @@ -14,7 +14,7 @@ //----------------------------------------------------------- #include "../tests.h" -#include +#include #include #include #include @@ -130,7 +130,7 @@ public: y_dot[0] = kappa; time_stepper.solve_dae(y,y_dot); } - SUNDIALS::IDAInterface > time_stepper; + SUNDIALS::IDA > time_stepper; private: Vector y; Vector y_dot; -- 2.39.5