46 #include "Epetra_Map.h"
47 #include "Epetra_CrsMatrix.h"
50 #include "Epetra_MpiComm.h"
55 #include "Epetra_Comm.h"
56 #include "Epetra_SerialComm.h"
58 #include "BelosConfigDefs.hpp"
59 #include "BelosMVOPTester.hpp"
60 #include "BelosEpetraAdapter.hpp"
62 #ifdef HAVE_EPETRA_THYRA
70 int main(
int argc,
char *argv[])
73 using Teuchos::rcp_implicit_cast;
83 MPI_Init(&argc,&argv);
96 int MyPID = Comm->MyPID();
100 if (argv[1][0]==
'-' && argv[1][1]==
'v') {
110 int NumMyElements = Map->NumMyElements();
111 std::vector<int> MyGlobalElements(NumMyElements);
112 Map->MyGlobalElements(&MyGlobalElements[0]);
117 std::vector<int> NumNz(NumMyElements);
121 for (i=0; i<NumMyElements; i++) {
122 if (MyGlobalElements[i]==0 || MyGlobalElements[i] == dim-1) {
136 std::vector<double> Values(2);
137 Values[0] = -1.0; Values[1] = -1.0;
138 std::vector<int> Indices(2);
141 for (i=0; i<NumMyElements; i++) {
142 if (MyGlobalElements[i]==0) {
146 else if (MyGlobalElements[i] == dim-1) {
151 Indices[0] = MyGlobalElements[i]-1;
152 Indices[1] = MyGlobalElements[i]+1;
155 ierr = A->InsertGlobalValues(MyGlobalElements[i],NumEntries,&Values[0],&Indices[0]);
158 ierr = A->InsertGlobalValues(MyGlobalElements[i],1,&two,&MyGlobalElements[i]);
163 ierr = A->FillComplete();
181 MyOM->setVerbosity( Belos::Errors + Belos::Warnings );
184 #ifdef HAVE_EPETRA_THYRA
185 typedef Thyra::MultiVectorBase<double> TMVB;
186 typedef Thyra::LinearOpBase<double> TLOB;
203 ierr = Belos::TestMultiVecTraits<double,TMVB>(MyOM,thyra_ivec);
207 if ( verbose && MyPID==0 ) {
208 std::cout <<
"*** ThyraAdapter PASSED TestMultiVecTraits()" << std::endl;
212 if ( verbose && MyPID==0 ) {
213 std::cout <<
"*** ThyraAdapter FAILED TestMultiVecTraits() ***"
214 << std::endl << std::endl;
220 ierr = Belos::TestOperatorTraits<double,TMVB,TLOB>(MyOM,thyra_ivec,thyra_op);
224 if ( verbose && MyPID==0 ) {
225 std::cout <<
"*** ThyraAdapter PASSED TestOperatorTraits()" << std::endl;
229 if ( verbose && MyPID==0 ) {
230 std::cout <<
"*** ThyraAdapter FAILED TestOperatorTraits() ***"
231 << std::endl << std::endl;
242 if (verbose && MyPID==0)
243 std::cout <<
"End Result: TEST FAILED" << std::endl;
249 if (verbose && MyPID==0)
250 std::cout <<
"End Result: TEST PASSED" << std::endl;
int main(int argc, char *argv[])
RCP< const VectorSpaceBase< double > > create_VectorSpace(const RCP< const Epetra_Map > &epetra_map)
Thyra specializations of MultiVecTraits and OperatorTraits.
RCP< MultiVectorBase< double > > create_MultiVector(const RCP< Epetra_MultiVector > &epetra_mv, const RCP< const VectorSpaceBase< double > > &range=Teuchos::null, const RCP< const VectorSpaceBase< double > > &domain=Teuchos::null)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)