MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_CoarseMapFactory_decl.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_COARSEMAPFACTORY_DECL_HPP_
11#define MUELU_COARSEMAPFACTORY_DECL_HPP_
12
13#include "Xpetra_StridedMapFactory_fwd.hpp"
14
15#include "MueLu_ConfigDefs.hpp"
18
19#include "MueLu_Level_fwd.hpp"
21#include "MueLu_Exceptions.hpp"
22
23namespace MueLu {
24
73template <class Scalar = DefaultScalar,
76 class Node = DefaultNode>
78#undef MUELU_COARSEMAPFACTORY_SHORT
80
81 public:
83
85
87
88
89 RCP<const ParameterList> GetValidParameterList() const override;
90
97 void DeclareInput(Level& currentLevel) const override;
98
100
102
103
105 void Build(Level& currentLevel) const override;
106
108
115 virtual size_t getFixedBlockSize() const {
116 // sum up size of all strided blocks (= number of dofs per node)
117 size_t blkSize = 0;
118 std::vector<size_t>::const_iterator it;
119 for (it = stridingInfo_.begin(); it != stridingInfo_.end(); ++it) {
120 blkSize += *it;
121 }
122 return blkSize;
123 }
124
126
131 virtual std::vector<size_t> getStridingData() const { return stridingInfo_; }
132
137 virtual void setStridingData(std::vector<size_t> stridingInfo);
138
144 const ParameterList& pL = GetParameterList();
145 return pL.get<LocalOrdinal>("Strided block id");
146 }
147
152 virtual void setStridedBlockId(LocalOrdinal stridedBlockId) {
153 SetParameter("Strided block id", ParameterEntry(stridedBlockId));
154 }
155
157
158 protected:
160 virtual void BuildCoarseMap(Level& currentLevel, const GlobalOrdinal domainGIDOffset) const;
161
163 virtual GlobalOrdinal GetDomainGIDOffset(Level& currentLevel) const;
164
165 private:
167 LocalOrdinal stridedBlockId, const size_t nullspaceDimension) const;
168
170 mutable std::vector<size_t> stridingInfo_;
171
172}; // class CoarseMapFactory
173
174} // namespace MueLu
175
176#define MUELU_COARSEMAPFACTORY_SHORT
177#endif /* MUELU_COARSEMAPFACTORY_DECL_HPP_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Factory for generating coarse level map. Used by TentativePFactory.
std::vector< size_t > stridingInfo_
Vector with size of strided blocks (dofs)
virtual void BuildCoarseMap(Level &currentLevel, const GlobalOrdinal domainGIDOffset) const
Build the coarse map using the domain GID offset.
virtual size_t getFixedBlockSize() const
Get information on the fixed block size.
virtual void CheckForConsistentStridingInformation(LocalOrdinal stridedBlockId, const size_t nullspaceDimension) const
RCP< const ParameterList > GetValidParameterList() const override
Return a const parameter list of valid parameters that setParameterList() will accept.
virtual GlobalOrdinal GetDomainGIDOffset(Level &currentLevel) const
Extract domain GID offset from user data.
void Build(Level &currentLevel) const override
Build an object with this factory.
virtual std::vector< size_t > getStridingData() const
getStridingData returns vector with size of striding blocks in the domain DOF map (= coarse map)....
virtual void setStridedBlockId(LocalOrdinal stridedBlockId)
setStridedBlockId set strided block id for the domain DOF map of Ptent (= coarse map) or -1 if full s...
virtual void setStridingData(std::vector< size_t > stridingInfo)
setStridingData set striding vector for the domain DOF map (= coarse map), e.g. (2,...
virtual LocalOrdinal getStridedBlockId() const
getStridedBlockId returns strided block id for the domain DOF map of Ptent (= coarse map) or -1 if fu...
void DeclareInput(Level &currentLevel) const override
Specifies the data that this class needs, and the factories that generate that data.
Class that holds all level-specific information.
virtual const Teuchos::ParameterList & GetParameterList() const
void SetParameter(const std::string &name, const ParameterEntry &entry)
Set a parameter directly as a ParameterEntry.
Base class for factories that use one level (currentLevel).
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar