]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add update_ghost_values to vector classes for compatibility with PETSc
authorMartin Steigemann <msteigemann@yahoo.de>
Mon, 24 Jan 2011 23:33:57 +0000 (23:33 +0000)
committerMartin Steigemann <msteigemann@yahoo.de>
Mon, 24 Jan 2011 23:33:57 +0000 (23:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@23257 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/lac/block_vector_base.h
deal.II/include/deal.II/lac/trilinos_vector.h
deal.II/include/deal.II/lac/vector.h

index aff7adfdeaa539f12c04556de6cd6c68f190773a..e610a06faacbc96ebad35d16851d1e7d85213987 100644 (file)
@@ -1104,6 +1104,23 @@ class BlockVectorBase : public Subscriptor
     void equ (const value_type a, const BlockVectorBase& V,
              const value_type b, const BlockVectorBase& W);
 
+                                     /**
+                                      * This function does nothing but is
+                                      * there for compatibility with the
+                                      * @p PETScWrappers::Vector class.
+                                      *
+                                      * For the PETSc vector wrapper class,
+                                      * this function updates the ghost
+                                      * values of the PETSc vector. This
+                                      * is necessary after any modification
+                                      * before reading ghost values.
+                                      *
+                                      * However, for the implementation of
+                                      * this class, it is immaterial and thus
+                                      * an empty function.
+                                      */
+    void update_ghost_values () const;
+
                                     /**
                                      * Determine an estimate for the
                                      * memory consumption (in bytes)
@@ -2241,6 +2258,15 @@ void BlockVectorBase<VectorType>::equ (const value_type    a,
 
 
 
+template <class VectorType>
+void BlockVectorBase<VectorType>::update_ghost_values () const
+{
+  for (unsigned int i=0; i<n_blocks(); ++i)
+    block(i).update_ghost_values ();
+}
+
+
+
 template <class VectorType>
 BlockVectorBase<VectorType>&
 BlockVectorBase<VectorType>::operator = (const value_type s)
index ada56124048a306fedbe8e0df41d9ececf9cef26..c30e9e71479ac898e96df0f998af91c2a38e9074 100644 (file)
@@ -723,6 +723,23 @@ namespace TrilinosWrappers
                                        */
       Vector &
        operator = (const Vector &V);
+
+                                      /**
+                                       * This function does nothing but is
+                                       * there for compatibility with the
+                                       * @p PETScWrappers::Vector class.
+                                       *
+                                       * For the PETSc vector wrapper class,
+                                       * this function updates the ghost
+                                       * values of the PETSc vector. This
+                                       * is necessary after any modification
+                                       * before reading ghost values.
+                                       *
+                                       * However, for the implementation of
+                                       * this class, it is immaterial and thus
+                                       * an empty function.
+                                       */
+      void update_ghost_values () const;
   };
 
 
@@ -796,6 +813,14 @@ namespace TrilinosWrappers
     return *this;
   }
 
+
+
+  inline
+  void
+  Vector::update_ghost_values () const
+  {}
+
+
 #endif
 
 
index 2dd5b2746ff79a6c6c4288da5a4dfd7d6c15454c..03ce3e770233c2caff5d3bd013f2c4a026829512 100644 (file)
@@ -851,6 +851,23 @@ class Vector : public Subscriptor
                                      */
     void ratio (const Vector<Number> &a,
                const Vector<Number> &b);
+
+                                     /**
+                                      * This function does nothing but is
+                                      * there for compatibility with the
+                                      * @p PETScWrappers::Vector class.
+                                      *
+                                      * For the PETSc vector wrapper class,
+                                      * this function updates the ghost
+                                      * values of the PETSc vector. This
+                                      * is necessary after any modification
+                                      * before reading ghost values.
+                                      *
+                                      * However, for the implementation of
+                                      * this class, it is immaterial and thus
+                                      * an empty function.
+                                      */
+    void update_ghost_values () const;
                                     //@}
 
 
@@ -1444,6 +1461,15 @@ Vector<Number>::compress () const
 {}
 
 
+
+template <typename Number>
+inline
+void
+Vector<Number>::update_ghost_values () const
+{}
+
+
+
 // Moved from vector.templates.h as an inline function by Luca Heltai
 // on 2009/04/12 to prevent strange compiling errors, after making
 // swap virtual.

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.