Skip to content
Snippets Groups Projects
Commit 9f329683 authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Compare the outcome, not just the last step

Make Neumann boundary t-dependent as well
parent 9765ed50
No related branches found
No related tags found
No related merge requests found
...@@ -89,8 +89,8 @@ void setup_boundary(GridView const &gridView, ...@@ -89,8 +89,8 @@ void setup_boundary(GridView const &gridView,
template <class GridType, class GridView, class LocalVectorType, class FEBasis> template <class GridType, class GridView, class LocalVectorType, class FEBasis>
void assemble_neumann(GridView const &gridView, FEBasis const &feBasis, void assemble_neumann(GridView const &gridView, FEBasis const &feBasis,
Dune::BitSetVector<1> const &neumannNodes, Dune::BitSetVector<1> const &neumannNodes,
Dune::BlockVector<LocalVectorType> & Dune::BlockVector<LocalVectorType> &f,
f) { // constant sample function on neumann boundary int run) { // constant sample function on neumann boundary
BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes); BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes);
LocalVectorType SampleVector(0); LocalVectorType SampleVector(0);
// FIXME: random values // FIXME: random values
...@@ -188,7 +188,8 @@ int main() { ...@@ -188,7 +188,8 @@ int main() {
u1 = 0; u1 = 0;
VectorType u2 = u1; VectorType u2 = u1;
VectorType b(grid.size(grid.maxLevel(), dim)); VectorType b1(grid.size(grid.maxLevel(), dim));
VectorType b2(grid.size(grid.maxLevel(), dim));
std::vector<Dune::FieldVector<double, 1>> nodalIntegrals; std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
assemble_frictional<GridType, GridType::LeafGridView, SmallVector, P1Basis>( assemble_frictional<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
...@@ -198,10 +199,12 @@ int main() { ...@@ -198,10 +199,12 @@ int main() {
std::cout << "Run: " << run << std::endl; std::cout << "Run: " << run << std::endl;
// b = neumann // b = neumann
assemble_neumann<GridType, GridType::LeafGridView, SmallVector, P1Basis>( assemble_neumann<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
leafView, p1Basis, neumannNodes, b); leafView, p1Basis, neumannNodes, b1, run);
b2 = b1;
// b += linear update // b += linear update
stiffnessMatrix.umv(u1, b); stiffnessMatrix.umv(u1, b1);
stiffnessMatrix.umv(u2, b2);
// {{{ Assemble terms for the nonlinearity // {{{ Assemble terms for the nonlinearity
// TODO: Random value // TODO: Random value
...@@ -221,7 +224,7 @@ int main() { ...@@ -221,7 +224,7 @@ int main() {
{ {
MyConvexProblemType myConvexProblem(stiffnessMatrix, MyConvexProblemType myConvexProblem(stiffnessMatrix,
myGlobalNonlinearity, b, u1); myGlobalNonlinearity, b1, u1);
MyBlockProblemType myBlockProblem(myConvexProblem); MyBlockProblemType myBlockProblem(myConvexProblem);
nonlinearGSStep.setProblem(u1, myBlockProblem); nonlinearGSStep.setProblem(u1, myBlockProblem);
...@@ -260,7 +263,7 @@ int main() { ...@@ -260,7 +263,7 @@ int main() {
{ {
// TODO: Why does blockGSStep even provide a default constructor? // TODO: Why does blockGSStep even provide a default constructor?
BlockGSStep<OperatorType, VectorType> blockGSStep(stiffnessMatrix, u2, BlockGSStep<OperatorType, VectorType> blockGSStep(stiffnessMatrix, u2,
b); b2);
blockGSStep.ignoreNodes_ = &ignoreNodes; blockGSStep.ignoreNodes_ = &ignoreNodes;
LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations, LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment