15 #include "Epetra_Map.h"
16 #include "Epetra_CrsMatrix.h"
19 #include "Epetra_MpiComm.h"
24 #include "Epetra_Comm.h"
25 #include "Epetra_SerialComm.h"
27 #include "BelosConfigDefs.hpp"
28 #include "BelosMVOPTester.hpp"
29 #include "BelosEpetraAdapter.hpp"
31 #ifdef HAVE_EPETRA_THYRA
39 int main(
int argc,
char *argv[])
42 using Teuchos::rcp_implicit_cast;
52 MPI_Init(&argc,&argv);
65 int MyPID = Comm->MyPID();
69 if (argv[1][0]==
'-' && argv[1][1]==
'v') {
79 int NumMyElements = Map->NumMyElements();
80 std::vector<int> MyGlobalElements(NumMyElements);
81 Map->MyGlobalElements(&MyGlobalElements[0]);
86 std::vector<int> NumNz(NumMyElements);
90 for (i=0; i<NumMyElements; i++) {
91 if (MyGlobalElements[i]==0 || MyGlobalElements[i] == dim-1) {
105 std::vector<double> Values(2);
106 Values[0] = -1.0; Values[1] = -1.0;
107 std::vector<int> Indices(2);
110 for (i=0; i<NumMyElements; i++) {
111 if (MyGlobalElements[i]==0) {
115 else if (MyGlobalElements[i] == dim-1) {
120 Indices[0] = MyGlobalElements[i]-1;
121 Indices[1] = MyGlobalElements[i]+1;
124 ierr = A->InsertGlobalValues(MyGlobalElements[i],NumEntries,&Values[0],&Indices[0]);
127 ierr = A->InsertGlobalValues(MyGlobalElements[i],1,&two,&MyGlobalElements[i]);
132 ierr = A->FillComplete();
150 MyOM->setVerbosity( Belos::Errors + Belos::Warnings );
153 #ifdef HAVE_EPETRA_THYRA
154 typedef Thyra::MultiVectorBase<double> TMVB;
155 typedef Thyra::LinearOpBase<double> TLOB;
172 ierr = Belos::TestMultiVecTraits<double,TMVB>(MyOM,thyra_ivec);
176 if ( verbose && MyPID==0 ) {
177 std::cout <<
"*** ThyraAdapter PASSED TestMultiVecTraits()" << std::endl;
181 if ( verbose && MyPID==0 ) {
182 std::cout <<
"*** ThyraAdapter FAILED TestMultiVecTraits() ***"
183 << std::endl << std::endl;
189 ierr = Belos::TestOperatorTraits<double,TMVB,TLOB>(MyOM,thyra_ivec,thyra_op);
193 if ( verbose && MyPID==0 ) {
194 std::cout <<
"*** ThyraAdapter PASSED TestOperatorTraits()" << std::endl;
198 if ( verbose && MyPID==0 ) {
199 std::cout <<
"*** ThyraAdapter FAILED TestOperatorTraits() ***"
200 << std::endl << std::endl;
211 if (verbose && MyPID==0)
212 std::cout <<
"End Result: TEST FAILED" << std::endl;
218 if (verbose && MyPID==0)
219 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)