3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
staggeredfvassembler.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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_STAGGERED_FV_ASSEMBLER_HH
26#define DUMUX_STAGGERED_FV_ASSEMBLER_HH
27
28#include <tuple>
29#include <memory>
30
31#include <dune/common/indices.hh>
32
36
40
41#include "diffmethod.hh"
42
43namespace Dumux {
44
55template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
56class StaggeredFVAssembler: public MultiDomainFVAssembler<StaggeredMultiDomainTraits<TypeTag, TypeTag>,
57 StaggeredCouplingManager<StaggeredMultiDomainTraits<TypeTag, TypeTag>>,
58 diffMethod>
59{
62 diffMethod>;
63
67
68public:
72
74 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
75 std::shared_ptr<const GridGeometry> gridGeometry,
76 std::shared_ptr<GridVariables> gridVariables)
77 : ParentType(std::make_tuple(problem, problem),
78 std::make_tuple(gridGeometry->faceFVGridGeometryPtr(), gridGeometry->cellCenterFVGridGeometryPtr()),
79 std::make_tuple(gridVariables->faceGridVariablesPtr(), gridVariables->cellCenterGridVariablesPtr()),
80 std::make_shared<CouplingManager>())
81 {
82 static_assert(isImplicit, "Explicit assembler for stationary problem doesn't make sense!");
83 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
84 }
85
87 [[deprecated("Please use the constructor additionally taking the previous solution. Will be removed after 3.2 release!")]]
88 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
89 std::shared_ptr<const GridGeometry> gridGeometry,
90 std::shared_ptr<GridVariables> gridVariables,
91 std::shared_ptr<const TimeLoop> timeLoop)
92 : ParentType(std::make_tuple(problem, problem),
93 std::make_tuple(gridGeometry->faceFVGridGeometryPtr(), gridGeometry->cellCenterFVGridGeometryPtr()),
94 std::make_tuple(gridVariables->faceGridVariablesPtr(), gridVariables->cellCenterGridVariablesPtr()),
95 std::make_shared<CouplingManager>(),
96 timeLoop)
97 {
98 static_assert(isImplicit, "Explicit assembler for stationary problem doesn't make sense!");
99 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
100 }
101
103 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
104 std::shared_ptr<const GridGeometry> gridGeometry,
105 std::shared_ptr<GridVariables> gridVariables,
106 std::shared_ptr<const TimeLoop> timeLoop,
107 const SolutionVector& prevSol)
108 : ParentType(std::make_tuple(problem, problem),
109 std::make_tuple(gridGeometry->faceFVGridGeometryPtr(), gridGeometry->cellCenterFVGridGeometryPtr()),
110 std::make_tuple(gridVariables->faceGridVariablesPtr(), gridVariables->cellCenterGridVariablesPtr()),
111 std::make_shared<CouplingManager>(),
112 timeLoop,
113 prevSol)
114 {
115 static_assert(isImplicit, "Explicit assembler for stationary problem doesn't make sense!");
116 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
117 }
118
120 { return ParentType::gridVariables(Dune::index_constant<0>()); }
121
122 const auto& gridVariables() const
123 { return ParentType::gridVariables(Dune::index_constant<0>()); }
124
126 { return ParentType::gridGeometry(Dune::index_constant<0>()).actualGridGeometry(); }
127
128};
129
130} // namespace Dumux
131
132#endif
An enum class to define various differentiation methods available in order to compute the derivatives...
Manages the handling of time dependent problems.
The available discretization methods in Dumux.
The interface of the coupling manager for multi domain problems.
Linear algebra traits for mixeddimension problems.
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
A linear system assembler (residual and Jacobian) for staggered finite volume schemes....
Definition: staggeredfvassembler.hh:59
const auto & gridVariables() const
Definition: staggeredfvassembler.hh:122
auto & gridVariables()
Definition: staggeredfvassembler.hh:119
const GridGeometry & gridGeometry() const
Definition: staggeredfvassembler.hh:125
StaggeredFVAssembler(std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables)
The constructor for stationary problems.
Definition: staggeredfvassembler.hh:74
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: staggeredfvassembler.hh:69
StaggeredFVAssembler(std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables, std::shared_ptr< const TimeLoop > timeLoop)
The constructor for instationary problems.
Definition: staggeredfvassembler.hh:88
StaggeredFVAssembler(std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables, std::shared_ptr< const TimeLoop > timeLoop, const SolutionVector &prevSol)
The constructor for instationary problems.
Definition: staggeredfvassembler.hh:103
GetPropType< TypeTag, Properties::GridVariables > GridVariables
Definition: staggeredfvassembler.hh:70
typename ParentType::CouplingManager CouplingManager
Definition: staggeredfvassembler.hh:71
Manages the handling of time dependent problems.
Definition: timeloop.hh:72
A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa,...
Definition: multidomain/fvassembler.hh:62
static constexpr bool isImplicit()
Returns true if the assembler considers implicit assembly.
Definition: multidomain/fvassembler.hh:93
StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > > CouplingManager
Definition: multidomain/fvassembler.hh:88
const auto & gridGeometry(Dune::index_constant< i > domainId) const
the finite volume grid geometry of domain i
Definition: multidomain/fvassembler.hh:405
const SolutionVector & prevSol() const
the solution of the previous time step
Definition: multidomain/fvassembler.hh:436
GridVariables< i > & gridVariables(Dune::index_constant< i > domainId)
the grid variables of domain i
Definition: multidomain/fvassembler.hh:415
std::shared_ptr< CouplingManager > couplingManager_
the coupling manager coupling the sub domains
Definition: multidomain/fvassembler.hh:468
const auto & problem(Dune::index_constant< i > domainId) const
the problem of domain i
Definition: multidomain/fvassembler.hh:400
Base coupling manager for the staggered discretization.
Definition: staggeredcouplingmanager.hh:42
A linear system assembler (residual and Jacobian) for finite volume schemes with multiple domains.
Declares all properties used in Dumux.