Skip to content

Commit

Permalink
Merge Pull Request #8825 from searhein/Trilinos/subdomain-solver
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: ShyLU_DD/FROSch: Replace FROSch::SubomainSolver by FROSch::SolverFactory
PR Author: searhein
  • Loading branch information
trilinos-autotester authored Mar 9, 2021
2 parents daf2b21 + 519376d commit e981d58
Show file tree
Hide file tree
Showing 89 changed files with 4,947 additions and 633 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@

#cmakedefine HAVE_SHYLU_DDFROSCH_ZOLTAN2


#cmakedefine HAVE_SHYLU_DDFROSCH_HDF5
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//@HEADER
// ************************************************************************
//
// ShyLU: Hybrid preconditioner package
// Copyright 2012 Sandia Corporation
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Alexander Heinlein ([email protected])
//
// ************************************************************************
//@HEADER

#ifndef _STRATIMIKOS_FROSCH_DECL_HPP
#define _STRATIMIKOS_FROSCH_DECL_HPP

#include <ShyLU_DDFROSch_config.h>

#ifdef HAVE_SHYLU_DDFROSCH_STRATIMIKOS
#include "Stratimikos_DefaultLinearSolverBuilder.hpp"

#include "Teuchos_RCP.hpp"
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_TestForException.hpp"
#include "Teuchos_AbstractFactoryStd.hpp"


namespace Thyra {

template <class SC,
class LO,
class GO,
class NO>
class FROSchFactory;
}

namespace Stratimikos {

using namespace std;
using namespace Teuchos;
using namespace Thyra;

template <typename LO = int,
typename GO = int,
typename NO = KokkosClassic::DefaultNode::DefaultNodeType>
void enableFROSch(DefaultLinearSolverBuilder& builder,
const string& stratName = "FROSch");
} // namespace Stratimikos

#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -39,48 +39,36 @@
// ************************************************************************
//@HEADER

#ifndef THYRA_FROSCH_XPETRA_FACTORY_HPP
#define THYRA_FROSCH_XPETRA_FACTORY_HPP
#ifndef _STRATIMIKOS_FROSCH_DEF_HPP
#define _STRATIMIKOS_FROSCH_DEF_HPP

#include <ShyLU_DDFROSch_config.h>

#ifdef HAVE_SHYLU_DDFROSCH_STRATIMIKOS
#include "Stratimikos_DefaultLinearSolverBuilder.hpp"
#include "Stratimikos_FROSch_decl.hpp"

#include "Thyra_FROSchFactory_def.hpp"

#include "Teuchos_RCP.hpp"
#include "Teuchos_ParameterList.hpp"
#include "Teuchos_TestForException.hpp"
#include "Teuchos_AbstractFactoryStd.hpp"

#include <string>


namespace Stratimikos {

using namespace std;
using namespace Teuchos;
using namespace Thyra;

template <typename LO = int,typename GO = int,typename NO = KokkosClassic::DefaultNode::DefaultNodeType>
template <typename LO,typename GO,typename NO>
void enableFROSch (DefaultLinearSolverBuilder& builder,
const string& stratName = "FROSch")
const string& stratName)
{
const RCP<const ParameterList> precValidParams = sublist(builder.getValidParameters(), "Preconditioner Types");

TEUCHOS_TEST_FOR_EXCEPTION(precValidParams->isParameter(stratName), logic_error,
"Stratimikos::enableFROSch cannot add \"" + stratName +"\" because it is already included in builder!");

using Base = PreconditionerFactoryBase<double>;
using Base = PreconditionerFactoryBase<double>;
if (!stratName.compare("FROSch")) {
using Impl = FROSchFactory<double, LO, GO, NO> ;
using Impl = FROSchFactory<double, LO, GO, NO>;
builder.setPreconditioningStrategyFactory(abstractFactoryStd<Base, Impl>(), stratName);
}
}

} // namespace Stratimikos

#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
// ************************************************************************
//@HEADER

#ifndef THYRA_FROSCH_XPETRA_FACTORY_DECL_HPP
#define THYRA_FROSCH_XPETRA_FACTORY_DECL_HPP
#ifndef _THYRA_FROSCH_FACTORY_DECL_HPP
#define _THYRA_FROSCH_FACTORY_DECL_HPP

#include <ShyLU_DDFROSch_config.h>

Expand Down Expand Up @@ -83,15 +83,11 @@
#endif

