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

[Cleanup] Rename: problem_*-> *

parent ac36e7c8
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,9 @@ class TimeSteppingScheme {
public:
void virtual nextTimeStep() = 0;
void virtual setup(VectorType const &ell, double _tau, double time,
VectorType &problem_rhs, VectorType &problem_iterate,
MatrixType &problem_AB) = 0;
VectorType &rhs, VectorType &iterate, MatrixType &AB) = 0;
void virtual postProcess(VectorType const &problem_iterate) = 0;
void virtual postProcess(VectorType const &iterate) = 0;
void virtual extractDisplacement(VectorType &displacement) const = 0;
void virtual extractVelocity(VectorType &velocity) const = 0;
};
......
......@@ -19,8 +19,8 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
template <class VectorType, class MatrixType, class FunctionType, int dim>
void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
VectorType const &ell, double _tau, double time, VectorType &problem_rhs,
VectorType &problem_iterate, MatrixType &problem_AM) {
VectorType const &ell, double _tau, double time, VectorType &rhs,
VectorType &iterate, MatrixType &AM) {
postProcessCalled = false;
tau = _tau;
......@@ -54,38 +54,38 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
indices.import(A);
indices.import(M);
indices.import(C);
indices.exportIdx(problem_AM);
indices.exportIdx(AM);
}
problem_AM = 0.0;
Arithmetic::addProduct(problem_AM, (1.0 - wc) / tau, M);
Arithmetic::addProduct(problem_AM, wc, C);
Arithmetic::addProduct(problem_AM, tau, A);
AM = 0.0;
Arithmetic::addProduct(AM, (1.0 - wc) / tau, M);
Arithmetic::addProduct(AM, wc, C);
Arithmetic::addProduct(AM, tau, A);
// set up RHS
{
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, (1.0 - wc) / tau, M, v_o);
Arithmetic::subtractProduct(problem_rhs, A, u_o);
rhs = ell;
Arithmetic::addProduct(rhs, (1.0 - wc) / tau, M, v_o);
Arithmetic::subtractProduct(rhs, A, u_o);
}
// v_o makes a good initial iterate; we could use anything, though
problem_iterate = 0.0;
iterate = 0.0;
for (size_t i = 0; i < dirichletNodes.size(); ++i)
switch (dirichletNodes[i].count()) {
case 0:
continue;
case dim:
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
iterate[i] = 0;
dirichletFunction.evaluate(time, iterate[i][0]);
break;
case 1:
if (dirichletNodes[i][0]) {
dirichletFunction.evaluate(time, problem_iterate[i][0]);
dirichletFunction.evaluate(time, iterate[i][0]);
break;
}
if (dirichletNodes[i][1]) {
problem_iterate[i][1] = 0;
iterate[i][1] = 0;
break;
}
assert(false);
......@@ -96,10 +96,10 @@ void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::setup(
template <class VectorType, class MatrixType, class FunctionType, int dim>
void BackwardEuler<VectorType, MatrixType, FunctionType, dim>::postProcess(
VectorType const &problem_iterate) {
VectorType const &iterate) {
postProcessCalled = true;
v = problem_iterate;
v = iterate;
u = u_o;
Arithmetic::addProduct(u, tau, v);
......
......@@ -21,8 +21,8 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::nextTimeStep() {
template <class VectorType, class MatrixType, class FunctionType, int dim>
void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
VectorType const &ell, double _tau, double time, VectorType &problem_rhs,
VectorType &problem_iterate, MatrixType &problem_AM) {
VectorType const &ell, double _tau, double time, VectorType &rhs,
VectorType &iterate, MatrixType &AM) {
postProcessCalled = false;
tau = _tau;
......@@ -57,40 +57,40 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
indices.import(A);
indices.import(M);
indices.import(C);
indices.exportIdx(problem_AM);
indices.exportIdx(AM);
}
problem_AM = 0.0;
Arithmetic::addProduct(problem_AM, (1.0 - wc) * 2.0 / tau, M);
Arithmetic::addProduct(problem_AM, wc, C);
Arithmetic::addProduct(problem_AM, tau / 2.0, A);
AM = 0.0;
Arithmetic::addProduct(AM, (1.0 - wc) * 2.0 / tau, M);
Arithmetic::addProduct(AM, wc, C);
Arithmetic::addProduct(AM, tau / 2.0, A);
// set up RHS
{
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, (1.0 - wc) * 2.0 / tau, M, v_o);
Arithmetic::addProduct(problem_rhs, 1.0 - wc, M, a_o);
Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_o);
Arithmetic::subtractProduct(problem_rhs, A, u_o);
rhs = ell;
Arithmetic::addProduct(rhs, (1.0 - wc) * 2.0 / tau, M, v_o);
Arithmetic::addProduct(rhs, 1.0 - wc, M, a_o);
Arithmetic::subtractProduct(rhs, tau / 2.0, A, v_o);
Arithmetic::subtractProduct(rhs, A, u_o);
}
// v_o makes a good initial iterate; we could use anything, though
problem_iterate = 0.0;
iterate = 0.0;
for (size_t i = 0; i < dirichletNodes.size(); ++i)
switch (dirichletNodes[i].count()) {
case 0:
continue;
case dim:
problem_iterate[i] = 0;
dirichletFunction.evaluate(time, problem_iterate[i][0]);
iterate[i] = 0;
dirichletFunction.evaluate(time, iterate[i][0]);
break;
case 1:
if (dirichletNodes[i][0]) {
dirichletFunction.evaluate(time, problem_iterate[i][0]);
dirichletFunction.evaluate(time, iterate[i][0]);
break;
}
if (dirichletNodes[i][1]) {
problem_iterate[i][1] = 0;
iterate[i][1] = 0;
break;
}
assert(false);
......@@ -101,10 +101,10 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
template <class VectorType, class MatrixType, class FunctionType, int dim>
void Newmark<VectorType, MatrixType, FunctionType, dim>::postProcess(
VectorType const &problem_iterate) {
VectorType const &iterate) {
postProcessCalled = true;
v = problem_iterate;
v = iterate;
// u1 = tau/2 ( v1 + v0 ) + u0
u = u_o;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment