MueLu
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
MueLu_ConstraintFactory_def.hpp
Go to the documentation of this file.
1
// @HEADER
2
// *****************************************************************************
3
// MueLu: A package for multigrid based preconditioning
4
//
5
// Copyright 2012 NTESS and the MueLu contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef MUELU_CONSTRAINTFACTORY_DEF_HPP
11
#define MUELU_CONSTRAINTFACTORY_DEF_HPP
12
13
#include "
MueLu_ConstraintFactory_decl.hpp
"
14
15
#include "MueLu_Constraint.hpp"
16
#include "
MueLu_Monitor.hpp
"
17
18
namespace
MueLu
{
19
20
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
21
RCP<const ParameterList>
ConstraintFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::GetValidParameterList
()
const
{
22
RCP<ParameterList> validParamList = rcp(
new
ParameterList());
23
24
validParamList->set<RCP<const FactoryBase> >(
"FineNullspace"
, Teuchos::null,
"Generating factory for the nullspace"
);
25
validParamList->set<RCP<const FactoryBase> >(
"CoarseNullspace"
, Teuchos::null,
"Generating factory for the nullspace"
);
26
validParamList->set<RCP<const FactoryBase> >(
"Ppattern"
, Teuchos::null,
"Generating factory for the nonzero pattern"
);
27
28
return
validParamList;
29
}
30
31
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
32
void
ConstraintFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::DeclareInput
(
Level
& fineLevel,
Level
& coarseLevel)
const
{
33
Input
(fineLevel,
"Nullspace"
,
"FineNullspace"
);
34
Input
(coarseLevel,
"Nullspace"
,
"CoarseNullspace"
);
35
Input
(coarseLevel,
"Ppattern"
);
36
}
37
38
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
39
void
ConstraintFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build
(
Level
& fineLevel,
Level
& coarseLevel)
const
{
40
FactoryMonitor
m(*
this
,
"Constraint"
, coarseLevel);
41
42
RCP<MultiVector> fineNullspace =
Get<RCP<MultiVector>
>(fineLevel,
"Nullspace"
,
"FineNullspace"
);
43
RCP<MultiVector> coarseNullspace =
Get<RCP<MultiVector>
>(coarseLevel,
"Nullspace"
,
"CoarseNullspace"
);
44
45
RCP<Constraint> constraint(
new
Constraint
);
46
constraint->Setup(fineNullspace, coarseNullspace,
47
Get
<RCP<const CrsGraph> >(coarseLevel,
"Ppattern"
));
48
49
Set
(coarseLevel,
"Constraint"
, constraint);
50
}
51
52
}
// namespace MueLu
53
54
#endif
// MUELU_CONSTRAINTFACTORY_DEF_HPP
MueLu_ConstraintFactory_decl.hpp
MueLu_Monitor.hpp
MueLu::ConstraintFactory::Constraint
MueLu::Constraint< Scalar, LocalOrdinal, GlobalOrdinal, Node > Constraint
MueLu::ConstraintFactory::GetValidParameterList
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Definition
MueLu_ConstraintFactory_def.hpp:21
MueLu::ConstraintFactory::Build
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
Definition
MueLu_ConstraintFactory_def.hpp:39
MueLu::ConstraintFactory::DeclareInput
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
Definition
MueLu_ConstraintFactory_def.hpp:32
MueLu::Factory::Input
void Input(Level &level, const std::string &varName) const
Definition
MueLu_Factory.cpp:72
MueLu::Factory::Get
T Get(Level &level, const std::string &varName) const
Definition
MueLu_Factory.hpp:69
MueLu::Factory::Set
void Set(Level &level, const std::string &varName, const T &data) const
Definition
MueLu_Factory.hpp:80
MueLu::FactoryMonitor
Timer to be used in factories. Similar to Monitor but with additional timers.
Definition
MueLu_Monitor.hpp:165
MueLu::Level
Class that holds all level-specific information.
Definition
MueLu_Level.hpp:63
MueLu
Namespace for MueLu classes and methods.
Definition
MueLu_BrickAggregationFactory_decl.hpp:42
src
Transfers
Energy-Minimization
MueLu_ConstraintFactory_def.hpp
Generated by
1.17.0