10 #ifndef MUELU_REFMAXWELL_DECL_HPP
11 #define MUELU_REFMAXWELL_DECL_HPP
26 #include "MueLu_FactoryManager.hpp"
221 #undef MUELU_REFMAXWELL_SHORT
259 bool ComputePrec =
true) {
260 int spaceNumber = List.
get<
int>(
"refmaxwell: space number", 1);
265 invMk_1_invBeta, invMk_2_invAlpha,
266 Nullspace11, Nullspace22, NodalCoords,
291 bool ComputePrec =
true) {
292 initialize(D0_Matrix, Ms_Matrix, M0inv_Matrix, M1_Matrix, Nullspace11, NodalCoords, List);
314 bool ComputePrec =
true) {
315 initialize(D0_Matrix, M1_Matrix, M0inv_Matrix, M1_Matrix, Nullspace11, NodalCoords, List);
335 initialize(D0_Matrix, M1_Matrix, M0inv_Matrix, M1_Matrix, Nullspace11, NodalCoords, List);
355 initialize(D0_Matrix, M1_Matrix, Teuchos::null, M1_Matrix, Nullspace11, NodalCoords, List);
373 initialize(D0_Matrix, M1_Matrix, Teuchos::null, M1_Matrix, Nullspace11, NodalCoords, List);
384 bool ComputePrec =
true);
404 void compute(
bool reuse =
false);
427 R.update(STS::one(), B, STS::zero());
496 void build22Matrix(
const bool reuse,
const bool doRebalancing,
const int rebalanceStriding,
const int numProcsA22);
555 const bool isSingular =
false);
585 void dump(
const Kokkos::View<bool *, typename Node::device_type> &v, std::string name)
const;
647 bool disable_addon_,
disable_addon_22_,
dump_matrices_,
useKokkos_,
use_as_preconditioner_,
implicitTranspose_,
fuseProlongationAndUpdate_,
syncTimers_,
enable_reuse_,
skipFirst11Level_,
skipFirst22Level_;
653 mutable Teuchos::RCP<MultiVector> P11res_,
P11x_,
P11resSubComm_,
P11xSubComm_,
DresIntermediate_,
Dres_,
DxIntermediate_,
Dx_,
DresSubComm_,
DxSubComm_,
residual_,
P11resTmp_,
DresTmp_,
DTR11Tmp_;
658 #define MUELU_REFMAXWELL_SHORT
659 #endif // MUELU_REFMAXWELL_DECL_HPP
const Teuchos::RCP< Matrix > & getJacobian() const
Returns Jacobian matrix SM.
Teuchos::RCP< const Import > Importer22_
size_t dim_
The spatial dimension.
RCP< Matrix > buildAddon(const int spaceNumber)
Teuchos::RCP< SmootherPrototype > PreSmootherData11_
Teuchos::RCP< Matrix > R22_
MueLu::DefaultLocalOrdinal LocalOrdinal
Kokkos::View< bool *, typename Node::device_type::memory_space > BCdomain22_
void solve22(const MultiVector &RHS, MultiVector &X) const
apply solve to 2-2 block only
Teuchos::RCP< SmootherBase > PreSmoother11_
Teuchos::RCP< Teuchos::ParameterList > A22_RAP_reuse_data_
void dumpCoords(const RCP< RealValuedMultiVector > &X, std::string name) const
dump out real-valued multivector
const Teuchos::RCP< const Map > getRangeMap() const
Returns the Xpetra::Map object associated with the range of this operator.
Xpetra::MultiVector< coordinateType, LO, GO, NO > RealValuedMultiVector
Kokkos::View< bool *, typename Node::device_type::memory_space > BCrows11_
Vectors for BCs.
Teuchos::RCP< MultiVector > CoarseNullspace22_
Nullspace for coarse (2,2) problem.
T & get(const std::string &name, T def_value)
void setFineLevelSmoother11()
Set the fine level smoother.
Teuchos::RCP< Matrix > SM_Matrix_
The system that is getting preconditioned.
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > MultiVector
Teuchos::RCP< Matrix > Mk_one_
mass matrices with unit weight on k-th and (k-1)-th spaces
std::string solverName_
The name of the solver.
Teuchos::RCP< Matrix > buildProjection(const int spaceNumber, const RCP< MultiVector > &EdgeNullspace) const
Builds a projection from a vector values space into a vector valued nodal space.
Teuchos::RCP< MultiVector > DxIntermediate_
void buildNodalProlongator(const Teuchos::RCP< Matrix > &A_nodal, Teuchos::RCP< Matrix > &P_nodal, Teuchos::RCP< MultiVector > &Nullspace_nodal, Teuchos::RCP< RealValuedMultiVector > &Coords_nodal) const
Teuchos::RCP< Matrix > A22_
void determineSubHierarchyCommSizes(bool &doRebalancing, int &rebalanceStriding, int &numProcsCoarseA11, int &numProcsA22)
Determine how large the sub-communicators for the two hierarchies should be.
Teuchos::RCP< SmootherBase > PostSmoother11_
void solveH(const MultiVector &RHS, MultiVector &X) const
apply solve to 1-1 block only
Teuchos::RCP< Matrix > Addon11_
the addon for the 11 block
Teuchos::RCP< Matrix > Mk_1_one_
void setParameters(Teuchos::ParameterList &list)
Set parameters.
Teuchos::RCP< Matrix > invMk_2_invAlpha_
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Teuchos::RCP< Matrix > D0_
D_0 matrix.
Teuchos::RCP< MultiVector > P11res_
Temporary memory.
RCP< MultiVector > buildNullspace(const int spaceNumber, const Kokkos::View< bool *, typename Node::device_type > &bcs, const bool applyBCs)
Builds a nullspace.
Verbose class for MueLu classes.
Static class that holds the complete list of valid MueLu parameters.
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form...
Teuchos::RCP< const Import > ImporterCoarse11_
Importer to coarse (1,1) hierarchy.
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List, bool ComputePrec)
Teuchos::RCP< MultiVector > P11resSubComm_
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List, bool ComputePrec=true)
void allocateMemory(int numVectors) const
allocate multivectors for solve
Teuchos::RCP< Matrix > coarseA22_
Teuchos::RCP< MultiVector > residual_
Teuchos::RCP< MultiVector > DxSubComm_
void applyInverseAdditive(const MultiVector &RHS, MultiVector &X) const
apply additive algorithm for 2x2 solve
Teuchos::RCP< MultiVector > P11resTmp_
Teuchos::RCP< Matrix > Dk_2_
D_{k-2} matrix.
Teuchos::RCP< Matrix > invMk_1_invBeta_
inverse of mass matrices on (k-1)-th and (k-2)-th space with weights 1/beta and 1/alpha respectively ...
Kokkos::View< bool *, typename Node::device_type::memory_space > BCcols22_
MueLu::DefaultScalar Scalar
void resetMatrix(Teuchos::RCP< Matrix > SM_Matrix_new, bool ComputePrec=true)
Reset system matrix.
MueLu::DefaultGlobalOrdinal GlobalOrdinal
void rebalanceCoarse11Matrix(const int rebalanceStriding, const int numProcsCoarseA11)
rebalance the coarse A11 matrix, as well as P11, CoordsCoarse11 and Addon11
Teuchos::ParameterList precList11_
Teuchos::RCP< const Import > DorigImporter_
Teuchos::RCP< Matrix > P11_
special prolongator for 11 block and its transpose
void initialize(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &Ms_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List)
Teuchos::RCP< Hierarchy > Hierarchy22_
RCP< Matrix > buildVectorNodalProlongator(const Teuchos::RCP< Matrix > &P_nodal) const
Teuchos::RCP< MultiVector > Dres_
void dump(const RCP< Matrix > &A, std::string name) const
dump out matrix
void buildCoarse11Matrix()
Compute coarseA11 = P11^{T}*SM*P11 + addon efficiently.
bool fuseProlongationAndUpdate_
int spaceNumber_
The number of the space in the deRham complex.
Teuchos::RCP< Teuchos::ParameterList > coarseA11_RAP_reuse_data_
Teuchos::RCP< Hierarchy > HierarchyCoarse11_
Two hierarchies: one for the coarse (1,1)-block, another for the (2,2)-block.
Teuchos::RCP< MultiVector > DTR11Tmp_
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &Dk_1, const Teuchos::RCP< Matrix > &Dk_2, const Teuchos::RCP< Matrix > &D0, const Teuchos::RCP< Matrix > &M1_beta, const Teuchos::RCP< Matrix > &M1_alpha, const Teuchos::RCP< Matrix > &Mk_one, const Teuchos::RCP< Matrix > &Mk_1_one, const Teuchos::RCP< Matrix > &invMk_1_invBeta, const Teuchos::RCP< Matrix > &invMk_2_invAlpha, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< MultiVector > &Nullspace22, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List, bool ComputePrec=true)
Teuchos::RCP< Matrix > Dk_1_T_
RCP< Operator > thyraPrecOp22_
void build22Matrix(const bool reuse, const bool doRebalancing, const int rebalanceStriding, const int numProcsA22)
Setup A22 = D0^T SM D0 and rebalance it, as well as D0 and Coords_.
Teuchos::RCP< RealValuedMultiVector > CoordsCoarse11_
Teuchos::RCP< MultiVector > NullspaceCoarse11_
Nullspace for coarse (1,1) problem.
Teuchos::RCP< Matrix > M1_alpha_
Teuchos::RCP< Teuchos::TimeMonitor > getTimer(std::string name, RCP< const Teuchos::Comm< int > > comm=Teuchos::null) const
get a (synced) timer
void compute(bool reuse=false)
Setup the preconditioner.
Teuchos::RCP< MultiVector > P11xSubComm_
Teuchos::RCP< const Map > DorigDomainMap_
Teuchos::RCP< Teuchos::ParameterList > getValidParamterList()
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_HIGH) const
bool disable_addon_
Some options.
RefMaxwell(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List)
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &Ms_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List, bool ComputePrec=true)
virtual ~RefMaxwell()
Destructor.
Teuchos::RCP< Matrix > M1_beta_
mass matrices on first space with weights beta and alpha respectively
Teuchos::RCP< Matrix > coarseA11_
coarse 11, 22 and coarse 22 blocks
void setupSubSolve(Teuchos::RCP< Hierarchy > &hierarchy, Teuchos::RCP< Operator > &thyraPrecOp, const Teuchos::RCP< Matrix > &A, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList ¶ms, std::string &label, const bool reuse, const bool isSingular=false)
Setup a subsolve.
Teuchos::ParameterList parameterList_
Parameter lists.
Teuchos::RCP< Matrix > P22_
special prolongator for 22 block and its transpose
Teuchos::RCP< RealValuedMultiVector > Coords22_
Teuchos::RCP< MultiVector > Nullspace11_
Nullspace for (1.1) block.
Teuchos::RCP< MultiVector > Nullspace22_
bool use_as_preconditioner_
Teuchos::RCP< MultiVector > DresIntermediate_
Teuchos::RCP< MultiVector > P11x_
Teuchos::RCP< Matrix > R11_
void apply(const MultiVector &X, MultiVector &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::zero()) const
RefMaxwell(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace11, const Teuchos::RCP< RealValuedMultiVector > &NodalCoords, Teuchos::ParameterList &List)
const Teuchos::RCP< const Map > getDomainMap() const
Returns the Xpetra::Map object associated with the domain of this operator.
void residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const
Compute a residual R = B - (*this) * X.
Teuchos::RCP< MultiVector > DresSubComm_
Teuchos::RCP< Teuchos::ParameterList > coarseA11_AP_reuse_data_
Teuchos::RCP< MultiVector > DresTmp_
Teuchos::RCP< Matrix > Addon22_
the addon for the 22 block
RCP< Operator > thyraPrecOpH_
Teuchos::ScalarTraits< Scalar >::coordinateType coordinateType
bool Dk_1_T_R11_colMapsMatch_
int globalNumberBoundaryUnknowns11_
RefMaxwell(Teuchos::RCP< Hierarchy > HH, Teuchos::RCP< Hierarchy > H22)
Constructor with Hierarchies.
void buildProlongator(const int spaceNumber, const Teuchos::RCP< Matrix > &A_nodal_Matrix, const RCP< MultiVector > &EdgeNullspace, Teuchos::RCP< Matrix > &edgeProlongator, Teuchos::RCP< MultiVector > &coarseEdgeNullspace, Teuchos::RCP< RealValuedMultiVector > &coarseNodalCoords) const
Teuchos::RCP< Teuchos::ParameterList > A22_AP_reuse_data_
Teuchos::RCP< SmootherPrototype > PostSmootherData11_
Teuchos::RCP< MultiVector > Dx_
Teuchos::RCP< RealValuedMultiVector > NodalCoords_
Coordinates.
Teuchos::ParameterList precList22_
Teuchos::RCP< Matrix > Dk_1_
D_{k-1} matrix and its transpose.
int globalNumberBoundaryUnknowns22_
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.