本文整理汇总了C++中Level::DeclareInput方法的典型用法代码示例。如果您正苦于以下问题:C++ Level::DeclareInput方法的具体用法?C++ Level::DeclareInput怎么用?C++ Level::DeclareInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level
的用法示例。
在下文中一共展示了Level::DeclareInput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void PermutingSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level ¤tLevel) const {
currentLevel.DeclareInput("permP", permFact_.get());
currentLevel.DeclareInput("permQT", permFact_.get());
currentLevel.DeclareInput("A", permFact_.get()); // this is the permuted and scaled A!!!
currentLevel.DeclareInput("permScaling", permFact_.get());
}
示例2:
void PermutingSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level& currentLevel) const {
currentLevel.DeclareInput("permP", permFact_.get());
currentLevel.DeclareInput("permQT", permFact_.get());
currentLevel.DeclareInput("permScaling", permFact_.get());
s_->DeclareInput(currentLevel);
}
示例3: fineSFM
void RebalanceBlockRestrictionFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level &fineLevel, Level &coarseLevel) const {
Input(coarseLevel, "R");
std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
SetFactoryManager fineSFM (rcpFromRef(fineLevel), *it);
SetFactoryManager coarseSFM(rcpFromRef(coarseLevel), *it);
coarseLevel.DeclareInput("Importer",(*it)->GetFactory("Importer").get(), this);
coarseLevel.DeclareInput("Nullspace",(*it)->GetFactory("Nullspace").get(), this);
}
}
示例4: currentSFM
void SimpleSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level ¤tLevel) const {
currentLevel.DeclareInput("A",this->GetFactory("A").get());
TEUCHOS_TEST_FOR_EXCEPTION(FactManager_.size() != 2, Exceptions::RuntimeError,"MueLu::SimpleSmoother::DeclareInput: You have to declare two FactoryManagers with a \"Smoother\" object: One for predicting the primary variable and one for the SchurComplement system. The smoother for the SchurComplement system needs a SchurComplementFactory as input for variable \"A\". make sure that you use the same proper damping factors for omega both in the SchurComplementFactory and in the SIMPLE smoother!");
// loop over all factory managers for the subblocks of blocked operator A
std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
SetFactoryManager currentSFM (rcpFromRef(currentLevel), *it);
// request "Smoother" for current subblock row.
currentLevel.DeclareInput("PreSmoother",(*it)->GetFactory("Smoother").get());
}
}
示例5: GetParameterList
void MultiVectorTransferFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level &fineLevel, Level &coarseLevel) const {
const ParameterList & pL = GetParameterList();
std::string vectorName = pL.get<std::string>("Vector name");
fineLevel.DeclareInput(vectorName, GetFactory("Vector factory").get(), this);
Input(coarseLevel, "R");
}
示例6: currentSFM
void BlockedGaussSeidelSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level ¤tLevel) const {
//this->Input(currentLevel, "A");
// TODO: check me: why is this->Input not freeing properly A in release mode?
currentLevel.DeclareInput("A",this->GetFactory("A").get());
// loop over all factory managers for the subblocks of blocked operator A
std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
SetFactoryManager currentSFM (rcpFromRef(currentLevel), *it);
// request "Smoother" for current subblock row.
currentLevel.DeclareInput("PreSmoother",(*it)->GetFactory("Smoother").get());
}
//RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
}
示例7: Input
void UncoupledAggregationFactory<LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level& currentLevel) const {
Input(currentLevel, "Graph");
Input(currentLevel, "DofsPerNode");
const ParameterList& pL = GetParameterList();
std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name"), mapSmallAggName = pL.get<std::string>("SmallAgg aggregate map name");
if (mapOnePtName.length() > 0) {
RCP<const FactoryBase> mapOnePtFact = GetFactory("OnePt aggregate map factory");
currentLevel.DeclareInput(mapOnePtName, mapOnePtFact.get());
}
if (mapSmallAggName.length() > 0) {
RCP<const FactoryBase> mapSmallAggFact = GetFactory("SmallAgg aggregate map factory");
currentLevel.DeclareInput(mapSmallAggName, mapSmallAggFact.get());
}
}
示例8: GetParameterList
void RebalanceMapFactory<LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level & currentLevel) const {
const Teuchos::ParameterList & pL = GetParameterList();
std::string mapName = pL.get<std::string> ("Map name");
Teuchos::RCP<const FactoryBase> mapFactory = GetFactory ("Map factory");
currentLevel.DeclareInput(mapName,mapFactory.get(),this);
Input(currentLevel, "Importer");
} //DeclareInput()
示例9:
void BlockedCoarseMapFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level ¤tLevel) const {
this->Input(currentLevel, "Aggregates");
this->Input(currentLevel, "Nullspace");
// Get CoarseMap from previously defined block
RCP<const FactoryBase> prevCoarseMapFact = this->GetFactory("CoarseMap");
TEUCHOS_TEST_FOR_EXCEPTION(prevCoarseMapFact==Teuchos::null, Exceptions::RuntimeError, "MueLu::BlockedCoarseMapFactory::getDomainMapOffset: user did not specify CoarseMap of previous block. Do not forget to set the CoarseMap factory.");
currentLevel.DeclareInput("CoarseMap", prevCoarseMapFact.get(), this); // --
}
示例10: fineSFM
void BlockedPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level &fineLevel, Level &coarseLevel) const {
Input(fineLevel, "A");
//fineLevel.DeclareInput("A",AFact_.get(),this);
//Teuchos::RCP<Teuchos::FancyOStream> fos = Teuchos::getFancyOStream(Teuchos::rcpFromRef(std::cout));
std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
SetFactoryManager fineSFM (rcpFromRef(fineLevel), *it);
SetFactoryManager coarseSFM(rcpFromRef(coarseLevel), *it);
if (!restrictionMode_)
coarseLevel.DeclareInput("P",(*it)->GetFactory("P").get(), this);
else
coarseLevel.DeclareInput("R",(*it)->GetFactory("R").get(), this);
}
}
示例11: Input
void SaPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level &fineLevel, Level &coarseLevel) const {
Input(fineLevel, "A");
// Get default tentative prolongator factory
// Getting it that way ensure that the same factory instance will be used for both SaPFactory and NullspaceFactory.
RCP<const FactoryBase> initialPFact = GetFactory("P");
if (initialPFact == Teuchos::null) { initialPFact = coarseLevel.GetFactoryManager()->GetFactory("Ptent"); }
coarseLevel.DeclareInput("P", initialPFact.get(), this); // --
}
示例12: Input
void RigidBodyModeFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node, LocalMatOps>::DeclareInput(Level ¤tLevel) const {
if (currentLevel.IsAvailable(nspName_, NoFactory::get()) == false && currentLevel.GetLevelID() == 0) {
Input(currentLevel, "A");
//Input(currentLevel,"Coordinates");
}
if (currentLevel.GetLevelID() !=0) {
currentLevel.DeclareInput("Nullspace", GetFactory(nspName_).get(), this); /* ! "Nullspace" and nspName_ mismatch possible here */
}
}
示例13: currentSFM
void BraessSarazinSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level& currentLevel) const {
this->Input(currentLevel, "A");
TEUCHOS_TEST_FOR_EXCEPTION(FactManager_.is_null(), Exceptions::RuntimeError,
"MueLu::BraessSarazinSmoother::DeclareInput: FactManager_ must not be null! "
"Introduce a FactoryManager for the SchurComplement equation.");
// carefully call DeclareInput after switching to internal FactoryManager
{
SetFactoryManager currentSFM(rcpFromRef(currentLevel), FactManager_);
// request "Smoother" for current subblock row.
currentLevel.DeclareInput("PreSmoother", FactManager_->GetFactory("Smoother").get());
// request Schur matrix just in case
currentLevel.DeclareInput("A", FactManager_->GetFactory("A").get());
}
}
示例14: Input
void UncoupledAggregationFactory_kokkos<LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level& currentLevel) const {
Input(currentLevel, "Graph");
Input(currentLevel, "DofsPerNode");
const ParameterList& pL = GetParameterList();
// request special data necessary for OnePtAggregationAlgorithm
std::string mapOnePtName = pL.get<std::string>("OnePt aggregate map name");
if (mapOnePtName.length() > 0) {
std::string mapOnePtFactName = pL.get<std::string>("OnePt aggregate map factory");
if (mapOnePtFactName == "" || mapOnePtFactName == "NoFactory") {
currentLevel.DeclareInput(mapOnePtName, NoFactory::get());
} else {
RCP<const FactoryBase> mapOnePtFact = GetFactory(mapOnePtFactName);
currentLevel.DeclareInput(mapOnePtName, mapOnePtFact.get());
}
}
}
示例15: GetParameterList
void ToggleCoordinatesTransferFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput(Level& fineLevel, Level& coarseLevel) const {
const ParameterList& pL = GetParameterList();
TEUCHOS_TEST_FOR_EXCEPTION(!pL.isParameter("Chosen P"), Exceptions::RuntimeError, "MueLu::ToggleCoordinatesTransferFactory::DeclareInput: You have to set the 'Chosen P' parameter to a factory name of type TogglePFactory. The ToggleCoordinatesTransferFactory must be used together with a TogglePFactory!");
Input(coarseLevel,"Chosen P");
for (std::vector<RCP<const FactoryBase> >::const_iterator it = coordFacts_.begin(); it != coordFacts_.end(); ++it) {
coarseLevel.DeclareInput("Coordinates", (*it).get(), this); // request/release coarse coordinates
(*it)->CallDeclareInput(coarseLevel); // request dependencies
}
hasDeclaredInput_ = true;
}
开发者ID:FreeScienceCommunity,项目名称:trilinos,代码行数:10,代码来源:MueLu_ToggleCoordinatesTransferFactory_def.hpp