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

Use an H1-style norm for the velocity

parent 0ad38afb
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@
#include <dune/fufem/functionspacebases/p1nodalbasis.hh>
#include <dune/fufem/sharedpointermap.hh>
#include <dune/solvers/norms/energynorm.hh>
#include <dune/solvers/norms/sumnorm.hh>
#include <dune/solvers/solvers/loopsolver.hh>
#include <dune/solvers/solvers/solver.hh> // Solver::FULL
......@@ -238,6 +239,7 @@ int main(int argc, char *argv[]) {
// Set up normal stress, mass matrix, and gravity functional
double normalStress;
MatrixType massMatrix;
EnergyNorm<MatrixType, VectorType> const massMatrixNorm(massMatrix);
VectorType gravityFunctional;
{
double const gravity = 9.81;
......@@ -280,6 +282,8 @@ int main(int argc, char *argv[]) {
surfaceNormalStress = normalStress;
MatrixType stiffnessMatrix;
EnergyNorm<MatrixType, VectorType> const stiffnessMatrixNorm(
stiffnessMatrix);
{
StVenantKirchhoffAssembler<GridType, P1Basis::LocalFiniteElement,
P1Basis::LocalFiniteElement> const
......@@ -303,6 +307,8 @@ int main(int argc, char *argv[]) {
OperatorAssembler<P1Basis, P1Basis>(p1Basis, p1Basis).assemble(
frictionalBoundaryMassAssembler, frictionalBoundaryMassMatrix);
}
SumNorm<VectorType> const velocityEnergyNorm(1.0, stiffnessMatrixNorm, 1.0,
massMatrixNorm);
auto const nodalIntegrals =
assemble_frictional<GridType, GridView, SmallVector, P1Basis>(
......@@ -387,7 +393,7 @@ int main(int argc, char *argv[]) {
stateUpdater->setup(tau);
timeSteppingScheme->setup(ell, tau, time, problem_rhs, problem_iterate,
problem_A);
EnergyNorm<MatrixType, VectorType> velocityEnergyNorm(problem_A);
LoopSolver<VectorType> overallSolver(
multigridStep, parset.get<size_t>("solver.tnnmg.maxiterations"),
solver_tolerance, &velocityEnergyNorm, verbosity,
......
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