void
FilteredMatrix<VECTOR>::initialize (const MATRIX &m, bool ecs)
{
- matrix = std_cxx1x::shared_ptr<PointerMatrixBase<VECTOR> > (
- new_pointer_matrix_base(m, VECTOR()));
+ matrix.reset (new_pointer_matrix_base(m, VECTOR()));
expect_constrained_source = ecs;
}
#include <base/config.h>
#include <base/named_data.h>
#include <base/smartpointer.h>
+#include <base/std_cxx1x/shared_ptr.h>
#include <lac/block_indices.h>
#include <lac/full_matrix.h>
-#include <boost/shared_ptr.hpp>
DEAL_II_NAMESPACE_OPEN
* @author Baerbel Janssen, Guido Kanschat, 2010
*/
template <class MATRIX>
-class MatrixBlockVector : public NamedData<boost::shared_ptr<MatrixBlock<MATRIX> > >
+class MatrixBlockVector : public NamedData<std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > >
{
public:
/**
* @author Baerbel Janssen, Guido Kanschat, 2010
*/
template <class MATRIX>
-class MGMatrixBlockVector : public NamedData<boost::shared_ptr<MatrixBlock<MATRIX> > >
+class MGMatrixBlockVector : public NamedData<std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > >
{
public:
/**
const std::string& name,
const BlockIndices* block_indices)
{
- boost::shared_ptr<MatrixBlock<MATRIX> > p(new MatrixBlock<MATRIX>(row, column, block_indices));
- NamedData<boost::shared_ptr<MatrixBlock<MATRIX> > >::add(p, name);
+ std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > p(new MatrixBlock<MATRIX>(row, column, block_indices));
+ NamedData<std_cxx1x::shared_ptr<MatrixBlock<MATRIX> > >::add(p, name);
}
#ifdef DEAL_II_USE_SLEPC
+# include <base/std_cxx1x/shared_ptr.hpp>
# include <lac/exceptions.h>
# include <lac/solver_control.h>
# include <lac/petsc_matrix_base.h>
# include <lac/slepc_spectral_transformation.h>
-# include <boost/shared_ptr.hpp>
# include <petscksp.h>
# include <slepceps.h>
EPS eps;
};
- boost::shared_ptr<SolverData> solver_data;
+ std_cxx1x::shared_ptr<SolverData> solver_data;
};
/**
#ifdef DEAL_II_USE_SLEPC
+# include <base/std_cxx1x/shared_ptr.hpp>
# include <lac/exceptions.h>
-# include <boost/shared_ptr.hpp>
# include <petscksp.h>
# include <slepceps.h>
ST st;
};
- boost::shared_ptr<TransformationData> transformation_data;
+ std_cxx1x::shared_ptr<TransformationData> transformation_data;
};
/**
#ifdef DEAL_II_USE_TRILINOS
+# include <base/std_cxx1x/shared_ptr.h>
# include <lac/exceptions.h>
# include <lac/solver_control.h>
# include <lac/vector.h>
#ifdef DEAL_II_USE_TRILINOS
+# include <base/std_cxx1x/shared_ptr.h>
# include <base/subscriptor.h>
# include <base/index_set.h>
# include <lac/full_matrix.h>
#ifdef DEAL_II_USE_TRILINOS
+# include <base/std_cxx1x/shared_ptr.h>
# include <base/subscriptor.h>
# include <base/index_set.h>
# include <base/utilities.h>
const dealii::Vector<number> &v)
{
if (&*vector != 0 && vector->Map().SameAs(parallel_partitioner))
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(parallel_partitioner));
+ vector.reset (new Epetra_FEVector(parallel_partitioner));
const int size = parallel_partitioner.NumMyElements();
{
if (size() != v.size())
{
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(Epetra_Map (v.size(), 0,
+ vector.reset (new Epetra_FEVector(Epetra_Map
+ (v.size(), 0,
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
- Epetra_MpiComm(MPI_COMM_SELF)
+ Epetra_MpiComm(MPI_COMM_SELF)
#else
- Epetra_SerialComm()
+ Epetra_SerialComm()
#endif
- )));
+ )));
}
reinit (vector_partitioner(), v);
Vector::Vector (const dealii::Vector<number> &v)
{
Epetra_LocalMap map ((int)v.size(), 0, Utilities::Trilinos::comm_self());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
*this = v;
}
Epetra_LocalMap map ((int)v.size(), 0,
Utilities::Trilinos::comm_self());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
const Epetra_Map & map = vector_partitioner();
#ifdef DEAL_II_USE_TRILINOS
+# include <base/std_cxx1x/shared_ptr.h>
# include <base/subscriptor.h>
# include <lac/exceptions.h>
# include <lac/vector.h>
* class.
*/
void print (const char* format = 0) const;
-
+
/**
* Print to a stream. @p
* precision denotes the desired
ExcMessage("Vector has not been constructed properly."));
if (fast == false || local_range() != v.local_range())
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>(new Epetra_FEVector(*v.vector));
+ vector.reset (new Epetra_FEVector(*v.vector));
}
{
return static_cast<const Epetra_Map&>(vector->Map());
}
-
-
+
+
#endif // DOXYGEN
}
vector_distributor.reset (new Epetra_Map(n_rows, 0, communicator));
if (&*Matrix==0)
- Matrix = std_cxx1x::shared_ptr<SparseMatrix> (new SparseMatrix());
+ Matrix.reset (new SparseMatrix());
Matrix->reinit (*vector_distributor, *vector_distributor,
deal_ii_sparse_matrix, drop_tolerance, true,
const PreconditionBase &preconditioner)
{
int ierr;
-
+
linear_problem.reset();
// We need an
// to let the AztecOO solver
// know about the matrix and
// vectors.
- linear_problem = std_cxx1x::shared_ptr<Epetra_LinearProblem>
- (new Epetra_LinearProblem(const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
+ linear_problem.reset
+ (new Epetra_LinearProblem(const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
&x.trilinos_vector(),
const_cast<Epetra_MultiVector*>(&b.trilinos_vector())));
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
// ... set some options, ...
- solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?
+ solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?
AZ_all : AZ_none);
solver.SetAztecOption (AZ_conv, AZ_noscaled);
// ... and then solve!
- ierr = solver.Iterate (solver_control.max_steps(),
+ ierr = solver.Iterate (solver_control.max_steps(),
solver_control.tolerance());
AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
const PreconditionBase &preconditioner)
{
int ierr;
-
+
linear_problem.reset();
// In case we call the solver with
// to let the AztecOO solver
// know about the matrix and
// vectors.
- linear_problem = std_cxx1x::shared_ptr<Epetra_LinearProblem>
- (new Epetra_LinearProblem
- (const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()), &ep_x, &ep_b));
+ linear_problem.reset (new Epetra_LinearProblem
+ (const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
+ &ep_x, &ep_b));
// Next we can allocate the
// AztecOO solver...
AssertThrow (ierr == 0, ExcTrilinosError(ierr));
// ... set some options, ...
- solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?
+ solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?
AZ_all : AZ_none);
solver.SetAztecOption (AZ_conv, AZ_noscaled);
// ... and then solve!
- ierr = solver.Iterate (solver_control.max_steps(),
+ ierr = solver.Iterate (solver_control.max_steps(),
solver_control.tolerance());
AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
throw SolverControl::NoConvergence (solver_control.last_step(),
solver_control.last_value());
}
-
-
-
+
+
+
/* ---------------------- SolverCG ------------------------ */
SolverCG::AdditionalData::
{
solver_name = cg;
}
-
+
/* ---------------------- SolverGMRES ------------------------ */
restart_parameter (restart_parameter)
{}
-
-
+
+
SolverGMRES::SolverGMRES (SolverControl &cn,
const AdditionalData &data)
:
{
solver_name = gmres;
}
-
+
/* ---------------------- SolverBicgstab ------------------------ */
solver_name = bicgstab;
}
-
+
/* ---------------------- SolverCGS ------------------------ */
SolverCGS::AdditionalData::
{
solver_name = cgs;
}
-
+
/* ---------------------- SolverTFQMR ------------------------ */
additional_data (data.output_solver_details)
{}
-
+
SolverDirect::~SolverDirect ()
{}
-
+
SolverControl &
SolverDirect::control() const
// First set whether we want to print
// the solver information to screen
// or not.
- ConditionalOStream verbose_cout (std::cout,
+ ConditionalOStream verbose_cout (std::cout,
additional_data.output_solver_details);
linear_problem.reset();
// to let the AztecOO solver
// know about the matrix and
// vectors.
- linear_problem = std_cxx1x::shared_ptr<Epetra_LinearProblem>
- (new Epetra_LinearProblem(const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
+ linear_problem.reset
+ (new Epetra_LinearProblem(const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
&x.trilinos_vector(),
const_cast<Epetra_MultiVector*>(&b.trilinos_vector())));
// Next we can allocate the
// AztecOO solver...
- solver = std_cxx1x::shared_ptr<Amesos_BaseSolver> (Amesos().Create("Amesos_Klu",
- *linear_problem));
+ solver.reset (Amesos().Create("Amesos_Klu", *linear_problem));
verbose_cout << "Starting symbolic factorization" << std::endl;
solver->SymbolicFactorization();
// First set whether we want to print
// the solver information to screen
// or not.
- ConditionalOStream verbose_cout (std::cout,
+ ConditionalOStream verbose_cout (std::cout,
additional_data.output_solver_details);
linear_problem.reset();
// to let the AztecOO solver
// know about the matrix and
// vectors.
- linear_problem = std_cxx1x::shared_ptr<Epetra_LinearProblem>
- (new Epetra_LinearProblem
- (const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()), &ep_x, &ep_b));
+ linear_problem.reset (new Epetra_LinearProblem
+ (const_cast<Epetra_CrsMatrix*>(&A.trilinos_matrix()),
+ &ep_x, &ep_b));
// Next we can allocate the
// AztecOO solver...
- solver = std_cxx1x::shared_ptr<Amesos_BaseSolver> (Amesos().Create("Amesos_Klu",
- *linear_problem));
+ solver.reset (Amesos().Create("Amesos_Klu", *linear_problem));
verbose_cout << "Starting symbolic factorization" << std::endl;
solver->SymbolicFactorization();
throw SolverControl::NoConvergence (solver_control.last_step(),
solver_control.last_value());
}
-
-
+
+
}
// interface.
SparseMatrix::SparseMatrix ()
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (0, 0,
- Utilities::Trilinos::comm_self()))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(View, *column_space_map,
- *column_space_map, 0))),
+ column_space_map (new Epetra_Map (0, 0,
+ Utilities::Trilinos::comm_self())),
+ matrix (new Epetra_FECrsMatrix(View, *column_space_map,
+ *column_space_map, 0)),
last_action (Zero),
compressed (true)
{
SparseMatrix::SparseMatrix (const Epetra_Map &input_map,
const unsigned int n_max_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_map))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, *column_space_map,
- int(n_max_entries_per_row), false))),
+ column_space_map (new Epetra_Map (input_map)),
+ matrix (new Epetra_FECrsMatrix(Copy, *column_space_map,
+ int(n_max_entries_per_row), false)),
last_action (Zero),
compressed (false)
{}
SparseMatrix::SparseMatrix (const Epetra_Map &input_map,
const std::vector<unsigned int> &n_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_map))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, *column_space_map,
- (int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
- false))),
+ column_space_map (new Epetra_Map (input_map)),
+ matrix (new Epetra_FECrsMatrix
+ (Copy, *column_space_map,
+ (int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
+ false)),
last_action (Zero),
compressed (false)
{}
const Epetra_Map &input_col_map,
const unsigned int n_max_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_col_map))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, input_row_map,
- int(n_max_entries_per_row), false))),
+ column_space_map (new Epetra_Map (input_col_map)),
+ matrix (new Epetra_FECrsMatrix(Copy, input_row_map,
+ int(n_max_entries_per_row), false)),
last_action (Zero),
compressed (false)
{}
const Epetra_Map &input_col_map,
const std::vector<unsigned int> &n_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_col_map))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, input_row_map,
+ column_space_map (new Epetra_Map (input_col_map)),
+ matrix (new Epetra_FECrsMatrix(Copy, input_row_map,
(int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
- false))),
+ false)),
last_action (Zero),
compressed (false)
{}
const unsigned int n,
const unsigned int n_max_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (n, 0,
- Utilities::Trilinos::comm_self()))),
+ column_space_map (new Epetra_Map (n, 0,
+ Utilities::Trilinos::comm_self())),
// on one processor only, we know how the
// columns of the matrix will be
// can't do so in parallel, where the
// information from columns is only
// available when entries have been added
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- Epetra_Map (m, 0,
- Utilities::Trilinos::comm_self()),
- *column_space_map,
- n_max_entries_per_row,
- false))),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ Epetra_Map (m, 0,
+ Utilities::Trilinos::comm_self()),
+ *column_space_map,
+ n_max_entries_per_row,
+ false)),
last_action (Zero),
compressed (false)
{}
const unsigned int n,
const std::vector<unsigned int> &n_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (n, 0,
- Utilities::Trilinos::comm_self()))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- Epetra_Map (m, 0,
- Utilities::Trilinos::comm_self()),
- *column_space_map,
+ column_space_map (new Epetra_Map (n, 0,
+ Utilities::Trilinos::comm_self())),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ Epetra_Map (m, 0,
+ Utilities::Trilinos::comm_self()),
+ *column_space_map,
(int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
- false))),
+ false)),
last_action (Zero),
compressed (false)
{}
const MPI_Comm &communicator,
const unsigned int n_max_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map(parallel_partitioning.
- make_trilinos_map(communicator, false)))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- *column_space_map,
- n_max_entries_per_row,
- false))),
+ column_space_map (new Epetra_Map(parallel_partitioning.
+ make_trilinos_map(communicator, false))),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ *column_space_map,
+ n_max_entries_per_row,
+ false)),
last_action (Zero),
compressed (false)
{}
const MPI_Comm &communicator,
const std::vector<unsigned int> &n_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map(parallel_partitioning.
- make_trilinos_map(communicator, false)))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- *column_space_map,
+ column_space_map (new Epetra_Map(parallel_partitioning.
+ make_trilinos_map(communicator, false))),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ *column_space_map,
(int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
- false))),
+ false)),
last_action (Zero),
compressed (false)
{}
const MPI_Comm &communicator,
const unsigned int n_max_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map(col_parallel_partitioning.
- make_trilinos_map(communicator, false)))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- row_parallel_partitioning.
- make_trilinos_map(communicator, false),
- n_max_entries_per_row,
- false))),
+ column_space_map (new Epetra_Map(col_parallel_partitioning.
+ make_trilinos_map(communicator, false))),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ row_parallel_partitioning.
+ make_trilinos_map(communicator, false),
+ n_max_entries_per_row,
+ false)),
last_action (Zero),
compressed (false)
{}
const MPI_Comm &communicator,
const std::vector<unsigned int> &n_entries_per_row)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map(col_parallel_partitioning.
- make_trilinos_map(communicator, false)))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- row_parallel_partitioning.
- make_trilinos_map(communicator, false),
+ column_space_map (new Epetra_Map(col_parallel_partitioning.
+ make_trilinos_map(communicator, false))),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ row_parallel_partitioning.
+ make_trilinos_map(communicator, false),
(int*)const_cast<unsigned int*>(&(n_entries_per_row[0])),
- false))),
+ false)),
last_action (Zero),
compressed (false)
{}
SparseMatrix::SparseMatrix (const SparsityPattern &sparsity_pattern)
:
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (sparsity_pattern.domain_partitioner()))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy,
- sparsity_pattern.trilinos_sparsity_pattern(),
- false))),
+ column_space_map (new Epetra_Map (sparsity_pattern.domain_partitioner())),
+ matrix (new Epetra_FECrsMatrix(Copy,
+ sparsity_pattern.trilinos_sparsity_pattern(),
+ false)),
last_action (Zero),
compressed (true)
{
SparseMatrix::SparseMatrix (const SparseMatrix &input_matrix)
:
Subscriptor(),
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_matrix.domain_partitioner()))),
- matrix (std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(*input_matrix.matrix))),
+ column_space_map (new Epetra_Map (input_matrix.domain_partitioner())),
+ matrix (new Epetra_FECrsMatrix(*input_matrix.matrix)),
last_action (Zero),
compressed (true)
{}
*matrix = *m.matrix;
else
{
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (m.domain_partitioner()));
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(*m.matrix));
+ column_space_map.reset (new Epetra_Map (m.domain_partitioner()));
+ matrix.reset (new Epetra_FECrsMatrix(*m.matrix));
}
compress();
sparsity_pattern.n_cols()));
}
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map> (new Epetra_Map (input_col_map));
+ column_space_map.reset (new Epetra_Map (input_col_map));
std::vector<int> n_entries_per_row(n_rows);
// columns as well. Compare this with bug
// # 4123 in the Sandia Bugzilla.
std_cxx1x::shared_ptr<Epetra_CrsGraph> graph;
+ int * first_row_length = &n_entries_per_row[input_row_map.MinMyGID()];
if (input_row_map.Comm().NumProc() > 1)
- graph = std_cxx1x::shared_ptr<Epetra_CrsGraph>
- (new Epetra_CrsGraph (Copy, input_row_map,
- &n_entries_per_row[input_row_map.MinMyGID()], true));
+ graph.reset (new Epetra_CrsGraph (Copy, input_row_map, first_row_length,
+ true));
else
- graph = std_cxx1x::shared_ptr<Epetra_CrsGraph>
- (new Epetra_CrsGraph (Copy, input_row_map, input_col_map,
- &n_entries_per_row[input_row_map.MinMyGID()], true));
+ graph.reset (new Epetra_CrsGraph (Copy, input_row_map, input_col_map,
+ first_row_length, true));
// This functions assumes that the
// sparsity pattern sits on all processors
sparsity_pattern.n_cols()));
// And now finally generate the matrix.
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, *graph, false));
+ matrix.reset (new Epetra_FECrsMatrix(Copy, *graph, false));
last_action = Zero;
{
// reinit with a (parallel) Trilinos
// sparsity pattern.
- matrix.reset();
-
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (sparsity_pattern.domain_partitioner()));
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, sparsity_pattern.trilinos_sparsity_pattern(),
- false));
+ column_space_map.reset (new Epetra_Map
+ (sparsity_pattern.domain_partitioner()));
+ matrix.reset (new Epetra_FECrsMatrix
+ (Copy, sparsity_pattern.trilinos_sparsity_pattern(), false));
compress();
}
void
SparseMatrix::reinit (const SparseMatrix &sparse_matrix)
{
- matrix.reset();
+ column_space_map.reset (new Epetra_Map (sparse_matrix.domain_partitioner()));
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (sparse_matrix.domain_partitioner()));
-
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, sparse_matrix.trilinos_sparsity_pattern(),
- false));
+ matrix.reset (new Epetra_FECrsMatrix
+ (Copy, sparse_matrix.trilinos_sparsity_pattern(), false));
compress();
}
goto set_matrix_values;
{
- std_cxx1x::shared_ptr<SparsityPattern> trilinos_sparsity;
- trilinos_sparsity = std_cxx1x::shared_ptr<SparsityPattern> (new SparsityPattern());
- trilinos_sparsity->reinit (input_row_map, input_col_map, sparsity_pattern);
- reinit (*trilinos_sparsity);
+ SparsityPattern trilinos_sparsity;
+ trilinos_sparsity.reinit (input_row_map, input_col_map, sparsity_pattern);
+ reinit (trilinos_sparsity);
}
set_matrix_values:
SparseMatrix::reinit (const Epetra_CrsMatrix &input_matrix,
const bool copy_values)
{
- matrix.reset();
-
Assert (input_matrix.Filled()==true,
ExcMessage("Input CrsMatrix has not called FillComplete()!"));
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (input_matrix.DomainMap()));
+ column_space_map.reset (new Epetra_Map (input_matrix.DomainMap()));
const Epetra_CrsGraph *graph = &input_matrix.Graph();
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(Copy, *graph, false));
+ matrix.reset (new Epetra_FECrsMatrix(Copy, *graph, false));
matrix->FillComplete (*column_space_map, input_matrix.RangeMap(), true);
// When we clear the matrix, reset
// the pointer and generate an
// empty matrix.
- matrix.reset();
- column_space_map.reset();
-
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
- matrix = std_cxx1x::shared_ptr<Epetra_FECrsMatrix>
- (new Epetra_FECrsMatrix(View, *column_space_map, 0));
+ column_space_map.reset (new Epetra_Map (0, 0,
+ Utilities::Trilinos::comm_self()));
+ matrix.reset (new Epetra_FECrsMatrix(View, *column_space_map, 0));
matrix->FillComplete();
:
compressed (true)
{
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0));
+ column_space_map.reset(new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
+ graph.reset (new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0));
graph->FillComplete();
}
SparsityPattern::SparsityPattern (const SparsityPattern &input_sparsity)
:
Subscriptor(),
- column_space_map (std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map(0, 0, Utilities::Trilinos::comm_self()))),
+ column_space_map (new Epetra_Map(0, 0, Utilities::Trilinos::comm_self())),
compressed (false),
- graph (std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(View, *column_space_map,
- *column_space_map, 0)))
+ graph (new Epetra_FECrsGraph(View, *column_space_map,
+ *column_space_map, 0))
{
Assert (input_sparsity.n_rows() == 0,
ExcMessage ("Copy constructor only works for empty sparsity patterns."));
const Epetra_Map &input_col_map,
const unsigned int n_entries_per_row)
{
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map> (new Epetra_Map (input_col_map));
- graph.reset();
+ column_space_map.reset (new Epetra_Map (input_col_map));
compressed = false;
// for more than one processor, need to
// processor, we can directly assign the
// columns as well.
if (input_row_map.Comm().NumProc() > 1)
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map, n_entries_per_row, false));
+ graph.reset (new Epetra_FECrsGraph(Copy, input_row_map,
+ n_entries_per_row, false));
else
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
- n_entries_per_row, false));
+ graph.reset (new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
+ n_entries_per_row, false));
}
ExcDimensionMismatch (n_entries_per_row.size(),
input_row_map.NumGlobalElements()));
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map> (new Epetra_Map (input_col_map));
- graph.reset();
+ column_space_map.reset (new Epetra_Map (input_col_map));
compressed = false;
if (input_row_map.Comm().NumProc() > 1)
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map,
- n_entries_per_row[input_row_map.MinMyGID()],
- false));
+ graph.reset(new Epetra_FECrsGraph(Copy, input_row_map,
+ n_entries_per_row[input_row_map.MinMyGID()],
+ false));
else
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
- n_entries_per_row[input_row_map.MinMyGID()],
- false));
+ graph.reset(new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
+ n_entries_per_row[input_row_map.MinMyGID()],
+ false));
}
ExcDimensionMismatch (sp.n_cols(),
input_col_map.NumGlobalElements()));
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map> (new Epetra_Map (input_col_map));
- graph.reset();
+ column_space_map.reset (new Epetra_Map (input_col_map));
compressed = false;
Assert (input_row_map.LinearMap() == true,
n_entries_per_row[row-input_row_map.MinMyGID()] = sp.row_length(row);
if (input_row_map.Comm().NumProc() > 1)
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map,
- n_entries_per_row[0],
- false));
+ graph.reset(new Epetra_FECrsGraph(Copy, input_row_map,
+ n_entries_per_row[0],
+ false));
else
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
- n_entries_per_row[0],
- false));
+ graph.reset (new Epetra_FECrsGraph(Copy, input_row_map, input_col_map,
+ n_entries_per_row[0],
+ false));
Assert (graph->NumGlobalRows() == (int)sp.n_rows(),
ExcDimensionMismatch (graph->NumGlobalRows(),
// When we clear the matrix, reset
// the pointer and generate an
// empty sparsity pattern.
- column_space_map.reset();
- graph.reset();
-
- column_space_map = std_cxx1x::shared_ptr<Epetra_Map>
- (new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
- graph = std_cxx1x::shared_ptr<Epetra_FECrsGraph>
- (new Epetra_FECrsGraph(View, *column_space_map, *column_space_map, 0));
+ column_space_map.reset (new Epetra_Map (0, 0, Utilities::Trilinos::comm_self()));
+ graph.reset (new Epetra_FECrsGraph(View, *column_space_map,
+ *column_space_map, 0));
graph->FillComplete();
compressed = true;
Vector::Vector ()
{
last_action = Zero;
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(Epetra_Map(0,0,0,Utilities::Trilinos::comm_self())));
+ vector.reset(new Epetra_FEVector(Epetra_Map(0,0,0,Utilities::Trilinos::comm_self())));
}
VectorBase()
{
last_action = Zero;
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(*v.vector));
+ vector.reset (new Epetra_FEVector(*v.vector));
}
last_action = Zero;
if (input_map.SameAs(v.vector->Map()) == true)
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(*v.vector));
+ vector.reset (new Epetra_FEVector(*v.vector));
else
{
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(input_map));
+ vector.reset (new Epetra_FEVector(input_map));
reinit (v, false, true);
}
}
last_action = Zero;
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(parallel_partitioner.make_trilinos_map(communicator,
- true)));
+ vector.reset (new Epetra_FEVector
+ (parallel_partitioner.make_trilinos_map(communicator,
+ true)));
reinit (v, false, true);
}
const bool fast)
{
if (!vector->Map().SameAs(input_map))
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(input_map));
+ vector.reset (new Epetra_FEVector(input_map));
else if (fast == false)
{
const int ierr = vector->PutScalar(0.);
{
if (vector->Map().SameAs(v.vector->Map()) == false)
{
- vector.reset();
-
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(v.vector->Map()));
+ vector.reset (new Epetra_FEVector(v.vector->Map()));
last_action = Zero;
}
else if (fast == false)
v.block(0).vector_partitioner().Comm());
if (import_data == false)
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector (new_map));
+ vector.reset (new Epetra_FEVector (new_map));
- Teuchos::RCP<Epetra_FEVector> actual_vec = (import_data == true) ?
- Teuchos::rcp (new Epetra_FEVector (new_map), true) :
+ Teuchos::RCP<Epetra_FEVector> actual_vec = (import_data == true) ?
+ Teuchos::rcp (new Epetra_FEVector (new_map), true) :
Teuchos::rcp (&*vector, false);
TrilinosScalar* entries = (*actual_vec)[0];
if (import_data == true)
{
- AssertThrow (static_cast<unsigned int>(actual_vec->GlobalLength())
+ AssertThrow (static_cast<unsigned int>(actual_vec->GlobalLength())
== v.size(),
- ExcDimensionMismatch (actual_vec->GlobalLength(),
+ ExcDimensionMismatch (actual_vec->GlobalLength(),
v.size()));
Epetra_Import data_exchange (vector->Map(), actual_vec->Map());
}
else
{
- vector.reset();
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(*v.vector));
+ vector.reset (new Epetra_FEVector(*v.vector));
last_action = Zero;
}
if (vector->Map().SameAs(m.col_partitioner()) == false)
{
Epetra_Map map = m.col_partitioner();
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
Epetra_Import data_exchange (vector->Map(), v.vector->Map());
{
last_action = Zero;
Epetra_LocalMap map (0, 0, Utilities::Trilinos::comm_self());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
{
last_action = Zero;
Epetra_LocalMap map ((int)n, 0, Utilities::Trilinos::comm_self());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector (map));
+ vector.reset (new Epetra_FEVector (map));
}
Epetra_LocalMap map (input_map.NumGlobalElements(),
input_map.IndexBase(),
input_map.Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
Epetra_SerialComm());
(void)communicator;
#endif
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
v.vector->Map().IndexBase(),
v.vector->Map().Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
if (vector->Map().SameAs(v.vector->Map()) == true)
{
{
if (size() != n)
{
- vector.reset();
-
Epetra_LocalMap map ((int)n, 0,
Utilities::Trilinos::comm_self());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector (map));
+ vector.reset (new Epetra_FEVector (map));
}
else if (fast == false)
{
{
if (vector->Map().NumGlobalElements() != input_map.NumGlobalElements())
{
- vector.reset();
Epetra_LocalMap map (input_map.NumGlobalElements(),
input_map.IndexBase(),
input_map.Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector (map));
+ vector.reset (new Epetra_FEVector (map));
}
else if (fast == false)
{
if (vector->Map().NumGlobalElements() !=
static_cast<int>(partitioning.size()))
{
- vector.reset();
Epetra_LocalMap map (partitioning.size(),
0,
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
Epetra_SerialComm());
(void)communicator;
#endif
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
else if (fast == false)
{
{
if (local_range() != v.local_range())
{
- vector.reset();
Epetra_LocalMap map (v.vector->GlobalLength(),
v.vector->Map().IndexBase(),
v.vector->Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
else
{
{
if (size() != v.size())
{
- vector.reset();
Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
v.vector->Map().IndexBase(),
v.vector->Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
reinit (v, false, true);
Epetra_LocalMap map (v.vector->Map().NumGlobalElements(),
v.vector->Map().IndexBase(),
v.vector->Comm());
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
}
const int ierr = vector->Update(1.0, *v.vector, 0.0);
last_action (Zero),
compressed (true),
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
- vector(std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(
- Epetra_Map(0,0,Epetra_MpiComm(MPI_COMM_SELF)))))
+ vector(new Epetra_FEVector(
+ Epetra_Map(0,0,Epetra_MpiComm(MPI_COMM_SELF))))
#else
- vector(std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(
- Epetra_Map(0,0,Epetra_SerialComm()))))
+ vector(new Epetra_FEVector(
+ Epetra_Map(0,0,Epetra_SerialComm())))
#endif
{}
Subscriptor(),
last_action (Zero),
compressed (true),
- vector(std_cxx1x::shared_ptr<Epetra_FEVector>
- (new Epetra_FEVector(*v.vector)))
+ vector(new Epetra_FEVector(*v.vector))
{}
// When we clear the vector,
// reset the pointer and generate
// an empty vector.
- vector.reset();
-
#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
Epetra_Map map (0, 0, Epetra_MpiComm(MPI_COMM_SELF));
#else
Epetra_Map map (0, 0, Epetra_SerialComm());
#endif
- vector = std_cxx1x::shared_ptr<Epetra_FEVector> (new Epetra_FEVector(map));
+ vector.reset (new Epetra_FEVector(map));
last_action = Zero;
}
if (local_range() != v.local_range())
{
- vector.reset();
last_action = Zero;
- vector = std_cxx1x::shared_ptr<Epetra_FEVector>(new Epetra_FEVector(*v.vector));
+ vector.reset (new Epetra_FEVector(*v.vector));
}
else
{