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

alpha_new -> alpha

parent 7efed67c
No related branches found
No related tags found
No related merge requests found
...@@ -198,8 +198,8 @@ int main(int argc, char *argv[]) { ...@@ -198,8 +198,8 @@ int main(int argc, char *argv[]) {
VectorType u_diff(finestSize); VectorType u_diff(finestSize);
u_diff = 0.0; // Has to be zero! u_diff = 0.0; // Has to be zero!
auto alpha_new = Dune::make_shared<SingletonVectorType>(finestSize); auto alpha = Dune::make_shared<SingletonVectorType>(finestSize);
*alpha_new = alpha_old; *alpha = alpha_old;
SingletonVectorType vonMisesStress; SingletonVectorType vonMisesStress;
VectorType rhs; VectorType rhs;
...@@ -268,8 +268,7 @@ int main(int argc, char *argv[]) { ...@@ -268,8 +268,7 @@ int main(int argc, char *argv[]) {
++state_fpi) { ++state_fpi) {
auto myGlobalNonlinearity = auto myGlobalNonlinearity =
assemble_nonlinearity<MatrixType, VectorType>( assemble_nonlinearity<MatrixType, VectorType>(
parset.sub("boundary.friction"), nodalIntegrals, alpha_new, parset.sub("boundary.friction"), nodalIntegrals, alpha, h);
h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix, MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, rhs); *myGlobalNonlinearity, rhs);
...@@ -295,12 +294,11 @@ int main(int argc, char *argv[]) { ...@@ -295,12 +294,11 @@ int main(int argc, char *argv[]) {
switch (parset.get<Config::state_model>( switch (parset.get<Config::state_model>(
"boundary.friction.state.model")) { "boundary.friction.state.model")) {
case Config::Dieterich: case Config::Dieterich:
(*alpha_new)[i] = (*alpha)[i] =
state_update_dieterich(h, unorm / L, alpha_old[i]); state_update_dieterich(h, unorm / L, alpha_old[i]);
break; break;
case Config::Ruina: case Config::Ruina:
(*alpha_new)[i] = (*alpha)[i] = state_update_ruina(h, unorm / L, alpha_old[i]);
state_update_ruina(h, unorm / L, alpha_old[i]);
break; break;
} }
} }
...@@ -319,7 +317,7 @@ int main(int argc, char *argv[]) { ...@@ -319,7 +317,7 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("writeEvolution")) { if (parset.get<bool>("writeEvolution")) {
double out; double out;
neumannFunction.evaluate(time, out); neumannFunction.evaluate(time, out);
octave_writer << (*alpha_new)[first_frictional_node][0] << " " octave_writer << (*alpha)[first_frictional_node][0] << " "
<< u[first_frictional_node][0] * 1e6 << " " << out << u[first_frictional_node][0] * 1e6 << " " << out
<< std::endl; << std::endl;
} }
...@@ -330,7 +328,7 @@ int main(int argc, char *argv[]) { ...@@ -330,7 +328,7 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("printVelocitySteppingComparison")) { if (parset.get<bool>("printVelocitySteppingComparison")) {
double const v = u_diff[first_frictional_node].two_norm() / h / L; double const v = u_diff[first_frictional_node].two_norm() / h / L;
double const euler = (*alpha_new)[first_frictional_node]; double const euler = (*alpha)[first_frictional_node];
double direct; double direct;
if (run < 120) { if (run < 120) {
direct = euler; direct = euler;
...@@ -353,7 +351,7 @@ int main(int argc, char *argv[]) { ...@@ -353,7 +351,7 @@ int main(int argc, char *argv[]) {
// Record the coefficient of friction at a fixed node // Record the coefficient of friction at a fixed node
if (parset.get<bool>("printCoefficient")) { if (parset.get<bool>("printCoefficient")) {
double const V = u_diff[first_frictional_node].two_norm(); double const V = u_diff[first_frictional_node].two_norm();
double const state = (*alpha_new)[first_frictional_node]; double const state = (*alpha)[first_frictional_node];
coefficient_writer << (mu + a * std::log(V * eta) + coefficient_writer << (mu + a * std::log(V * eta) +
b * (state - std::log(eta * L))) << std::endl; b * (state - std::log(eta * L))) << std::endl;
...@@ -361,7 +359,7 @@ int main(int argc, char *argv[]) { ...@@ -361,7 +359,7 @@ int main(int argc, char *argv[]) {
} }
u += u_diff; u += u_diff;
alpha_old = *alpha_new; alpha_old = *alpha;
// Compute von Mises stress and write everything to a file // Compute von Mises stress and write everything to a file
if (parset.get<bool>("writeVTK")) { if (parset.get<bool>("writeVTK")) {
...@@ -373,7 +371,7 @@ int main(int argc, char *argv[]) { ...@@ -373,7 +371,7 @@ int main(int argc, char *argv[]) {
.assemble(localStressAssembler, vonMisesStress, true); .assemble(localStressAssembler, vonMisesStress, true);
writeVtk<P1Basis, P0Basis, VectorType, SingletonVectorType, GridView>( writeVtk<P1Basis, P0Basis, VectorType, SingletonVectorType, GridView>(
p1Basis, u, *alpha_new, p0Basis, vonMisesStress, leafView, p1Basis, u, *alpha, p0Basis, vonMisesStress, leafView,
(boost::format("obs%d") % run).str()); (boost::format("obs%d") % run).str());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment