15 #include "../general/forall.hpp"
81 if (n == 0) { n =
width; }
82 if (m == 0) { m =
height; }
87 out << setiosflags(ios::scientific | ios::showpos);
88 for (
int i = 0; i < n; i++)
92 for (
int j = 0; j < m; j++)
96 out << j+1 <<
" " << i+1 <<
" " << y(j) <<
'\n';
105 bool ownA,
bool ownB)
107 A(A), B(B), ownA(ownA), ownB(ownB), z(A->
Width())
110 "incompatible Operators: A->Width() = " << A->
Width()
111 <<
", B->Height() = " << B->
Height());
116 if (ownA) {
delete A; }
117 if (ownB) {
delete B; }
123 :
Operator(Rt_.Width(), P_.Width()), Rt(Rt_), A(A_), P(P_)
126 "incompatible Operators: Rt.Height() = " << Rt.
Height()
127 <<
", A.Height() = " << A.
Height());
129 "incompatible Operators: A.Width() = " << A.
Width()
130 <<
", P.Height() = " << P.
Height());
141 bool ownA,
bool ownB,
bool ownC)
144 , ownA(ownA), ownB(ownB), ownC(ownC)
147 "incompatible Operators: A->Width() = " << A->
Width()
148 <<
", B->Height() = " << B->
Height());
150 "incompatible Operators: B->Width() = " << B->
Width()
151 <<
", C->Height() = " << C->
Height());
161 if (ownA) {
delete A; }
162 if (ownB) {
delete B; }
163 if (ownC) {
delete C; }
169 :
Operator(A->Height(), A->Width()), A(A), own_A(_own_A)
190 const int id = idx[i];
201 const int id = idx[i];
220 MFEM_FORALL(i, csz, d_z[idx[i]] = 0.0;);
229 const int id = idx[i];
static MemoryClass GetMemoryClass()
Get the current Device MemoryClass. This is the MemoryClass used by most MFEM device kernels to acces...
int Size() const
Logical size of the array.
virtual ~ProductOperator()
Array< int > constraint_list
List of constrained indices/dofs.
void SyncMemory(const Vector &v)
Update the memory location of the vector to match v.
void SetSize(int s)
Resize the vector to size s.
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
virtual void Mult(const Vector &x, Vector &y) const
Constrained operator action.
int Size() const
Returns the size of the vector.
ProductOperator(const Operator *A, const Operator *B, bool ownA, bool ownB)
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
Memory< double > & GetMemory()
Return a reference to the Memory object used by the Vector.
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 ...
virtual const Operator * GetProlongation() const
Prolongation operator from linear algebra (linear system) vectors, to input vectors for the operator...
double * ReadWrite(bool on_dev=true)
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), on_dev).
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().
const T * Read(bool on_dev=true) const
Shortcut for mfem::Read(a.GetMemory(), a.Size(), on_dev).
The operator x -> R*A*P*x constructed through the actions of R^T, A and P.
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...
void SetSubVectorComplement(const Array< int > &dofs, const double val)
Set all vector entries NOT in the 'dofs' array to the given 'val'.
Vector w
Auxiliary vectors.
MemoryType
Memory types supported by MFEM.
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.
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.
const double * Read(bool on_dev=true) const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), on_dev).
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.
void NewMemoryAndSize(const Memory< double > &mem, int s, bool own_mem)
Reset the Vector to use the given external Memory mem and size s.
MemoryType GetMemoryType(MemoryClass mc)
Return a suitable MemoryType for a given MemoryClass.
ConstrainedOperator(Operator *A, const Array< int > &list, bool own_A=false)
Constructor from a general Operator and a list of essential indices/dofs.
TripleProductOperator(const Operator *A, const Operator *B, const Operator *C, bool ownA, bool ownB, bool ownC)
void MakeRef(T *, int)
Make this Array a reference to a pointer.
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...
int width
Dimension of the input / number of columns in the matrix.