Skip to content

Commit

Permalink
Merge branch 'thyra_FROSch_sort' of https://github.com/roeverf/Trilinos
Browse files Browse the repository at this point in the history
… into FROSch_Thyra

* 'thyra_FROSch_sort' of https://github.com/roeverf/Trilinos:
  Clean Up
  Epetra Version
  Eliminate Epetra Version->Files located at src/adapters/Epetra
  Thyra_FROSCh_Xpetra
  Use Amesos Klu as subdomain solver
  fix #1
  thyra test
  New initialize()
  ExtractFromParameterList
  TwoLevelPreconditioner+ExtractCoordinates(not tested )
  no message
  no message
  example stratimikos
  ParameterList Issue
  ZwischenStand Thyra
  Thyra_FROSch_Epetra
  Thyra -> New start
  Test Thyra Adapters-> still not working -> wrong Map
  Test Thyra_FROSch —not working yet!
  interface start
  • Loading branch information
Alexander Heinlein committed Aug 27, 2018
2 parents 3e7d020 + e0fbdb5 commit d8cdf26
Show file tree
Hide file tree
Showing 32 changed files with 3,271 additions and 27 deletions.
1 change: 1 addition & 0 deletions packages/muelu/adapters/epetra/MueLu_EpetraOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ int EpetraOperator::ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector
<< e.what() << std::endl;
return -1;
}

return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,37 +127,37 @@ namespace Thyra {
TEUCHOS_TEST_FOR_EXCEPT((bIsEpetra != bIsTpetra) && bIsBlocked == true);

RCP<XpMat> A = Teuchos::null;
if(bIsBlocked) {
Teuchos::RCP<const Thyra::BlockedLinearOpBase<Scalar> > ThyBlockedOp =
Teuchos::rcp_dynamic_cast<const Thyra::BlockedLinearOpBase<Scalar> >(fwdOp);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(ThyBlockedOp));
if(bIsBlocked) {
Teuchos::RCP<const Thyra::BlockedLinearOpBase<Scalar> > ThyBlockedOp =
Teuchos::rcp_dynamic_cast<const Thyra::BlockedLinearOpBase<Scalar> >(fwdOp);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(ThyBlockedOp));

TEUCHOS_TEST_FOR_EXCEPT(ThyBlockedOp->blockExists(0,0)==false);
TEUCHOS_TEST_FOR_EXCEPT(ThyBlockedOp->blockExists(0,0)==false);

Teuchos::RCP<const LinearOpBase<Scalar> > b00 = ThyBlockedOp->getBlock(0,0);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(b00));
Teuchos::RCP<const LinearOpBase<Scalar> > b00 = ThyBlockedOp->getBlock(0,0);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(b00));

RCP<const XpCrsMat > xpetraFwdCrsMat00 = XpThyUtils::toXpetra(b00);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMat00));
RCP<const XpCrsMat > xpetraFwdCrsMat00 = XpThyUtils::toXpetra(b00);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMat00));

// MueLu needs a non-const object as input
RCP<XpCrsMat> xpetraFwdCrsMatNonConst00 = Teuchos::rcp_const_cast<XpCrsMat>(xpetraFwdCrsMat00);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMatNonConst00));
// MueLu needs a non-const object as input
RCP<XpCrsMat> xpetraFwdCrsMatNonConst00 = Teuchos::rcp_const_cast<XpCrsMat>(xpetraFwdCrsMat00);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMatNonConst00));

// wrap the forward operator as an Xpetra::Matrix that MueLu can work with
RCP<XpMat> A00 = rcp(new Xpetra::CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node>(xpetraFwdCrsMatNonConst00));
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(A00));
// wrap the forward operator as an Xpetra::Matrix that MueLu can work with
RCP<XpMat> A00 = rcp(new Xpetra::CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node>(xpetraFwdCrsMatNonConst00));
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(A00));

RCP<const XpMap> rowmap00 = A00->getRowMap();
RCP< const Teuchos::Comm< int > > comm = rowmap00->getComm();
RCP<const XpMap> rowmap00 = A00->getRowMap();
RCP< const Teuchos::Comm< int > > comm = rowmap00->getComm();

