24 int dof_u0 = el[0]->GetDof();
25 int dof_r0 = pel[0]->GetDof();
27 int dim = el[0]->GetDim();
32 " is not defined on manifold meshes");
44 Vector param(1); param=0.0;
51 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0])
63 el[0]->CalcPhysDShape(Tr,dsu0);
64 el[0]->CalcPhysShape(Tr,shu0);
65 pel[0]->CalcPhysShape(Tr,shr0);
67 param[0]=shr0*(*pelfun[0]);
70 for (
int jj=0; jj<
dim; jj++)
76 energy=energy+w * qfun.
QEnergy(Tr,ip,param,uu);
90 int dof_u0 = el[0]->GetDof();
91 int dof_r0 = pel[0]->GetDof();
93 int dim = el[0]->GetDim();
101 " is not defined on manifold meshes");
113 Vector param(1); param=0.0;
119 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0])
131 el[0]->CalcPhysDShape(Tr,dsu0);
132 el[0]->CalcPhysShape(Tr,shu0);
133 pel[0]->CalcPhysShape(Tr,shr0);
135 param[0]=shr0*(*pelfun[0]);
138 for (
int jj=0; jj<
dim; jj++)
147 elvec[0]->Add(w,lvec);
159 int dof_u0 = el[0]->GetDof();
160 int dof_r0 = pel[0]->GetDof();
162 int dim = el[0]->GetDim();
172 " is not defined on manifold meshes");
184 Vector param(1); param=0.0;
190 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0])
201 el[0]->CalcPhysDShape(Tr,dsu0);
202 el[0]->CalcPhysShape(Tr,shu0);
203 pel[0]->CalcPhysShape(Tr,shr0);
205 param[0]=shr0*(*pelfun[0]);
208 for (
int jj=0; jj<
dim; jj++)
229 int dof_u0 = el[0]->GetDof();
230 int dof_r0 = pel[0]->GetDof();
232 int dim = el[0]->GetDim();
242 " is not defined on manifold meshes");
254 Vector param(1); param=0.0;
262 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0])
274 el[0]->CalcPhysDShape(Tr,dsu0);
275 el[0]->CalcPhysShape(Tr,shu0);
276 pel[0]->CalcPhysShape(Tr,shr0);
278 param[0]=shr0*(*pelfun[0]);
281 for (
int jj=0; jj<
dim; jj++)
303 int dof_u0 = el[0]->GetDof();
304 int dim = el[0]->GetDim();
309 " is not defined on manifold meshes");
322 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0]);
334 el[0]->CalcPhysShape(Tr,shu0);
336 val=shu0*(*elfun[0]);
337 energy=energy + w * val * val;
348 int dof_u0 = el[0]->GetDof();
349 int dim = el[0]->GetDim();
358 " is not defined on manifold meshes");
369 int order= 2 * el[0]->GetOrder() + Tr.
OrderGrad(el[0]);
381 el[0]->CalcPhysShape(Tr,shu0);
383 val=shu0*(*elfun[0]);
385 elvec[0]->Add(w*val,shu0);
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
virtual void QResidual(ElementTransformation &T, const IntegrationPoint &ip, mfem::Vector &dd, mfem::Vector &uu, mfem::Vector &rr)=0
void SetCol(int c, const double *col)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
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)
Data type dense matrix using column-major storage.
void AddMult_a_ABt(double a, const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &ABt)
ABt += a * A * B^t.
virtual void AQResidual(ElementTransformation &T, const IntegrationPoint &ip, mfem::Vector &dd, mfem::Vector &uu, mfem::Vector &aa, mfem::Vector &rr)=0
virtual void AssembleElementGrad(const Array< const FiniteElement * > &el, const Array< const FiniteElement * > &pel, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< const Vector * > &pelfun, const Array2D< DenseMatrix * > &elmats) override
Computes the stiffness/tangent matrix.
virtual double QEnergy(ElementTransformation &T, const IntegrationPoint &ip, mfem::Vector &dd, mfem::Vector &uu)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
virtual double GetElementEnergy(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun) override
Returns the objective contribution at element level.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
void GetColumn(int c, Vector &col) const
Dynamic 2D array using row-major layout.
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
virtual void QGradResidual(ElementTransformation &T, const IntegrationPoint &ip, mfem::Vector &dd, mfem::Vector &uu, mfem::DenseMatrix &hh)=0
Returns the gradient of the residual at a integration point.
Vector & Add(const double a, const Vector &Va)
(*this) += a * Va
Class for integration point with weight.
virtual void AssembleElementVector(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< Vector * > &elvec) override
Returns the gradient of the objective contribution at element level.
virtual void AssemblePrmElementVector(const Array< const FiniteElement * > &el, const Array< const FiniteElement * > &pel, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< const Vector * > &alfun, const Array< const Vector * > &pelfun, const Array< Vector * > &elvec) override
void Mult(const double *x, double *y) const
Matrix vector multiplication.
virtual double GetElementEnergy(const Array< const FiniteElement * > &el, const Array< const FiniteElement * > &pel, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< const Vector * > &pelfun) override
Computes the local energy.
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
virtual void AssembleElementVector(const Array< const FiniteElement * > &el, const Array< const FiniteElement * > &pel, ElementTransformation &Tr, const Array< const Vector * > &elfun, const Array< const Vector * > &pelfun, const Array< Vector * > &elvec) override
Computes the element's residual.