3.1-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 <type_traits>
29
30#include <dune/istl/matrixindexset.hh>
31
35
39
40#include "diffmethod.hh"
41
42namespace Dumux {
43
54template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
55class StaggeredFVAssembler: public MultiDomainFVAssembler<StaggeredMultiDomainTraits<TypeTag, TypeTag>,
56 StaggeredCouplingManager<StaggeredMultiDomainTraits<TypeTag, TypeTag>>,
57 diffMethod>
58{
61 diffMethod>;
62
66
67public:
69 using FVGridGeometry [[deprecated("Use GridGeometry instead. FVGridGeometry will be removed after 3.1!")]] = GridGeometry;
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->cellCenterFVGridGeometryPtr(), gridGeometry->faceFVGridGeometryPtr()),
79 std::make_tuple(gridVariables->cellCenterGridVariablesPtr(), gridVariables->faceGridVariablesPtr()),
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->cellCenterFVGridGeometryPtr(), gridGeometry->faceFVGridGeometryPtr()),
94 std::make_tuple(gridVariables->cellCenterGridVariablesPtr(), gridVariables->faceGridVariablesPtr()),
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->cellCenterFVGridGeometryPtr(), gridGeometry->faceFVGridGeometryPtr()),
110 std::make_tuple(gridVariables->cellCenterGridVariablesPtr(), gridVariables->faceGridVariablesPtr()),
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
119
121 { return ParentType::gridVariables(Dune::index_constant<0>()); }
122
123 const auto& gridVariables() const
124 { return ParentType::gridVariables(Dune::index_constant<0>()); }
125
127 [[deprecated("Use gridGeometry() instead. fvGridGeometry() will be removed after 3.1!")]]
129 { return gridGeometry(); }
130
132 { return ParentType::gridGeometry(Dune::index_constant<0>()).actualGridGeometry(); }
133
134};
135
136} // namespace Dumux
137
138#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.
make the local view function available whenever we use the grid geometry
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:58
GridGeometry FVGridGeometry
Definition: staggeredfvassembler.hh:69
const auto & gridVariables() const
Definition: staggeredfvassembler.hh:123
auto & gridVariables()
Definition: staggeredfvassembler.hh:120
const GridGeometry & gridGeometry() const
Definition: staggeredfvassembler.hh:131
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:68
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
const GridGeometry & fvGridGeometry() const
The global finite volume geometry.
Definition: staggeredfvassembler.hh:128
typename ParentType::CouplingManager CouplingManager
Definition: staggeredfvassembler.hh:71
Manages the handling of time dependent problems.
Definition: timeloop.hh:65
A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa,...
Definition: multidomain/fvassembler.hh:59
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:369
const SolutionVector & prevSol() const
the solution of the previous time step
Definition: multidomain/fvassembler.hh:400
GridVariables< i > & gridVariables(Dune::index_constant< i > domainId)
the grid variables of domain i
Definition: multidomain/fvassembler.hh:379
std::shared_ptr< CouplingManager > couplingManager_
the coupling manager coupling the sub domains
Definition: multidomain/fvassembler.hh:432
const auto & problem(Dune::index_constant< i > domainId) const
the problem of domain i
Definition: multidomain/fvassembler.hh:358
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.