]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Renamed IDAInterface to IDA.
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 6 Sep 2017 12:38:46 +0000 (14:38 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Fri, 15 Sep 2017 12:39:45 +0000 (14:39 +0200)
include/deal.II/sundials/ida.h [moved from include/deal.II/sundials/ida_interface.h with 94% similarity]
source/sundials/CMakeLists.txt
source/sundials/ida.cc [moved from source/sundials/ida_interface.cc with 86% similarity]
tests/quick_tests/sundials-ida.cc
tests/sundials/harmonic_oscillator_01.cc

similarity index 94%
rename from include/deal.II/sundials/ida_interface.h
rename to include/deal.II/sundials/ida.h
index da37f7f587f79781ac16830271f7802e44bb6b47..a5e1130d30ab4fee1c586b9210219a3800af14a9 100644 (file)
@@ -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 <deal.II/base/config.h>
 #ifdef DEAL_II_WITH_SUNDIALS
@@ -128,7 +128,7 @@ namespace SUNDIALS
    * @author Luca Heltai, Alberto Sartori, 2017.
    */
   template<typename VectorType=Vector<double> >
-  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
index 714f24ba31b91a32f25eb9fcdfb0e7034e1b9430..437bf07466dc06b9f4909939c0c6d0d0d6302f6f 100644 (file)
@@ -16,7 +16,7 @@
 INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
 
 SET(_src
-  ida_interface.cc
+  ida.cc
   copy.cc
   )
 
similarity index 86%
rename from source/sundials/ida_interface.cc
rename to source/sundials/ida.cc
index cca559a2f2ccba28b0fc487e50dafa00344012d9..e5b5c312db7fe7c82c3c47a5ea9aca82471c71e2 100644 (file)
@@ -14,7 +14,7 @@
 //-----------------------------------------------------------
 
 
-#include <deal.II/sundials/ida_interface.h>
+#include <deal.II/sundials/ida.h>
 #include <deal.II/base/config.h>
 
 #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<VectorType> &solver = *static_cast<IDAInterface<VectorType> *>(user_data);
+      IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(user_data);
 
       std::shared_ptr<VectorType> src_yy = solver.create_new_vector();
       std::shared_ptr<VectorType> src_yp = solver.create_new_vector();
@@ -79,7 +79,7 @@ namespace SUNDIALS
       (void) tmp2;
       (void) tmp3;
       (void) resp;
-      IDAInterface<VectorType> &solver = *static_cast<IDAInterface<VectorType> *>(IDA_mem->ida_user_data);
+      IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(IDA_mem->ida_user_data);
 
       std::shared_ptr<VectorType> src_yy = solver.create_new_vector();
       std::shared_ptr<VectorType> src_yp = solver.create_new_vector();
@@ -107,7 +107,7 @@ namespace SUNDIALS
       (void) yy;
       (void) yp;
       (void) resp;
-      IDAInterface<VectorType> &solver = *static_cast<IDAInterface<VectorType> *>(IDA_mem->ida_user_data);
+      IDA<VectorType> &solver = *static_cast<IDA<VectorType> *>(IDA_mem->ida_user_data);
 
       std::shared_ptr<VectorType> dst = solver.create_new_vector();
       std::shared_ptr<VectorType> src = solver.create_new_vector();
@@ -122,23 +122,23 @@ namespace SUNDIALS
   }
 
   template <typename VectorType>
-  IDAInterface<VectorType>::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<VectorType>::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 <typename VectorType>
-  IDAInterface<VectorType>::~IDAInterface()
+  IDA<VectorType>::~IDA()
   {
     if (ida_mem)
       IDAFree(&ida_mem);
@@ -171,7 +171,7 @@ namespace SUNDIALS
   }
 
   template <typename VectorType>
