Commit 79e618c7 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

Moved all boundary condition definitions after operator definitions, as it should be done.

parent d90fb7ef
......@@ -69,9 +69,6 @@ int main(int argc, char* argv[])
&ball,
adaptInfo);
// ===== add boundary conditions =====
ball.addDirichletBC(1, new G);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR, ball.getFESpace());
matrixOperator.addSecondOrderTerm(new Laplace_SOT);
......@@ -83,6 +80,9 @@ int main(int argc, char* argv[])
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
ball.addVectorOperator(&rhsOperator);
// ===== add boundary conditions =====
ball.addDirichletBC(1, new G);
// ===== start adaption loop =====
adapt->adapt();
......
......@@ -66,9 +66,6 @@ int main(int argc, char* argv[])
&bunny,
adaptInfo);
// ===== add boundary conditions =====
//bunny.addDirichletBC(1111, new G);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR,
bunny.getFESpace());
......
......@@ -141,12 +141,6 @@ int main(int argc, char* argv[])
&problem1,
adoptFlag);
// ===== add boundary conditions for problem1 =====
problem1.addDirichletBC(1, new G);
// ===== add boundary conditions for problem1 =====
//problem2.addDirichletBC(1, new G);
// ===== create operators for problem1 =====
Operator matrixOperator1(Operator::MATRIX_OPERATOR, problem1.getFESpace());
matrixOperator1.addSecondOrderTerm(new Laplace_SOT);
......@@ -167,6 +161,12 @@ int main(int argc, char* argv[])
new Identity(degree)));
problem2.addVectorOperator(&rhsOperator2);
// ===== add boundary conditions for problem1 =====
problem1.addDirichletBC(1, new G);
// ===== add boundary conditions for problem1 =====
//problem2.addDirichletBC(1, new G);
// ===== create adaptation loop and iteration interface =====
AdaptInfo *adaptInfo = new AdaptInfo("couple->adapt", 1);
MyCoupledIteration coupledIteration(&problem1, &problem2);
......
......@@ -65,10 +65,6 @@ int main(int argc, char* argv[])
AdaptStationary adapt("ellipt->adapt", ellipt, adaptInfo);
// ===== add boundary conditions =====
ellipt.addDirichletBC(1, new G);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR, ellipt.getFESpace());
matrixOperator.addSecondOrderTerm(new Laplace_SOT);
......@@ -82,6 +78,10 @@ int main(int argc, char* argv[])
ellipt.addVectorOperator(rhsOperator);
// ===== add boundary conditions =====
ellipt.addDirichletBC(1, new G);
// ===== start adaption loop =====
adapt.adapt();
......
......@@ -193,14 +193,6 @@ int main(int argc, char** argv)
adaptInfoInitial);
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(heat.getBoundaryTimePtr());
heat.setExactSolution(boundaryFct);
heatSpace.addDirichletBC(DIRICHLET, boundaryFct);
// ===== create rhs functions =====
int degree = heatSpace.getFESpace()->getBasisFcts()->getDegree();
F *rhsFct = new F(degree);
......@@ -235,6 +227,14 @@ int main(int argc, char** argv)
heatSpace.addVectorOperator(F);
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(heat.getBoundaryTimePtr());
heat.setExactSolution(boundaryFct);
heatSpace.addDirichletBC(DIRICHLET, boundaryFct);
// ===== start adaption loop =====
int errorCode = adaptInstat.adapt();
......
......@@ -62,10 +62,6 @@ int main(int argc, char* argv[])
&neumann,
adaptInfo);
// ===== add boundary conditions =====
neumann.addNeumannBC(1, new N);
neumann.addDirichletBC(2, new G);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR, neumann.getFESpace());
matrixOperator.addSecondOrderTerm(new Laplace_SOT);
......@@ -77,6 +73,10 @@ int main(int argc, char* argv[])
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
neumann.addVectorOperator(&rhsOperator);
// ===== add boundary conditions =====
neumann.addNeumannBC(1, new N);
neumann.addDirichletBC(2, new G);
// ===== start adaption loop =====
adapt->adapt();
......
......@@ -71,9 +71,6 @@ int main(int argc, char* argv[])
&parallelellipt,
adaptInfo);
// ===== add boundary conditions =====
ellipt.addDirichletBC(1, new G);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR, ellipt.getFESpace());
matrixOperator.addSecondOrderTerm(new Laplace_SOT);
......@@ -85,6 +82,9 @@ int main(int argc, char* argv[])
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
ellipt.addVectorOperator(&rhsOperator);
// ===== add boundary conditions =====
ellipt.addDirichletBC(1, new G);
parallelellipt.initParallelization(adaptInfo);
adapt->adapt();
parallelellipt.exitParallelization(adaptInfo);
......
......@@ -174,13 +174,6 @@ int main(int argc, char** argv)
&parallelheat,
adaptInfoInitial);
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(heat->getTimePtr());
heat->setBoundaryFct(boundaryFct);
heatSpace->addDirichletBC(DIRICHLET, boundaryFct);
// ===== create rhs functions =====
int degree = heatSpace->getFESpace()->getBasisFcts()->getDegree();
F *rhsFct = new F(degree);
......@@ -221,20 +214,21 @@ int main(int argc, char** argv)
heatSpace->addVectorOperator(F);
// // ===== start adaption loop =====
// if(MPI::COMM_WORLD.Get_rank() == 0) {
// bool wait=true;
// while(wait) {}
// }
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(heat->getTimePtr());
heat->setBoundaryFct(boundaryFct);
heatSpace->addDirichletBC(DIRICHLET, boundaryFct);
// // ===== start adaption loop =====
parallelheat.initParallelization(adaptInfo);
adaptInstat->adapt();
parallelheat.exitParallelization(adaptInfo);
// if(MPI::COMM_WORLD.Get_rank() == 0)
// heatSpace->writeFiles(adaptInfo, true);
MPI::Finalize();
}
......@@ -52,12 +52,6 @@ int main(int argc, char* argv[])
&periodic,
adaptInfo);
// ===== add boundary conditions =====
periodic.addDirichletBC(1, new G);
// ===== add periodic conditions =====
periodic.addPeriodicBC(-1);
// ===== create matrix operator =====
Operator matrixOperator(Operator::MATRIX_OPERATOR, periodic.getFESpace());
matrixOperator.addSecondOrderTerm(new Laplace_SOT);
......@@ -69,6 +63,12 @@ int main(int argc, char* argv[])
rhsOperator.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
periodic.addVectorOperator(&rhsOperator);
// ===== add boundary conditions =====
periodic.addDirichletBC(1, new G);
// ===== add periodic conditions =====
periodic.addPeriodicBC(-1);
// ===== start adaption loop =====
adapt->adapt();
......
......@@ -63,10 +63,6 @@ int main(int argc, char* argv[])
AdaptStationary adapt("vecellipt->adapt", vecellipt, adaptInfo);
// ===== add boundary conditions =====
vecellipt.addDirichletBC(1, 0, 0, new G);
// ===== create matrix operators =====
Operator matrixOperator00(Operator::MATRIX_OPERATOR,
vecellipt.getFESpace(0), vecellipt.getFESpace(0));
......@@ -90,6 +86,9 @@ int main(int argc, char* argv[])
rhsOperator0.addZeroOrderTerm(new CoordsAtQP_ZOT(new F(degree)));
vecellipt.addVectorOperator(rhsOperator0, 0);
// ===== add boundary conditions =====
vecellipt.addDirichletBC(1, 0, 0, new G);
// ===== start adaption loop =====
adapt.adapt();
......
......@@ -248,14 +248,6 @@ int main(int argc, char** argv)
*(adaptInfo.getTimestepPtr()) *= fac * pow(2.0, -nRefine);
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(vecheat.getBoundaryTimePtr());
vecheat.setBoundaryFct(boundaryFct);
vecheatSpace.addDirichletBC(DIRICHLET, 0, 0, boundaryFct);
vecheatSpace.addDirichletBC(DIRICHLET, 1, 1, boundaryFct);
// ===== create rhs functions =====
F *rhsFct0 = new F(vecheatSpace.getFESpace(0)->getBasisFcts()->getDegree());
rhsFct0->setTimePtr(vecheat.getRHSTimePtr());
......@@ -315,6 +307,14 @@ int main(int argc, char** argv)
F1.addZeroOrderTerm(new CoordsAtQP_ZOT(rhsFct1));
vecheatSpace.addVectorOperator(F1, 1);
// ===== create boundary functions =====
G *boundaryFct = new G;
boundaryFct->setTimePtr(vecheat.getBoundaryTimePtr());
vecheat.setBoundaryFct(boundaryFct);
vecheatSpace.addDirichletBC(DIRICHLET, 0, 0, boundaryFct);
vecheatSpace.addDirichletBC(DIRICHLET, 1, 1, boundaryFct);
// ===== start adaption loop =====
int errorCode = adaptInstat.adapt();
......
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