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

Rename: twoStageImplicit -> ImplicitTwoStep

parent 1094fd78
No related branches found
No related tags found
No related merge requests found
......@@ -156,12 +156,12 @@ void implicitEulerExtractVelocity(VectorType const &u_old,
//
// Setup: Substract a(u_new, .) from rhs
template <class VectorType, class MatrixType, class FunctionType, int dim>
void twoStageImplicitSetup(VectorType const &ell, MatrixType const &A,
VectorType const &u_old, VectorType const *u_old_old,
VectorType &problem_rhs, VectorType &problem_iterate,
MatrixType &problem_A,
Dune::BitSetVector<dim> const &dirichletNodes,
FunctionType const &dirichletFunction, double time) {
void ImplicitTwoStepSetup(VectorType const &ell, MatrixType const &A,
VectorType const &u_old, VectorType const *u_old_old,
VectorType &problem_rhs, VectorType &problem_iterate,
MatrixType &problem_A,
Dune::BitSetVector<dim> const &dirichletNodes,
FunctionType const &dirichletFunction, double time) {
problem_A = A;
problem_A /= 1.5;
problem_rhs = ell;
......@@ -187,10 +187,10 @@ void twoStageImplicitSetup(VectorType const &ell, MatrixType const &A,
}
template <class VectorType>
void twoStageImplicitExtract(VectorType const &u_old,
VectorType const *u_old_old,
VectorType const &problem_iterate,
VectorType &solution) {
void ImplicitTwoStepExtract(VectorType const &u_old,
VectorType const *u_old_old,
VectorType const &problem_iterate,
VectorType &solution) {
solution = problem_iterate;
solution.axpy(2, u_old);
solution.axpy(-.5, *u_old_old);
......@@ -207,10 +207,10 @@ void twoStageImplicitExtract(VectorType const &u_old,
}
template <class VectorType>
void twoStageImplicitExtractVelocity(VectorType const &u_old,
VectorType const *u_old_old,
VectorType const &problem_iterate,
VectorType &diff) {
void ImplicitTwoStepExtractVelocity(VectorType const &u_old,
VectorType const *u_old_old,
VectorType const &problem_iterate,
VectorType &diff) {
diff = problem_iterate;
}
......@@ -369,11 +369,11 @@ int main(int argc, char *argv[]) {
VectorType problem_iterate(finestSize);
auto setupFunc =
(run == 1 || !parset.get<bool>("twoStageImplicit"))
(run == 1 || !parset.get<bool>("ImplicitTwoStep"))
? &implicitEulerSetup<VectorType, MatrixType,
decltype(dirichletFunction), dim>
: &twoStageImplicitSetup<VectorType, MatrixType,
decltype(dirichletFunction), dim>;
: &ImplicitTwoStepSetup<VectorType, MatrixType,
decltype(dirichletFunction), dim>;
VectorType *u_old_old_ptr = (run == 1) ? nullptr : &u_previous;
setupFunc(ell, stiffnessMatrix, u, u_old_old_ptr, problem_rhs,
......@@ -400,17 +400,17 @@ int main(int argc, char *argv[]) {
false); // absolute error
overallSolver.solve();
auto extractFunc = (run == 1 || !parset.get<bool>("twoStageImplicit"))
auto extractFunc = (run == 1 || !parset.get<bool>("ImplicitTwoStep"))
? implicitEulerExtract<VectorType>
: twoStageImplicitExtract<VectorType>;
: ImplicitTwoStepExtract<VectorType>;
// Extract solution from solver
extractFunc(u, u_old_old_ptr, problem_iterate, solution);
auto extractDiffFunc =
(run == 1 || !parset.get<bool>("twoStageImplicit"))
(run == 1 || !parset.get<bool>("implicitTwoStep"))
? implicitEulerExtractVelocity<VectorType>
: twoStageImplicitExtractVelocity<VectorType>;
: ImplicitTwoStepExtractVelocity<VectorType>;
// Extract difference from solver
extractDiffFunc(u, u_old_old_ptr, problem_iterate, u_diff);
......
......@@ -13,7 +13,7 @@ printVelocitySteppingComparison = false
enable_timer = false
twoStageImplicit = false
implicitTwoStep = false
[grid]
refinements = 4
......
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