53 {
mfem_error(
"Operator::MultTranspose() is not overloaded!"); }
59 mfem_error(
"Operator::GetGradient() is not overloaded!");
60 return const_cast<Operator &
>(*this);
103 int copy_interior = 0);
117 void PrintMatlab(std::ostream & out,
int n = 0,
int m = 0)
const;
186 mfem_error(
"TimeDependentOperator::ExplicitMult() is not overridden!");
196 mfem_error(
"TimeDependentOperator::ImplicitMult() is not overridden!");
204 mfem_error(
"TimeDependentOperator::Mult() is not overridden!");
225 mfem_error(
"TimeDependentOperator::ImplicitSolve() is not overridden!");
236 mfem_error(
"TimeDependentOperator::GetImplicitGradient() is "
248 mfem_error(
"TimeDependentOperator::GetExplicitGradient() is "
267 explicit Solver(
int s = 0,
bool iter_mode =
false)
271 Solver(
int h,
int w,
bool iter_mode =
false)
349 bool ownA, ownB, ownC;
354 bool ownA,
bool ownB,
bool ownC)
357 , ownA(ownA), ownB(ownB), ownC(ownC)
369 if (ownA) {
delete A; }
370 if (ownB) {
delete B; }
371 if (ownC) {
delete C; }
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.
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 void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
TripleProductOperator(Operator *A, Operator *B, Operator *C, bool ownA, bool ownB, bool ownC)
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 ~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...
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.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
virtual ~ConstrainedOperator()
Destructor: destroys the unconstrained Operator A if own_A is true.
This type assumes F(x,k,t) = k, i.e. k = f(x,t) = G(x,t).
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.
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.
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().
void mfem_error(const char *msg)
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().
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...
int height
Dimension of the output / number of rows in the matrix.
This type assumes that G(x,t) = 0.
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.
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). ...
virtual void SetOperator(const Operator &op)=0
Set/update the solver for the given operator.
Identity Operator I: x -> x.
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()...
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 ...
int width
Dimension of the input / number of columns in the matrix.
virtual ~TripleProductOperator()
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...