23 MFEM_ABORT(
"Not supported.");
29 mfem_error(
"LinearFormIntegrator::AssembleRHSElementVect(...)");
36 mfem_error(
"LinearFormIntegrator::AssembleRHSElementVect(...)");
66 add(elvect, ip.
weight * val, shape, elvect);
73 MFEM_ASSERT(
delta != NULL,
"coefficient must be DeltaCoefficient");
104 Q.
Eval(Qvec, Tr, ip);
114 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
116 int spaceDim =
Trans.GetSpaceDim();
124 dshape.
Mult(Qvec, elvect);
139 int intorder = oa * el.
GetOrder() + ob;
152 add(elvect, ip.
weight * val, shape, elvect);
168 int intorder = oa * el.
GetOrder() + ob;
186 add(elvect, val, shape, elvect);
204 int intorder = oa * el.
GetOrder() + ob;
221 Q.
Eval(Qvec, Tr, ip);
242 mfem_error(
"These methods make sense only in 2D problems.");
248 int intorder = oa * el.
GetOrder() + ob;
258 tangent(0) = Jac(0,0);
259 tangent(1) = Jac(1,0);
261 Q.
Eval(Qvec, Tr, ip);
265 add(elvect, ip.
weight*(Qvec*tangent), shape, elvect);
297 Q.
Eval (Qvec, Tr, ip);
299 for (
int k = 0; k < vdim; k++)
303 for (
int s = 0;
s < dof;
s++)
305 elvect(dof*k+
s) += ip.
weight * cf * shape(
s);
314 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
325 MultVWt(shape, Qvec, elvec_as_mat);
332 const int dof = el.
GetDof();
338 elvect.
SetSize(dof*(vdim/sdim));
358 Q.
Eval(Qvec, Tr, ip);
361 for (
int k = 0; k < vdim/sdim; k++)
363 for (
int d=0; d < sdim; ++d) { part_x(d) = Qvec(k*sdim+d); }
364 dshape.
Mult(part_x, pelvect);
365 for (
int s = 0;
s < dof; ++
s) { elvect(
s+k*dof) += pelvect(
s); }
373 MFEM_ABORT(
"Not implemented!");
403 for (
int k = 0; k < vdim; k++)
404 for (
int s = 0;
s < dof;
s++)
406 elvect(dof*k+
s) += vec(k) * shape(
s);
444 for (
int k = 0; k < vdim; k++)
446 for (
int s = 0;
s < dof;
s++)
448 elvect(dof*k+
s) += vec(k) * shape(
s);
459 int vdim = std::max(spaceDim, el.
GetVDim());
482 QF.
Eval (vec, Tr, ip);
491 MFEM_ASSERT(
vec_delta != NULL,
"coefficient must be VectorDeltaCoefficient");
493 int spaceDim =
Trans.GetSpaceDim();
501 vshape.
Mult(vec, elvect);
509 int n=(spaceDim == 3)? spaceDim : 1;
529 QF->
Eval(vec, Tr, ip);
532 curlshape.
AddMult (vec, elvect);
539 int spaceDim =
Trans.GetSpaceDim();
541 "coefficient must be VectorDeltaCoefficient");
543 int n=(spaceDim == 3)? spaceDim : 1;
550 curlshape.
Mult(vec, elvect);
577 add(elvect, ip.
weight * val, divshape, elvect);
584 MFEM_ASSERT(
delta != NULL,
"coefficient must be DeltaCoefficient");
613 nor *= Sign * ip.
weight * F -> Eval (Tr, ip);
614 for (
int j = 0; j < dof; j++)
615 for (
int k = 0; k <
dim; k++)
617 elvect(dof*k+j) += nor(k) * shape(j);
635 int intorder = oa * el.
GetOrder() + ob;
648 val *= F->
Eval(Tr, ip);
651 elvect.
Add(val, shape);
665 MFEM_VERIFY(vdim == 2,
"VectorFEBoundaryTangentLFIntegrator " 666 "must be called with vector basis functions of dimension 2.");
674 int intorder = oa * el.
GetOrder() + ob;
685 f.
Eval(f_loc, Tr, ip);
694 f_hat(0) = J(0,0) * f_loc(0) + J(1,0) * f_loc(1);
703 Swap<double>(f_hat(0), f_hat(1));
704 f_hat(0) = -f_hat(0);
714 mfem_error(
"BoundaryFlowIntegrator::AssembleRHSElementVect\n" 715 " is not implemented as boundary integrator!\n" 716 " Use LinearForm::AddBdrFaceIntegrator instead of\n" 717 " LinearForm::AddBoundaryIntegrator.");
723 int dim, ndof, order;
724 double un, w, vu_data[3], nor_data[3];
763 nor(0) = 2*eip.
x - 1.0;
771 w = 0.5*alpha*un - beta*fabs(un);
773 elvect.
Add(w, shape);
780 mfem_error(
"DGDirichletLFIntegrator::AssembleRHSElementVect");
787 bool kappa_is_nonzero = (
kappa != 0.);
829 nor(0) = 2*eip.
x - 1.0;
861 if (kappa_is_nonzero)
871 mfem_error(
"DGElasticityDirichletLFIntegrator::AssembleRHSElementVect");
877 MFEM_ASSERT(Tr.
Elem2No < 0,
"interior boundary is not supported");
879 #ifdef MFEM_THREAD_SAFE 891 const int ndofs = el.
GetDof();
892 const int nvdofs =
dim*ndofs;
934 nor(0) = 2*eip.
x - 1.0;
941 double wL, wM, jcoef;
990 for (
int im = 0, i = 0; im <
dim; ++im)
992 const double t2 = wM *
u_dir(im);
993 const double t3 = wM *
nor(im);
994 const double tj = jcoef *
u_dir(im);
995 for (
int idof = 0; idof < ndofs; ++idof, ++i)
1013 for (
int i = 0; i < n; i++)
1015 elvect(i) = dist(generator);
1020 if (!save_factors || !L[iel])
1032 massinteg.AssembleElementMatrix(el, Tr, *M);
1035 chol.LMult(n,1,elvect.
GetData());
1052 const int vdim = vqfc.
GetVDim();
1053 const int ndofs = fe.
GetDof();
1058 for (
int q = 0; q < nqp; q++)
1063 vqfc.
Eval(temp, Tr, ip);
1065 for (
int ind = 0; ind < vdim; ind++)
1067 for (
int nd = 0; nd < ndofs; nd++)
1069 elvect(nd + ind * ndofs) += w * shape(nd) * temp(ind);
1084 const int ndofs = fe.
GetDof();
1088 for (
int q = 0; q < nqp; q++)
1093 double temp = qfc.
Eval(Tr, ip);
1095 shape *= (w * temp);
Abstract class for all finite elements.
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
int GetNPoints() const
Returns the number of the points in the integration rule.
Class for an integration rule - an Array of IntegrationPoint.
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
void MultVWt(const Vector &v, const Vector &w, DenseMatrix &VWt)
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
const QuadratureFunction & GetQuadFunction() const
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
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 ...
void SetSize(int s)
Resize the vector to size s.
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
int Space() const
Returns the type of FunctionSpace on the element.
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
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 ...
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
void CalcAdjugate(const DenseMatrix &a, DenseMatrix &adja)
Data type dense matrix using column-major storage.
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
double * Data() const
Returns the matrix data array.
void CalcPhysVShape(ElementTransformation &Trans, DenseMatrix &shape) const
Equivalent to the CalcVShape() method with the same arguments.
void CalcOrtho(const DenseMatrix &J, Vector &n)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
void add(const Vector &v1, const Vector &v2, Vector &v)
IntegrationRules IntRules(0, Quadrature1D::GaussLegendre)
A global object with all integration rules (defined in intrules.cpp)
const QuadratureFunction & GetQuadFunction() const
Geometry::Type GetGeomType() const
Returns the Geometry::Type of the reference element.
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
virtual 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...
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
void MultTranspose(const double *x, double *y) const
Multiply a vector with the transpose matrix.
void mfem_error(const char *msg)
Function called when an error is encountered. Used by the macros MFEM_ABORT, MFEM_ASSERT, MFEM_VERIFY.
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
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...
VectorDeltaCoefficient * vec_delta
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
int GetVDim()
Returns dimension of the vector.
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 Mult(const double *x, double *y) const
Matrix vector multiplication.
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...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient in the element described by T at the point ip, storing the result in ...
void LMult(int m, int n, double *X) const
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
double * GetData() const
Return a pointer to the beginning of the Vector data.
double p(const Vector &x, double t)
int GetDim() const
Returns the reference space dimension for the finite element.
virtual void AddMult(const Vector &x, Vector &y, const double a=1.0) const
y += a * A.x
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
virtual bool Factor(int m, double TOL=0.0)
Compute the Cholesky factorization of the current matrix.
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
virtual void EvalDelta(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Return the specified direction vector multiplied by the value returned by DeltaCoefficient::EvalDelta...
int GetDof() const
Returns the number of degrees of freedom in the finite element.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual double EvalDelta(ElementTransformation &T, const IntegrationPoint &ip)
The value of the function assuming we are evaluating at the delta center.
Vector & Set(const double a, const Vector &x)
(*this) = a * x
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
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 ...
Vector & Add(const double a, const Vector &Va)
(*this) += a * Va
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
Class for integration point with weight.
int GetVDim() const
Returns the vector dimension for vector-valued finite elements.
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
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...
virtual void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
virtual void AssembleRHSElementVect(const FiniteElement &fe, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
virtual void AssembleDeltaElementVect(const FiniteElement &fe, ElementTransformation &Trans, Vector &elvect)
Assemble the delta coefficient at the IntegrationPoint set in Trans which is assumed to map to the de...
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect)
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
virtual void AssembleRHSElementVect(const FiniteElement &el, ElementTransformation &Tr, Vector &elvect) override
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...
int GetOrder() const
Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order...