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

[Cleanup] Do not reuse the variable ell

parent 4afb85ef
No related branches found
No related tags found
No related merge requests found
......@@ -200,8 +200,8 @@ int main(int argc, char *argv[]) {
_relativeTime);
_ell += gravityFunctional;
};
Vector ell(leafVertexCount);
computeExternalForces(0.0, ell);
Vector ell0(leafVertexCount);
computeExternalForces(0.0, ell0);
// {{{ Initial conditions
using LinearFactory = SolverFactory<
......@@ -237,7 +237,7 @@ int main(int argc, char *argv[]) {
// Solve the stationary problem
Vector u_initial(leafVertexCount);
u_initial = 0.0;
solveLinearProblem(dirichletNodes, A, ell, u_initial, ANorm,
solveLinearProblem(dirichletNodes, A, ell0, u_initial, ANorm,
parset.sub("u0.solver"));
Vector ur_initial(leafVertexCount);
ur_initial = 0.0;
......@@ -267,7 +267,7 @@ int main(int argc, char *argv[]) {
Vector a_initial(leafVertexCount);
a_initial = 0.0;
{
// We solve Ma = ell - [Au + Cv + Psi(v)]
// We solve Ma = ell0 - [Au + Cv + Psi(v)]
Vector accelerationRHS(leafVertexCount);
{
accelerationRHS = 0.0;
......@@ -276,7 +276,7 @@ int main(int argc, char *argv[]) {
// NOTE: We assume differentiability of Psi at 0 here!
myGlobalFriction->addGradient(v_initial, accelerationRHS);
accelerationRHS *= -1.0;
accelerationRHS += ell;
accelerationRHS += ell0;
}
solveLinearProblem(noNodes, M, accelerationRHS, a_initial, MNorm,
parset.sub("a0.solver"));
......@@ -376,6 +376,7 @@ int main(int argc, char *argv[]) {
timeSteppingScheme->nextTimeStep();
auto const relativeTime = double(timeStep) / double(timeSteps);
Vector ell(leafVertexCount);
computeExternalForces(relativeTime, ell);
Matrix velocityMatrix;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment