3.5-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, isImplicit>
59{
62 diffMethod, isImplicit>;
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 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
88 std::shared_ptr<const GridGeometry> gridGeometry,
89 std::shared_ptr<GridVariables> gridVariables,
90 std::shared_ptr<const TimeLoop> timeLoop,
91 const SolutionVector& prevSol)
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 prevSol)
98 {
99 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
100 }
101
103 { return ParentType::gridVariables(Dune::index_constant<0>()); }
104
105 const auto& gridVariables() const
106 { return ParentType::gridVariables(Dune::index_constant<0>()); }
107
109 { return ParentType::gridGeometry(Dune::index_constant<0>()).actualGridGeometry(); }
110
111};
112
113} // namespace Dumux
114
115#endif
An enum class to define various differentiation methods available in order to compute the derivatives...
The available discretization methods in Dumux.
Linear algebra traits for mixeddimension problems.
The interface of the coupling manager for multi domain problems.
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
A linear system assembler (residual and Jacobian) for staggered finite volume schemes....
Definition: staggeredfvassembler.hh:59
const auto & gridVariables() const
Definition: staggeredfvassembler.hh:105
auto & gridVariables()
Definition: staggeredfvassembler.hh:102
const GridGeometry & gridGeometry() const
Definition: staggeredfvassembler.hh:108
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, const SolutionVector &prevSol)
The constructor for instationary problems.
Definition: staggeredfvassembler.hh:87
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: common/timeloop.hh:69
A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa,...
Definition: multidomain/fvassembler.hh:64
static constexpr bool isImplicit()
Returns true if the assembler considers implicit assembly.
Definition: multidomain/fvassembler.hh:95
CMType CouplingManager
Definition: multidomain/fvassembler.hh:90
const auto & gridGeometry(Dune::index_constant< i > domainId) const
the finite volume grid geometry of domain i
Definition: multidomain/fvassembler.hh:398
GridVariables< i > & gridVariables(Dune::index_constant< i > domainId)
the grid variables of domain i
Definition: multidomain/fvassembler.hh:408
std::shared_ptr< CouplingManager > couplingManager_
the coupling manager coupling the sub domains
Definition: multidomain/fvassembler.hh:461
const auto & problem(Dune::index_constant< i > domainId) const
the problem of domain i
Definition: multidomain/fvassembler.hh:393
Base coupling manager for the staggered discretization.
Definition: staggeredcouplingmanager.hh:43
A linear system assembler (residual and Jacobian) for finite volume schemes with multiple domains.
Declares all properties used in Dumux.
Manages the handling of time dependent problems.