16 #include "ceed/util.hpp"
22 :
Operator(nlf->FESpace()->GetVSize()), nlf(nlf) { }
27 dnfi(*nlf->GetDNFI()),
42 for (
int i = 0; i <
dnfi.Size(); i++)
44 energy +=
dnfi[i]->GetLocalStateEnergyPA(
xe);
53 "face integrators are not supported yet");
55 for (
int i = 0; i <
dnfi.Size(); ++i) {
dnfi[i]->AssemblePA(
fes); }
60 if (!DeviceCanUseCeed())
64 for (
int i = 0; i <
dnfi.Size(); ++i) {
dnfi[i]->AddMultPA(
xe,
ye); }
71 for (
int i = 0; i <
dnfi.Size(); ++i)
73 dnfi[i]->AddMultPA(x, y);
97 void PANonlinearFormExtension::Gradient::AssembleGrad(
const Vector &g)
99 ext.elemR->
Mult(g, ext.xe);
100 for (
int i = 0; i < ext.dnfi.Size(); ++i)
102 ext.dnfi[i]->AssembleGradPA(ext.xe, ext.fes);
109 ext.elemR->Mult(x, ext.xe);
110 for (
int i = 0; i < ext.dnfi.Size(); ++i)
112 ext.dnfi[i]->AddMultGradPA(ext.xe, ext.ye);
114 ext.elemR->MultTranspose(ext.ye, y);
117 void PANonlinearFormExtension::Gradient::AssembleDiagonal(Vector &diag)
const
119 MFEM_ASSERT(diag.Size() == Height(),
120 "Vector for holding diagonal has wrong size!");
122 for (
int i = 0; i < ext.dnfi.Size(); ++i)
124 ext.dnfi[i]->AssembleGradDiagonalPA(ext.ye);
126 ext.elemR->MultTranspose(ext.ye, diag);
131 height = width = ext.Height();
151 const int Ni = integrators.
Size();
152 for (
int i = 0; i < Ni; ++i)
154 integrators[i]->AssembleMF(
fes);
161 const int iSz = integrators.
Size();
167 for (
int i = 0; i < iSz; ++i)
177 for (
int i = 0; i < iSz; ++i)
179 integrators[i]->AddMultMF(x, y);
int Size() const
Return the logical size of the array.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
void SetSize(int s)
Resize the vector to size s.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
virtual void Mult(const Vector &x, Vector &y) const =0
Operator application: y=A(x).
virtual void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
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 ...
const Operator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
static MemoryType GetMemoryType()
(DEPRECATED) Equivalent to GetDeviceMemoryType().
void Update(Vector &x, int k, DenseMatrix &h, Vector &s, Array< Vector * > &v)
int height
Dimension of the output / number of rows in the matrix.
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
Lexicographic ordering for tensor-product FiniteElements.
int width
Dimension of the input / number of columns in the matrix.