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

several changes concerning quadrature degrees for operators

parent 47183212
This diff is collapsed.
......@@ -386,145 +386,6 @@ private:
int component;
};
/* -------------------------------------------------------------- */
/// < phase*d_i(u) * n_j , psi > or < phase*u*n_j , d_i(psi) > where vecs in R^n
class PhaseAndViscosityPartialDerivativeBoundary_FOT : public FirstOrderTerm
{
public:
PhaseAndViscosityPartialDerivativeBoundary_FOT(DOFVectorBase<double>* phaseDV_, DOFVectorBase<double>* chDV_, int component, int normalComponent, double viscosity1=1.0, double viscosity2=1.0);
void initElement(const ElInfo*,
SubAssembler* ,
Quadrature *quad= NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
void getLb(const ElInfo *elInfo,
vector<mtl::dense_vector<double> >& result) const;
void 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);
double f(const int iq) const;
protected:
DOFVectorBase<double> *phaseDV, *chDV;
mtl::dense_vector<double> phase, ch;
double v1, v2, normalJ;
int component, normalComponent;
};
/* -------------------------------------------------------------- */
/// < d_i(u) * n_j , psi > or < u*n_j , d_i(psi) > where vecs in R^n
class ViscosityPartialDerivativeBoundary_FOT : public FirstOrderTerm
{
public:
ViscosityPartialDerivativeBoundary_FOT(DOFVectorBase<double>* chDV_, int component, int normalComponent, double viscosity1=1.0, double viscosity2=1.0);
void initElement(const ElInfo*,
SubAssembler* ,
Quadrature *quad= NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
void getLb(const ElInfo *elInfo,
vector<mtl::dense_vector<double> >& result) const;
void 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);
double f(const int iq) const;
protected:
DOFVectorBase<double> *chDV;
mtl::dense_vector<double> ch;
double v1, v2, normalJ;
int component, normalComponent;
};
/* -------------------------------------------------------------- */
/// < factor*v1*v2*d_i(u) , psi > or < factor*v1*v2*u , d_i(psi) >
class Vec2ProductPartial_FOT : public FirstOrderTerm
{
public:
Vec2ProductPartial_FOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
int component_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void getLb(const ElInfo *elInfo, vector<mtl::dense_vector<double> >& result) const;
void 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);
protected:
DOFVectorBase<double>* vec1DV;
DOFVectorBase<double>* vec2DV;
mtl::dense_vector<double> vec1,vec2;
double fac;
int component;
};
/* -------------------------------------------------------------- */
/// < factor*phase*grad(u) , grad(psi) >
class WettingAngleImpl_FOT : public FirstOrderTerm
{
public:
/// Constructor.
WettingAngleImpl_FOT(DOFVectorBase<double>* chDV, DOFVectorBase<double>* phaseDV, double fac=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL);
/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void getLb(const ElInfo *elInfo, vector<mtl::dense_vector<double> >& result) const;
void 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);
inline WorldVector<double> f(const int iq) const;
void setFactor(const double fac_) { fac=fac_; }
protected:
DOFVectorBase<double> *phaseDV, *chDV;
mtl::dense_vector<WorldVector<double> > gradPhase, gradCh;
double fac;
};
/* -------------------------------------------------------------- */
/**
......@@ -538,14 +399,7 @@ class VecGrad2_FOT : public FirstOrderTerm
public:
/// Constructor
VecGrad2_FOT(DOFVectorBase<double> *dv, DOFVectorBase<double> *dw1, DOFVectorBase<double> *dw2,
TertiaryAbstractFunction<WorldVector<double>, double, WorldVector<double>, WorldVector<double> > *vecFct_)
: FirstOrderTerm(vecFct_->getDegree()), vec0(dv), vec1(dw1), vec2(dw2), vecFct(vecFct_)
{
auxFeSpaces.insert(dv->getFeSpace());
auxFeSpaces.insert(dw1->getFeSpace());
auxFeSpaces.insert(dw2->getFeSpace());
}
TertiaryAbstractFunction<WorldVector<double>, double, WorldVector<double>, WorldVector<double> > *vecFct_);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
......
......@@ -66,170 +66,6 @@ double fac;
/* -------------------------------------------------------------- */
class ViscosityPhase_SOT : public Phase_SOT
{
public:
/// Constructor.
ViscosityPhase_SOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *chDV_, double v1_=1.0, double v2_=1.0, double factor_=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL);
/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
inline double f(const int iq) const;
protected:
/** \brief
* DOFVector to be evaluated at quadrature points.
*/
DOFVectorBase<double>* chDV;
/** \brief
* Vector v at quadrature points.
*/
mtl::dense_vector<double> ch;
double v1,v2;
};
/* -------------------------------------------------------------- */
class ViscosityPhase2_SOT : public Phase_SOT
{
public:
/// Constructor.
ViscosityPhase2_SOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *chDV_, double v1_=1.0, double v2_=1.0, double factor_=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL);
/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
inline double f(const int iq) const;
protected:
/** \brief
* DOFVector to be evaluated at quadrature points.
*/
DOFVectorBase<double>* chDV;
/** \brief
* Vector v at quadrature points.
*/
mtl::dense_vector<double> ch;
double v1,v2;
};
/* -------------------------------------------------------------- */
class Viscosity_SOT : public SecondOrderTerm
{
public:
/// Constructor.
Viscosity_SOT(DOFVectorBase<double> *chDV_, double v1_=1.0, double v2_=1.0, double factor_=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL);
/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void getLALt(const ElInfo *elInfo,
std::vector<mtl::dense2D<double> > &LALt) const;
void 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);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
std::vector<WorldVector<double> > &result);
inline double f(const int iq) const;
protected:
/** \brief
* DOFVector to be evaluated at quadrature points.
*/
DOFVectorBase<double>* chDV;
/** \brief
* Vector v at quadrature points.
*/
mtl::dense_vector<double> ch;
double v1,v2;
double factor;
};
/* -------------------------------------------------------------- */
class Viscosity2_SOT : public SecondOrderTerm
{
public:
/// Constructor.
Viscosity2_SOT(DOFVectorBase<double> *chDV_, double v1_=1.0, double v2_=1.0, double factor_=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
Quadrature *quad = NULL);
/// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void getLALt(const ElInfo *elInfo,
std::vector<mtl::dense2D<double> > &LALt) const;
void 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);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
std::vector<WorldVector<double> > &result);
inline double f(const int iq) const;
protected:
/** \brief
* DOFVector to be evaluated at quadrature points.
*/
DOFVectorBase<double>* chDV;
/** \brief
* Vector v at quadrature points.
*/
mtl::dense_vector<double> ch;
double v1,v2;
double factor;
};
/* -------------------------------------------------------------- */
/// < factor*phase*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixPhase_SOT : public SecondOrderTerm
{
......@@ -342,125 +178,5 @@ double fac;
bool symmetric;
};
/* -------------------------------------------------------------- */
/// < factor*phase*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixIJViscosityPhase_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixIJViscosityPhase_SOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double>* chDV, int row, int col, double v1_, double v2_, double fac=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void getLALt(const ElInfo *elInfo,
std::vector<mtl::dense2D<double> > &LALt) const;
void 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);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
std::vector<WorldVector<double> > &result);
void setFactor(const double fac_) { fac=fac_; }
inline double f(const int iq) const;
protected:
DOFVectorBase<double> *phaseDV;
DOFVectorBase<double>* chDV;
mtl::dense_vector<double> ch;
mtl::dense_vector<double> phase;
int row,col;
double v1,v2;
double fac;
bool symmetric;
};
/* -------------------------------------------------------------- */
/// < factor*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixIJViscosity_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixIJViscosity_SOT(DOFVectorBase<double>* chDV, int row, int col, double v1_, double v2_, double fac=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void getLALt(const ElInfo *elInfo,
std::vector<mtl::dense2D<double> > &LALt) const;
void 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);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
std::vector<WorldVector<double> > &result);
void setFactor(const double fac_) { fac=fac_; }
inline double f(const int iq) const;
protected:
DOFVectorBase<double>* chDV;
mtl::dense_vector<double> ch;
int row,col;
double v1,v2;
double fac;
bool symmetric;
};
/* -------------------------------------------------------------- */
/// < factor*phase*A*grad(u) , grad(psi) > ... 'I' kann ueberladen werden
class MatrixIJViscosityPhase2_SOT : public SecondOrderTerm
{
public:
/// Constructor
MatrixIJViscosityPhase2_SOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double>* chDV, int row, int col, double v1_, double v2_, double fac=1.0);
/// Implementation of \ref OperatorTerm::initElement().
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler,
Quadrature *quad=NULL);
void getLALt(const ElInfo *elInfo,
std::vector<mtl::dense2D<double> > &LALt) const;
void 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);
void weakEval(const std::vector<WorldVector<double> > &grdUhAtQP,
std::vector<WorldVector<double> > &result);
void setFactor(const double fac_) { fac=fac_; }
inline double f(const int iq) const;
protected:
DOFVectorBase<double> *phaseDV;
DOFVectorBase<double>* chDV;
mtl::dense_vector<double> ch;
mtl::dense_vector<double> phase;
int row,col;
double v1,v2;
double fac;
bool symmetric;
};
#endif // EXTENSIONS_P_OPERATORS_SOT_H
......@@ -58,25 +58,6 @@ double fac;
/* -------------------------------------------------------------- */
/// < factor*phase*v*u , psi >
class FactorPhase_ZOT : public Phase_ZOT
{
public:
FactorPhase_ZOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
inline double f(const int iq) const;
protected:
DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho;
};
/* -------------------------------------------------------------- */
/// < factor*(1-phase)*u , psi > or < factor*v[i]*(1-phase)*u , psi > where v in R^n
class PhaseInverse_ZOT : public ZeroOrderTerm
{
......@@ -114,210 +95,6 @@ WorldVector<double>* facVec;
/* -------------------------------------------------------------- */
/// < factor*(v^3)*u , psi >
class Pow3_ZOT : public ZeroOrderTerm
{
public:
Pow3_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
void getC(const ElInfo *, int nPoints, ElementVector &C);
void 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);
double f(const int iq) const;
protected:
DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho;
double fac;
};
/* -------------------------------------------------------------- */
/// < factor*(v^3)*phi*u , psi >
class Pow3Phase_ZOT : public Phase_ZOT
{
public:
Pow3Phase_ZOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
double f(const int iq) const;
protected:
DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho;
};
/* -------------------------------------------------------------- */
/// < factor*(v^2)*u , psi >
class Pow2_ZOT : public ZeroOrderTerm
{
public:
Pow2_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
void getC(const ElInfo *, int nPoints, ElementVector &C);
void 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);
double f(const int iq) const;
protected:
DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho;
double fac;
};
/* -------------------------------------------------------------- */
/// < factor*(v^2)*phi*u , psi >
class Pow2Phase_ZOT : public Phase_ZOT
{
public:
Pow2Phase_ZOT(DOFVectorBase<double>* phaseDV, DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
double f(const int iq) const;
protected:
DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho;
};
/* -------------------------------------------------------------- */
/// < factor*phase*(-1/max(1e-6, sqr(v+0.9)))*u , psi >
class ConstrainedFracSqr_ZOT : public Phase_ZOT
{
public:
ConstrainedFracSqr_ZOT(DOFVectorBase<double> *phaseDV_, DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler,
Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*,
Quadrature *quad = NULL);
inline double f(const int iq) const;
protected: