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