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