36 int coarse_element = cf.
embeddings[fine_element].parent;
54 const int ne = qspace.
GetNE();
56 for (
int iel = 0; iel < ne; ++iel)
61 for (
int iq = 0; iq < ir.
Size(); ++iq)
66 values[iq_p] =
Eval(T, ip);
80 return (constants(att-1));
83void PWCoefficient::InitMap(
const Array<int> & attr,
86 MFEM_VERIFY(attr.
Size() == coefs.
Size(),
88 "Attribute and coefficient arrays have incompatible "
91 for (
int i=0; i<attr.
Size(); i++)
104 std::map<int, Coefficient*>::iterator
p = pieces.begin();
105 for (;
p != pieces.end();
p++)
107 if (
p->second != NULL)
109 p->second->SetTime(
t);
118 std::map<int, Coefficient*>::const_iterator
p = pieces.find(att);
119 if (
p != pieces.end())
121 if (
p->second != NULL)
123 return p->second->Eval(T, ip);
158 return sqrt(transip[0] * transip[0] + transip[1] * transip[1]);
165 return atan2(transip[1], transip[0]);
172 return sqrt(transip * transip);
179 return atan2(transip[1], transip[0]);
186 return atan2(sqrt(transip[0] * transip[0] + transip[1] * transip[1]),
196 return GridF->
GetValue(T, ip, Component);
202 return GridF->
GetValue(*coarse_T, coarse_ip, Component);
240 MFEM_VERIFY(vcenter.
Size() <= 3,
241 "SetDeltaCenter::Maximum number of dim supported is 3")
242 for (
int i = 0; i < vcenter.
Size(); i++) {
center[i] = vcenter[i]; }
283 const int ne = qspace.
GetNE();
286 for (
int iel = 0; iel < ne; ++iel)
291 for (
int iq = 0; iq < ir.
Size(); ++iq)
302void PWVectorCoefficient::InitMap(
const Array<int> & attr,
305 MFEM_VERIFY(attr.
Size() == coefs.
Size(),
306 "PWVectorCoefficient: "
307 "Attribute and coefficient arrays have incompatible "
310 for (
int i=0; i<attr.
Size(); i++)
312 if (coefs[i] != NULL)
322 "PWVectorCoefficient::UpdateCoefficient: "
323 "VectorCoefficient has incompatible dimension.");
324 pieces[attr] = &coef;
331 std::map<int, VectorCoefficient*>::iterator
p = pieces.begin();
332 for (;
p != pieces.end();
p++)
334 if (
p->second != NULL)
336 p->second->SetTime(
t);
345 std::map<int, VectorCoefficient*>::const_iterator
p = pieces.find(att);
346 if (
p != pieces.end())
348 if (
p->second != NULL)
350 p->second->Eval(V, T, ip);
377 Function(transip, V);
381 TDFunction(transip,
GetTime(), V);
392 for (
int i = 0; i <
dim; i++)
401 for (
int i = 0; i <
vdim; i++)
403 if (Coeff[i]) { Coeff[i]->SetTime(
t); }
410 if (ownCoeff[i]) {
delete Coeff[i]; }
417 for (
int i = 0; i <
vdim; i++)
419 if (ownCoeff[i]) {
delete Coeff[i]; }
427 for (
int i = 0; i <
vdim; i++)
429 V(i) = this->
Eval(i, T, ip);
482 gf -> FESpace() ->
GetMesh() -> SpaceDimension() : 0)
490 gf -> FESpace() ->
GetMesh() -> SpaceDimension() : 0;
632 const int ne = qspace.
GetNE();
634 for (
int iel = 0; iel < ne; ++iel)
639 for (
int iq = 0; iq < ir.
Size(); ++iq)
651void PWMatrixCoefficient::InitMap(
const Array<int> & attr,
654 MFEM_VERIFY(attr.
Size() == coefs.
Size(),
655 "PWMatrixCoefficient: "
656 "Attribute and coefficient arrays have incompatible "
659 for (
int i=0; i<attr.
Size(); i++)
661 if (coefs[i] != NULL)
671 "PWMatrixCoefficient::UpdateCoefficient: "
672 "MatrixCoefficient has incompatible height.");
674 "PWMatrixCoefficient::UpdateCoefficient: "
675 "MatrixCoefficient has incompatible width.");
679 "PWMatrixCoefficient::UpdateCoefficient: "
680 "MatrixCoefficient has incompatible symmetry.");
682 pieces[attr] = &coef;
689 std::map<int, MatrixCoefficient*>::iterator
p = pieces.begin();
690 for (;
p != pieces.end();
p++)
692 if (
p->second != NULL)
694 p->second->SetTime(
t);
703 std::map<int, MatrixCoefficient*>::const_iterator
p = pieces.find(att);
704 if (
p != pieces.end())
706 if (
p->second != NULL)
708 p->second->Eval(K, T, ip);
736 "MatrixFunctionCoefficient is not symmetric");
740 SymmFunction(transip, Ksym);
744 for (
int i=0; i<
height; ++i)
746 for (
int j=i; j<
width; ++j)
748 const real_t Kij = Ksym[j - i + os];
750 if (j != i) { K(j,i) = Kij; }
760 Function(transip, K);
764 TDFunction(transip,
GetTime(), K);
783 "MatrixFunctionCoefficient is not symmetric");
794 SymmFunction(transip, K);
806 MFEM_VERIFY(vdim ==
height*(
height+1)/2,
"Wrong sizes.");
809 const int ne = qspace.
GetNE();
812 for (
int iel = 0; iel < ne; ++iel)
817 for (
int iq = 0; iq < ir.
Size(); ++iq)
833 for (
int j = 0; j <
width; ++j)
835 for (
int i = 0; i <
height; ++ i)
861 Function(transip, K);
865 TDFunction(transip,
GetTime(), K);
894 if (Coeff[i]) { Coeff[i]->SetTime(
t); }
901 if (ownCoeff[i*
width+j]) {
delete Coeff[i*
width+j]; }
902 Coeff[i*
width+j] = c;
903 ownCoeff[i*
width+j] = own;
910 if (ownCoeff[i]) {
delete Coeff[i]; }
918 for (
int i = 0; i <
height; i++)
920 for (
int j = 0; j <
width; j++)
922 K(i,j) = this->
Eval(i, j, T, ip);
977 :
a(&A),
b(&B), va(A.GetVDim()), vb(B.GetVDim())
980 "InnerProductCoefficient: "
981 "Arguments have incompatible dimensions.");
1001 :
a(&A),
b(&B), va(A.GetVDim()), vb(B.GetVDim())
1004 "VectorRotProductCoefficient: "
1005 "Arguments must have dimension equal to two.");
1020 return va[0] * vb[1] - va[1] * vb[0];
1024 :
a(&A), ma(A.GetHeight(), A.GetWidth())
1027 "DeterminantCoefficient: "
1028 "Argument must be a square matrix.");
1046 ACoef(NULL), BCoef(NULL),
1048 alphaCoef(NULL), betaCoef(NULL),
1058 ACoef(&A_), BCoef(&B_),
1059 A(A_.GetVDim()), B(A_.GetVDim()),
1060 alphaCoef(NULL), betaCoef(NULL),
1064 "VectorSumCoefficient: "
1065 "Arguments must have the same dimension.");
1073 ACoef(&A_), BCoef(&B_),
1081 "VectorSumCoefficient: "
1082 "Arguments must have the same dimension.");
1089 if (alphaCoef) { alphaCoef->
SetTime(
t); }
1090 if (betaCoef) { betaCoef->
SetTime(
t); }
1098 if ( ACoef) { ACoef->
Eval(A, T, ip); }
1099 if ( BCoef) { BCoef->
Eval(B, T, ip); }
1100 if (alphaCoef) { alpha = alphaCoef->
Eval(T, ip); }
1101 if ( betaCoef) { beta = betaCoef->
Eval(T, ip); }
1102 add(alpha, A, beta, B, V);
1127 real_t sa = (a == NULL) ? aConst : a->
Eval(T, ip);
1148 V *= (nv > tol) ? (1.0/nv) : 0.0;
1157 "VectorCrossProductCoefficient: "
1158 "Arguments must have dimension equal to three.");
1174 V[0] = va[1] * vb[2] - va[2] * vb[1];
1175 V[1] = va[2] * vb[0] - va[0] * vb[2];
1176 V[2] = va[0] * vb[1] - va[1] * vb[0];
1182 ma(A.GetHeight(), A.GetWidth()), vb(B.GetVDim())
1185 "MatrixVectorProductCoefficient: "
1186 "Arguments have incompatible dimensions.");
1210 for (
int d=0; d<dim; d++) { M(d,d) = 1.0; }
1218 ma(A.GetHeight(), A.GetWidth())
1221 "MatrixSumCoefficient: "
1222 "Arguments must have the same dimensions.");
1236 if ( beta != 1.0 ) { M *= beta; }
1245 ma(A.GetHeight(), A.GetWidth()),
1246 mb(B.GetHeight(), B.GetWidth())
1249 "MatrixProductCoefficient: "
1250 "Arguments must have compatible dimensions.");
1284 real_t sa = (a == NULL) ? aConst : a->
Eval(T, ip);
1311 "InverseMatrixCoefficient: "
1312 "Argument must be a square matrix.");
1332 va(A.GetVDim()), vb(B.GetVDim())
1348 for (
int i=0; i<va.
Size(); i++)
1350 for (
int j=0; j<vb.
Size(); j++)
1352 M(i, j) = va[i] * vb[j];
1382 for (
int i=0; i<vk.Size(); i++)
1385 for (
int j=0; j<vk.Size(); j++)
1387 M(i, j) -= vk[i] * vk[j];
1390 M *= ((a == NULL ) ? aConst : a->
Eval(T, ip) );
1399 for (
int i = 0; i < mesh.
GetNE(); i++)
1406 tr->SetIntPoint(&ip);
1410 norm += ip.
weight * tr->Weight() * pow(val,
p);
1433 for (
int i = 0; i < mesh.
GetNE(); i++)
1440 tr->SetIntPoint(&ip);
1441 coeff.
Eval(vval, *tr, ip);
1444 for (
int idim(0); idim < vdim; ++idim)
1446 norm += ip.
weight * tr->Weight() * pow(fabs( vval(idim) ),
p);
1451 for (
int idim(0); idim < vdim; ++idim)
1453 val = fabs(vval(idim));
1476 norm = -pow(-norm, 1.0/
p);
1480 norm = pow(norm, 1.0/
p);
1497 norm = -pow(-norm, 1.0/
p);
1501 norm = pow(norm, 1.0/
p);
1515 MPI_Comm comm = pmesh.
GetComm();
1523 if (glob_norm < 0.0)
1525 glob_norm = -pow(-glob_norm, 1.0/
p);
1529 glob_norm = pow(glob_norm, 1.0/
p);
1547 MPI_Comm comm = pmesh.
GetComm();
1555 if (glob_norm < 0.0)
1557 glob_norm = -pow(-glob_norm, 1.0/
p);
1561 glob_norm = pow(glob_norm, 1.0/
p);
1580 MFEM_VERIFY(index_ >= 0,
"Index must be >= 0");
1581 MFEM_VERIFY(index_ < QuadF.
GetVDim(),
1582 "Index must be < QuadratureFunction length");
1585 MFEM_VERIFY(length_ > 0,
"Length must be > 0");
1586 MFEM_VERIFY(length_ <= QuadF.
GetVDim() - index,
1587 "Length must be <= (QuadratureFunction length - index)");
1601 if (el_idx < 0) { V = 0.0;
return; }
1614 for (
int i = 0; i <
vdim; i++)
1616 V(i) = temp(index + i);
1631 MFEM_VERIFY(qf.
GetVDim() == 1,
"QuadratureFunction's vdim must be 1");
1642 if (el_idx < 0) {
return 0.0; }
1656 :
Vector(), storage(storage_), vdim(0), qs(qs_), qf(NULL)
1709 MakeRef(qf_coeff->GetQuadFunction());
1727 else if (
auto *qf_coeff =
1730 MakeRef(qf_coeff->GetQuadFunction());
1747 else if (
auto *const_sym_coeff =
1757 const int width = coeff.
GetWidth();
1758 vdim = sym ? height*(height + 1)/2 : width*height;
1762 if (sym) { sym_coeff->ProjectSymmetric(*
qf); }
1777 MFEM_CONTRACT_VAR(qs2);
1778 MFEM_VERIFY(qs2 != NULL,
"Invalid QuadratureSpace.")
1797 for (
int iq = 0; iq < nq; ++iq)
1799 for (
int vd = 0; vd<
vdim; ++vd)
1801 (*this)[vd + iq*
vdim] = constant[vd];
1809 const int width = constant.
Width();
1810 const int height = constant.
Height();
1811 vdim = width*height;
1813 for (
int iq = 0; iq < nq; ++iq)
1815 for (
int j = 0; j < width; ++j)
1817 for (
int i = 0; i < height; ++i)
1819 (*this)[i + j*height + iq*
vdim] = constant(i, j);
1828 const int height = constant.
Height();
1830 vdim = sym ? height*(height + 1)/2 : height*height;
1832 for (
int iq = 0; iq < nq; ++iq)
1834 for (
int vd = 0; vd <
vdim; ++vd)
1836 const real_t value = sym ? constant.
GetData()[vd] : constant(vd % height,
1838 (*this)[vd + iq*
vdim] = value;
void SetSize(int nsize)
Change the logical size of the array, keep existing entries.
int Size() const
Return the logical size of the array.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
Class to represent a coefficient evaluated at quadrature points.
void SetConstant(real_t constant)
Set this vector to the given constant.
int vdim
Number of values per quadrature point.
void Project(Coefficient &coeff)
Evaluate the given Coefficient at the quadrature points defined by qs.
int GetVDim() const
Return the number of values per quadrature point.
CoefficientVector(QuadratureSpaceBase &qs_, CoefficientStorage storage_=CoefficientStorage::FULL)
Create an empty CoefficientVector.
QuadratureFunction * qf
Internal QuadratureFunction (owned, may be NULL).
CoefficientStorage storage
Storage optimizations (see CoefficientStorage).
QuadratureSpaceBase & qs
Associated QuadratureSpaceBase.
void ProjectTranspose(MatrixCoefficient &coeff)
Project the transpose of coeff.
void MakeRef(const QuadratureFunction &qf_)
Make this vector a reference to the given QuadratureFunction.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
real_t GetTime()
Get the time for time dependent coefficients.
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
A coefficient that is constant across space and time.
void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf with the constant value.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
CrossCrossCoefficient(real_t A, VectorCoefficient &K)
void SetGridFunction(const GridFunction *gf)
Set the vector grid function.
const GridFunction * GridFunc
CurlGridFunctionCoefficient(const GridFunction *gf)
Construct the coefficient with a vector grid function gf. The grid function is not owned by the coeff...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector curl coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
void GetDeltaCenter(Vector ¢er)
Write the center of the delta function into center.
real_t Scale()
Return the scale factor times the optional time dependent function. Returns with when not set by th...
void SetDeltaCenter(const Vector ¢er)
Set the center location of the delta function.
virtual real_t EvalDelta(ElementTransformation &T, const IntegrationPoint &ip)
The value of the function assuming we are evaluating at the delta center.
Data type dense matrix using column-major storage.
void Mult(const real_t *x, real_t *y) const
Matrix vector multiplication.
void Transpose()
(*this) = (*this)^t
void GetColumnReference(int c, Vector &col)
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
void Invert()
Replaces the current matrix with its inverse.
void UseExternalData(real_t *d, int h, int w)
Change the data array and the size of the DenseMatrix.
void Add(const real_t c, const DenseMatrix &A)
Adds the matrix A multiplied by the number c to the matrix.
void SetSize(int s)
Change the size of the DenseSymmetricMatrix to s x s.
void UseExternalData(real_t *d, int s)
Change the data array and the size of the DenseSymmetricMatrix.
real_t * GetData() const
Returns the matrix data array.
DeterminantCoefficient(MatrixCoefficient &A)
Construct with the matrix.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the determinant coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
DivergenceGridFunctionCoefficient(const GridFunction *gf)
Construct the coefficient with a vector grid function gf. The grid function is not owned by the coeff...
const GridFunction * GridFunc
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the scalar divergence coefficient at ip.
Mesh * GetMesh() const
Returns the mesh.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
std::function< real_t(const Vector &)> Function
std::function< real_t(const Vector &, real_t)> TDFunction
void SetGridFunction(const GridFunction *gf)
Set the scalar grid function.
GradientGridFunctionCoefficient(const GridFunction *gf)
Construct the coefficient with a scalar grid function gf. The grid function is not owned by the coeff...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the gradient vector coefficient at ip.
const GridFunction * GridFunc
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
Class for grid function - Vector with associated FE space.
virtual real_t GetValue(int i, const IntegrationPoint &ip, int vdim=1) const
void GetGradients(ElementTransformation &tr, const IntegrationRule &ir, DenseMatrix &grad) const
Extension of GetGradient(...) for a collection of IntegrationPoints.
FiniteElementSpace * FESpace()
virtual void GetVectorValue(int i, const IntegrationPoint &ip, Vector &val) const
real_t GetDivergence(ElementTransformation &tr) const
void GetCurl(ElementTransformation &tr, Vector &curl) const
void GetGradient(ElementTransformation &tr, Vector &grad) const
Gradient of a scalar function at a quadrature point.
void GetVectorValues(int i, const IntegrationRule &ir, DenseMatrix &vals, DenseMatrix &tr) const
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
InnerProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
Construct with the two vector coefficients. Result is .
void SetTime(real_t t)
Set the time for internally stored coefficients.
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.
InverseMatrixCoefficient(MatrixCoefficient &A)
Construct with the matrix coefficient. Result is .
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void Set(int i, int j, Coefficient *c, bool own=true)
Set the coefficient located at (i,j) in the matrix. By default by default this will take ownership of...
MatrixArrayCoefficient(int dim)
Construct a coefficient matrix of dimensions dim * dim. The actual coefficients still need to be adde...
virtual ~MatrixArrayCoefficient()
real_t Eval(int i, int j, ElementTransformation &T, const IntegrationPoint &ip)
void SetTime(real_t t)
Set the time for internally stored coefficients.
Base class for Matrix Coefficients that optionally depend on time and space.
virtual void Project(QuadratureFunction &qf, bool transpose=false)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points....
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
real_t GetTime()
Get the time for time dependent coefficients.
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 GetWidth() const
Get the width of the matrix.
int GetHeight() const
Get the height of the matrix.
A matrix coefficient that is constant in space and time.
virtual void EvalSymmetric(Vector &K, ElementTransformation &T, const IntegrationPoint &ip)
(DEPRECATED) Evaluate the symmetric matrix coefficient at ip.
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
MatrixProductCoefficient(MatrixCoefficient &A, MatrixCoefficient &B)
Construct with the two coefficients. Result is A * B.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
MatrixSumCoefficient(MatrixCoefficient &A, MatrixCoefficient &B, real_t alpha_=1.0, real_t beta_=1.0)
Construct with the two coefficients. Result is alpha_ * A + beta_ * B.
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient at ip.
MatrixVectorProductCoefficient(MatrixCoefficient &A, VectorCoefficient &B)
Constructor with two coefficients. Result is A*B.
void SetTime(real_t t)
Set the time for internally stored coefficients.
Element::Type GetElementType(int i) const
Returns the type of element i.
const CoarseFineTransformations & GetRefinementTransforms() const
int GetNE() const
Returns number of elements.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr) const
Builds the transformation defining the i-th element in ElTr. ElTr must be allocated in advance and wi...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
NormalizedVectorCoefficient(VectorCoefficient &A, real_t tol=1e-6)
Return a vector normalized to a length of one.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
int Width() const
Get the width (size of input) of the Operator. Synonym with NumCols().
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
OuterProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
Construct with two vector coefficients. Result is .
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void UpdateCoefficient(int attr, Coefficient &coef)
Replace a single Coefficient for a particular attribute.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void UpdateCoefficient(int attr, MatrixCoefficient &coef)
Replace a single coefficient for a particular attribute.
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void UpdateCoefficient(int attr, VectorCoefficient &coef)
Replace a single Coefficient for a particular attribute.
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
Class for parallel meshes.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
void SetTime(real_t t)
Set the time for internally stored coefficients.
Quadrature function coefficient which requires that the quadrature rules used for this coefficient be...
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
QuadratureFunctionCoefficient(const QuadratureFunction &qf)
Constructor with a quadrature function as input.
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
Represents values or vectors of values at quadrature points on a mesh.
void SetVDim(int vdim_)
Set the vector dimension, updating the size by calling Vector::SetSize().
QuadratureSpaceBase * GetSpace()
Get the associated QuadratureSpaceBase object.
void ProjectGridFunction(const GridFunction &gf)
Evaluate a grid function at each quadrature point.
void GetValues(int idx, Vector &values)
Return all values associated with mesh element idx in a Vector.
int GetVDim() const
Get the vector dimension.
Abstract base class for QuadratureSpace and FaceQuadratureSpace.
int GetNE() const
Return the number of entities.
virtual ElementTransformation * GetTransformation(int idx)=0
Get the (element or face) transformation of entity idx.
int GetSize() const
Return the total number of quadrature points.
const IntegrationRule & GetIntRule(int idx) const
Return the IntegrationRule associated with entity idx.
virtual int GetEntityIndex(const ElementTransformation &T) const =0
Returns the index in the quadrature space of the entity associated with the transformation T.
virtual int GetPermutedIndex(int idx, int iq) const =0
Returns the permuted index of the iq quadrature point in entity idx.
int GetOrder() const
Return the order of the quadrature rule(s) used by all elements.
Mesh * GetMesh() const
Returns the mesh.
void SetTime(real_t t)
Set the time for internally stored coefficients.
void SetTime(real_t t)
Set the time for internally stored coefficients.
ScalarMatrixProductCoefficient(real_t A, MatrixCoefficient &B)
Constructor with one coefficient. Result is A*B.
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
ScalarVectorProductCoefficient(real_t A, VectorCoefficient &B)
Constructor with constant and vector coefficient. Result is A * B.
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
Base class for symmetric matrix coefficients that optionally depend on time and space.
DenseSymmetricMatrix mat
Internal matrix used when evaluating this coefficient as a DenseMatrix.
virtual void ProjectSymmetric(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
virtual void Eval(DenseSymmetricMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result as ...
A matrix coefficient that is constant in space and time.
virtual void Eval(DenseSymmetricMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
TransposeMatrixCoefficient(MatrixCoefficient &A)
Construct with the matrix coefficient. Result is .
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual ~VectorArrayCoefficient()
Destroys vector coefficient.
void SetTime(real_t t)
Set the time for internally stored coefficients.
VectorArrayCoefficient(int dim)
Construct vector of dim coefficients. The actual coefficients still need to be added with Set().
void Set(int i, Coefficient *c, bool own=true)
Sets coefficient in the vector.
real_t Eval(int i, ElementTransformation &T, const IntegrationPoint &ip)
Base class for vector Coefficients that optionally depend on time and space.
int GetVDim()
Returns dimension of the vector.
virtual void SetTime(real_t t)
Set the time for time dependent coefficients.
real_t GetTime()
Get the time for time dependent coefficients.
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 Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
Vector coefficient that is constant in space and time.
void SetTime(real_t t)
Set the time for internally stored coefficients.
VectorCrossProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
Construct with the two coefficients. Result is A x B.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
void SetDirection(const Vector &d_)
virtual void EvalDelta(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Return the specified direction vector multiplied by the value returned by DeltaCoefficient::EvalDelta...
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient at ip.
void SetGridFunction(const GridFunction *gf)
Set the grid function for this coefficient. Also sets the Vector dimension to match that of the gf.
const GridFunction * GridFunc
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient at ip.
VectorGridFunctionCoefficient()
Construct an empty coefficient. Calling Eval() before the grid function is set will cause a segfault.
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
Vector quadrature function coefficient which requires that the quadrature rules used for this vector ...
VectorQuadratureFunctionCoefficient(const QuadratureFunction &qf)
Constructor with a quadrature function as input.
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 ...
virtual void Project(QuadratureFunction &qf)
Fill the QuadratureFunction qf by evaluating the coefficient at the quadrature points.
void SetComponent(int index_, int length_)
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the vector coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
VectorRotProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
Constructor with two vector coefficients. Result is .
virtual real_t Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
void SetTime(real_t t)
Set the time for internally stored coefficients.
void SetTime(real_t t)
Set the time for internally stored coefficients.
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient at ip.
VectorSumCoefficient(int dim)
virtual const real_t * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
real_t Norml2() const
Returns the l2 norm of the vector.
virtual bool UseDevice() const
Return the device flag of the Memory object used by the Vector.
int Size() const
Returns the size of the vector.
void SetSize(int s)
Resize the vector to size s.
Vector & operator=(const real_t *v)
Copy Size() entries from v.
void MakeRef(Vector &base, int offset, int size)
Reset the Vector to be a reference to a sub-vector of base.
int index(int i, int j, int nx, int ny)
real_t infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
real_t ComputeGlobalLpNorm(real_t p, Coefficient &coeff, ParMesh &pmesh, const IntegrationRule *irs[])
Compute the global Lp norm of a function f. .
void add(const Vector &v1, const Vector &v2, Vector &v)
real_t ComputeLpNorm(real_t p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[])
Compute the Lp norm of a function f. .
CoefficientStorage
Flags that determine what storage optimizations to use in CoefficientVector.
@ SYMMETRIC
Store the triangular part of symmetric matrices.
@ CONSTANTS
Store constants using only vdim entries.
real_t LpNormLoop(real_t p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[])
ElementTransformation * RefinedToCoarse(Mesh &coarse_mesh, const ElementTransformation &T, const IntegrationPoint &ip, IntegrationPoint &coarse_ip)
real_t p(const Vector &x, real_t t)
Helper struct to convert a C++ type to an MPI type.