46 #ifndef MUELU_MAXWELL1_DECL_HPP 47 #define MUELU_MAXWELL1_DECL_HPP 56 #include "MueLu_TrilinosSmoother.hpp" 64 #if defined(HAVE_MUELU_KOKKOS_REFACTOR) 68 #include "Xpetra_Map_fwd.hpp" 69 #include "Xpetra_Matrix_fwd.hpp" 70 #include "Xpetra_MatrixFactory_fwd.hpp" 71 #include "Xpetra_MultiVectorFactory_fwd.hpp" 72 #include "Xpetra_VectorFactory_fwd.hpp" 73 #include "Xpetra_CrsMatrixWrap_fwd.hpp" 89 #undef MUELU_MAXWELL1_SHORT 94 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType
magnitudeType;
95 typedef typename Teuchos::ScalarTraits<Scalar>::coordinateType
coordinateType;
106 Maxwell1(Teuchos::RCP<Hierarchy> H11, Teuchos::RCP<Hierarchy> H22) :
122 const Teuchos::RCP<Matrix> & D0_Matrix,
123 const Teuchos::RCP<MultiVector> & Nullspace,
124 const Teuchos::RCP<RealValuedMultiVector> & Coords,
125 Teuchos::ParameterList& List,
126 bool ComputePrec =
true)
128 RCP<Matrix> Kn_Matrix;
129 initialize(D0_Matrix,Kn_Matrix,Nullspace,Coords,List);
143 const Teuchos::RCP<Matrix> & D0_Matrix,
144 const Teuchos::RCP<Matrix> & Kn_Matrix,
145 const Teuchos::RCP<MultiVector> & Nullspace,
146 const Teuchos::RCP<RealValuedMultiVector> & Coords,
147 Teuchos::ParameterList& List,
148 bool ComputePrec =
true)
150 initialize(D0_Matrix,Kn_Matrix,Nullspace,Coords,List);
162 Teuchos::ParameterList& List,
163 bool ComputePrec =
true)
166 RCP<MultiVector> Nullspace = List.get<RCP<MultiVector> >(
"Nullspace", Teuchos::null);
167 RCP<RealValuedMultiVector> Coords = List.get<RCP<RealValuedMultiVector> >(
"Coordinates", Teuchos::null);
168 RCP<Matrix> D0_Matrix = List.get<RCP<Matrix> >(
"D0");
169 RCP<Matrix> Kn_Matrix;
170 if (List.isType<RCP<Matrix> >(
"Kn"))
171 Kn_Matrix = List.get<RCP<Matrix> >(
"Kn");
173 initialize(D0_Matrix,Kn_Matrix,Nullspace,Coords,List);
175 if (SM_Matrix != Teuchos::null)
197 void compute(
bool reuse=
false);
200 void resetMatrix(Teuchos::RCP<Matrix> SM_Matrix_new,
bool ComputePrec=
true);
205 void apply (
const MultiVector& X, MultiVector& Y,
206 Teuchos::ETransp mode = Teuchos::NO_TRANS,
207 Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
208 Scalar beta = Teuchos::ScalarTraits<Scalar>::zero())
const;
213 void describe(Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel = Teuchos::VERB_HIGH)
const;
217 const MultiVector & B,
218 MultiVector & R)
const {
219 using STS = Teuchos::ScalarTraits<Scalar>;
220 R.update(STS::one(),B,STS::zero());
221 this->
apply (X, R, Teuchos::NO_TRANS, -STS::one(), STS::one());
238 void initialize(
const Teuchos::RCP<Matrix> & D0_Matrix,
239 const Teuchos::RCP<Matrix> & Kn_Matrix,
240 const Teuchos::RCP<MultiVector> & Nullspace,
241 const Teuchos::RCP<RealValuedMultiVector> & Coords,
242 Teuchos::ParameterList& List);
255 void dump(
const Matrix& A, std::string name)
const;
258 void dump(
const MultiVector& X, std::string name)
const;
264 void dump(
const Teuchos::ArrayRCP<bool>& v, std::string name)
const;
266 #ifdef HAVE_MUELU_KOKKOS_REFACTOR 284 #ifdef HAVE_MUELU_KOKKOS_REFACTOR 312 #define MUELU_MAXWELL1_SHORT 313 #endif // MUELU_MAXWELL1_DECL_HPP
Teuchos::RCP< MultiVector > Nullspace_
Nullspace.
MueLu::DefaultLocalOrdinal LocalOrdinal
Maxwell1(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
Teuchos::RCP< Hierarchy > Hierarchy11_
Two hierarchies: one for the (1,1)-block, another for the (2,2)-block.
Teuchos::RCP< const Map > getDomainMap() const
Returns the Xpetra::Map object associated with the domain of this operator.
void applyInverseStandard(const MultiVector &RHS, MultiVector &X) const
apply standard Maxwell1 cycle
void resetMatrix(Teuchos::RCP< Matrix > SM_Matrix_new, bool ComputePrec=true)
Reset system matrix.
void applyInverseRefMaxwellAdditive(const MultiVector &RHS, MultiVector &X) const
apply RefMaxwell additive 2x2 style cycle
bool useKokkos_
Some options.
Teuchos::ArrayRCP< bool > BCcols_
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_HIGH) const
Teuchos::RCP< Matrix > D0_Matrix_
void initialize(const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &Kn_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List)
Maxwell1(const Teuchos::RCP< Matrix > &SM_Matrix, const Teuchos::RCP< Matrix > &D0_Matrix, const Teuchos::RCP< Matrix > &Kn_Matrix, const Teuchos::RCP< MultiVector > &Nullspace, const Teuchos::RCP< RealValuedMultiVector > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
Teuchos::RCP< MultiVector > residual11c_
Teuchos::ParameterList precList22_
Namespace for MueLu classes and methods.
Teuchos::RCP< MultiVector > update22_
Verbose class for MueLu classes.
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form...
Teuchos::ScalarTraits< Scalar >::magnitudeType magnitudeType
void setParameters(Teuchos::ParameterList &list)
Set parameters.
Teuchos::ArrayRCP< bool > BCdomain_
Teuchos::ParameterList precList11_
Teuchos::RCP< Hierarchy > Hierarchy22_
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Teuchos::RCP< Teuchos::TimeMonitor > getTimer(std::string name, RCP< const Teuchos::Comm< int > > comm=Teuchos::null) const
get a (synced) timer
Teuchos::ScalarTraits< Scalar >::coordinateType coordinateType
mode_type
Execution modes.
int BCedges_
Vectors for BCs.
Teuchos::RCP< Matrix > Kn_Matrix_
void dump(const Matrix &A, std::string name) const
dump out matrix
const Teuchos::RCP< Matrix > & getJacobian() const
Returns Jacobian matrix SM.
RCP< Matrix > P11_
Temporary memory (cached vectors for RefMaxwell-style)
Teuchos::ArrayRCP< bool > BCrows_
Teuchos::RCP< const Map > getRangeMap() const
Returns the Xpetra::Map object associated with the range of this operator.
Maxwell1(Teuchos::RCP< Hierarchy > H11, Teuchos::RCP< Hierarchy > H22)
Constructor with Hierarchies.
void compute(bool reuse=false)
Setup the preconditioner.
Teuchos::RCP< Matrix > generate_kn() const
Generates the Kn matrix.
Xpetra::MultiVector< coordinateType, LO, GO, NO > RealValuedMultiVector
Teuchos::RCP< MultiVector > update11c_
Maxwell1(const Teuchos::RCP< Matrix > &SM_Matrix, Teuchos::ParameterList &List, bool ComputePrec=true)
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
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
virtual ~Maxwell1()
Destructor.
Teuchos::RCP< MultiVector > residual22_
void dumpCoords(const RealValuedMultiVector &X, std::string name) const
dump out real-valued multivector
Teuchos::RCP< RealValuedMultiVector > Coords_
Coordinates.
void residual(const MultiVector &X, const MultiVector &B, MultiVector &R) const
Compute a residual R = B - (*this) * X.
Teuchos::RCP< Matrix > SM_Matrix_
Various matrices.
Teuchos::RCP< MultiVector > residualFine_
Teuchos::ParameterList parameterList_
ParameterLists.
void allocateMemory(int numVectors) const
allocate multivectors for solve