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

[Cleanup] Move ell/createRHS out of the loop

This will allow us to compute the initial acceleration
parent 8d3698a2
No related branches found
No related tags found
No related merge requests found
......@@ -325,6 +325,15 @@ int main(int argc, char *argv[]) {
auto myGlobalNonlinearity = assemble_nonlinearity<MatrixType, VectorType>(
frictionalNodes, *nodalIntegrals, frictionData);
// Problem formulation: right-hand side
auto const createRHS = [&](double _time, VectorType &_ell) {
assemble_neumann(leafView, p1Assembler, neumannNodes, _ell,
neumannFunction, _time);
_ell += gravityFunctional;
};
VectorType ell(finestSize);
// {{{ Initial conditions
VectorType u_initial(finestSize);
u_initial = 0.0;
VectorType v_initial(finestSize);
......@@ -371,11 +380,6 @@ int main(int argc, char *argv[]) {
auto const timesteps = parset.get<size_t>("timeSteps");
auto const tau = parset.get<double>("endOfTime") / timesteps;
auto const createRHS = [&](double _time, VectorType &_ell) {
assemble_neumann(leafView, p1Assembler, neumannNodes, _ell,
neumannFunction, _time);
_ell += gravityFunctional;
};
VectorType v = v_initial;
SingletonVectorType alpha = alpha_initial;
......@@ -389,8 +393,6 @@ int main(int argc, char *argv[]) {
timeSteppingScheme->nextTimeStep();
double const time = tau * run;
VectorType ell(finestSize);
createRHS(time, ell);
MatrixType problem_AB;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment