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

[Cleanup] Rename: B -> M

parent 01520e3e
No related branches found
No related tags found
No related merge requests found
......@@ -444,13 +444,13 @@ int main(int argc, char *argv[]) {
double const time = tau * run;
createRHS(time, ell);
MatrixType problem_AB;
MatrixType problem_AM;
VectorType problem_rhs(finestSize);
VectorType problem_iterate(finestSize);
stateUpdater->setup(tau);
timeSteppingScheme->setup(ell, tau, time, problem_rhs, problem_iterate,
problem_AB);
problem_AM);
LoopSolver<VectorType> velocityProblemSolver(
multigridStep, parset.get<size_t>("solver.tnnmg.maxiterations"),
......@@ -465,7 +465,7 @@ int main(int argc, char *argv[]) {
using ConvexProblemType = ConvexProblem<
Dune::GlobalNonlinearity<MatrixType, VectorType>, MatrixType>;
// FIXME: Do we really need to pass u here?
ConvexProblemType const myConvexProblem(1.0, problem_AB,
ConvexProblemType const myConvexProblem(1.0, problem_AM,
*myGlobalNonlinearity,
problem_rhs, _problem_iterate);
MyBlockProblem<ConvexProblemType> velocityProblem(parset,
......
template <class VectorType, class MatrixType, class FunctionType, int dim>
Newmark<VectorType, MatrixType, FunctionType, dim>::Newmark(
MatrixType const &_A, MatrixType const &_B, VectorType const &_u_initial,
MatrixType const &_A, MatrixType const &_M, VectorType const &_u_initial,
VectorType const &_v_initial, VectorType const &_a_initial,
Dune::BitSetVector<dim> const &_dirichletNodes,
FunctionType const &_dirichletFunction)
: A(_A),
B(_B),
M(_M),
u(_u_initial),
v(_v_initial),
a(_a_initial),
......@@ -22,14 +22,14 @@ 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_AB) {
VectorType &problem_iterate, MatrixType &problem_AM) {
postProcessCalled = false;
tau = _tau;
/* We start out with the formulation
B a + A u = ell
M a + A u = ell
Newmark means
......@@ -38,14 +38,14 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
in summary, we get at time t=1
B [2/tau ( u1 - u0 ) - a0]
M [2/tau ( u1 - u0 ) - a0]
+ A [tau/2 ( v1 + v0 ) + u0] = ell
or
2/tau B v1 + tau/2 A v1
= [2/tau B + tau/2 A] v1
= ell + 2/tau B v0 + B a0
2/tau M v1 + tau/2 A v1
= [2/tau M + tau/2 A] v1
= ell + 2/tau M v0 + M a0
- tau/2 A v0 - A u0
*/
......@@ -53,18 +53,18 @@ void Newmark<VectorType, MatrixType, FunctionType, dim>::setup(
{
Dune::MatrixIndexSet indices(A.N(), A.M());
indices.import(A);
indices.import(B);
indices.exportIdx(problem_AB);
indices.import(M);
indices.exportIdx(problem_AM);
}
problem_AB = 0.0;
Arithmetic::addProduct(problem_AB, 2.0 / tau, B);
Arithmetic::addProduct(problem_AB, tau / 2.0, A);
problem_AM = 0.0;
Arithmetic::addProduct(problem_AM, 2.0 / tau, M);
Arithmetic::addProduct(problem_AM, tau / 2.0, A);
// set up RHS
{
problem_rhs = ell;
Arithmetic::addProduct(problem_rhs, 2.0 / tau, B, v_o);
Arithmetic::addProduct(problem_rhs, B, a_o);
Arithmetic::addProduct(problem_rhs, 2.0 / tau, M, v_o);
Arithmetic::addProduct(problem_rhs, M, a_o);
Arithmetic::subtractProduct(problem_rhs, tau / 2.0, A, v_o);
Arithmetic::subtractProduct(problem_rhs, A, u_o);
}
......
......@@ -5,7 +5,7 @@ template <class VectorType, class MatrixType, class FunctionType, int dim>
class Newmark
: public TimeSteppingScheme<VectorType, MatrixType, FunctionType, dim> {
public:
Newmark(MatrixType const &_A, MatrixType const &_B,
Newmark(MatrixType const &_A, MatrixType const &_M,
VectorType const &_u_initial, VectorType const &_v_initial,
VectorType const &_a_initial,
Dune::BitSetVector<dim> const &_dirichletNodes,
......@@ -20,7 +20,7 @@ class Newmark
private:
MatrixType const &A;
MatrixType const &B;
MatrixType const &M;
VectorType u;
VectorType v;
VectorType a;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment