| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Belos: Block Linear Solvers Package |
| 4 |
// |
| 5 |
// Copyright 2004-2016 NTESS and the Belos contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef BELOS_EPETRA_UTILS_H |
| 11 |
#define BELOS_EPETRA_UTILS_H |
| 12 |
|
| 13 |
/*! \file BelosEpetraUtils.h |
| 14 |
\brief Provides utilities for Epetra examples and tests. |
| 15 |
*/ |
| 16 |
|
| 17 |
#include "Epetra_config.h" |
| 18 |
#include "Belos_config.h" |
| 19 |
|
| 20 |
// RWH TODO FIXME: Trilinos_Util_distrib_msr_matrix available only if 32 bit GIDs available. |
| 21 |
#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES |
| 22 |
|
| 23 |
#ifdef EPETRA_MPI |
| 24 |
#include "mpi.h" |
| 25 |
#endif |
| 26 |
|
| 27 |
class Epetra_Map; |
| 28 |
class Epetra_Comm; |
| 29 |
class Epetra_CrsMatrix; |
| 30 |
class Epetra_MultiVector; |
| 31 |
|
| 32 |
#include "Teuchos_RCP.hpp" |
| 33 |
#include "Teuchos_Ptr.hpp" |
| 34 |
using Teuchos::RCP; |
| 35 |
using Teuchos::rcp; |
| 36 |
|
| 37 |
namespace Belos { |
| 38 |
|
| 39 |
namespace Util { |
| 40 |
|
| 41 |
#ifdef HAVE_BELOS_TRIUTILS |
| 42 |
|
| 43 |
int createEpetraProblem( |
| 44 |
std::string &filename |
| 45 |
,RCP<Epetra_Map> *rowMap |
| 46 |
,RCP<Epetra_CrsMatrix> *A |
| 47 |
,RCP<Epetra_MultiVector> *B |
| 48 |
,RCP<Epetra_MultiVector> *X |
| 49 |
,int *MyPID |
| 50 |
,int &numRHS |
| 51 |
); |
| 52 |
|
| 53 |
int createEpetraProblem( |
| 54 |
std::string &filename |
| 55 |
,RCP<Epetra_Map> *rowMap |
| 56 |
,RCP<Epetra_CrsMatrix> *A |
| 57 |
,RCP<Epetra_MultiVector> *B |
| 58 |
,RCP<Epetra_MultiVector> *X |
| 59 |
,int *MyPID |
| 60 |
); |
| 61 |
|
| 62 |
#endif |
| 63 |
|
| 64 |
int rebalanceEpetraProblem( |
| 65 |
RCP<Epetra_Map> &rowMap |
| 66 |
,RCP<Epetra_CrsMatrix> &A |
| 67 |
,RCP<Epetra_MultiVector> &B |
| 68 |
,RCP<Epetra_MultiVector> &X |
| 69 |
,Epetra_Comm &Comm |
| 70 |
); |
| 71 |
|
| 72 |
} // namespace Util |
| 73 |
|
| 74 |
namespace Test { |
| 75 |
class MPISession { |
| 76 |
public: |
| 77 |
MPISession (Teuchos::Ptr<int> argc, Teuchos::Ptr<char**> argv); |
| 78 |
~MPISession (); |
| 79 |
Teuchos::RCP<const Epetra_Comm> getComm (); |
| 80 |
|
| 81 |
private: |
| 82 |
// Lazily initialized Epetra communicator wrapper. |
| 83 |
Teuchos::RCP<Epetra_Comm> comm_; |
| 84 |
}; |
| 85 |
} // namespace Test |
| 86 |
|
| 87 |
} // namespace Belos |
| 88 |
|
| 89 |
#endif // EPETRA_NO_32BIT_GLOBAL_INDICES |
| 90 |
|
| 91 |
#endif // BELOS_EPETRA_UTILS_H |