]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added some reinit functions to trilinos_vector
authorcazamias <cazamias@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 16 Nov 2012 22:52:37 +0000 (22:52 +0000)
committercazamias <cazamias@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 16 Nov 2012 22:52:37 +0000 (22:52 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@27553 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/trilinos_vector.h
deal.II/include/deal.II/lac/trilinos_vector_base.h
deal.II/source/lac/trilinos_vector.cc
deal.II/source/lac/trilinos_vector_base.cc

index 4df3e86c6b6cea13d5ce375f931edb517aa42534..fe539408241df6472255f659d125a559a1287530 100644 (file)
@@ -235,6 +235,16 @@ namespace TrilinosWrappers
         void reinit (const BlockVector &v,
                      const bool         import_data = false);
 
+                                       /**
+                                        * Reinit function. Creates a vector
+                                        * using the IndexSet local as our
+                                        * own unknowns, add optional ghost
+                                        * values ghost.
+                                        */
+        void reinit (const MPI_Comm &communicator,
+                     const IndexSet &local,
+                     const IndexSet &ghost=IndexSet(0));
+
                                        /**
                                         * Set all components of the
                                         * vector to the given number @p
@@ -416,6 +426,10 @@ namespace TrilinosWrappers
         Vector (const IndexSet &parallel_partitioning,
                 const MPI_Comm &communicator = MPI_COMM_WORLD);
 
+        Vector (const MPI_Comm &communicator,
+                const IndexSet &local,
+                const IndexSet &ghost=IndexSet(0));
+
                                        /**
                                         * Copy constructor from the
                                         * TrilinosWrappers vector
@@ -616,6 +630,16 @@ namespace TrilinosWrappers
       Vector (const IndexSet &partitioning,
               const MPI_Comm &communicator = MPI_COMM_WORLD);
 
+                                       /**
+                                        * This constructor creates a vector
+                                        * using the IndexSet local as our
+                                        * own unknowns, add optional ghost
+                                        * values ghost.
+                                        */
+      Vector (const MPI_Comm &communicator,
+              const IndexSet &local,
+              const IndexSet &ghost);
+
                                        /**
                                         * This constructor takes a
                                         * (possibly parallel) Trilinos
@@ -691,6 +715,7 @@ namespace TrilinosWrappers
                    const bool        fast = false,
                    const bool        allow_different_maps = false);
 
+
                                        /**
                                         * Set all components of the
                                         * vector to the given number @p
index f3a7bee54a113f25139187fa6333e727ca445e4c..fd39fff3d02cccc07df8348fa70671ce85e4f1a5 100644 (file)
@@ -858,6 +858,14 @@ namespace TrilinosWrappers
                                         */
       void ratio (const VectorBase &a,
                   const VectorBase &b);
+
+
+                                       /**
+                                        * Empty function; added to allow
+                                        * PETSc and Trilinos Vectors to 
+                                        * be used interchangeably
+                                        */
+      void update_ghost_values() const;
                                        //@}
 
 
@@ -949,6 +957,7 @@ namespace TrilinosWrappers
       std::size_t memory_consumption () const;
                                        //@}
 
+
                                        /**
                                         * Exception
                                         */
index 2f4611cc6490100736822904ccaabdd39962cc56..64be7df51372f0d73c12958be954ea2e8a114250 100644 (file)
@@ -106,6 +106,17 @@ namespace TrilinosWrappers
       reinit (v, false, true);
     }
 
+    Vector::Vector (const MPI_Comm &communicator,
+                    const IndexSet &local,
+                    const IndexSet &ghost)
+                    :
+                    VectorBase()
+    {
+        IndexSet parallel_partitioning = local;
+        parallel_partitioning.add_indices(ghost);
+        reinit(parallel_partitioning, communicator);
+    }
+
 
 
     Vector::~Vector ()
@@ -279,6 +290,13 @@ namespace TrilinosWrappers
     }
 
 
+    void Vector::reinit(const MPI_Comm &communicator, const IndexSet &local, const IndexSet &ghost)
+    {
+        IndexSet parallel_partitioning = local;
+        parallel_partitioning.add_indices(ghost);
+        reinit(parallel_partitioning, communicator);
+    }
+
 
     Vector &
     Vector::operator = (const Vector &v)
index 7e545c4f17ea7a5896c1260dc616e383e3a6df40..706af557cf5e35d8e0287b311a85154d0cccb3ef 100644 (file)
@@ -425,6 +425,11 @@ namespace TrilinosWrappers
       + this->local_size()*( sizeof(double)+sizeof(int) );
   }
 
+  void
+  VectorBase::update_ghost_values() const
+  {
+  }
+
 } /* end of namespace TrilinosWrappers */
 
 

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.