19struct DGMassInvKernels { DGMassInvKernels(); };
25 :
Solver(fes_orig.GetTrueVSize()),
26 fec(fes_orig.GetMaxElementOrder(),
27 fes_orig.
GetMesh()->Dimension(),
29 fes_orig.GetTypicalFE()->GetMapType()),
32 static DGMassInvKernels kernels;
37 const int btype_orig =
40 if (btype_orig == btype)
79 M->AddDomainIntegrator(
m);
103 MFEM_ABORT(
"SetOperator not supported with DGMassInverse.")
128 CGKernels::Run(
dim, d1d, q1d, *
this, Mu,
u);
131DGMassInvKernels::DGMassInvKernels()
133 using k = DGMassInverse::CGKernels;
135 k::Specialization<2,1,1>::Add();
136 k::Specialization<2,2,2>::Add();
137 k::Specialization<2,3,3>::Add();
138 k::Specialization<2,3,5>::Add();
139 k::Specialization<2,4,4>::Add();
140 k::Specialization<2,4,6>::Add();
141 k::Specialization<2,5,5>::Add();
142 k::Specialization<2,5,7>::Add();
143 k::Specialization<2,6,6>::Add();
144 k::Specialization<2,6,8>::Add();
146 k::Specialization<3,2,2>::Add();
147 k::Specialization<3,2,3>::Add();
148 k::Specialization<3,3,3>::Add();
149 k::Specialization<3,3,4>::Add();
150 k::Specialization<3,3,5>::Add();
151 k::Specialization<3,4,4>::Add();
152 k::Specialization<3,4,5>::Add();
153 k::Specialization<3,4,6>::Add();
154 k::Specialization<3,4,8>::Add();
155 k::Specialization<3,5,5>::Add();
156 k::Specialization<3,5,6>::Add();
157 k::Specialization<3,5,7>::Add();
158 k::Specialization<3,5,8>::Add();
159 k::Specialization<3,6,6>::Add();
160 k::Specialization<3,6,7>::Add();
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
T * HostReadWrite()
Shortcut for mfem::ReadWrite(a.GetMemory(), a.Size(), false).
T * HostWrite()
Shortcut for mfem::Write(a.GetMemory(), a.Size(), false).
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
Solver for the discontinuous Galerkin mass matrix.
Vector diag_inv
Jacobi preconditioner.
class MassIntegrator * m
Mass integrator, owned by the form M.
real_t rel_tol
Relative CG tolerance.
int max_iter
Maximum number of CG iterations;.
Array< real_t > B_
Inverse of change of basis.
std::unique_ptr< class BilinearForm > M
Mass bilinear form.
real_t abs_tol
Absolute CG tolerance.
DGMassInverse(const FiniteElementSpace &fes_, Coefficient *coeff, const IntegrationRule *ir, int btype)
Protected constructor, used internally.
void SetMaxIter(const int max_iter_)
Set the maximum number of iterations.
Array< real_t > Bt_
Inverse of change of basis, transposed.
void SetOperator(const Operator &op) override
Not implemented. Aborts.
void Update()
Recompute operator and preconditioner (when coefficient or mesh changes).
void Mult(const Vector &b, Vector &u) const override
Solve the system M b = u.
void SetRelTol(const real_t rel_tol_)
Set the relative tolerance.
FiniteElementSpace fes
FE space in requested basis.
const DofToQuad * d2q
Change of basis. Not owned.
void SetAbsTol(const real_t abs_tol_)
Set the absolute tolerance.
Data type dense matrix using column-major storage.
void Transpose()
(*this) = (*this)^t
@ TENSOR
Tensor product representation using 1D matrices/tensors with dimensions using 1D number of quadrature...
Array< real_t > B
Basis functions evaluated at quadrature points.
int ndof
Number of degrees of freedom = number of basis functions. When mode is TENSOR, this is the 1D number.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
bool IsVariableOrder() const
Returns true if the space contains elements of varying polynomial orders.
const FiniteElementCollection * FEColl() const
Mesh * GetMesh() const
Returns the mesh.
bool IsDGSpace() const
Return whether or not the space is discontinuous (L2)
const FiniteElement * GetTypicalFE() const
Return GetFE(0) if the local mesh is not empty; otherwise return a typical FE based on the Geometry t...
Abstract class for all finite elements.
virtual const DofToQuad & GetDofToQuad(const IntegrationRule &ir, DofToQuad::Mode mode) const
Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mo...
const IntegrationRule & GetNodes() const
Get a const reference to the nodes of the element.
Class for an integration rule - an Array of IntegrationPoint.
Arbitrary order "L2-conforming" discontinuous finite elements.
bool Factor(int m, real_t TOL=0.0) override
Compute the LU factorization of the current matrix.
void GetInverseMatrix(int m, real_t *X) const override
Assuming L.U = P.A factored data of size (m x m), compute X <- A^{-1}.
int Dimension() const
Dimension of the reference space used within the elements.
int height
Dimension of the output / number of rows in the matrix.
virtual void AssembleDiagonal(Vector &diag) const
Computes the diagonal entries into diag. Typically, this operation only makes sense for linear Operat...
void SetSize(int s)
Resize the vector to size s.
void Reciprocal()
(*this)(i) = 1.0 / (*this)(i)
real_t u(const Vector &xvec)