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

Make multiple runs

parent 170ac694
No related branches found
No related tags found
No related merge requests found
......@@ -128,6 +128,7 @@ int main() {
typedef Dune::BlockVector<SmallVector> VectorType;
// FIXME: Random values
size_t const runs = 3;
double const E = 1;
double const nu = 0.3;
int const refinements = 5;
......@@ -179,6 +180,7 @@ int main() {
u1 = 0;
VectorType u2 = u1;
for (size_t run = 1; run <= runs; ++run) {
VectorType f(grid.size(grid.maxLevel(), dim));
f = 0;
VectorType neumannTerm(grid.size(grid.maxLevel(), dim));
......@@ -188,8 +190,9 @@ int main() {
// {{{ Assemble terms for the nonlinearity
std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
assemble_frictional<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
leafView, p1Basis, frictionalNodes, nodalIntegrals);
assemble_frictional<GridType, GridType::LeafGridView, SmallVector,
P1Basis>(leafView, p1Basis, frictionalNodes,
nodalIntegrals);
// TODO: populate on S_F
std::vector<double> normalStress;
......@@ -199,15 +202,16 @@ int main() {
// TODO: populate on S_F
std::vector<double> coefficientOfFriction;
coefficientOfFriction.resize(grid.size(grid.maxLevel(), dim));
std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(), 0.0);
std::fill(coefficientOfFriction.begin(), coefficientOfFriction.end(),
0.0);
Dune::GlobalNonlinearity<dim, Dune::LinearFunction> myGlobalNonlinearity(
coefficientOfFriction, normalStress, nodalIntegrals);
// }}}
{
MyConvexProblemType myConvexProblem(stiffnessMatrix, myGlobalNonlinearity,
f, u1);
MyConvexProblemType myConvexProblem(stiffnessMatrix,
myGlobalNonlinearity, f, u1);
MyBlockProblemType myBlockProblem(myConvexProblem);
nonlinearGSStep.setProblem(u1, myBlockProblem);
......@@ -221,7 +225,8 @@ int main() {
// same results if phi vanishes (e.g. because the normalstress is zero)
{
// TODO: Why does blockGSStep even provide a default constructor?
BlockGSStep<OperatorType, VectorType> blockGSStep(stiffnessMatrix, u2, f);
BlockGSStep<OperatorType, VectorType> blockGSStep(stiffnessMatrix, u2,
f);
blockGSStep.ignoreNodes_ = &ignoreNodes;
LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations,
......@@ -229,6 +234,7 @@ int main() {
Solver::FULL); // Solver::QUIET);
solver.solve();
}
}
VectorType diff = u2;
diff -= u1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment