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