12 #ifndef MTOPINTEGRATORS_HPP
13 #define MTOPINTEGRATORS_HPP
30 virtual std::string
GetType()=0;
73 double pp=1.0,
double minrho=1e-7,
double betac=4.0,
double etac=0.5):
74 diff(diffco),load(hsrco), powerc(pp), rhomin(minrho), beta(betac), eta(etac)
81 return "QLinearDiffusion";
94 double di=diff.
Eval(T,ip);
95 double ll=load.
Eval(T,ip);
97 double rz=0.5+0.5*std::tanh(beta*(dd[0]-eta));
99 double fd=di*(std::pow(rz,powerc)+rhomin);
102 double rez = 0.5*(uu[0]*uu[0]+uu[1]*uu[1]+uu[2]*uu[2])*fd-uu[3]*ll;
111 double di=diff.
Eval(T,ip);
112 double ll=load.
Eval(T,ip);
113 double rz=0.5+0.5*std::tanh(beta*(dd[0]-eta));
114 double fd=di*(std::pow(rz,powerc)+rhomin);
129 double di=diff.
Eval(T,ip);
130 double tt=std::tanh(beta*(dd[0]-eta));
131 double rz=0.5+0.5*tt;
132 double fd=di*powerc*std::pow(rz,powerc-1.0)*0.5*(1.0-tt*tt)*beta;
134 rr[0] = -(aa[0]*uu[0]+aa[1]*uu[1]+aa[2]*uu[2])*fd;
143 double di=diff.
Eval(T,ip);
144 double tt=std::tanh(beta*(dd[0]-eta));
145 double rz=0.5+0.5*tt;
146 double fd=di*(std::pow(rz,powerc)+rhomin);
virtual void QResidual(ElementTransformation &T, const IntegrationPoint &ip, mfem::Vector &dd, mfem::Vector &uu, mfem::Vector &rr)=0
virtual void QResidual(ElementTransformation &T, const IntegrationPoint &ip, Vector &dd, Vector &uu, Vector &rr) override
Returns the derivative of QEnergy with respect to the state vector uu.
Data type dense matrix using column-major storage.
ParametricLinearDiffusion(BaseQFunction &qfunm)
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)
Base class for representing function at integration points.
virtual double GetElementEnergy(const Array< const FiniteElement * > &el, ElementTransformation &Tr, const Array< const Vector * > &elfun) override
Returns the objective contribution at element level.
virtual std::string GetType() override
Returns a user defined string identifying the function.
virtual void AQResidual(ElementTransformation &T, const IntegrationPoint &ip, Vector &dd, Vector &uu, Vector &aa, Vector &rr) override
virtual double QEnergy(ElementTransformation &T, const IntegrationPoint &ip, Vector &dd, Vector &uu) override
virtual void QGradResidual(ElementTransformation &T, const IntegrationPoint &ip, Vector &dd, Vector &uu, DenseMatrix &hh) override
Returns the gradient of the residual at a integration point.
Dynamic 2D array using row-major layout.
Base class Coefficients that optionally depend on space and time. These are used by the BilinearFormI...
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.
QLinearDiffusion(mfem::Coefficient &diffco, mfem::Coefficient &hsrco, double pp=1.0, double minrho=1e-7, double betac=4.0, double etac=0.5)
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
virtual double Eval(ElementTransformation &T, const IntegrationPoint &ip)=0
Evaluate the coefficient in the element described by T at the point ip.
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.
virtual std::string GetType()=0
Returns a user defined string identifying the function.
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.