version 3.8
freeflow/shallowwater/iofields.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_FREEFLOW_SHALLOW_WATER_IO_FIELDS_HH
13#define DUMUX_FREEFLOW_SHALLOW_WATER_IO_FIELDS_HH
14
15#include <dumux/io/name.hh>
16#include <string>
17
18namespace Dumux {
19
25{
26public:
27 template <class OutputModule>
28 static void initOutputModule(OutputModule& out)
29 {
30 using VolumeVariables = typename OutputModule::VolumeVariables;
31
32 out.addVolumeVariable([](const VolumeVariables& v){ return v.waterDepth(); }, "waterDepth");
33 out.addVolumeVariable([](const VolumeVariables& v){ return v.velocity(0); }, "velocityX");
34 out.addVolumeVariable([](const VolumeVariables& v){ return v.velocity(1); }, "velocityY");
35 out.addVolumeVariable([](const VolumeVariables& v){ return v.bedSurface(); }, "bedSurface");
36 out.addVolumeVariable([](const VolumeVariables& v){ return v.bedSurface() + v.waterDepth(); }, "freeSurface");
37 }
38
39 /* Restart is limited for shallow water models since only primary
40 * variables are regarded. Important parameters like the bedSurface,
41 * fricition,.. are missing so far.
42 */
43 template <class ModelTraits>
44 static std::string primaryVariableName(int pvIdx)
45 {
46 std::string name;
47
48 switch(pvIdx){
49 case 0 : name = "waterDepth";
50 case 1 : name = "velocityX";
51 case 2 : name = "velocityY";
52 }
53
54 return name;
55 }
56
57};
58
59} // end namespace Dumux
60
61#endif
Adds vtk output fields for the shallow water model.
Definition: freeflow/shallowwater/iofields.hh:25
static std::string primaryVariableName(int pvIdx)
Definition: freeflow/shallowwater/iofields.hh:44
static void initOutputModule(OutputModule &out)
Definition: freeflow/shallowwater/iofields.hh:28
A collection of input/output field names for common physical quantities.
Definition: adapt.hh:17