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

Define finestSize

parent 312c1236
No related branches found
No related tags found
No related merge requests found
...@@ -157,6 +157,7 @@ int main(int argc, char *argv[]) { ...@@ -157,6 +157,7 @@ int main(int argc, char *argv[]) {
Dune::FieldVector<bool, dim>(false), // non-periodic in each direction Dune::FieldVector<bool, dim>(false), // non-periodic in each direction
0); // zero overlap (whatever that is) 0); // zero overlap (whatever that is)
grid->globalRefine(refinements); grid->globalRefine(refinements);
size_t const finestSize = grid->size(grid->maxLevel(), dim);
typedef GridType::LeafGridView GridView; typedef GridType::LeafGridView GridView;
GridView const leafView = grid->leafView(); GridView const leafView = grid->leafView();
...@@ -196,29 +197,27 @@ int main(int argc, char *argv[]) { ...@@ -196,29 +197,27 @@ int main(int argc, char *argv[]) {
GenericNonlinearGS<MyBlockProblemType> nonlinearGSStep; GenericNonlinearGS<MyBlockProblemType> nonlinearGSStep;
nonlinearGSStep.ignoreNodes_ = &ignoreNodes; nonlinearGSStep.ignoreNodes_ = &ignoreNodes;
VectorType u1(grid->size(grid->maxLevel(), dim)); VectorType u1(finestSize);
u1 = 0.0; // Has to be zero! u1 = 0.0; // Has to be zero!
VectorType u2 = u1; VectorType u2 = u1;
VectorType u3 = u1; VectorType u3 = u1;
VectorType u4 = u1; VectorType u4 = u1;
VectorType u5 = u1; VectorType u5 = u1;
SingletonVectorType s4_old(grid->size(grid->maxLevel(), dim)); SingletonVectorType s4_old(finestSize);
SingletonVectorType s5_old(grid->size(grid->maxLevel(), dim)); SingletonVectorType s5_old(finestSize);
s4_old = parset.get<double>("boundary.friction.state.initial"); s4_old = parset.get<double>("boundary.friction.state.initial");
s5_old = s4_old; s5_old = s4_old;
VectorType u1_diff(grid->size(grid->maxLevel(), dim)); VectorType u1_diff(finestSize);
u1_diff = 0.0; // Has to be zero! u1_diff = 0.0; // Has to be zero!
VectorType u2_diff = u1_diff; VectorType u2_diff = u1_diff;
VectorType u3_diff = u1_diff; VectorType u3_diff = u1_diff;
VectorType u4_diff = u1_diff; VectorType u4_diff = u1_diff;
VectorType u5_diff = u1_diff; VectorType u5_diff = u1_diff;
auto s4_new = Dune::make_shared<SingletonVectorType>( auto s4_new = Dune::make_shared<SingletonVectorType>(finestSize);
grid->size(grid->maxLevel(), dim)); auto s5_new = Dune::make_shared<SingletonVectorType>(finestSize);
auto s5_new = Dune::make_shared<SingletonVectorType>(
grid->size(grid->maxLevel(), dim));
*s4_new = s4_old; *s4_new = s4_old;
*s5_new = *s4_new; *s5_new = *s4_new;
...@@ -305,12 +304,11 @@ int main(int argc, char *argv[]) { ...@@ -305,12 +304,11 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("solver.nonlineargs.use")) { if (parset.get<bool>("solver.nonlineargs.use")) {
auto state = auto state =
Dune::make_shared<Dune::BlockVector<Dune::FieldVector<double, 1>>>( Dune::make_shared<Dune::BlockVector<Dune::FieldVector<double, 1>>>(
grid->size(grid->maxLevel(), dim)); finestSize);
*state = 0.0; *state = 0.0;
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<VectorType, OperatorType>( assemble_nonlinearity<VectorType, OperatorType>(
grid->size(grid->maxLevel(), dim), parset, nodalIntegrals, finestSize, parset, nodalIntegrals, state, h);
state, h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix, MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b1); *myGlobalNonlinearity, b1);
MyBlockProblemType myBlockProblem(parset, myConvexProblem); MyBlockProblemType myBlockProblem(parset, myConvexProblem);
...@@ -331,8 +329,7 @@ int main(int argc, char *argv[]) { ...@@ -331,8 +329,7 @@ int main(int argc, char *argv[]) {
++state_fpi) { ++state_fpi) {
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<VectorType, OperatorType>( assemble_nonlinearity<VectorType, OperatorType>(
grid->size(grid->maxLevel(), dim), parset, nodalIntegrals, finestSize, parset, nodalIntegrals, s4_new, h);
s4_new, h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix, MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b4); *myGlobalNonlinearity, b4);
...@@ -404,8 +401,7 @@ int main(int argc, char *argv[]) { ...@@ -404,8 +401,7 @@ int main(int argc, char *argv[]) {
++state_fpi) { ++state_fpi) {
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<VectorType, OperatorType>( assemble_nonlinearity<VectorType, OperatorType>(
grid->size(grid->maxLevel(), dim), parset, nodalIntegrals, finestSize, parset, nodalIntegrals, s5_new, h);
s5_new, h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix, MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b5); *myGlobalNonlinearity, b5);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment