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

[Cleanup] Store Dirichlet values

parent 0e32046f
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ void BackwardEuler<Vector, Matrix, Function, dim>::setup( ...@@ -23,7 +23,7 @@ void BackwardEuler<Vector, Matrix, Function, dim>::setup(
Vector const &ell, double _tau, double relativeTime, Vector &rhs, Vector const &ell, double _tau, double relativeTime, Vector &rhs,
Vector &iterate, Matrix &AM) { Vector &iterate, Matrix &AM) {
postProcessCalled = false; postProcessCalled = false;
dirichletFunction.evaluate(relativeTime, dirichletValue);
tau = _tau; tau = _tau;
/* We start out with the formulation /* We start out with the formulation
...@@ -72,12 +72,8 @@ void BackwardEuler<Vector, Matrix, Function, dim>::setup( ...@@ -72,12 +72,8 @@ void BackwardEuler<Vector, Matrix, Function, dim>::setup(
for (size_t i = 0; i < dirichletNodes.size(); ++i) for (size_t i = 0; i < dirichletNodes.size(); ++i)
for (size_t j = 0; j < dim; ++j) for (size_t j = 0; j < dim; ++j)
if (dirichletNodes[i][j]) { if (dirichletNodes[i][j])
if (j == 0) iterate[i][j] = (j == 0) ? dirichletValue : 0;
dirichletFunction.evaluate(relativeTime, iterate[i][j]);
else
iterate[i][j] = 0;
}
} }
template <class Vector, class Matrix, class Function, size_t dim> template <class Vector, class Matrix, class Function, size_t dim>
......
...@@ -25,6 +25,7 @@ class BackwardEuler : public TimeSteppingScheme<Vector, Matrix, Function, dim> { ...@@ -25,6 +25,7 @@ class BackwardEuler : public TimeSteppingScheme<Vector, Matrix, Function, dim> {
Vector v; Vector v;
Dune::BitSetVector<dim> const &dirichletNodes; Dune::BitSetVector<dim> const &dirichletNodes;
Function const &dirichletFunction; Function const &dirichletFunction;
double dirichletValue;
Vector u_o; Vector u_o;
Vector v_o; Vector v_o;
......
...@@ -27,7 +27,7 @@ void Newmark<Vector, Matrix, Function, dim>::setup(Vector const &ell, ...@@ -27,7 +27,7 @@ void Newmark<Vector, Matrix, Function, dim>::setup(Vector const &ell,
Vector &rhs, Vector &iterate, Vector &rhs, Vector &iterate,
Matrix &AM) { Matrix &AM) {
postProcessCalled = false; postProcessCalled = false;
dirichletFunction.evaluate(relativeTime, dirichletValue);
tau = _tau; tau = _tau;
/* We start out with the formulation /* We start out with the formulation
...@@ -79,12 +79,8 @@ void Newmark<Vector, Matrix, Function, dim>::setup(Vector const &ell, ...@@ -79,12 +79,8 @@ void Newmark<Vector, Matrix, Function, dim>::setup(Vector const &ell,
for (size_t i = 0; i < dirichletNodes.size(); ++i) for (size_t i = 0; i < dirichletNodes.size(); ++i)
for (size_t j = 0; j < dim; ++j) for (size_t j = 0; j < dim; ++j)
if (dirichletNodes[i][j]) { if (dirichletNodes[i][j])
if (j == 0) iterate[i][j] = (j == 0) ? dirichletValue : 0;
dirichletFunction.evaluate(relativeTime, iterate[i][j]);
else
iterate[i][j] = 0;
}
} }
template <class Vector, class Matrix, class Function, size_t dim> template <class Vector, class Matrix, class Function, size_t dim>
......
...@@ -27,6 +27,7 @@ class Newmark : public TimeSteppingScheme<Vector, Matrix, Function, dim> { ...@@ -27,6 +27,7 @@ class Newmark : public TimeSteppingScheme<Vector, Matrix, Function, dim> {
Vector a; Vector a;
Dune::BitSetVector<dim> const &dirichletNodes; Dune::BitSetVector<dim> const &dirichletNodes;
Function const &dirichletFunction; Function const &dirichletFunction;
double dirichletValue;
Vector u_o; Vector u_o;
Vector v_o; Vector v_o;
......
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