-  void IDAInterface<VectorType>::add_parameters(ParameterHandler &prm)
+  void IDA<VectorType>::add_parameters(ParameterHandler &prm)
   {
     prm.add_parameter("Initial step size",initial_step_size);
 
@@ -228,8 +228,8 @@ namespace SUNDIALS
 
 
   template <typename VectorType>
-  unsigned int IDAInterface<VectorType>::solve_dae(VectorType &solution,
-                                                   VectorType &solution_dot)
+  unsigned int IDA<VectorType>::solve_dae(VectorType &solution,
+                                          VectorType &solution_dot)
   {
 
     unsigned int system_size = solution.size();
@@ -335,10 +335,10 @@ namespace SUNDIALS
   }
 
   template <typename VectorType>
-  void IDAInterface<VectorType>::reset(const double &current_time,
-                                       const double &current_time_step,
-                                       VectorType &solution,
-                                       VectorType &solution_dot)
+  void IDA<VectorType>::reset(const double &current_time,
+                              const double &current_time_step,
+                              VectorType &solution,
+                              VectorType &solution_dot)
   {
 
     unsigned int system_size;
@@ -508,13 +508,13 @@ namespace SUNDIALS
   }
 
   template<typename VectorType>
-  void IDAInterface<VectorType>::set_initial_time(const double &t)
+  void IDA<VectorType>::set_initial_time(const double &t)
   {
     initial_time = t;
   }
 
   template<typename VectorType>
-  void IDAInterface<VectorType>::set_functions_to_trigger_an_assert()
+  void IDA<VectorType>::set_functions_to_trigger_an_assert()
   {
 
     create_new_vector = []() ->std::unique_ptr<VectorType>
@@ -582,19 +582,19 @@ namespace SUNDIALS
     };
   }
 
-  template class IDAInterface<Vector<double> >;
-  template class IDAInterface<BlockVector<double> >;
+  template class IDA<Vector<double> >;
+  template class IDA<BlockVector<double> >;
 
 #ifdef DEAL_II_WITH_MPI
 
 #ifdef DEAL_II_WITH_TRILINOS
-  template class IDAInterface<TrilinosWrappers::MPI::Vector>;
-  template class IDAInterface<TrilinosWrappers::MPI::BlockVector>;
+  template class IDA<TrilinosWrappers::MPI::Vector>;
+  template class IDA<TrilinosWrappers::MPI::BlockVector>;
 #endif
 
 #ifdef DEAL_II_WITH_PETSC
-  template class IDAInterface<PETScWrappers::MPI::Vector>;
-  template class IDAInterface<PETScWrappers::MPI::BlockVector>;
+  template class IDA<PETScWrappers::MPI::Vector>;
+  template class IDA<PETScWrappers::MPI::BlockVector>;
 #endif
 
 #endif
index 2f7c20c58a1339043ad9ed3eba5852cf657ab067..de6ad8b9820a10a1cdeee3489cdd22c825f6d2ce 100644 (file)
@@ -13,7 +13,7 @@
 //
 //-----------------------------------------------------------
 
-#include <deal.II/sundials/ida_interface.h>
+#include <deal.II/sundials/ida.h>
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -138,7 +138,7 @@ public:
     y[1] = kappa;
     time_stepper.solve_dae(y,y_dot);
   }
-  SUNDIALS::IDAInterface<Vector<double> >  time_stepper;
+  SUNDIALS::IDA<Vector<double> >  time_stepper;
 private:
   Vector<double> y;
   Vector<double> y_dot;
index 8bded1027b44ef6d5ce8d5bd7c495075b915e98f..f048672014e301bdc8ae35d6d9bcd4ed04fab119 100644 (file)
@@ -14,7 +14,7 @@
 //-----------------------------------------------------------
 
 #include "../tests.h"
-#include <deal.II/sundials/ida_interface.h>
+#include <deal.II/sundials/ida.h>
 #include <deal.II/base/parameter_handler.h>
 #include <deal.II/lac/full_matrix.h>
 #include <deal.II/lac/vector.h>
@@ -130,7 +130,7 @@ public:
     y_dot[0] = kappa;
     time_stepper.solve_dae(y,y_dot);
   }
-  SUNDIALS::IDAInterface<Vector<double> >  time_stepper;
+  SUNDIALS::IDA<Vector<double> >  time_stepper;
 private:
   Vector<double> y;
   Vector<double> y_dot;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.