54 #include "Epetra_MpiComm.h"
56 #include "Epetra_SerialComm.h"
59 #include "Epetra_Map.h"
60 #include "Epetra_CrsMatrix.h"
61 #include "Epetra_Vector.h"
64 #include "Thyra_LinearOpBase.hpp"
65 #include "Thyra_VectorBase.hpp"
68 #include "Thyra_LinearOpWithSolveFactoryHelpers.hpp"
69 #include "Thyra_LinearOpWithSolveHelpers.hpp"
70 #include "Thyra_DefaultZeroLinearOp.hpp"
71 #include "Thyra_DefaultProductVector.hpp"
72 #include "Thyra_DefaultProductVectorSpace.hpp"
73 #include "Thyra_MultiVectorStdOps.hpp"
74 #include "Thyra_VectorStdOps.hpp"
75 #include "Thyra_DefaultBlockedLinearOp.hpp"
84 Epetra_Map map(nx*comm.NumProc(),0,comm);
87 int offsets[3] = {-1, 0, 1 };
88 double values[3] = { -1, 2, -1};
89 int maxGid = map.MaxAllGID();
90 for(
int lid=0;lid<nx;lid++) {
91 int gid = mat->GRID(lid);
92 int numEntries = 3, offset = 0;
93 int indices[3] = { gid+offsets[0],
104 mat->InsertGlobalValues(gid,numEntries,values+offset,indices+offset);
115 Epetra_MpiComm Comm(MPI_COMM_WORLD);
117 Epetra_SerialComm Comm;
135 tA = Thyra::epetraLinearOp( mat );
155 Thyra::linearOpWithSolve(*lowsFactory, tA);
158 Thyra::SolveStatus<double> status;
159 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx0.
ptr());
160 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx1.ptr());
167 Epetra_MpiComm Comm(MPI_COMM_WORLD);
169 Epetra_SerialComm Comm;
187 = Thyra::epetraLinearOp( mat );
189 = Thyra::zero(tA_sub->range(),tA_sub->domain());
191 tA = Thyra::block2x2(tA_sub,zero,zero,tA_sub);
198 Thyra::randomize(-1.0,1.0,tb_m.ptr());
205 tx0 = Thyra::createMember(tA->domain());
206 tx1 = Thyra::createMember(tA->domain());
208 Thyra::randomize(-1.0,1.0,tx0.
ptr());
209 Thyra::randomize(-1.0,1.0,tx1.ptr());
224 Thyra::linearOpWithSolve(*lowsFactory, tA);
227 Thyra::SolveStatus<double> status;
228 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx0.
ptr());
229 status = Thyra::solve<double>(*lows, Thyra::NOTRANS, *tb, tx1.
ptr());
void setParameterList(RCP< ParameterList > const ¶mList)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< Thyra::LinearOpWithSolveFactoryBase< double > > createLinearSolveStrategy(const std::string &linearSolveStrategyName) const
RCP< VectorBase< double > > create_Vector(const RCP< Epetra_Vector > &epetra_v, const RCP< const VectorSpaceBase< double > > &space=Teuchos::null)
TEUCHOS_UNIT_TEST(belos_gcrodr, multiple_solves)
Concrete subclass of Thyra::LinearSolverBuilderBase for creating LinearOpWithSolveFactoryBase objects...
Teuchos::RCP< Epetra_CrsMatrix > buildMatrix(int nx, Epetra_Comm &comm)