20 #include "Epetra_MpiComm.h"
22 #include "Epetra_SerialComm.h"
25 #include "Epetra_Map.h"
26 #include "Epetra_CrsMatrix.h"
27 #include "Epetra_Vector.h"
30 #include "Thyra_LinearOpBase.hpp"
31 #include "Thyra_VectorBase.hpp"
34 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
35 #include "Thyra_LinearOpWithSolveHelpers.hpp"
36 #include "Thyra_DefaultZeroLinearOp.hpp"
37 #include "Thyra_DefaultProductVector.hpp"
38 #include "Thyra_DefaultProductVectorSpace.hpp"
39 #include "Thyra_MultiVectorStdOps.hpp"
40 #include "Thyra_VectorStdOps.hpp"
41 #include "Thyra_DefaultBlockedLinearOp.hpp"
50 Epetra_Map map(nx*comm.NumProc(),0,comm);
53 int offsets[3] = {-1, 0, 1 };
54 double values[3] = { -1, 2, -1};
55 int maxGid = map.MaxAllGID();
56 for(
int lid=0;lid<nx;lid++) {
57 int gid = mat->GRID(lid);
58 int numEntries = 3, offset = 0;
59 int indices[3] = { gid+offsets[0],
70 mat->InsertGlobalValues(gid,numEntries,values+offset,indices+offset);
81 Epetra_MpiComm Comm(MPI_COMM_WORLD);
83 Epetra_SerialComm Comm;
101 tA = Thyra::epetraLinearOp( mat );
121 Thyra::linearOpWithSolve(*lowsFactory, tA);
124 Thyra::SolveStatus<double> status;
125 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx0.
ptr());
126 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx1.ptr());
133 Epetra_MpiComm Comm(MPI_COMM_WORLD);
135 Epetra_SerialComm Comm;
153 = Thyra::epetraLinearOp( mat );
155 = Thyra::zero(tA_sub->range(),tA_sub->domain());
157 tA = Thyra::block2x2(tA_sub,zero,zero,tA_sub);
164 Thyra::randomize(-1.0,1.0,tb_m.ptr());
171 tx0 = Thyra::createMember(tA->domain());
172 tx1 = Thyra::createMember(tA->domain());
174 Thyra::randomize(-1.0,1.0,tx0.
ptr());
175 Thyra::randomize(-1.0,1.0,tx1.ptr());
190 Thyra::linearOpWithSolve(*lowsFactory, tA);
193 Thyra::SolveStatus<double> status;
194 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx0.
ptr());
195 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx1.
ptr());
TEUCHOS_UNIT_TEST(belos_gcrodr, multiple_solves)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void setParameterList(RCP< ParameterList > const ¶mList)
RCP< VectorBase< double > > create_Vector(const RCP< Epetra_Vector > &epetra_v, const RCP< const VectorSpaceBase< double > > &space=Teuchos::null)
RCP< Thyra::LinearOpWithSolveFactoryBase< Scalar > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const
Teuchos::RCP< Epetra_CrsMatrix > buildMatrix(int nx, Epetra_Comm &comm)
Concrete subclass of Thyra::LinearSolverBuilderBase for creating Thyra::LinearOpWithSolveFactoryBase ...