Commit 7b9f8d5a authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

several changes concerning quadrature degrees for operators

parent 47183212
...@@ -23,7 +23,7 @@ using namespace std; ...@@ -23,7 +23,7 @@ using namespace std;
using namespace AMDiS; using namespace AMDiS;
Phase_SOT::Phase_SOT(DOFVectorBase<double>* phaseDV_, double fac_) Phase_SOT::Phase_SOT(DOFVectorBase<double>* phaseDV_, double fac_)
: SecondOrderTerm(6), : SecondOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
phaseDV(phaseDV_), phaseDV(phaseDV_),
fac(fac_) fac(fac_)
{ {
...@@ -91,7 +91,7 @@ double Phase_SOT::f(const int iq) const ...@@ -91,7 +91,7 @@ double Phase_SOT::f(const int iq) const
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
Phase_FOT::Phase_FOT(DOFVectorBase<double>* phaseDV_, double fac_) Phase_FOT::Phase_FOT(DOFVectorBase<double>* phaseDV_, double fac_)
: FirstOrderTerm(6), : FirstOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
phaseDV(phaseDV_), phaseDV(phaseDV_),
fac(fac_) fac(fac_)
{ {
...@@ -147,7 +147,7 @@ WorldVector<double> Phase_FOT::f(const int iq) const ...@@ -147,7 +147,7 @@ WorldVector<double> Phase_FOT::f(const int iq) const
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
Phase_ZOT::Phase_ZOT(DOFVectorBase<double>* phaseDV_, double fac_) Phase_ZOT::Phase_ZOT(DOFVectorBase<double>* phaseDV_, double fac_)
: ZeroOrderTerm(6), : ZeroOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
phaseDV(phaseDV_), phaseDV(phaseDV_),
fac(fac_) fac(fac_)
{ {
...@@ -197,7 +197,7 @@ double Phase_ZOT::f(const int iq) const ...@@ -197,7 +197,7 @@ double Phase_ZOT::f(const int iq) const
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_) PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_)
: ZeroOrderTerm(6), : ZeroOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
phaseDV(phaseDV_), phaseDV(phaseDV_),
fac(fac_), fac(fac_),
component(0) component(0)
...@@ -210,7 +210,7 @@ PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_) ...@@ -210,7 +210,7 @@ PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_)
} }
PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_, WorldVector<double> *facVec_, int component_) PhaseInverse_ZOT::PhaseInverse_ZOT(DOFVectorBase<double>* phaseDV_, double fac_, WorldVector<double> *facVec_, int component_)
: ZeroOrderTerm(6), : ZeroOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
phaseDV(phaseDV_), phaseDV(phaseDV_),
fac(fac_), fac(fac_),
component(component_), component(component_),
...@@ -262,2256 +262,1066 @@ double PhaseInverse_ZOT::f(const int iq) const ...@@ -262,2256 +262,1066 @@ double PhaseInverse_ZOT::f(const int iq) const
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
Pow3_ZOT::Pow3_ZOT(DOFVectorBase<double> *rhoDV_, double fac_) WorldVecAndVecFct_FOT::WorldVecAndVecFct_FOT(WorldVector<DOFVectorBase<double>*> vecs_, DOFVectorBase<double> *phaseDV_, double fac_)
: ZeroOrderTerm(3), : FirstOrderTerm(vecs_[0]->getFeSpace()->getBasisFcts()->getDegree() + phaseDV_->getFeSpace()->getBasisFcts()->getDegree()),
rhoDV(rhoDV_), phaseDV(phaseDV_),
fac(fac_) fac(fac_)
{ {
TEST_EXIT(rhoDV_)("No vector rho!\n"); numVecs=vecs_.size();
auxFeSpaces.insert(rhoDV_->getFeSpace()); TEST_EXIT(numVecs==2 || numVecs==3)("Only Dim=2 or Dim=3 possible\n");
TEST_EXIT(phaseDV_)("phaseDV is NULL!\n");
for (int i = 0; i < numVecs; i++) {
TEST_EXIT(vecs_[i])("One vector is NULL!\n");
auxFeSpaces.insert(vecs_[i]->getFeSpace());
}
vec0DV=vecs_[0];
vec1DV=vecs_[1];
if(numVecs>=3) vec2DV=vecs_[2];
} }
void Pow3_ZOT::initElement(const ElInfo* elInfo, void WorldVecAndVecFct_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, elInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, elInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, elInfo, subAssembler, quad, vec2);
getVectorAtQPs(phaseDV, elInfo, subAssembler, quad, phase);
} }
void Pow3_ZOT::initElement(const ElInfo* largeElInfo, void WorldVecAndVecFct_FOT::initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, smallElInfo, largeElInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, smallElInfo, largeElInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, smallElInfo, largeElInfo, subAssembler, quad, vec2);
getVectorAtQPs(phaseDV, smallElInfo, largeElInfo, subAssembler, quad, phase);
} }
void Pow3_ZOT::getC(const ElInfo *elInfo, int nPoints, ElementVector &C) void WorldVecAndVecFct_FOT::getLb(const ElInfo *elInfo,
vector<mtl::dense_vector<double> >& result) const
{ {
for (int iq = 0; iq < nPoints; iq++) const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
C[iq] += f(iq) * fac; const int nPoints = static_cast<int>(result.size());
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> vec;
vec[0]=vec0[iq];
vec[1]=vec1[iq];
if(numVecs>=3) vec[2]=vec2[iq];
lb(Lambda, vec, result[iq], phase[iq]*fac);
}
} }
void Pow3_ZOT::eval(int nPoints, void WorldVecAndVecFct_FOT::eval(int nPoints,
const mtl::dense_vector<double>& uhAtQP, const mtl::dense_vector<double>& uhAtQP,
const mtl::dense_vector<WorldVector<double> >& grdUhAtQP, const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP, const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
mtl::dense_vector<double>& result, mtl::dense_vector<double>& result,
double opFactor) double opFactor)
{ {
double factor = opFactor * fac; double factor = fac * opFactor;
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++) {
result[iq] += factor * f(iq) * uhAtQP[iq]; double resultQP = 0.0;
}
double Pow3_ZOT::f(const int iq) const
{
return rho[iq]*sqr(rho[iq]);
}
/* ----------------------------------------------------------- */
Pow3Phase_ZOT::Pow3Phase_ZOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double> *rhoDV_, double fac_)
: Phase_ZOT(phaseDV, fac_),
rhoDV(rhoDV_)
{
TEST_EXIT(rhoDV_)("No vector rho!\n");
auxFeSpaces.insert(rhoDV_->getFeSpace());
}
void Pow3Phase_ZOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
Phase_ZOT::initElement(elInfo,subAssembler,quad);
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho);
}
void Pow3Phase_ZOT::initElement(const ElInfo* largeElInfo, resultQP += grdUhAtQP[iq][0] * vec0[iq];
const ElInfo* smallElInfo, resultQP += grdUhAtQP[iq][1] * vec1[iq];
SubAssembler* subAssembler, if(numVecs>=3) resultQP += grdUhAtQP[iq][2] * vec2[iq];
Quadrature *quad)
{
Phase_ZOT::initElement(largeElInfo,smallElInfo,subAssembler,quad);
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho);
}
double Pow3Phase_ZOT::f(const int iq) const result[iq] += phase[iq] * factor * resultQP;
{ }
return rho[iq]*sqr(rho[iq]);
} }
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
Pow2_ZOT::Pow2_ZOT(DOFVectorBase<double> *rhoDV_, double fac_) WorldVec_FOT::WorldVec_FOT(WorldVector<DOFVector<double>*> vecs_, double fac_)
: ZeroOrderTerm(2), : FirstOrderTerm(vecs_[0]->getFeSpace()->getBasisFcts()->getDegree()),
rhoDV(rhoDV_),
fac(fac_) fac(fac_)
{ {
TEST_EXIT(rhoDV_)("No vector rho!\n"); numVecs=vecs_.size();
auxFeSpaces.insert(rhoDV_->getFeSpace()); TEST_EXIT(numVecs==2 || numVecs==3)("Only Dim=2 or Dim=3 possible\n");
for (int i = 0; i < numVecs; i++) {
TEST_EXIT(vecs_[i])("One vector is NULL!\n");
auxFeSpaces.insert(vecs_[i]->getFeSpace());
}
vec0DV=vecs_[0];
vec1DV=vecs_[1];
if(numVecs>=3) vec2DV=vecs_[2];
} }
void Pow2_ZOT::initElement(const ElInfo* elInfo, void WorldVec_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, elInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, elInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, elInfo, subAssembler, quad, vec2);
} }
void Pow2_ZOT::initElement(const ElInfo* largeElInfo, void WorldVec_FOT::initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, smallElInfo, largeElInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, smallElInfo, largeElInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, smallElInfo, largeElInfo, subAssembler, quad, vec2);
} }
void Pow2_ZOT::getC(const ElInfo *elInfo, int nPoints, ElementVector &C) void WorldVec_FOT::getLb(const ElInfo *elInfo,
vector<mtl::dense_vector<double> >& result) const
{ {
for (int iq = 0; iq < nPoints; iq++) const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
C[iq] += f(iq) * fac; const int nPoints = static_cast<int>(result.size());
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> vec;
vec[0]=vec0[iq];
vec[1]=vec1[iq];
if(numVecs>=3) vec[2]=vec2[iq];
lb(Lambda, vec, result[iq], fac);
}
} }
void Pow2_ZOT::eval(int nPoints, void WorldVec_FOT::eval(int nPoints,
const mtl::dense_vector<double>& uhAtQP, const mtl::dense_vector<double>& uhAtQP,
const mtl::dense_vector<WorldVector<double> >& grdUhAtQP, const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP, const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
mtl::dense_vector<double>& result, mtl::dense_vector<double>& result,
double opFactor) double opFactor)
{ {
double factor = opFactor * fac; double factor = fac * opFactor;
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++) {
result[iq] += factor * f(iq) * uhAtQP[iq]; double resultQP = 0.0;
}
double Pow2_ZOT::f(const int iq) const resultQP += grdUhAtQP[iq][0] * vec0[iq];
{ resultQP += grdUhAtQP[iq][1] * vec1[iq];
return sqr(rho[iq]); if(numVecs>=3) resultQP += grdUhAtQP[iq][2] * vec2[iq];
result[iq] += factor * resultQP;
}
} }
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
Pow2Phase_ZOT::Pow2Phase_ZOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double> *rhoDV_, double fac_) WorldVector_FOT::WorldVector_FOT(DOFVector<WorldVector<double> >* dv, double fac_)
: Phase_ZOT(phaseDV, fac_), : FirstOrderTerm(dv->getFeSpace()->getBasisFcts()->getDegree()),
rhoDV(rhoDV_) vec(dv),
fac(fac_)
{ {
TEST_EXIT(rhoDV_)("No vector rho!\n"); TEST_EXIT(dv)("No vector!\n");
auxFeSpaces.insert(rhoDV_->getFeSpace());
auxFeSpaces.insert(dv->getFeSpace());
} }
void Pow2Phase_ZOT::initElement(const ElInfo* elInfo, void WorldVector_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
Phase_ZOT::initElement(elInfo,subAssembler,quad); getVectorAtQPs(vec, elInfo, subAssembler, quad, vecAtQPs);
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho);
} }
void Pow2Phase_ZOT::initElement(const ElInfo* largeElInfo, void WorldVector_FOT::initElement(const ElInfo* largeElInfo,
const ElInfo* smallElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
Phase_ZOT::initElement(largeElInfo,smallElInfo,subAssembler,quad); getVectorAtQPs(vec, smallElInfo, largeElInfo, subAssembler, quad, vecAtQPs);
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho);
}
double Pow2Phase_ZOT::f(const int iq) const
{
return sqr(rho[iq]);
}
/* ----------------------------------------------------------- */
ConstrainedFrac_ZOT::ConstrainedFrac_ZOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *rhoDV_, double fac_)
: Phase_ZOT(phaseDV_,fac_),
rhoDV(rhoDV_)
{
TEST_EXIT(rhoDV_)("No vector rho!\n");
auxFeSpaces.insert(rhoDV_->getFeSpace());
} }
void ConstrainedFrac_ZOT::initElement(const ElInfo* elInfo, void WorldVector_FOT::getLb(const ElInfo *elInfo,
SubAssembler* subAssembler, vector<mtl::dense_vector<double> >& Lb) const
Quadrature *quad)
{ {
Phase_ZOT::initElement(elInfo, subAssembler,quad); const DimVec<WorldVector<double> > &grdLambda = elInfo->getGrdLambda();
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho); const int nPoints = static_cast<int>(Lb.size());
}
void ConstrainedFrac_ZOT::initElement(const ElInfo* largeElInfo, for (int iq = 0; iq < nPoints; iq++)
const ElInfo* smallElInfo, lb(grdLambda, vecAtQPs[iq], Lb[iq], fac);
SubAssembler* subAssembler,
Quadrature *quad)
{
Phase_ZOT::initElement(largeElInfo, smallElInfo, subAssembler,quad);
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho);
} }
double ConstrainedFrac_ZOT::f(const int iq) const void WorldVector_FOT::eval(int nPoints,
const mtl::dense_vector<double>&,
const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
mtl::dense_vector<double>& result,
double opFactor)
{ {
return 1.0/std::max(1.e-6, rho[iq]+0.9); if (num_rows(grdUhAtQP) > 0) {
double fac_ = fac * opFactor;
for (int iq = 0; iq < nPoints; iq++)
result[iq] += (vecAtQPs[iq] * grdUhAtQP[iq]) * fac_;
}
} }
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
ConstrainedFracSqr_ZOT::ConstrainedFracSqr_ZOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *rhoDV_, double factor_) WorldVecPhase_FOT::WorldVecPhase_FOT(DOFVectorBase<double> *phaseDV_, WorldVector<DOFVector<double>*> vecs_,double fac_)
: Phase_ZOT(phaseDV_,factor_), : FirstOrderTerm(phaseDV_->getFeSpace()->getBasisFcts()->getDegree() + vecs_[0]->getFeSpace()->getBasisFcts()->getDegree()),
rhoDV(rhoDV_) phaseDV(phaseDV_),
{ fac(fac_)
TEST_EXIT(rhoDV_)("No vector rho!\n");
auxFeSpaces.insert(rhoDV_->getFeSpace());
}
void ConstrainedFracSqr_ZOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{
Phase_ZOT::initElement(elInfo, subAssembler,quad);
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho);
}
void ConstrainedFracSqr_ZOT::initElement(const ElInfo* largeElInfo,
const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad)
{ {
Phase_ZOT::initElement(largeElInfo, smallElInfo, subAssembler,quad); numVecs=vecs_.size();
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho); TEST_EXIT(numVecs==2 || numVecs==3)("Only Dim=2 or Dim=3 possible\n");
}
double ConstrainedFracSqr_ZOT::f(const int iq) const TEST_EXIT(phaseDV_)("phaseDV is NULL!\n");
{ for (int i = 0; i < numVecs; i++) {
return -1.0/std::max(1.e-6, sqr(rho[iq]+0.9)); TEST_EXIT(vecs_[i])("One vector is NULL!\n");
}
/* ----------------------------------------------------------- */ auxFeSpaces.insert(vecs_[i]->getFeSpace());
}
auxFeSpaces.insert(phaseDV_->getFeSpace());
ConstrainedPowImpl_ZOT::ConstrainedPowImpl_ZOT(DOFVectorBase<double> *rhoDV_, double p_, double rhoMin_, double fac_) vec0DV=vecs_[0];
: ZeroOrderTerm(2), vec1DV=vecs_[1];
rhoDV(rhoDV_), if(numVecs>=3) vec2DV=vecs_[2];
p(p_),
rhoMin(rhoMin_),
fac(fac_)
{
TEST_EXIT(rhoDV_)("No vector rho!\n");
auxFeSpaces.insert(rhoDV_->getFeSpace());
} }
void ConstrainedPowImpl_ZOT::initElement(const ElInfo* elInfo, void WorldVecPhase_FOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, elInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, elInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, elInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, elInfo, subAssembler, quad, vec2);
getVectorAtQPs(phaseDV, elInfo, subAssembler, quad, phase);
} }
void ConstrainedPowImpl_ZOT::initElement(const ElInfo* largeElInfo, void WorldVecPhase_FOT::initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(rhoDV, smallElInfo, largeElInfo, subAssembler, quad, rho); getVectorAtQPs(vec0DV, smallElInfo, largeElInfo, subAssembler, quad, vec0);
getVectorAtQPs(vec1DV, smallElInfo, largeElInfo, subAssembler, quad, vec1);
if(numVecs>=3) getVectorAtQPs(vec2DV, smallElInfo, largeElInfo, subAssembler, quad, vec2);
getVectorAtQPs(phaseDV, smallElInfo, largeElInfo, subAssembler, quad, phase);
} }
void ConstrainedPowImpl_ZOT::getC(const ElInfo *elInfo, int nPoints, ElementVector &C) void WorldVecPhase_FOT::getLb(const ElInfo *elInfo,
vector<mtl::dense_vector<double> >& result) const
{ {
for (int iq = 0; iq < nPoints; iq++) const DimVec<WorldVector<double> > &Lambda = elInfo->getGrdLambda();
C[iq] += f(iq)*fac; const int nPoints = static_cast<int>(result.size());
for (int iq = 0; iq < nPoints; iq++) {
WorldVector<double> vec;
vec[0]=vec0[iq];
vec[1]=vec1[iq];
if(numVecs>=3) vec[2]=vec2[iq];
lb(Lambda, vec, result[iq], phase[iq]*fac);
}
} }
void ConstrainedPowImpl_ZOT::eval(int nPoints, void WorldVecPhase_FOT::eval(int nPoints,
const mtl::dense_vector<double>& uhAtQP, const mtl::dense_vector<double>& uhAtQP,
const mtl::dense_vector<WorldVector<double> >& grdUhAtQP, const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP, const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
mtl::dense_vector<double>& result, mtl::dense_vector<double>& result,
double opFactor) double opFactor)
{ {
double factor = opFactor*fac; double factor = fac * opFactor;
for (int iq = 0; iq < nPoints; iq++) for (int iq = 0; iq < nPoints; iq++) {
result[iq] += factor * f(iq) * uhAtQP[iq]; double resultQP = 0.0;
}
double ConstrainedPowImpl_ZOT::f(const int iq) const resultQP += grdUhAtQP[iq][0] * vec0[iq];
{ resultQP += grdUhAtQP[iq][1] * vec1[iq];
return 2.0*p*Helpers::toInt(0.0<=rhoMin-rho[iq]); if(numVecs>=3) resultQP += grdUhAtQP[iq][2] * vec2[iq];
result[iq] += phase[iq] * factor * resultQP;
}
} }
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
ConstrainedPowExpl_ZOT::ConstrainedPowExpl_ZOT(DOFVectorBase<double> *rhoDV_, double p_, double rhoMin_, double fac_) VecAndWorldVec_FOT::VecAndWorldVec_FOT(DOFVector<double>* vec0_, WorldVector<DOFVector<double>*> vecs_, AbstractFunction<double, double>* fct_, double fac_)
: ZeroOrderTerm(2), : FirstOrderTerm(fct_->getDegree() + vecs_[0]->getFeSpace()->getBasisFcts()->getDegree()),
rhoDV(rhoDV_), vDV(vec0_),
p(p_),