* reference to <tt>*this</tt>.
*/
SparseMatrix &
- copy_from (const SparseMatrix &source);
+ copy_from (const SparseMatrix &source);
/**
* This function initializes
* pattern previously used.
*/
SparseMatrix &
- operator = (const double d);
+ operator = (const double d);
/**
* Set the element (<i>i,j</i>)
* Return the
* <i>l</i><sub>1</sub>-norm of
* the matrix, that is
- * $|M|_1=\max_{\mathrm{all
- * columns} j}\sum_{\mathrm{all
- * rows} i} |M_{ij}|$, (max. sum
+ * $|M|_1=
+ * \max_{\mathrm{all columns } j}
+ * \sum_{\mathrm{all rows } i}
+ * |M_{ij}|$, (max. sum
* of columns). This is the
* natural matrix norm that is
* compatible to the l1-norm for
- * vectors, i.e. $|Mv|_1\leq
+ * vectors, i.e. $|Mv|_1 \leq
* |M|_1 |v|_1$.
* (cf. Haemmerlin-Hoffmann:
* Numerische Mathematik)
* necessary.
*/
Vector &
- operator = (const Vector &v);
+ operator = (const Vector &V);
+
+ /**
+ * Copy operator from a given
+ * localized vector (present on
+ * all processes) in
+ * TrilinosWrappers format to the
+ * current distributed
+ * vector. This function assumes
+ * that the calling vector (left
+ * hand object) already is of the
+ * same size as the right hand
+ * side vector. Otherwise, an
+ * exception will be thrown.
+ */
+ Vector &
+ operator = (const LocalizedVector &V);
/**
* Another copy function. This
* friend.
*/
friend class internal::VectorReference;
+ friend class LocalizedVector;
};
* @see @ref SoftwareTrilinos
* @author Martin Kronbichler, 2008
*/
- class LocalizedVector : Vector
+ class LocalizedVector : public Vector
{
public:
/**
public:
std::auto_ptr<Epetra_MultiVector> vector;
+
+ friend class Vector;
};
#ifdef DEAL_II_USE_TRILINOS
+#include <Epetra_Import.h>
+
+
DEAL_II_NAMESPACE_OPEN
namespace TrilinosWrappers
}
+
+ Vector &
+ Vector::operator = (const LocalizedVector &v)
+ {
+ Assert (size() == v.size(), ExcDimensionMismatch(size(), v.size()));
+
+ Epetra_Import import_information (map, v.map);
+ const int ierr = vector->Import(*v.vector, import_information, Insert);
+
+ Assert (ierr == 0, ExcTrilinosError(ierr));
+
+ return *this;
+ }
+
+
+
Vector &
Vector::operator = (const ::dealii::Vector<double> &v)
{
LocalizedVector::reinit (const Vector &v)
{
map = Epetra_LocalMap (v.size(),0,v.vector->Comm());
+
+ Epetra_Import import_information (map, v.map);
+
vector = std::auto_ptr<Epetra_MultiVector>
(new Epetra_MultiVector (map,1,false));
- *vector = *v.vector;
+
+ int ierr = vector->Import(*v.vector, import_information, Insert);
+ Assert (ierr == 0, ExcTrilinosError(ierr));
}