From: Martin Steigemann Date: Mon, 24 Jan 2011 23:33:57 +0000 (+0000) Subject: add update_ghost_values to vector classes for compatibility with PETSc X-Git-Tag: v8.0.0~4439 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffce73449392927ff535ca647198a034e39af43b;p=dealii.git add update_ghost_values to vector classes for compatibility with PETSc git-svn-id: https://svn.dealii.org/trunk@23257 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/block_vector_base.h b/deal.II/include/deal.II/lac/block_vector_base.h index aff7adfdea..e610a06faa 100644 --- a/deal.II/include/deal.II/lac/block_vector_base.h +++ b/deal.II/include/deal.II/lac/block_vector_base.h @@ -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::equ (const value_type a, +template +void BlockVectorBase::update_ghost_values () const +{ + for (unsigned int i=0; i BlockVectorBase& BlockVectorBase::operator = (const value_type s) diff --git a/deal.II/include/deal.II/lac/trilinos_vector.h b/deal.II/include/deal.II/lac/trilinos_vector.h index ada5612404..c30e9e7147 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_vector.h @@ -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 diff --git a/deal.II/include/deal.II/lac/vector.h b/deal.II/include/deal.II/lac/vector.h index 2dd5b2746f..03ce3e7702 100644 --- a/deal.II/include/deal.II/lac/vector.h +++ b/deal.II/include/deal.II/lac/vector.h @@ -851,6 +851,23 @@ class Vector : public Subscriptor */ void ratio (const Vector &a, const Vector &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::compress () const {} + +template +inline +void +Vector::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.