46 #ifndef MUELU_REFMAXWELL_DECL_HPP 47 #define MUELU_REFMAXWELL_DECL_HPP 60 #ifdef HAVE_MUELU_KOKKOS_REFACTOR 70 #include "MueLu_TrilinosSmoother.hpp" 71 #include "MueLu_Hierarchy.hpp" 73 #include "Xpetra_Map_fwd.hpp" 74 #include "Xpetra_Matrix_fwd.hpp" 75 #include "Xpetra_MatrixFactory_fwd.hpp" 76 #include "Xpetra_MultiVectorFactory_fwd.hpp" 77 #include "Xpetra_VectorFactory_fwd.hpp" 78 #include "Xpetra_CrsMatrixWrap_fwd.hpp" 79 #include "Xpetra_ExportFactory_fwd.hpp" 81 #if defined(HAVE_MUELU_IFPACK2) && (!defined(HAVE_MUELU_EPETRA) || defined(HAVE_MUELU_INST_DOUBLE_INT_INT)) 82 #include "Ifpack2_Preconditioner.hpp" 83 #include "Ifpack2_Hiptmair.hpp" 112 template <
class Scalar,
116 class RefMaxwell :
public VerboseObject,
public Xpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> {
118 #undef MUELU_REFMAXWELL_SHORT 123 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType
magnitudeType;
136 RefMaxwell(Teuchos::RCP<Hierarchy> HH, Teuchos::RCP<Hierarchy> H22) :
156 const Teuchos::RCP<Matrix> & D0_Matrix,
157 const Teuchos::RCP<Matrix> & M0inv_Matrix,
158 const Teuchos::RCP<Matrix> & M1_Matrix,
159 const Teuchos::RCP<MultiVector> & Nullspace,
160 const Teuchos::RCP<RealValuedMultiVector> & Coords,
161 Teuchos::ParameterList& List,
162 bool ComputePrec =
true)
164 initialize(D0_Matrix,M0inv_Matrix,M1_Matrix,Nullspace,Coords,List);
183 const Teuchos::RCP<Matrix> & M0inv_Matrix,
184 const Teuchos::RCP<Matrix> & M1_Matrix,
185 const Teuchos::RCP<MultiVector> & Nullspace,
186 const Teuchos::RCP<RealValuedMultiVector> & Coords,
189 initialize(D0_Matrix,M0inv_Matrix,M1_Matrix,Nullspace,Coords,List);
203 const Teuchos::RCP<Matrix> & D0_Matrix,
204 const Teuchos::RCP<Matrix> & M1_Matrix,
205 const Teuchos::RCP<MultiVector> & Nullspace,
206 const Teuchos::RCP<RealValuedMultiVector> & Coords,
207 Teuchos::ParameterList& List,
208 bool ComputePrec =
true)
210 initialize(D0_Matrix,Teuchos::null,M1_Matrix,Nullspace,Coords,List);
228 const Teuchos::RCP<Matrix> & M1_Matrix,
229 const Teuchos::RCP<MultiVector> & Nullspace,
230 const Teuchos::RCP<RealValuedMultiVector> & Coords,
233 initialize(D0_Matrix,Teuchos::null,M1_Matrix,Nullspace,Coords,List);
243 Teuchos::ParameterList& List,
244 bool ComputePrec =
true)
247 RCP<MultiVector> Nullspace = List.get<RCP<MultiVector> >(
"Nullspace", Teuchos::null);
248 RCP<RealValuedMultiVector> Coords = List.get<RCP<RealValuedMultiVector> >(
"Coordinates", Teuchos::null);
249 RCP<Matrix> D0_Matrix = List.get<RCP<Matrix> >(
"D0");
250 RCP<Matrix> M1_Matrix = List.get<RCP<Matrix> >(
"M1");
251 RCP<Matrix> M0inv_Matrix = List.get<RCP<Matrix> >(
"M0inv", Teuchos::null);
253 initialize(D0_Matrix,M0inv_Matrix,M1_Matrix,Nullspace,Coords,List);
255 if (SM_Matrix != Teuchos::null)
290 void resetMatrix(Teuchos::RCP<Matrix> SM_Matrix_new);
307 void apply (
const MultiVector& X, MultiVector& Y,
308 Teuchos::ETransp mode = Teuchos::NO_TRANS,
309 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
310 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const;
315 template <
class NewNode>
316 Teuchos::RCP< RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, NewNode> >
317 clone (
const RCP<NewNode>& new_node)
const {
323 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::VERB_HIGH)
const;
336 void initialize(
const Teuchos::RCP<Matrix> & D0_Matrix,
337 const Teuchos::RCP<Matrix> & M0inv_Matrix,
338 const Teuchos::RCP<Matrix> & M1_Matrix,
339 const Teuchos::RCP<MultiVector> & Nullspace,
340 const Teuchos::RCP<RealValuedMultiVector> & Coords,
341 Teuchos::ParameterList& List);
346 #if defined(HAVE_MUELU_IFPACK2) && (!defined(HAVE_MUELU_EPETRA) || defined(HAVE_MUELU_INST_DOUBLE_INT_INT)) 347 Teuchos::RCP<Ifpack2::Preconditioner<Scalar,LocalOrdinal,GlobalOrdinal,Node> > hiptmairPreSmoother_, hiptmairPostSmoother_;
354 #ifdef HAVE_MUELU_KOKKOS_REFACTOR 355 Kokkos::View<const bool*, typename Node::device_type> BCrowsKokkos_;
356 Kokkos::View<const bool*, typename Node::device_type> BCcolsKokkos_;
375 #define MUELU_REFMAXWELL_SHORT 376 #endif // MUELU_REFMAXWELL_DECL_HPP
Teuchos::RCP< SmootherBase > PostSmoother_
Teuchos::RCP< Matrix > D0_T_Matrix_
Teuchos::ArrayRCP< const bool > BCrows_
Vectors for BCs.
Teuchos::RCP< Matrix > Ms_Matrix_
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 > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
Teuchos::RCP< Matrix > D0_Matrix_
Teuchos::RCP< Matrix > SM_Matrix_
Various matrices.
Teuchos::RCP< MultiVector > D0res_
RefMaxwell(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List)
Teuchos::ParameterList smootherList_
Teuchos::ArrayRCP< const bool > BCcols_
Teuchos::RCP< Matrix > A22_
Namespace for MueLu classes and methods.
bool useHiptmairSmoothing_
void setParameters(Teuchos::ParameterList &list)
Set parameters.
void applyInverseAdditive(const MultiVector &RHS, MultiVector &X) const
apply additive algorithm for 2x2 solve
void buildProlongator()
Setup the prolongator for the (1,1)-block.
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
Teuchos::RCP< MultiVector > P11res_
Temporary memory.
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form...
Xpetra::MultiVector< magnitudeType, LO, GO, NO > RealValuedMultiVector
Teuchos::RCP< Matrix > M0inv_Matrix_
Teuchos::RCP< MultiVector > residual_
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_HIGH) const
Teuchos::RCP< MultiVector > D0x_
void applyInverse121(const MultiVector &RHS, MultiVector &X) const
apply 1-2-1 algorithm for 2x2 solve
Teuchos::ParameterList precList11_
void compute()
Setup the preconditioner.
Teuchos::RCP< const Map > getRangeMap() const
Returns the Xpetra::Map object associated with the range of this operator.
Teuchos::RCP< Matrix > P11_
Teuchos::RCP< Matrix > A_nodal_Matrix_
Teuchos::RCP< Hierarchy > Hierarchy22_
Teuchos::RCP< Matrix > M1_Matrix_
Teuchos::RCP< RealValuedMultiVector > CoordsH_
void initialize(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List)
Teuchos::RCP< SmootherBase > PreSmoother_
bool disable_addon_
Some options.
virtual ~RefMaxwell()
Destructor.
Teuchos::ParameterList parameterList_
Parameter lists.
Teuchos::RCP< RealValuedMultiVector > Coords_
Coordinates.
RefMaxwell(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &M0inv_Matrix, const Teuchos::RCP< Matrix > &M1_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List)
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
void applyInverse212(const MultiVector &RHS, MultiVector &X) const
apply 2-1-2 algorithm for 2x2 solve
bool use_as_preconditioner_
Teuchos::RCP< RefMaxwell< Scalar, LocalOrdinal, GlobalOrdinal, NewNode > > clone(const RCP< NewNode > &new_node) const
Teuchos::RCP< MultiVector > P11x_
Teuchos::RCP< Matrix > R11_
const Teuchos::RCP< Matrix > & getJacobian() const
Returns Jacobian matrix SM.
Teuchos::RCP< Matrix > AH_
void formCoarseMatrix()
Compute P11^{T}*A*P11 efficiently.
void applyInverse11only(const MultiVector &RHS, MultiVector &X) const
apply solve to 1-1 block only
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
Teuchos::RCP< Hierarchy > HierarchyH_
Two hierarchies: one for the coarse (1,1)-block, another for the (2,2)-block.
RefMaxwell(Teuchos::RCP< Hierarchy > HH, Teuchos::RCP< Hierarchy > H22)
Constructor with Hierarchies.
Teuchos::ParameterList precList22_
Teuchos::RCP< MultiVector > Nullspace_
Nullspace.
void resetMatrix(Teuchos::RCP< Matrix > SM_Matrix_new)
Reset system matrix.
Teuchos::RCP< const Map > getDomainMap() const
Returns the Xpetra::Map object associated with the domain of this operator.
RefMaxwell(const Teuchos::RCP< Matrix > &SM_Matrix, Teuchos::ParameterList &List, bool ComputePrec=true)