20 class ConstrainedOperator;
21 class RectangularConstrainedOperator;
85 {
mfem_error(
"Operator::MultTranspose() is not overloaded!"); }
91 mfem_error(
"Operator::GetGradient() is not overloaded!");
92 return const_cast<Operator &
>(*this);
147 int copy_interior = 0);
395 int jok,
int *jcur,
double gamma);
491 virtual void ImplicitSolve(
const double dt0,
const double dt1,
510 explicit Solver(
int s = 0,
bool iter_mode =
false)
514 Solver(
int h,
int w,
bool iter_mode =
false)
557 { A_.
Mult(x, y); y *= a_; }
640 bool ownA, ownB, ownC;
646 const Operator *C,
bool ownA,
bool ownB,
bool ownC);
virtual double GetTime() const
Read the currently set time.
virtual void Mult(const Vector &x, const Vector &dxdt, Vector &y) const
Perform the action of the operator: y = k = f(x,@ dxdt, t), where k solves the algebraic equation F(x...
void FormRectangularSystemOperator(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this rectangular operator (including constraints)...
bool isImplicit() const
True if type is IMPLICIT or HOMOGENEOUS.
bool isHomogeneous() const
True if type is HOMOGENEOUS.
virtual MemoryClass GetMemoryClass() const
Returns the type of memory in which the solution and temporaries are stored.
Solver(int s=0, bool iter_mode=false)
Initialize a square Solver with size s.
virtual ~ProductOperator()
Array< int > constraint_list
List of constrained indices/dofs.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
Type type
Describes the form of the TimeDependentOperator.
Base abstract class for first order time dependent operators.
virtual void ImplicitSolve(const double dt, const Vector &x, Vector &k)
Solve the equation: k = f(x + dt k, t), for the unknown k at the current time t.
virtual Operator & GetGradient(const Vector &x) const
Evaluate the gradient operator at the point x. The default behavior in class Operator is to generate ...
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
ID for class ComplexHypreParMatrix.
virtual void Mult(const Vector &x, Vector &y) const
Constrained operator action.
virtual void SetTime(const double _t)
Set the current time.
virtual Operator & GetExplicitGradient(const Vector &x) const
Return an Operator representing dG/dx at the given point x and the currently set time.
virtual MemoryClass GetMemoryClass() const
Return the MemoryClass preferred by the Operator.
virtual const Operator * GetOutputProlongation() const
Prolongation operator from linear algebra (linear system) vectors, to output vectors for the operator...
void EliminateRHS(const Vector &x, Vector &b) const
Eliminate columns corresponding to "essential boundary condition" values specified in x from the give...
void FormDiscreteOperator(Operator *&A)
Return in A a parallel (on truedofs) version of this rectangular operator.
virtual void MultTranspose(const Vector &x, Vector &y) const
Application of the transpose.
EvalMode eval_mode
Current evaluation mode.
ProductOperator(const Operator *A, const Operator *B, bool ownA, bool ownB)
ID for class PetscParMatrix, MATHYPRE format.
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
virtual void MultTranspose(const Vector &x, Vector &y) const
Application of the transpose. Apply the original Operator.
bool iterative_mode
If true, use the second argument of Mult() as an initial guess.
SecondOrderTimeDependentOperator(int n=0, double t_=0.0, Type type_=EXPLICIT)
Construct a "square" SecondOrderTimeDependentOperator y = f(x,dxdt,t), where x, dxdt and y have the s...
SecondOrderTimeDependentOperator(int h, int w, double t_=0.0, Type type_=EXPLICIT)
Construct a SecondOrderTimeDependentOperator y = f(x,dxdt,t), where x, dxdt and y have the same dimen...
virtual MemoryClass GetMemoryClass() const
Returns the type of memory in which the solution and temporaries are stored.
virtual ~TimeDependentOperator()
bool own_A
Ownership flag for A.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
void FormRectangularConstrainedSystemOperator(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, RectangularConstrainedOperator *&Aout)
see FormRectangularSystemOperator()
Solver(int h, int w, bool iter_mode=false)
Initialize a Solver with height h and width w.
Array< int > test_constraints
virtual int SUNImplicitSolve(const Vector &b, Vector &x, double tol)
Solve the ODE linear system as setup by the method SUNImplicitSetup().
virtual void ExplicitMult(const Vector &x, Vector &y) const
Perform the action of the explicit part of the operator, G: y = G(x, t) where t is the current time...
void FormRectangularLinearSystem(const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B)
Form a column-constrained linear system using a matrix-free approach.
virtual void Mult(const Vector &x, Vector &y) const
Operator application. Apply the transpose of the original Operator.
ID for class SparseMatrix.
virtual const Operator * GetProlongation() const
Prolongation operator from linear algebra (linear system) vectors, to input vectors for the operator...
TransposeOperator(const Operator &a)
Construct the transpose of a given operator a.
virtual void MultTranspose(const Vector &x, Vector &y) const
Application of the transpose.
General product operator: x -> (A*B)(x) = A(B(x)).
ID for the base class Operator, i.e. any type.
virtual ~SecondOrderTimeDependentOperator()
virtual void SetEvalMode(const EvalMode new_eval_mode)
Set the evaluation mode of the time-dependent operator.
virtual MemoryClass GetMemoryClass() const
Return the MemoryClass preferred by the Operator.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
virtual ~ConstrainedOperator()
Destructor: destroys the unconstrained Operator, if owned.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
void FormConstrainedSystemOperator(const Array< int > &ess_tdof_list, ConstrainedOperator *&Aout)
see FormSystemOperator()
This type assumes F(x,k,t) = k, i.e. k = f(x,t) = G(x,t).
ID for class PetscParMatrix, unspecified format.
virtual int SUNMassSetup()
Setup the mass matrix in the ODE system .
virtual ~RectangularConstrainedOperator()
TimeDependentOperator(int h, int w, double t_=0.0, Type type_=EXPLICIT)
Construct a TimeDependentOperator y = f(x,t), where x and y have dimensions w and h...
The operator x -> R*A*P*x constructed through the actions of R^T, A and P.
virtual void Mult(const Vector &x, Vector &y) const
Rectangular-constrained operator action.
ID for class PetscParMatrix, MATNEST format.
bool isExplicit() const
True if type is EXPLICIT.
RAPOperator(const Operator &Rt_, const Operator &A_, const Operator &P_)
Construct the RAP operator given R^T, A and P.
virtual const Operator * GetRestriction() const
Restriction operator from input vectors for the operator to linear algebra (linear system) vectors...
This is the most general type, no assumptions on F and G.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
ID for class PetscParMatrix, MATSHELL format.
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
Operator(int s=0)
Construct a square Operator with given size s (default 0).
IdentityOperator(int n)
Create an identity operator of size n.
bool IsIdentityProlongation(const Operator *P)
Type
Enumeration defining IDs for some classes derived from Operator.
Array< int > trial_constraints
virtual int SUNMassSolve(const Vector &b, Vector &x, double tol)
Solve the mass matrix linear system as setup by the method SUNMassSetup().
Scaled Operator B: x -> a A(x).
TimeDependentOperator(int n=0, double t_=0.0, Type type_=EXPLICIT)
Construct a "square" TimeDependentOperator y = f(x,t), where x and y have the same dimension n...
Vector w
Auxiliary vectors.
int NumRows() const
Get the number of rows (size of output) of the Operator. Synonym with Height().
void InitTVectors(const Operator *Po, const Operator *Ri, const Operator *Pi, Vector &x, Vector &b, Vector &X, Vector &B) const
Initializes memory for true vectors of linear system.
virtual Operator & GetImplicitGradient(const Vector &x, const Vector &k, double shift) const
Return an Operator representing (dF/dk shift + dF/dx) at the given x, k, and the currently set time...
Base abstract class for second order time dependent operators.
int NumCols() const
Get the number of columns (size of input) of the Operator. Synonym with Width().
void FormLinearSystem(const Array< int > &ess_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B, int copy_interior=0)
Form a constrained linear system using a matrix-free approach.
ScaledOperator(const Operator *A, double a)
Create an operator which is a scalar multiple of A.
The transpose of a given operator. Switches the roles of the methods Mult() and MultTranspose().
Type GetType() const
Return the type ID of the Operator class.
virtual void RecoverFEMSolution(const Vector &X, const Vector &b, Vector &x)
Reconstruct a solution vector x (e.g. a GridFunction) from the solution X of a constrained linear sys...
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
int height
Dimension of the output / number of rows in the matrix.
This type assumes that G(x,t) = 0.
virtual void ImplicitMult(const Vector &x, const Vector &k, Vector &y) const
Perform the action of the implicit part of the operator, F: y = F(x, k, t) where t is the current tim...
Rectangular Operator for imposing essential boundary conditions on the input space using only the act...
Host memory; using new[] and delete[].
virtual ~TripleProductOperator()
void EliminateRHS(const Vector &x, Vector &b) const
Eliminate "essential boundary condition" values specified in x from the given right-hand side b...
void PrintMatlab(std::ostream &out, int n=0, int m=0) const
Prints operator with input size n and output size m in Matlab format.
ID for class PetscParMatrix, MATAIJ format.
void FormSystemOperator(const Array< int > &ess_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this square operator.
General triple product operator x -> A*B*C*x, with ownership of the factors.
ConstrainedOperator(Operator *A, const Array< int > &list, bool own_A=false)
Constructor from a general Operator and a list of essential indices/dofs.
virtual void Mult(const Vector &x, Vector &y) const
Operator application.
EvalMode GetEvalMode() const
Return the current evaluation mode. See SetEvalMode() for details.
Operator(int h, int w)
Construct an Operator with the given height (output size) and width (input size). ...
virtual int SUNImplicitSetup(const Vector &x, const Vector &fx, int jok, int *jcur, double gamma)
Setup the ODE linear system or , where .
virtual void Mult(const Vector &x, Vector &y) const
Perform the action of the operator: y = k = f(x, t), where k solves the algebraic equation F(x...
TripleProductOperator(const Operator *A, const Operator *B, const Operator *C, bool ownA, bool ownB, bool ownC)
virtual int SUNMassMult(const Vector &x, Vector &v)
Compute the mass matrix-vector product .
ID for class ComplexSparseMatrix.
Operator * SetupRAP(const Operator *Pi, const Operator *Po)
Returns RAP Operator of this, taking in input/output Prolongation matrices.
virtual void SetOperator(const Operator &op)=0
Set/update the solver for the given operator.
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
EvalMode
Evaluation mode. See SetEvalMode() for details.
Identity Operator I: x -> x.
ID for class HypreParMatrix.
TransposeOperator(const Operator *a)
Construct the transpose of a given operator *a.
Operator * A
The unconstrained Operator.
ID for class ComplexOperator.
Square Operator for imposing essential boundary conditions using only the action, Mult()...
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
virtual void ImplicitSolve(const double dt0, const double dt1, const Vector &x, const Vector &dxdt, Vector &k)
Solve the equation: k = f(x + 1/2 dt0^2 k, dxdt + dt1 k, t), for the unknown k at the current time t...
virtual ~Operator()
Virtual destructor.
virtual void MultTranspose(const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an ...
ID for class PetscParMatrix, MATIS format.
MemoryClass
Memory classes identify sets of memory types.
int width
Dimension of the input / number of columns in the matrix.
RectangularConstrainedOperator(Operator *A, const Array< int > &trial_list, const Array< int > &test_list, bool own_A=false)
Constructor from a general Operator and a list of essential indices/dofs.
virtual const Operator * GetOutputRestriction() const
Restriction operator from output vectors for the operator to linear algebra (linear system) vectors...
virtual MemoryClass GetMemoryClass() const
Return the MemoryClass preferred by the Operator.