64 {
mfem_error(
"Operator::MultTranspose() is not overloaded!"); }
70 mfem_error(
"Operator::GetGradient() is not overloaded!");
71 return const_cast<Operator &
>(*this);
114 int copy_interior = 0);
208 mfem_error(
"TimeDependentOperator::ExplicitMult() is not overridden!");
218 mfem_error(
"TimeDependentOperator::ImplicitMult() is not overridden!");
226 mfem_error(
"TimeDependentOperator::Mult() is not overridden!");
247 mfem_error(
"TimeDependentOperator::ImplicitSolve() is not overridden!");
258 mfem_error(
"TimeDependentOperator::GetImplicitGradient() is "
270 mfem_error(
"TimeDependentOperator::GetExplicitGradient() is "
289 explicit Solver(
int s = 0,
bool iter_mode =
false)
293 Solver(
int h,
int w,
bool iter_mode =
false)
395 bool ownA, ownB, ownC;
401 const Operator *C,
bool ownA,
bool ownB,
bool ownC);
virtual double GetTime() const
Read the currently set time.
bool isImplicit() const
True if type is IMPLICIT or HOMOGENEOUS.
bool isHomogeneous() const
True if type is HOMOGENEOUS.
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 time dependent operators.
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().
virtual void Mult(const Vector &x, Vector &y) const
Constrained operator action.
virtual void SetTime(const double _t)
Set the current time.
virtual MemoryClass GetMemoryClass() const
Return the MemoryClass preferred by the Operator.
virtual void MultTranspose(const Vector &x, Vector &y) const
Application of the transpose.
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.
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 ~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 ...
Solver(int h, int w, bool iter_mode=false)
Initialize a Solver with height h and width w.
virtual void Mult(const Vector &x, Vector &y) const
Operator application. Apply the transpose of the original Operator.
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...
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 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.
This type assumes F(x,k,t) = k, i.e. k = f(x,t) = G(x,t).
ID for class PetscParMatrix, unspecified format.
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.
ID for class PetscParMatrix, MATNEST format.
bool isExplicit() const
True if type is EXPLICIT.
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.
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.
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.
Type
Enumeration defining IDs for some classes derived from Operator.
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.
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...
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...
int NumRows() const
Get the number of rows (size of output) of the Operator. Synonym with Height().
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.
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.
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.
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.
Operator(int h, int w)
Construct an Operator with the given height (output size) and width (input size). ...
TripleProductOperator(const Operator *A, const Operator *B, const Operator *C, bool ownA, bool ownB, bool ownC)
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).
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.
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 ~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 subsets of memory types.
int width
Dimension of the input / number of columns in the matrix.
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...
virtual MemoryClass GetMemoryClass() const
Return the MemoryClass preferred by the Operator.