Commit 27106dcf authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

make use of addTerm in demos.

parent 597d9f62
The cmake version requires
* AMDiS was build and installed using cmake or downloaded from www.amdis-fem.org
or installed from a package from http://www.amdis-fem.org.
To use the cmake buildsystem, simply run
cmake .
If your cmake complains about not to find AMDiS, you have at least two ways:
1. run cmake -DAMDiS_DIR=<path-to-AMDiS> .
2. run a graphic cmake tool (i.e. ccmake, cmake-gui, ...) and select your amdis
configuration directory <path-to-AMDiS>
HINT: The <path-to-AMDiS> is the directoy containing the file AMDiSConfig.cmake.
If you installed AMDiS with a package manager, cmake should already find AMDiS.
......@@ -65,13 +65,13 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(ball.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
ball.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
int degree = ball.getFeSpace()->getBasisFcts()->getDegree();
Operator rhsOperator(ball.getFeSpace());
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
ball.addVectorOperator(&rhsOperator, 0);
// ===== add boundary conditions =====
......
......@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(bunny.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
bunny.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
......@@ -67,7 +67,7 @@ int main(int argc, char* argv[])
int degree = bunny.getFeSpace()->getBasisFcts()->getDegree();
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
bunny.addVectorOperator(&rhsOperator, 0);
// ===== start adaption loop =====
......
......@@ -62,14 +62,14 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(ellipt.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
ellipt.addMatrixOperator(matrixOperator, 0, 0);
// ===== create rhs operator =====
int degree = ellipt.getFeSpace()->getBasisFcts()->getDegree();
Operator rhsOperator(ellipt.getFeSpace());
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
ellipt.addVectorOperator(rhsOperator, 0);
// ===== add boundary conditions =====
......
......@@ -52,14 +52,14 @@ protected:
{
// ===== create matrix operator =====
Operator *matrixOperator = new Operator(getFeSpace());
matrixOperator->addSecondOrderTerm(new Simple_SOT);
matrixOperator->addTerm(new Simple_SOT);
prob->addMatrixOperator(matrixOperator, 0, 0);
// ===== create rhs operator =====
int degree = getFeSpace()->getBasisFcts()->getDegree();
Operator *rhsOperator = new Operator(getFeSpace());
rhsOperator->addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator->addTerm(new CoordsAtQP_ZOT(new F(degree)));
prob->addVectorOperator(rhsOperator, 0);
}
......
......@@ -67,12 +67,12 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(ellipt.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
ellipt.addMatrixOperator(matrixOperator, 0, 0);
// ===== create rhs operator =====
Operator rhsOperator(ellipt.getFeSpace());
rhsOperator.addZeroOrderTerm(new Simple_ZOT(1.0));
rhsOperator.addTerm(new Simple_ZOT(1.0));
ellipt.addVectorOperator(rhsOperator, 0);
// ===== add boundary conditions =====
......
......@@ -182,7 +182,7 @@ int main(int argc, char** argv)
// create laplace
Operator A(heatSpace.getFeSpace());
A.addSecondOrderTerm(new Simple_SOT);
A.addTerm(new Simple_SOT);
A.setUhOld(heat.getOldSolution(0));
if (*(heat.getThetaPtr()) != 0.0)
heatSpace.addMatrixOperator(A, 0, 0, heat.getThetaPtr(), &one);
......@@ -191,14 +191,14 @@ int main(int argc, char** argv)
// create zero order operator
Operator C(heatSpace.getFeSpace());
C.addZeroOrderTerm(new Simple_ZOT);
C.addTerm(new Simple_ZOT);
C.setUhOld(heat.getOldSolution(0));
heatSpace.addMatrixOperator(C, 0, 0, heat.getInvTau(), heat.getInvTau());
heatSpace.addVectorOperator(C, 0, heat.getInvTau(), heat.getInvTau());
// create RHS operator
Operator F(heatSpace.getFeSpace());
F.addZeroOrderTerm(new CoordsAtQP_ZOT(rhsFct));
F.addTerm(new CoordsAtQP_ZOT(rhsFct));
heatSpace.addVectorOperator(F, 0);
......
......@@ -60,13 +60,13 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(neumann.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
neumann.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
int degree = neumann.getFeSpace()->getBasisFcts()->getDegree();
Operator rhsOperator(neumann.getFeSpace());
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
neumann.addVectorOperator(&rhsOperator, 0);
// ===== add boundary conditions =====
......
......@@ -93,25 +93,25 @@ int main(int argc, char* argv[])
// === create matrix operators ===
Operator mat01(nonlin.getFeSpace());
mat01.addSecondOrderTerm(new Simple_SOT());
mat01.addTerm(new Simple_SOT());
nonlin.addMatrixOperator(mat01, 0, 0);
Operator mat02(nonlin.getFeSpace());
mat02.addZeroOrderTerm(new VecAtQP_ZOT(nonlin.getSolution(0), new NonlinFctLeft()));
mat02.addTerm(new VecAtQP_ZOT(nonlin.getSolution(0), new NonlinFctLeft()));
nonlin.addMatrixOperator(mat02, 0, 0);
// === create rhs operators ===
Operator vec01(nonlin.getFeSpace());
vec01.setUhOld(nonlin.getSolution(0));
vec01.addSecondOrderTerm(new Simple_SOT(-1.0));
vec01.addTerm(new Simple_SOT(-1.0));
nonlin.addVectorOperator(vec01, 0);
Operator vec02(nonlin.getFeSpace());
vec02.addZeroOrderTerm(new VecAtQP_ZOT(nonlin.getSolution(0), new NonlinFctRight()));
vec02.addTerm(new VecAtQP_ZOT(nonlin.getSolution(0), new NonlinFctRight()));
nonlin.addVectorOperator(vec02, 0);
Operator vec03(nonlin.getFeSpace());
vec03.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(nonlin.getFeSpace()->getBasisFcts()->getDegree())));
vec03.addTerm(new CoordsAtQP_ZOT(new F(nonlin.getFeSpace()->getBasisFcts()->getDegree())));
nonlin.addVectorOperator(vec03, 0);
// ===== add boundary conditions =====
......
......@@ -140,7 +140,7 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(parametric.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
parametric.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
......@@ -148,7 +148,7 @@ int main(int argc, char* argv[])
int degree = parametric.getFeSpace()->getBasisFcts()->getDegree();
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
parametric.addVectorOperator(&rhsOperator, 0);
// ===== start adaption loop =====
......
......@@ -50,13 +50,13 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(periodic.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
periodic.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
int degree = periodic.getFeSpace()->getBasisFcts()->getDegree();
Operator rhsOperator(periodic.getFeSpace());
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
periodic.addVectorOperator(&rhsOperator, 0);
// ===== add boundary conditions =====
......
......@@ -49,7 +49,7 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(sphere.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
sphere.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
......@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
int degree = sphere.getFeSpace()->getBasisFcts()->getDegree();
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator.addTerm(new CoordsAtQP_ZOT(new F(degree)));
sphere.addVectorOperator(&rhsOperator, 0);
// ===== start adaption loop =====
......
......@@ -114,7 +114,7 @@ int main(int argc, char* argv[])
// ===== create matrix operator =====
Operator matrixOperator(torus.getFeSpace());
matrixOperator.addSecondOrderTerm(new Simple_SOT);
matrixOperator.addTerm(new Simple_SOT);
torus.addMatrixOperator(&matrixOperator, 0, 0);
// ===== create rhs operator =====
......@@ -123,7 +123,7 @@ int main(int argc, char* argv[])
int degree = torus.getFeSpace()->getBasisFcts()->getDegree();
F f(degree);
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(&f));
rhsOperator.addTerm(new CoordsAtQP_ZOT(&f));
torus.addVectorOperator(&rhsOperator, 0);
// ===== start adaption loop =====
......
......@@ -59,22 +59,22 @@ int main(int argc, char* argv[])
// ===== create matrix operators =====
Operator matrixOperator00(vecellipt.getFeSpace(0), vecellipt.getFeSpace(0));
matrixOperator00.addSecondOrderTerm(new Simple_SOT);
matrixOperator00.addTerm(new Simple_SOT);
vecellipt.addMatrixOperator(matrixOperator00, 0, 0);
Operator matrixOperator10(vecellipt.getFeSpace(1), vecellipt.getFeSpace(0));
matrixOperator10.addZeroOrderTerm(new Simple_ZOT);
matrixOperator10.addTerm(new Simple_ZOT);
vecellipt.addMatrixOperator(matrixOperator10, 1, 0);
Operator matrixOperator11(vecellipt.getFeSpace(1), vecellipt.getFeSpace(1));
matrixOperator11.addZeroOrderTerm(new Simple_ZOT(-1.0));
matrixOperator11.addTerm(new Simple_ZOT(-1.0));
vecellipt.addMatrixOperator(matrixOperator11, 1, 1);
// ===== create rhs operator =====
int degree = vecellipt.getFeSpace(0)->getBasisFcts()->getDegree();
Operator rhsOperator0(vecellipt.getFeSpace(0));
rhsOperator0.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
rhsOperator0.addTerm(new CoordsAtQP_ZOT(new F(degree)));
vecellipt.addVectorOperator(rhsOperator0, 0);
// ===== add boundary conditions =====
......
......@@ -227,11 +227,11 @@ int main(int argc, char** argv)
// create laplace
Operator A00 (vecheatSpace.getFeSpace(0), vecheatSpace.getFeSpace(0));
A00.addSecondOrderTerm(new Simple_SOT);
A00.addTerm(new Simple_SOT);
A00.setUhOld(vecheat.getOldSolution()->getDOFVector(0));
Operator A11(vecheatSpace.getFeSpace(1), vecheatSpace.getFeSpace(1));
A11.addSecondOrderTerm(new Simple_SOT);
A11.addTerm(new Simple_SOT);
A11.setUhOld(vecheat.getOldSolution()->getDOFVector(1));
if (*(vecheat.getThetaPtr()) != 0.0) {
......@@ -246,7 +246,7 @@ int main(int argc, char** argv)
// create zero order operator
Operator C00(vecheatSpace.getFeSpace(0), vecheatSpace.getFeSpace(0));
C00.addZeroOrderTerm(new Simple_ZOT);
C00.addTerm(new Simple_ZOT);
C00.setUhOld(vecheat.getOldSolution()->getDOFVector(0));
vecheatSpace.addMatrixOperator(C00, 0, 0,
vecheat.getInvTau(), vecheat.getInvTau());
......@@ -254,7 +254,7 @@ int main(int argc, char** argv)
Operator C11(vecheatSpace.getFeSpace(1), vecheatSpace.getFeSpace(1));
C11.addZeroOrderTerm(new Simple_ZOT);
C11.addTerm(new Simple_ZOT);
C11.setUhOld(vecheat.getOldSolution()->getDOFVector(1));
vecheatSpace.addMatrixOperator(C11, 1, 1,
vecheat.getInvTau(), vecheat.getInvTau());
......@@ -263,11 +263,11 @@ int main(int argc, char** argv)
// create RHS operator
Operator F0(vecheatSpace.getFeSpace(0));
F0.addZeroOrderTerm(new CoordsAtQP_ZOT(rhsFct0));
F0.addTerm(new CoordsAtQP_ZOT(rhsFct0));
vecheatSpace.addVectorOperator(F0, 0);
Operator F1 = Operator(vecheatSpace.getFeSpace(1));
F1.addZeroOrderTerm(new CoordsAtQP_ZOT(rhsFct1));
F1.addTerm(new CoordsAtQP_ZOT(rhsFct1));
vecheatSpace.addVectorOperator(F1, 1);
......
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