| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// ShyLU: Scalable Hybrid LU Preconditioner and Solver |
| 4 |
// |
| 5 |
// Copyright 2011 NTESS and the ShyLU contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef _FROSCH_INTERFACEPARTITIONOFUNITY_DEF_HPP |
| 11 |
#define _FROSCH_INTERFACEPARTITIONOFUNITY_DEF_HPP |
| 12 |
|
| 13 |
#include <FROSch_InterfacePartitionOfUnity_decl.hpp> |
| 14 |
|
| 15 |
|
| 16 |
namespace FROSch { |
| 17 |
|
| 18 |
using namespace Teuchos; |
| 19 |
using namespace Xpetra; |
| 20 |
|
| 21 |
template <class SC,class LO,class GO,class NO> |
| 22 |
InterfacePartitionOfUnity<SC,LO,GO,NO>::InterfacePartitionOfUnity(CommPtr mpiComm, |
| 23 |
CommPtr serialComm, |
| 24 |
UN dimension, |
| 25 |
UN dofsPerNode, |
| 26 |
ConstXMapPtr nodesMap, |
| 27 |
ConstXMapPtrVecPtr dofsMaps, |
| 28 |
ParameterListPtr parameterList, |
| 29 |
Verbosity verbosity, |
| 30 |
UN levelID) : |
| 31 |
PartitionOfUnity<SC,LO,GO,NO> (mpiComm,serialComm,dofsPerNode,nodesMap,dofsMaps,parameterList,verbosity,levelID) |
| 32 |
{ |
| 33 |
FROSCH_DETAILTIMER_START_LEVELID(interfacePartitionOfUnityTime,"InterfacePartitionOfUnity::InterfacePartitionOfUnity"); |
| 34 |
CommunicationStrategy communicationStrategy = CreateOneToOneMap; |
| 35 |
if (!this->ParameterList_->get("Interface Communication Strategy","CreateOneToOneMap").compare("CrsMatrix")) { |
| 36 |
communicationStrategy = CommCrsMatrix; |
| 37 |
} else if (!this->ParameterList_->get("Interface Communication Strategy","CreateOneToOneMap").compare("CrsGraph")) { |
| 38 |
communicationStrategy = CommCrsGraph; |
| 39 |
} else if (!this->ParameterList_->get("Interface Communication Strategy","CreateOneToOneMap").compare("CreateOneToOneMap")) { |
| 40 |
communicationStrategy = CreateOneToOneMap; |
| 41 |
} else { |
| 42 |
FROSCH_ASSERT(false,"FROSch::InterfacePartitionOfUnity: Specify a valid communication strategy for the identification of the interface components."); |
| 43 |
} |
| 44 |
|
| 45 |
DDInterface_.reset(new DDInterface<SC,LO,GO,NO>(dimension,dofsPerNode,nodesMap.getConst(),this->Verbosity_,this->LevelID_,communicationStrategy)); |
| 46 |
DDInterface_->resetGlobalDofs(dofsMaps); |
| 47 |
} |
| 48 |
|
| 49 |
template <class SC,class LO,class GO,class NO> |
| 50 |
InterfacePartitionOfUnity<SC,LO,GO,NO>::~InterfacePartitionOfUnity() |
| 51 |
{ |
| 52 |
|
| 53 |
} |
| 54 |
|
| 55 |
template <class SC,class LO,class GO,class NO> |
| 56 |
typename InterfacePartitionOfUnity<SC,LO,GO,NO>::ConstDDInterfacePtr InterfacePartitionOfUnity<SC,LO,GO,NO>::getDDInterface() const |
| 57 |
{ |
| 58 |
return DDInterface_.getConst(); |
| 59 |
} |
| 60 |
|
| 61 |
template <class SC,class LO,class GO,class NO> |
| 62 |
typename InterfacePartitionOfUnity<SC,LO,GO,NO>::DDInterfacePtr InterfacePartitionOfUnity<SC,LO,GO,NO>::getDDInterfaceNonConst() const |
| 63 |
{ |
| 64 |
return DDInterface_; |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
#endif |