22 MFEM_ABORT(
"Not supported.");
28 mfem_error(
"LinearFormIntegrator::AssembleRHSElementVect(...)");
35 mfem_error(
"LinearFormIntegrator::AssembleRHSElementVect(...)");
79 add(elvect, ip.
weight * val, shape, elvect);
86 MFEM_ASSERT(
delta != NULL,
"coefficient must be DeltaCoefficient");
117 Q.
Eval(Qvec, Tr, ip);
127 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
137 dshape.
Mult(Qvec, elvect);
152 int intorder = oa * el.
GetOrder() + ob;
165 add(elvect, ip.
weight * val, shape, elvect);
181 int intorder = oa * el.
GetOrder() + ob;
199 add(elvect, val, shape, elvect);
217 int intorder = oa * el.
GetOrder() + ob;
234 Q.
Eval(Qvec, Tr, ip);
255 mfem_error(
"These methods make sense only in 2D problems.");
261 int intorder = oa * el.
GetOrder() + ob;
271 tangent(0) = Jac(0,0);
272 tangent(1) = Jac(1,0);
274 Q.
Eval(Qvec, Tr, ip);
278 add(elvect, ip.
weight*(Qvec*tangent), shape, elvect);
317 Q.
Eval (Qvec, Tr, ip);
319 for (
int k = 0; k < vdim; k++)
323 for (
int s = 0; s < dof; s++)
325 elvect(dof*k+s) += ip.
weight * cf * shape(s);
334 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
345 MultVWt(shape, Qvec, elvec_as_mat);
352 const int dof = el.
GetDof();
358 elvect.
SetSize(dof*(vdim/sdim));
378 Q.
Eval(Qvec, Tr, ip);
381 for (
int k = 0; k < vdim/sdim; k++)
383 for (
int d=0; d < sdim; ++d) { part_x(d) = Qvec(k*sdim+d); }
384 dshape.
Mult(part_x, pelvect);
385 for (
int s = 0; s < dof; ++s) { elvect(s+k*dof) += pelvect(s); }
393 MFEM_ABORT(
"Not implemented!");
423 for (
int k = 0; k < vdim; k++)
424 for (
int s = 0; s < dof; s++)
426 elvect(dof*k+s) += vec(k) * shape(s);
464 for (
int k = 0; k < vdim; k++)
466 for (
int s = 0; s < dof; s++)
468 elvect(dof*k+s) += vec(k) * shape(s);
502 QF.
Eval (vec, Tr, ip);
511 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
521 vshape.
Mult(vec, elvect);
529 int n=(spaceDim == 3)? spaceDim : 1;
549 QF->
Eval(vec, Tr, ip);
552 curlshape.
AddMult (vec, elvect);
561 "coefficient must be VectorDeltaCoefficient");
563 int n=(spaceDim == 3)? spaceDim : 1;
570 curlshape.
Mult(vec, elvect);
597 add(elvect, ip.
weight * val, divshape, elvect);
604 MFEM_ASSERT(
delta != NULL,
"coefficient must be DeltaCoefficient");
633 nor *= Sign * ip.
weight * F -> Eval (Tr, ip);
634 for (
int j = 0; j < dof; j++)
635 for (
int k = 0; k <
dim; k++)
637 elvect(dof*k+j) += nor(k) * shape(j);
655 int intorder = oa * el.
GetOrder() + ob;
668 val *= F->
Eval(Tr, ip);
671 elvect.
Add(val, shape);
699 F.
Eval(Fvec, Tr, ip);
704 elvect.
Add(val, shape);
718 MFEM_VERIFY(vdim == 2,
"VectorFEBoundaryTangentLFIntegrator "
719 "must be called with vector basis functions of dimension 2.");
727 int intorder = oa * el.
GetOrder() + ob;
738 f.
Eval(f_loc, Tr, ip);
747 f_hat(0) = J(0,0) * f_loc(0) + J(1,0) * f_loc(1);
757 f_hat(0) = -f_hat(0);
767 mfem_error(
"BoundaryFlowIntegrator::AssembleRHSElementVect\n"
768 " is not implemented as boundary integrator!\n"
769 " Use LinearForm::AddBdrFaceIntegrator instead of\n"
770 " LinearForm::AddBoundaryIntegrator.");
776 int dim, ndof, order;
777 real_t un, w, vu_data[3], nor_data[3];
816 nor(0) = 2*eip.
x - 1.0;
824 w = 0.5*alpha*un - beta*fabs(un);
826 elvect.
Add(w, shape);
833 mfem_error(
"DGDirichletLFIntegrator::AssembleRHSElementVect");
840 bool kappa_is_nonzero = (
kappa != 0.);
882 nor(0) = 2*eip.
x - 1.0;
914 if (kappa_is_nonzero)
924 mfem_error(
"DGElasticityDirichletLFIntegrator::AssembleRHSElementVect");
930 MFEM_ASSERT(Tr.
Elem2No < 0,
"interior boundary is not supported");
932#ifdef MFEM_THREAD_SAFE
944 const int ndofs = el.
GetDof();
945 const int nvdofs =
dim*ndofs;
987 nor(0) = 2*eip.
x - 1.0;
1043 for (
int im = 0, i = 0; im <
dim; ++im)
1048 for (
int idof = 0; idof < ndofs; ++idof, ++i)
1066 for (
int i = 0; i < n; i++)
1068 elvect(i) = dist(generator);
1073 if (!save_factors || !L[iel])
1105 const int vdim = vqfc.
GetVDim();
1106 const int ndofs = fe.
GetDof();
1111 for (
int q = 0; q < nqp; q++)
1116 vqfc.
Eval(temp, Tr, ip);
1118 for (
int ind = 0; ind < vdim; ind++)
1120 for (
int nd = 0; nd < ndofs; nd++)
1122 elvect(nd + ind * ndofs) += w * shape(nd) * temp(ind);
1137 const int ndofs = fe.
GetDof();
1141 for (
int q = 0; q < nqp; q++)
1148 shape *= (w * temp);
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
bool Factor(int m, real_t TOL=0.0) override
Compute the Cholesky factorization of the current matrix.
void LMult(int m, int n, real_t *X) const
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
virtual real_t EvalDelta(ElementTransformation &T, const IntegrationPoint &ip)
The value of the function assuming we are evaluating at the delta center.
Abstract class for integrators that support delta coefficients.
VectorDeltaCoefficient * vec_delta
Data type dense matrix using column-major storage.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
void MultTranspose(const real_t *x, real_t *y) const
Multiply a vector with the transpose matrix.
real_t * Data() const
Returns the matrix data array. Warning: this method casts away constness.
void AddMult(const Vector &x, Vector &y, const real_t a=1.0) const override
y += a * A.x
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
DomainLFIntegrator(Coefficient &QF, int a=2, int b=0)
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Abstract class for all finite elements.
virtual void CalcVShape(const IntegrationPoint &ip, DenseMatrix &shape) const
Evaluate the values of all shape functions of a vector finite element in reference space at the given...
int GetRangeDim() const
Returns the vector dimension for vector-valued finite elements, which is also the dimension of the in...
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...
void CalcPhysDShape(ElementTransformation &Trans, DenseMatrix &dshape) const
Evaluate the gradients of all shape functions of a scalar finite element in physical space at the poi...
int GetDim() const
Returns the reference space dimension for the finite element.
virtual void CalcDShape(const IntegrationPoint &ip, DenseMatrix &dshape) const =0
Evaluate the gradients of all shape functions of a scalar finite element in reference space at the gi...
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
int Space() const
Returns the type of FunctionSpace on the element.
void CalcPhysDivShape(ElementTransformation &Trans, Vector &divshape) const
Evaluate the divergence of all shape functions of a vector finite element in physical space at the po...
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
virtual void CalcShape(const IntegrationPoint &ip, Vector &shape) const =0
Evaluate the values of all shape functions of a scalar finite element in reference space at the given...
virtual void CalcPhysCurlShape(ElementTransformation &Trans, DenseMatrix &curl_shape) const
Evaluate the curl of all shape functions of a vector finite element in physical space at the point de...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
void CalcPhysShape(ElementTransformation &Trans, Vector &shape) const
Evaluate the values of all shape functions of a scalar finite element in physical space at the point ...
@ Pk
Polynomials of order k.
Class for integration point with weight.
Class for an integration rule - an Array of IntegrationPoint.
int GetNPoints() const
Returns the number of the points in the integration rule.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const IntegrationRule * GetIntegrationRule() const
Equivalent to GetIntRule, but retained for backward compatibility with applications.
const IntegrationRule * IntRule
void AssembleElementMatrix(const FiniteElement &el, ElementTransformation &Trans, DenseMatrix &elmat) override
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
real_t Eval(ElementTransformation &T, const IntegrationPoint &ip) override
Evaluate the coefficient in the element described by T at the point ip.
const QuadratureFunction & GetQuadFunction() const
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
Base class for vector Coefficients that optionally depend on time and space.
int GetVDim()
Returns dimension of the vector.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
virtual void EvalDelta(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Return the specified direction vector multiplied by the value returned by DeltaCoefficient::EvalDelta...
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
VectorDomainLFIntegrator(VectorCoefficient &QF, const IntegrationRule *ir=nullptr)
Constructs a domain integrator with a given VectorCoefficient.
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect) override
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip) override
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
const QuadratureFunction & GetQuadFunction() const
void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect) override
Vector & Set(const real_t a, const Vector &x)
(*this) = a * x
void SetSize(int s)
Resize the vector to size s.
real_t * GetData() const
Return a pointer to the beginning of the Vector data.
Vector & Add(const real_t a, const Vector &Va)
(*this) += a * Va
void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
void CalcOrtho(const DenseMatrix &J, Vector &n)
void mfem_error(const char *msg)
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
void MultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
void add(const Vector &v1, const Vector &v2, Vector &v)
void Swap(T &a, T &b)
Swap objects of type T. The operation is performed using the most specialized swap function from the ...
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
real_t p(const Vector &x, real_t t)