Commit 906739e7 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

demos updated

parent 4ec20197
......@@ -26,7 +26,7 @@ class F : public AbstractFunction<double, WorldVector<double> >
{
public:
F() : AbstractFunction<double, WorldVector<double> >() {}
F(int degree = 1) : AbstractFunction<double, WorldVector<double> >(degree) {}
/// Implementation of AbstractFunction::operator().
double operator()(const WorldVector<double>& x) const
......@@ -52,27 +52,26 @@ int main(int argc, char* argv[])
ProblemStat ellipt("ellipt");
ellipt.initialize(INIT_ALL);
// === create adapt info ===
AdaptInfo adaptInfo("ellipt->adapt", ellipt.getNumComponents());
// === create adapt ===
AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo);
// ===== create matrix operator =====
Operator matrixOperator(ellipt.getFeSpace());
matrixOperator.addTerm(new Simple_ZOT);
matrixOperator.addTerm(new Simple_SOT);
ellipt.addMatrixOperator(matrixOperator, 0, 0);
int degree = ellipt.getFeSpace()->getBasisFcts()->getDegree();
// ===== create rhs operator =====
// Operator rhsOperator(ellipt.getFeSpace());
// rhsOperator.addTerm(new CoordsAtQP_ZOT(new F));
// ellipt.addVectorOperator(rhsOperator, 0);
Operator rhsOperator(ellipt.getFeSpace());
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
ellipt.addVectorOperator(rhsOperator, 0);
// ===== add boundary conditions =====
ellipt.addDirichletBC(1, 0, 0, new AMDiS::Const<double, WorldVector<double> >(1.0));
ellipt.addDirichletBC(1, 0, 0, new G);
// ===== start adaption loop =====
......
......@@ -22,7 +22,7 @@ public:
class F : public AbstractFunction<double, WorldVector<double> >
{
public:
F() : AbstractFunction<double, WorldVector<double> >() {}
F(int degree = 1) : AbstractFunction<double, WorldVector<double> >(degree) {}
/// Implementation of AbstractFunction::operator().
double operator()(const WorldVector<double>& x) const
......@@ -70,9 +70,11 @@ int main(int argc, char* argv[])
matrixOperator11.addTerm(new Simple_SOT);
vecellipt.addMatrixOperator(matrixOperator11, 1, 1);
int degree = ellipt.getFeSpace()->getBasisFcts()->getDegree();
// ===== create rhs operator =====
Operator rhsOperator0(vecellipt.getFeSpace(0));
rhsOperator0.addTerm(new CoordsAtQP_ZOT(new F));
rhsOperator0.addTerm(new CoordsAtQP_ZOT(new F(degree)));
vecellipt.addVectorOperator(rhsOperator0, 0);
// ===== add boundary conditions =====
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment