22 :
Operator(nlf->FESpace()->GetVSize()), nlf(nlf) { }
27 dnfi(*nlf->GetDNFI()),
46 for (
int i = 0; i <
dnfi.Size(); i++)
48 energy +=
dnfi[i]->GetLocalStateEnergyPA(
xe);
57 "face integrators are not supported yet");
59 for (
int i = 0; i <
dnfi.Size(); ++i) {
dnfi[i]->AssemblePA(
fes); }
68 for (
int i = 0; i <
dnfi.Size(); ++i) {
dnfi[i]->AddMultPA(
xe,
ye); }
75 for (
int i = 0; i <
dnfi.Size(); ++i)
77 dnfi[i]->AddMultPA(x, y);
101 void PANonlinearFormExtension::Gradient::AssembleGrad(
const Vector &g)
103 ext.elemR->
Mult(g, ext.xe);
104 for (
int i = 0; i < ext.dnfi.Size(); ++i)
106 ext.dnfi[i]->AssembleGradPA(ext.xe, ext.fes);
113 ext.elemR->Mult(x, ext.xe);
114 for (
int i = 0; i < ext.dnfi.Size(); ++i)
116 ext.dnfi[i]->AddMultGradPA(ext.xe, ext.ye);
118 ext.elemR->MultTranspose(ext.ye, y);
121 void PANonlinearFormExtension::Gradient::AssembleDiagonal(Vector &diag)
const 123 MFEM_ASSERT(diag.Size() == Height(),
124 "Vector for holding diagonal has wrong size!");
126 for (
int i = 0; i < ext.dnfi.Size(); ++i)
128 ext.dnfi[i]->AssembleGradDiagonalPA(ext.ye);
130 ext.elemR->MultTranspose(ext.ye, diag);
135 height = width = ext.Height();
158 const int Ni = integrators.
Size();
159 for (
int i = 0; i < Ni; ++i)
161 integrators[i]->AssembleMF(
fes);
168 const int iSz = integrators.
Size();
174 for (
int i = 0; i < iSz; ++i)
184 for (
int i = 0; i < iSz; ++i)
186 integrators[i]->AddMultMF(x, y);
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 ...
void SetSize(int s)
Resize the vector to size s.
virtual void UseDevice(bool use_dev) const
Enable execution of Vector operations using the mfem::Device.
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).
const ElementRestrictionOperator * GetElementRestriction(ElementDofOrdering e_ordering) const
Return an Operator that converts L-vectors to E-vectors.
void Update(Vector &x, int k, DenseMatrix &h, Vector &s, Array< Vector *> &v)
static MemoryType GetMemoryType()
(DEPRECATED) Equivalent to GetDeviceMemoryType().
bool DeviceCanUseCeed()
Function that determines if a CEED kernel should be used, based on the current mfem::Device configura...
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int height
Dimension of the output / number of rows in the matrix.
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
int GetVSize() const
Return the number of vector dofs, i.e. GetNDofs() x GetVDim().
Lexicographic ordering for tensor-product FiniteElements.
int Size() const
Return the logical size of the array.
int width
Dimension of the input / number of columns in the matrix.