Reference documentation for deal.II version 9.1.0-pre
copy.h
1 //-----------------------------------------------------------
2 //
3 // Copyright (C) 2017 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 //-----------------------------------------------------------
15 
16 #ifndef dealii_sundials_copy_h
17 #define dealii_sundials_copy_h
18 
19 #include <deal.II/base/config.h>
20 #ifdef DEAL_II_WITH_SUNDIALS
21 
22 # include <sundials/sundials_nvector.h>
23 # ifdef DEAL_II_WITH_MPI
24 # include <nvector/nvector_parallel.h>
25 # endif
26 # include <deal.II/lac/block_vector.h>
27 # include <deal.II/lac/vector.h>
28 
29 # include <nvector/nvector_serial.h>
30 
31 # ifdef DEAL_II_WITH_TRILINOS
32 # include <deal.II/lac/trilinos_parallel_block_vector.h>
33 # include <deal.II/lac/trilinos_vector.h>
34 # endif
35 
36 # ifdef DEAL_II_WITH_PETSC
37 # include <deal.II/lac/petsc_block_vector.h>
38 # include <deal.II/lac/petsc_vector.h>
39 # endif
40 
41 DEAL_II_NAMESPACE_OPEN
42 namespace SUNDIALS
43 {
44  namespace internal
45  {
46  // The following internal functions are used by SUNDIALS wrappers to copy
47  // to and from deal.II vector types.
48 # ifdef DEAL_II_WITH_MPI
49 
50 # ifdef DEAL_II_WITH_TRILINOS
51  void
52  copy(TrilinosWrappers::MPI::Vector &dst, const N_Vector &src);
53  void
54  copy(N_Vector &dst, const TrilinosWrappers::MPI::Vector &src);
55  void
56  copy(TrilinosWrappers::MPI::BlockVector &dst, const N_Vector &src);
57  void
58  copy(N_Vector &dst, const TrilinosWrappers::MPI::BlockVector &src);
59 # endif // DEAL_II_WITH_TRILINOS
60 
61 # ifdef DEAL_II_WITH_PETSC
62 # ifndef PETSC_USE_COMPLEX
63  void
64  copy(PETScWrappers::MPI::Vector &dst, const N_Vector &src);
65  void
66  copy(N_Vector &dst, const PETScWrappers::MPI::Vector &src);
67  void
68  copy(PETScWrappers::MPI::BlockVector &dst, const N_Vector &src);
69  void
70  copy(N_Vector &dst, const PETScWrappers::MPI::BlockVector &src);
71 # endif // PETSC_USE_COMPLEX
72 # endif // DEAL_II_WITH_PETSC
73 
74 # endif
75 
76  void
77  copy(BlockVector<double> &dst, const N_Vector &src);
78  void
79  copy(N_Vector &dst, const BlockVector<double> &src);
80 
81  void
82  copy(Vector<double> &dst, const N_Vector &src);
83  void
84  copy(N_Vector &dst, const Vector<double> &src);
85  } // namespace internal
86 } // namespace SUNDIALS
87 DEAL_II_NAMESPACE_CLOSE
88 
89 #endif // DEAL_II_WITH_SUNDIALS
90 #endif // dealii_sundials_copy_h