// create a Xpetra::BlockedCrsMatrix which derives from Xpetra::Matrix that MueLu can work with
RCP<XpBlockedCrsMat> bMat = Teuchos::rcp(new XpBlockedCrsMat(ThyBlockedOp, comm));
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(bMat));
// create a Xpetra::BlockedCrsMatrix which derives from Xpetra::Matrix that MueLu can work with
RCP<XpBlockedCrsMat> bMat = Teuchos::rcp(new XpBlockedCrsMat(ThyBlockedOp, comm));
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(bMat));

// save blocked matrix
A = bMat;
} else {
// save blocked matrix
A = bMat;
} else {
RCP<const XpCrsMat > xpetraFwdCrsMat = XpThyUtils::toXpetra(fwdOp);
TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMat));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,16 @@ void XpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node>::applyImpl(

TEUCHOS_TEST_FOR_EXCEPTION(getConstXpetraOperator() == Teuchos::null, MueLu::Exceptions::RuntimeError, "XpetraLinearOp::applyImpl: internal Xpetra::Operator is null.");
RCP< const Teuchos::Comm< int > > comm = getConstXpetraOperator()->getRangeMap()->getComm();

comm->barrier();
comm->barrier();
comm->barrier();
if(comm->getRank() == 0) std::cout<<"LinearOP Base line 163\n";
const RCP<const Xpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > tX_in =
Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toXpetra(rcpFromRef(X_in), comm);
comm->barrier();
comm->barrier();
comm->barrier();
if(comm->getRank() == 0) std::cout<<"LinearOP Base line 169\n";
RCP<Xpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > tY_inout =
Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toXpetra(rcpFromPtr(Y_inout), comm);
Teuchos::ETransp transp;
Expand Down
9 changes: 9 additions & 0 deletions packages/shylu/shylu_dd/frosch/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/InterfaceSets)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/SchwarzOperators)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/SchwarzPreconditioners)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Tools)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/adapters)



APPEND_SET(HEADERS
Expand Down Expand Up @@ -102,6 +104,13 @@ APPEND_SET(HEADERS
Tools/FROSch_SubdomainSolver_def.hpp
Tools/FROSch_Tools_decl.hpp
Tools/FROSch_Tools_def.hpp
adapters/FROSch_XpetraOperator_decl.hpp
adapters/stratimikos_FROSchXpetra.hpp
adapters/Thyra_FROSchLinearOp_decl.hpp
adapters/Thyra_FROSchLinearOp_def.hpp
adapters/Thyra_FROSchXpetraFactory_decl.hpp
adapters/Thyra_FROSchXpetraFactory_def.hpp

)

# Set sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace FROSch {

MultiVectorPtr xTmp = Xpetra::MultiVectorFactory<SC,LO,GO,NO>::Build(x.getMap(),x.getNumVectors());
*xTmp = x;

Teuchos::RCP<const Teuchos::Comm<int> > Comm = x.getMap()->getComm();
if (!usePreconditionerOnly && mode == Teuchos::NO_TRANS) {
this->K_->apply(x,*xTmp,mode,1.0,0.0);
}
Expand All @@ -88,8 +88,11 @@ namespace FROSch {
xOverlap->doImport(*xTmp,*Scatter_,Xpetra::INSERT);

xOverlap->replaceMap(OverlappingMatrix_->getRangeMap());

Comm->barrier(); Comm->barrier(); Comm->barrier();
if(Comm->getRank()==0)std::cout<<"Overlapping Op Before Subdomain Solve\n";
SubdomainSolver_->apply(*xOverlap,*yOverlap,mode,1.0,0.0);
Comm->barrier(); Comm->barrier(); Comm->barrier();
if(Comm->getRank()==0)std::cout<<"Overlapping Op After Subdomain Solve\n";

yOverlap->replaceMap(OverlappingMap_);

Expand Down
Loading

0 comments on commit d8cdf26

Please sign in to comment.