//FROSch
#include <FROSch_AlgebraicOverlappingPreconditioner_def.hpp>
#include <FROSch_GDSWPreconditioner_def.hpp>
#include <FROSch_RGDSWPreconditioner_def.hpp>
#include <FROSch_OneLevelPreconditioner_def.hpp>
#include <FROSch_TwoLevelPreconditioner_def.hpp>
#include <FROSch_TwoLevelBlockPreconditioner_def.hpp>
#include <Thyra_FROSchLinearOp_def.hpp>
#include <FROSch_Tools_def.hpp>

#include <FROSch_SchwarzPreconditioners_fwd.hpp>


namespace Thyra {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,24 @@
// ************************************************************************
//@HEADER

#ifndef THYRA_FROSCH_XPETRA_FACTORY_DEF_HPP
#define THYRA_FROSCH_XPETRA_FACTORY_DEF_HPP
#ifndef _THYRA_FROSCH_FACTORY_DEF_HPP
#define _THYRA_FROSCH_FACTORY_DEF_HPP

#include "Thyra_FROSchFactory_decl.hpp"

#include <FROSch_AlgebraicOverlappingPreconditioner_def.hpp>
#include <FROSch_GDSWPreconditioner_def.hpp>
#include <FROSch_RGDSWPreconditioner_def.hpp>
#include <FROSch_OneLevelPreconditioner_def.hpp>
#include <FROSch_TwoLevelPreconditioner_def.hpp>
#include <FROSch_TwoLevelBlockPreconditioner_def.hpp>


namespace Thyra {

using namespace FROSch;
using namespace std;
using namespace Teuchos;
using namespace Thyra;
using namespace Xpetra;

//Constructor
Expand Down Expand Up @@ -272,7 +278,7 @@ namespace Thyra {
}
}

FROSCH_ASSERT(!repeatedMaps.is_null(),"FROSch::FROSchFactory : ERROR: repeatedMaps.is_null()");
FROSCH_ASSERT(!repeatedMaps.is_null(),"FROSch::FROSchFactory: repeatedMaps.is_null()");
// Extract the DofsPerNode vector
dofsPerNodeVector = ExtractVectorFromParameterList<UN>(*paramList_,"DofsPerNode Vector");
// Extract the DofOrdering vector
Expand All @@ -295,7 +301,7 @@ namespace Thyra {

SchwarzPreconditioner = TLBP;
} else {
FROSCH_ASSERT(false,"Thyra::FROSchFactory : ERROR: Preconditioner Type is unknown.");
FROSCH_ASSERT(false,"Thyra::FROSchFactory: Preconditioner Type is unknown.");
}

SchwarzPreconditioner->compute();
Expand Down Expand Up @@ -344,7 +350,7 @@ namespace Thyra {
TLBP->resetMatrix(A);
SchwarzPreconditioner = TLBP;
} else {
FROSCH_ASSERT(false,"Thyra::FROSchFactory : ERROR: Preconditioner Type is unknown.");
FROSCH_ASSERT(false,"Thyra::FROSchFactory: Preconditioner Type is unknown.");
}
// recompute SchwarzPreconditioner
SchwarzPreconditioner->compute();
Expand Down Expand Up @@ -441,7 +447,7 @@ namespace Thyra {
#endif
}
}
FROSCH_ASSERT(!repeatedMap.is_null(),"FROSch::FROSchFactory : ERROR: repeatedMap.is_null()");
FROSCH_ASSERT(!repeatedMap.is_null(),"FROSch::FROSchFactory: repeatedMap.is_null()");
}
return repeatedMap;
}
Expand All @@ -465,7 +471,7 @@ namespace Thyra {
#endif
}
}
FROSCH_ASSERT(!coordinatesList.is_null(),"FROSch::FROSchFactory : ERROR: coordinatesList.is_null()");
FROSCH_ASSERT(!coordinatesList.is_null(),"FROSch::FROSchFactory: coordinatesList.is_null()");
}
return coordinatesList;
}
Expand All @@ -489,7 +495,7 @@ namespace Thyra {
#endif
}
}
FROSCH_ASSERT(!nullSpaceBasis.is_null(),"FROSch::FROSchFactory : ERROR: nullSpaceBasis.is_null()");
FROSCH_ASSERT(!nullSpaceBasis.is_null(),"FROSch::FROSchFactory: nullSpaceBasis.is_null()");
}
return nullSpaceBasis;
}
Expand Down
Loading

0 comments on commit e981d58

Please sign in to comment.