28 return (constants(att-1));
41 return ((*Function)(transip));
45 return (*TDFunction)(transip, GetTime());
52 return GridF -> GetValue (T.
ElementNo, ip, Component);
60 return (*Transform2)(Q1->Eval(T, ip, GetTime()),
61 Q2->Eval(T, ip, GetTime()));
65 return (*Transform1)(Q1->Eval(T, ip, GetTime()));
71 MFEM_VERIFY(vcenter.
Size() <= 3,
72 "SetDeltaCenter::Maximum number of dim supported is 3")
73 for (
int i = 0; i < vcenter.
Size(); i++) { center[i] = vcenter[i]; }
74 sdim = vcenter.
Size();
87 return weight ? weight->Eval(T, ip, GetTime())*w : w;
115 (*Function)(transip, V);
119 (*TDFunction)(transip, GetTime(), V);
123 V *= Q->Eval(T, ip, GetTime());
130 for (
int i = 0; i <
dim; i++)
139 if (ownCoeff[i]) {
delete Coeff[i]; }
146 for (
int i = 0; i <
vdim; i++)
148 if (ownCoeff[i]) {
delete Coeff[i]; }
156 for (
int i = 0; i <
vdim; i++)
158 V(i) = this->
Eval(i, T, ip);
189 gf -> FESpace() -> GetMesh() -> SpaceDimension() : 0)
197 gf -> FESpace() -> GetMesh() -> SpaceDimension() : 0;
215 gf -> FESpace() -> GetMesh() -> SpaceDimension() : 0)
223 gf -> FESpace() -> GetMesh() -> SpaceDimension() : 0;
300 (*Function)(transip, K);
304 (*TDFunction)(transip,
GetTime(), K);
330 if (ownCoeff[i*
width+j]) {
delete Coeff[i*
width+j]; }
331 Coeff[i*
width+j] = c;
332 ownCoeff[i*
width+j] = own;
339 if (ownCoeff[i]) {
delete Coeff[i]; }
346 for (
int i = 0; i <
height; i++)
348 for (
int j = 0; j <
width; j++)
350 K(i,j) = this->
Eval(i, j, T, ip);
375 "InnerProductCoefficient: "
376 "Arguments have incompatible dimensions.");
389 :
a(&A),
b(&B), va(A.GetVDim()), vb(B.GetVDim())
392 "VectorRotProductCoefficient: "
393 "Arguments must have dimension equal to two.");
401 return va[0] * vb[1] - va[1] * vb[0];
405 :
a(&A), ma(A.GetHeight(), A.GetWidth())
408 "DeterminantCoefficient: "
409 "Argument must be a square matrix.");
421 double _alpha,
double _beta)
426 "VectorSumCoefficient: "
427 "Arguments must have the same dimension.");
434 if ( beta != 1.0 ) { V *= beta; }
448 double sa = a->
Eval(T, ip);
459 "VectorCrossProductCoefficient: "
460 "Arguments must have dimension equal to three.");
469 V[0] = va[1] * vb[2] - va[2] * vb[1];
470 V[1] = va[2] * vb[0] - va[0] * vb[2];
471 V[2] = va[0] * vb[1] - va[1] * vb[0];
477 ma(A.GetHeight(), A.GetWidth()), vb(B.GetVDim())
480 "MatVecCoefficient: Arguments have incompatible dimensions.");
496 for (
int d=0; d<dim; d++) { M(d,d) = 1.0; }
501 double _alpha,
double _beta)
503 a(&A),
b(&B),
alpha(_alpha), beta(_beta),
504 ma(A.GetHeight(), A.GetWidth())
507 "MatrixSumCoefficient: "
508 "Arguments must have the same dimensions.");
515 if ( beta != 1.0 ) { M *= beta; }
530 double sa = a->
Eval(T, ip);
551 "InverseMatrixCoefficient: "
552 "Argument must be a square matrix.");
566 va(A.GetVDim()), vb(B.GetVDim())
575 for (
int i=0; i<va.
Size(); i++)
577 for (
int j=0; j<vb.
Size(); j++)
579 M(i, j) = va[i] * vb[j];
590 for (
int i = 0; i < mesh.
GetNE(); i++)
598 double val = fabs(coeff.
Eval(*tr, ip));
624 for (
int i = 0; i < mesh.
GetNE(); i++)
632 coeff.
Eval(vval, *tr, ip);
635 for (
int idim(0); idim < vdim; ++idim)
637 norm += ip.
weight * tr->
Weight() * pow(fabs( vval(idim) ), p);
642 for (
int idim(0); idim < vdim; ++idim)
644 val = fabs(vval(idim));
660 double norm =
LpNormLoop(p, coeff, mesh, irs);
667 norm = -pow(-norm, 1.0/p);
671 norm = pow(norm, 1.0/p);
681 double norm =
LpNormLoop(p, coeff, mesh, irs);
688 norm = -pow(-norm, 1.0/p);
692 norm = pow(norm, 1.0/p);
703 double loc_norm =
LpNormLoop(p, coeff, pmesh, irs);
704 double glob_norm = 0;
706 MPI_Comm comm = pmesh.
GetComm();
710 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_SUM, comm);
715 glob_norm = -pow(-glob_norm, 1.0/p);
719 glob_norm = pow(glob_norm, 1.0/p);
724 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_MAX, comm);
733 double loc_norm =
LpNormLoop(p, coeff, pmesh, irs);
734 double glob_norm = 0;
736 MPI_Comm comm = pmesh.
GetComm();
740 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_SUM, comm);
745 glob_norm = -pow(-glob_norm, 1.0/p);
749 glob_norm = pow(glob_norm, 1.0/p);
754 MPI_Allreduce(&loc_norm, &glob_norm, 1, MPI_DOUBLE, MPI_MAX, comm);
int GetNPoints() const
Returns the number of the points in the integration rule.
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 ...
Class for an integration rule - an Array of IntegrationPoint.
Class for grid function - Vector with associated FE space.
void Set(int i, int j, Coefficient *c, bool own=true)
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
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 ...
TransposeMatrixCoefficient(MatrixCoefficient &A)
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 ...
VectorCrossProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
void GetVectorValue(int i, const IntegrationPoint &ip, Vector &val) const
void SetSize(int s)
Resize the vector to size s.
double Eval(int i, ElementTransformation &T, const IntegrationPoint &ip)
Evaluates i'th component of the vector.
void SetDeltaCenter(const Vector ¢er)
Element::Type GetElementType(int i) const
Returns the type of element i.
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 ...
GradientGridFunctionCoefficient(GridFunction *gf)
Data type dense matrix using column-major storage.
int Size() const
Returns the size of the vector.
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 ...
int GetNE() const
Returns number of elements.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
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 ~MatrixArrayCoefficient()
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate coefficient.
DeterminantCoefficient(MatrixCoefficient &A)
void SetGridFunction(GridFunction *gf)
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
double Eval(int i, int j, ElementTransformation &T, const IntegrationPoint &ip)
InnerProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
double ComputeLpNorm(double p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[])
double LpNormLoop(double p, Coefficient &coeff, Mesh &mesh, const IntegrationRule *irs[])
void Add(const double c, const DenseMatrix &A)
Adds the matrix A multiplied by the number c to the matrix.
ScalarVectorProductCoefficient(Coefficient &A, VectorCoefficient &B)
void SetDirection(const Vector &_d)
OuterProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
virtual void Eval(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void Invert()
Replaces the current matrix with its inverse.
void Set(int i, Coefficient *c, bool own=true)
Sets coefficient in the vector.
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 ~VectorArrayCoefficient()
Destroys vector coefficient.
int GetVDim()
Returns dimension of the vector.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
VectorSumCoefficient(VectorCoefficient &A, VectorCoefficient &B, double _alpha=1.0, double _beta=1.0)
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void SetGridFunction(GridFunction *gf)
void GetDeltaCenter(Vector ¢er)
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient.
void Transpose()
(*this) = (*this)^t
MatVecCoefficient(MatrixCoefficient &A, VectorCoefficient &B)
Base class Coefficient that may optionally depend on time.
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient function.
void GetColumnReference(int c, Vector &col)
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 EvalDelta(Vector &V, ElementTransformation &T, const IntegrationPoint &ip)
Return the specified direction vector multiplied by the value returned by DeltaCoefficient::EvalDelta...
double ComputeGlobalLpNorm(double p, Coefficient &coeff, ParMesh &pmesh, const IntegrationRule *irs[])
double GetDivergence(ElementTransformation &tr) const
virtual double EvalDelta(ElementTransformation &T, const IntegrationPoint &ip)
Return the Scale() multiplied by the weight Coefficient, if any.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
void SetGridFunction(GridFunction *gf)
MatrixArrayCoefficient(int dim)
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 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 ...
Vector & Add(const double a, const Vector &Va)
(*this) += a * Va
Class for integration point with weight.
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the coefficient in the element described by T at the point ip.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
MatrixSumCoefficient(MatrixCoefficient &A, MatrixCoefficient &B, double _alpha=1.0, double _beta=1.0)
void GetGradients(ElementTransformation &tr, const IntegrationRule &ir, DenseMatrix &grad) const
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
void GetVectorValues(ElementTransformation &T, const IntegrationRule &ir, DenseMatrix &vals) const
double infinity()
Define a shortcut for std::numeric_limits<double>::infinity()
DivergenceGridFunctionCoefficient(GridFunction *gf)
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
VectorArrayCoefficient(int dim)
Construct vector of dim coefficients.
void GetCurl(ElementTransformation &tr, Vector &curl) const
void Mult(const double *x, double *y) const
Matrix vector multiplication.
VectorRotProductCoefficient(VectorCoefficient &A, VectorCoefficient &B)
virtual void Eval(DenseMatrix &K, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
virtual void Eval(DenseMatrix &M, ElementTransformation &T, const IntegrationPoint &ip)
Evaluate the matrix coefficient in the element described by T at the point ip, storing the result in ...
CurlGridFunctionCoefficient(GridFunction *gf)
void SetSize(int s)
Change the size of the DenseMatrix to s x s.
Class for parallel meshes.
InverseMatrixCoefficient(MatrixCoefficient &A)
ScalarMatrixProductCoefficient(Coefficient &A, MatrixCoefficient &B)
void GetGradient(ElementTransformation &tr, Vector &grad) const
VectorGridFunctionCoefficient()