Commit 6ff14ecb authored by Praetorius, Simon's avatar Praetorius, Simon

Navier-Stokes corrected

parent 515af748
...@@ -129,7 +129,7 @@ public: ...@@ -129,7 +129,7 @@ public:
if (asmMatrix && (singularDirichletBC.size() > 0 || manualPeriodicBC.size() > 0)) { if (asmMatrix && (singularDirichletBC.size() > 0 || manualPeriodicBC.size() > 0)) {
solverMatrix.setMatrix(*getSystemMatrix()); solverMatrix.setMatrix(*getSystemMatrix());
} }
// writeMatrix("matrix.mat");
#endif #endif
} }
......
...@@ -22,9 +22,9 @@ void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, ...@@ -22,9 +22,9 @@ void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad=NULL); Quadrature *quad=NULL);
inline void getC(const ElInfo *, int nPoints, ElementVector &C); void getC(const ElInfo *, int nPoints, ElementVector &C);
inline void eval(int nPoints, void eval(int nPoints,
const mtl::dense_vector<double>&, const mtl::dense_vector<double>&,
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,
...@@ -76,16 +76,16 @@ void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, ...@@ -76,16 +76,16 @@ void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad=NULL); Quadrature *quad=NULL);
inline void getC(const ElInfo *, int nPoints, ElementVector &C); void getC(const ElInfo *, int nPoints, ElementVector &C);
inline void eval(int nPoints, void eval(int nPoints,
const mtl::dense_vector<double>&, const mtl::dense_vector<double>&,
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);
inline double f(const int iq) const; double f(const int iq) const;
void setFactor(const double fac_) { fac=fac_; } void setFactor(const double fac_) { fac=fac_; }
protected: protected:
...@@ -102,26 +102,26 @@ WorldVector<double>* facVec; ...@@ -102,26 +102,26 @@ WorldVector<double>* facVec;
class Pow3_ZOT : public ZeroOrderTerm class Pow3_ZOT : public ZeroOrderTerm
{ {
public: public:
Pow3_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0); Pow3_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo, void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad = NULL); Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*, SubAssembler*,
Quadrature *quad = NULL); Quadrature *quad = NULL);
inline void getC(const ElInfo *, int nPoints, ElementVector &C); void getC(const ElInfo *, int nPoints, ElementVector &C);
inline void eval(int nPoints, void eval(int nPoints,
const mtl::dense_vector<double>&, const mtl::dense_vector<double>&,
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);
inline double f(const int iq) const; double f(const int iq) const;
protected: protected:
DOFVectorBase<double> *rhoDV; DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho; mtl::dense_vector<double> rho;
double fac; double fac;
}; };
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
...@@ -137,7 +137,7 @@ public: ...@@ -137,7 +137,7 @@ public:
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*, SubAssembler*,
Quadrature *quad = NULL); Quadrature *quad = NULL);
inline double f(const int iq) const; double f(const int iq) const;
protected: protected:
DOFVectorBase<double> *rhoDV; DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho; mtl::dense_vector<double> rho;
...@@ -148,26 +148,26 @@ protected: ...@@ -148,26 +148,26 @@ protected:
class Pow2_ZOT : public ZeroOrderTerm class Pow2_ZOT : public ZeroOrderTerm
{ {
public: public:
Pow2_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0); Pow2_ZOT(DOFVectorBase<double> *rhoDV_, double fac_=1.0);
void initElement(const ElInfo* elInfo, void initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad = NULL); Quadrature *quad = NULL);
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*, SubAssembler*,
Quadrature *quad = NULL); Quadrature *quad = NULL);
inline void getC(const ElInfo *, int nPoints, ElementVector &C); void getC(const ElInfo *, int nPoints, ElementVector &C);
inline void eval(int nPoints, void eval(int nPoints,
const mtl::dense_vector<double>&, const mtl::dense_vector<double>&,
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);
inline double f(const int iq) const; double f(const int iq) const;
protected: protected:
DOFVectorBase<double> *rhoDV; DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho; mtl::dense_vector<double> rho;
double fac; double fac;
}; };
/* -------------------------------------------------------------- */ /* -------------------------------------------------------------- */
...@@ -183,7 +183,7 @@ public: ...@@ -183,7 +183,7 @@ public:
void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo, void initElement(const ElInfo* largeElInfo, const ElInfo* smallElInfo,
SubAssembler*, SubAssembler*,
Quadrature *quad = NULL); Quadrature *quad = NULL);
inline double f(const int iq) const; double f(const int iq) const;
protected: protected:
DOFVectorBase<double> *rhoDV; DOFVectorBase<double> *rhoDV;
mtl::dense_vector<double> rho; mtl::dense_vector<double> rho;
......
...@@ -457,10 +457,15 @@ public: ...@@ -457,10 +457,15 @@ public:
double operator()(const WorldVector<double>& x) const double operator()(const WorldVector<double>& x) const
{ {
double result=0.0; double result=0.0;
PerturbedCircleRadius perturbedCircle(radius, 1.0, 3, rotation); PerturbedCircleRadius perturbedCircle(radius, 0.7, 3, rotation);
result = signedDist2D(x, midPoint, &perturbedCircle, 1.e-6); result = signedDist2D(x, midPoint, &perturbedCircle, 1.e-6);
return -result; return -result;
}; }
void setRotation(double rotation_)
{
rotation = rotation_;
}
private: private:
......
...@@ -185,88 +185,30 @@ namespace details { ...@@ -185,88 +185,30 @@ namespace details {
* The 'nr' and 'meshIndicator' describe one boundary of the mesh and to each DegreeOfFreedom * The 'nr' and 'meshIndicator' describe one boundary of the mesh and to each DegreeOfFreedom
* the 'periodicMap' associates a second DegreeOfFreedom. * the 'periodicMap' associates a second DegreeOfFreedom.
**/ **/
inline void getPeriodicAssociation(const FiniteElemSpace* feSpace, // inline void getPeriodicAssociation(const FiniteElemSpace* feSpace,
BoundaryType nr, // BoundaryType nr,
AbstractFunction<bool, WorldVector<double> >* meshIndicator, // AbstractFunction<bool, WorldVector<double> >* meshIndicator,
AbstractFunction<WorldVector<double>, WorldVector<double> >* periodicMap, // AbstractFunction<WorldVector<double>, WorldVector<double> >* periodicMap,
std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &association) // std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &association)
{ // {
std::set<DegreeOfFreedom> indices; // std::set<DegreeOfFreedom> indices;
details::getBoundaryIndices(feSpace, nr, meshIndicator, indices); // details::getBoundaryIndices(feSpace, nr, meshIndicator, indices);
//
association.clear(); // association.clear();
//
DOFVector<WorldVector<double> > coords(feSpace, "coords"); // DOFVector<WorldVector<double> > coords(feSpace, "coords");
feSpace->getMesh()->getDofIndexCoords(coords); // feSpace->getMesh()->getDofIndexCoords(coords);
std::set<DegreeOfFreedom>::iterator it; // std::set<DegreeOfFreedom>::iterator it;
for (it = indices.begin(); it != indices.end(); it++) // for (it = indices.begin(); it != indices.end(); it++)
{ // {
DegreeOfFreedom idx2; // DegreeOfFreedom idx2;
WorldVector<double> p; // WorldVector<double> p;
p = (*periodicMap)(coords[*it]); // p = (*periodicMap)(coords[*it]);
TEST_EXIT(coords.getDofIdxAtPoint(p,idx2))("periodic association not found!\n"); // TEST_EXIT(coords.getDofIdxAtPoint(p,idx2))("periodic association not found!\n");
//
association.push_back(std::make_pair(*it, idx2)); // association.push_back(std::make_pair(min(*it, idx2), max(*it, idx2)));
} // }
} // }
inline bool getDofIdxAtPoint(const FiniteElemSpace* feSpace,
WorldVector<double> &p,
DegreeOfFreedom &idx,
ElInfo *oldElInfo = NULL,
bool useOldElInfo = false)
{
FUNCNAME("DOFVector::getDofIdxAtPoint()");
Mesh *mesh = feSpace->getMesh();
const BasisFunction *basFcts = feSpace->getBasisFcts();
int dim = mesh->getDim();
int numBasFcts = basFcts->getNumber();
std::vector<DegreeOfFreedom> localIndices(numBasFcts);
DimVec<double> lambda(dim, NO_INIT);
ElInfo *elInfo = mesh->createNewElInfo();
idx = 0;
bool inside = false;
if (oldElInfo && useOldElInfo && oldElInfo->getMacroElement()) {
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, oldElInfo->getMacroElement(), NULL, NULL);
delete oldElInfo;
} else {
inside = mesh->findElInfoAtPoint(p, elInfo, lambda, NULL, NULL, NULL);
}
if (oldElInfo)
oldElInfo = elInfo;
if (!inside)
return false;
basFcts->getLocalIndices(elInfo->getElement(), feSpace->getAdmin(), localIndices);
WorldVector<double> coord;
int minIdx = -1;
double minDist = 1.e15;
for (int i = 0; i < numBasFcts; i++) {
elInfo->coordToWorld(*(basFcts->getCoords(i)), coord);
WorldVector<double> dist = coord - p;
double newDist = norm(dist);
if (newDist < minDist) {
minIdx = i;
minDist = newDist;
}
}
if (minIdx >= 0)
idx = localIndices[minIdx];
if(!oldElInfo) delete elInfo;
return inside;
}
/** /**
* get al list of pairs that describes wich DegreeOfFreedom are assiciated in the given mesh * get al list of pairs that describes wich DegreeOfFreedom are assiciated in the given mesh
...@@ -274,28 +216,51 @@ namespace details { ...@@ -274,28 +216,51 @@ namespace details {
* The 'meshIndicator' describes one boundary of the mesh and to each DegreeOfFreedom * The 'meshIndicator' describes one boundary of the mesh and to each DegreeOfFreedom
* the 'periodicMap' associates a second DegreeOfFreedom. * the 'periodicMap' associates a second DegreeOfFreedom.
**/ **/
// inline void getPeriodicAssociation(const FiniteElemSpace* feSpace,
// AbstractFunction<bool, WorldVector<double> >* meshIndicator,
// AbstractFunction<WorldVector<double>, WorldVector<double> >* periodicMap,
// std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &association)
// {
// std::set<DegreeOfFreedom> indices;
// details::getBoundaryIndices(feSpace, meshIndicator, indices);
// MSG_DBG("Nr of indices: %d\n", indices.size());
//
// association.clear();
//
// DOFVector<WorldVector<double> > coords(feSpace, "coords");
// feSpace->getMesh()->getDofIndexCoords(coords);
// std::set<DegreeOfFreedom>::iterator it;
// for (it = indices.begin(); it != indices.end(); it++)
// {
// DegreeOfFreedom idx2;
// WorldVector<double> p;
// p = (*periodicMap)(coords[*it]);
// TEST_EXIT(coords.getDofIdxAtPoint(p,idx2))("periodic association not found!\n");
//
// association.push_back(std::make_pair(min(*it, idx2), max(*it, idx2));
// }
//
// MSG_DBG("Nr of associations: %d\n", association.size());
// }
inline void getPeriodicAssociation(const FiniteElemSpace* feSpace, inline void getPeriodicAssociation(const FiniteElemSpace* feSpace,
AbstractFunction<bool, WorldVector<double> >* meshIndicator, std::set<DegreeOfFreedom> indices,
AbstractFunction<WorldVector<double>, WorldVector<double> >* periodicMap, AbstractFunction<WorldVector<double>, WorldVector<double> >* periodicMap,
std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &association) std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > &association)
{ {
std::set<DegreeOfFreedom> indices;
details::getBoundaryIndices(feSpace, meshIndicator, indices);
MSG_DBG("Nr of indices: %d\n", indices.size());
association.clear(); association.clear();
DOFVector<WorldVector<double> > coords(feSpace, "coords"); DOFVector<WorldVector<double> > coords(feSpace, "coords");
feSpace->getMesh()->getDofIndexCoords(coords); feSpace->getMesh()->getDofIndexCoords(coords);
std::set<DegreeOfFreedom>::iterator it; std::set<DegreeOfFreedom>::iterator it;
DegreeOfFreedom idx_;
WorldVector<double> p;
for (it = indices.begin(); it != indices.end(); it++) for (it = indices.begin(); it != indices.end(); it++)
{ {
DegreeOfFreedom idx2;
WorldVector<double> p;
p = (*periodicMap)(coords[*it]); p = (*periodicMap)(coords[*it]);
TEST_EXIT(coords.getDofIdxAtPoint(p,idx2))("periodic association not found!\n"); TEST_EXIT(coords.getDofIdxAtPoint(p,idx_))("periodic association not found!\n");
association.push_back(std::make_pair(std::min(*it, idx_), std::max(*it, idx_)));
association.push_back(std::make_pair(*it, idx2));
} }
MSG_DBG("Nr of associations: %d\n", association.size()); MSG_DBG("Nr of associations: %d\n", association.size());
...@@ -547,11 +512,14 @@ struct PeriodicBcData { ...@@ -547,11 +512,14 @@ struct PeriodicBcData {
void addToList(const FiniteElemSpace *feSpace, std::vector<ManualPeriodicBC> &list) void addToList(const FiniteElemSpace *feSpace, std::vector<ManualPeriodicBC> &list)
{ {
std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > associations; std::set<DegreeOfFreedom> indices;
if (nr == 0) if (nr == 0)
details::getPeriodicAssociation(feSpace, meshIndicator, periodicMap, associations); details::getBoundaryIndices(feSpace, meshIndicator, indices);
else else
details::getPeriodicAssociation(feSpace, nr, meshIndicator, periodicMap, associations); details::getBoundaryIndices(feSpace, nr, meshIndicator, indices);
std::vector<std::pair<DegreeOfFreedom, DegreeOfFreedom> > associations;
details::getPeriodicAssociation(feSpace, indices, periodicMap, associations);
list.push_back(ManualPeriodicBC(row, associations)); list.push_back(ManualPeriodicBC(row, associations));
} }
int row; int row;
......
...@@ -10,7 +10,8 @@ NavierStokesPhase_TaylorHood::NavierStokesPhase_TaylorHood(const std::string &na ...@@ -10,7 +10,8 @@ NavierStokesPhase_TaylorHood::NavierStokesPhase_TaylorHood(const std::string &na
beta(1.0), beta(1.0),
epsilon(1.e-1), epsilon(1.e-1),
alpha(3.0), alpha(3.0),
fileWriterPhase(NULL) fileWriterPhase(NULL),
phaseOld(NULL)
{ {
for (int i = 0; i < bcDOF.getSize(); ++i) for (int i = 0; i < bcDOF.getSize(); ++i)
bcDOF[i] = NULL; bcDOF[i] = NULL;
...@@ -24,8 +25,14 @@ NavierStokesPhase_TaylorHood::NavierStokesPhase_TaylorHood(const std::string &na ...@@ -24,8 +25,14 @@ NavierStokesPhase_TaylorHood::NavierStokesPhase_TaylorHood(const std::string &na
NavierStokesPhase_TaylorHood::~NavierStokesPhase_TaylorHood() NavierStokesPhase_TaylorHood::~NavierStokesPhase_TaylorHood()
{ {
if (fileWriterPhase != NULL) if (fileWriterPhase != NULL) {
delete fileWriterPhase; delete fileWriterPhase;
fileWriterPhase = NULL;
}
if (phaseOld != NULL) {
delete phaseOld;
phaseOld = NULL;
}
} }
...@@ -44,29 +51,13 @@ void NavierStokesPhase_TaylorHood::transferInitialSolution(AdaptInfo *adaptInfo) ...@@ -44,29 +51,13 @@ void NavierStokesPhase_TaylorHood::transferInitialSolution(AdaptInfo *adaptInfo)
fileWriterPhase = new FileWriter(name + "->phase->output", getFeSpace()->getMesh(), phase); fileWriterPhase = new FileWriter(name + "->phase->output", getFeSpace()->getMesh(), phase);
for (int i = 0; i < dow; i++) for (int i = 0; i < dow; i++)
transformDOF(prob->getSolution()->getDOFVector(0), phase, prob->getSolution()->getDOFVector(0), new AMDiS::Mult<double>); transformDOF(prob->getSolution()->getDOFVector(i), phase, prob->getSolution()->getDOFVector(i), new AMDiS::Mult<double>);
super::transferInitialSolution(adaptInfo); super::transferInitialSolution(adaptInfo);
phaseOld->interpol(phase); phaseOld->interpol(phase);
} }
void NavierStokesPhase_TaylorHood::closeTimestep(AdaptInfo *adaptInfo)
{
super::closeTimestep(adaptInfo);
phaseOld->interpol(phase);
writeFiles(adaptInfo, false);
}
void NavierStokesPhase_TaylorHood::writeFiles(AdaptInfo *adaptInfo, bool force)
{ FUNCNAME("NavierStokesPhase_TaylorHood::closeTimestep()");
super::writeFiles(adaptInfo, force);
fileWriterPhase->writeFiles(adaptInfo, false);
}
void NavierStokesPhase_TaylorHood::fillOperators() void NavierStokesPhase_TaylorHood::fillOperators()
{ FUNCNAME("NavierStokesPhase_TaylorHood::fillOperators()"); { FUNCNAME("NavierStokesPhase_TaylorHood::fillOperators()");
...@@ -82,40 +73,34 @@ void NavierStokesPhase_TaylorHood::fillOperators() ...@@ -82,40 +73,34 @@ void NavierStokesPhase_TaylorHood::fillOperators()
Operator *opTime = new Operator(prob->getFeSpace(i), prob->getFeSpace(i)); Operator *opTime = new Operator(prob->getFeSpace(i), prob->getFeSpace(i));
opTime->addTerm(new Phase_ZOT(phase, density)); opTime->addTerm(new Phase_ZOT(phase, density));
prob->addMatrixOperator(*opTime, i, i, getInvTau()); prob->addMatrixOperator(*opTime, i, i, getInvTau());
/// < (1/tau)*u_i^old , psi > /// < (1/tau)*u_i^old , psi >
Operator *opTimeOld = new Operator(prob->getFeSpace(i), prob->getFeSpace(i)); Operator *opTimeOld = new Operator(prob->getFeSpace(i), prob->getFeSpace(i));
opTimeOld->addTerm(new Phase_ZOT(phaseOld, density)); opTimeOld->addTerm(new FactorPhase_ZOT(phaseOld, getOldSolution(i), density));
opTimeOld->setUhOld(getOldSolution(i));
prob->addVectorOperator(*opTimeOld, i, getInvTau()); prob->addVectorOperator(*opTimeOld, i, getInvTau());
/// < u^old*grad(u_i^old) , psi > /// < u^old*grad(u_i^old) , psi >
Operator *opUGradU0 = new Operator(prob->getFeSpace(i),prob->getFeSpace(i)); Operator *opUGradU0 = new Operator(getFeSpace(i), getFeSpace(i));
opUGradU0->addTerm(new WorldVecPhase_FOT(phase,vel, -density), GRD_PHI); opUGradU0->addTerm(new WorldVecPhase_FOT(phase, vel, density), GRD_PHI);
opUGradU0->setUhOld(prob->getSolution()->getDOFVector(i)); opUGradU0->setUhOld(prob->getSolution()->getDOFVector(i));
if (nonLinTerm == 0) { prob->addVectorOperator(*opUGradU0, i);
prob->addVectorOperator(*opUGradU0, i);
} else { /// < u*grad(u_i^old) , psi >
prob->addVectorOperator(*opUGradU0, i, &theta1); for (unsigned k = 0; k < dow; ++k) {
Operator *opUGradU1 = new Operator(getFeSpace(i), getFeSpace(k));
opUGradU1->addTerm(new VecAndPartialDerivative_ZOT(
phase,
prob->getSolution()->getDOFVector(i), k, density));
prob->addMatrixOperator(*opUGradU1, i, k);
} }
if (nonLinTerm == 1) { /// < u^old*grad(u_i) , psi >
/// < u'*grad(u_i^old) , psi > for(unsigned k = 0; k < dow; ++k) {
for (unsigned j = 0; j < dow; ++j) { Operator *opUGradU2 = new Operator(getFeSpace(i),getFeSpace(i));
Operator *opUGradU1 = new Operator(prob->getFeSpace(i),prob->getFeSpace(i)); opUGradU2->addTerm(new Vec2ProductPartial_FOT(
opUGradU1->addTerm(new VecAndPartialDerivative_ZOT( phase,
phase, vel[k], k, density), GRD_PHI);
prob->getSolution()->getDOFVector(i), j, density)); prob->addMatrixOperator(*opUGradU2, i, i);
prob->addMatrixOperator(*opUGradU1, i, j, &theta);
}
} else if (nonLinTerm == 2) {
/// < u^old*grad(u'_i) , psi >
for(unsigned j = 0; j < dow; ++j) {
Operator *opUGradU2 = new Operator(prob->getFeSpace(i),prob->getFeSpace(i));
opUGradU2->addTerm(new Vec2ProductPartial_FOT(
phase,
prob->getSolution()->getDOFVector(j), j, density), GRD_PHI);
prob->addMatrixOperator(*opUGradU2, i, i, &theta);
}
} }
/// Diffusion-Operator (including Stress-Tensor for space-dependent viscosity /// Diffusion-Operator (including Stress-Tensor for space-dependent viscosity
...@@ -147,6 +132,10 @@ void NavierStokesPhase_TaylorHood::fillOperators() ...@@ -147,6 +132,10 @@ void NavierStokesPhase_TaylorHood::fillOperators()
opDivU2->addTerm(new PartialDerivative_ZOT(phase,i)); opDivU2->addTerm(new PartialDerivative_ZOT(phase,i));
prob->addMatrixOperator(*opDivU2, dow, i); prob->addMatrixOperator(*opDivU2, dow, i);
} }
Operator *opNull = new Operator(getFeSpace(dow), getFeSpace(dow));
opNull->addTerm(new Simple_ZOT(0.0));
prob->addMatrixOperator(*opNull, dow, dow);
} }
...@@ -226,3 +215,18 @@ void NavierStokesPhase_TaylorHood::fillBoundaryConditions() ...@@ -226,3 +215,18 @@ void NavierStokesPhase_TaylorHood::fillBoundaryConditions()
TEST_EXIT(!bcCond)("implicit boundary condition specified twice, by bcFct and bcDOF. This is not allowed!\n"); TEST_EXIT(!bcCond)("implicit boundary condition specified twice, by bcFct and bcDOF. This is not allowed!\n");
} }
} }
void NavierStokesPhase_TaylorHood::closeTimestep(AdaptInfo *adaptInfo)
{ FUNCNAME("Nav