// of the Stokes matrix – except
// that it is much easier here since we
// do not need to take care of any blocks
- // or coupling between components:
+ // or coupling between components. Note
+ // how we initialize the three
+ // temperature matrices: We only use the
+ // sparsity pattern for reinitialization
+ // of the first matrix, whereas we use
+ // the previously generated matrix for
+ // the two remaining reinits. The reason
+ // for doing so is that reinitialization
+ // from an already generated matrix
+ // allows Trilinos to reuse the sparsity
+ // pattern instead of generating a new
+ // one for each copy. This saves both
+ // some time and memory.
{
temperature_mass_matrix.clear ();
temperature_stiffness_matrix.clear ();
temperature_constraints, false);
temperature_matrix.reinit (csp);
- temperature_mass_matrix.reinit (csp);
- temperature_stiffness_matrix.reinit (csp);
+ temperature_mass_matrix.reinit (temperature_matrix);
+ temperature_stiffness_matrix.reinit (temperature_matrix);
}
// Lastly, we set the vectors for the
// $Id$
// Version: $Name$
//
-// Copyright (C) 2008 by the deal.II authors
+// Copyright (C) 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*
* @ingroup TrilinosWrappers
* @ingroup Matrix1
- * @author Martin Kronbichler, Wolfgang Bangerth, 2008
+ * @author Martin Kronbichler, Wolfgang Bangerth, 2008, 2009
*/
class SparseMatrix : public Subscriptor
{
// $Id$
// Version: $Name$
//
-// Copyright (C) 2008 by the deal.II authors
+// Copyright (C) 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
row_map = m.row_map;
col_map = m.col_map;
*matrix = *m.matrix;
+ compress();
return *this;
}
row_map = sparse_matrix.row_map;
col_map = sparse_matrix.col_map;
- matrix = std::auto_ptr<Epetra_FECrsMatrix>(new Epetra_FECrsMatrix(
- *sparse_matrix.matrix));
- compressed = true;
+ matrix = std::auto_ptr<Epetra_FECrsMatrix>
+ (new Epetra_FECrsMatrix(Copy, sparse_matrix.matrix->Graph(), false));
+
+ compress();
}