version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_STAGGERED_FV_ASSEMBLER_HH
14#define DUMUX_STAGGERED_FV_ASSEMBLER_HH
15
16#include <tuple>
17#include <memory>
18
19#include <dune/common/indices.hh>
20
24
28
29#include "diffmethod.hh"
30
31namespace Dumux {
32
43template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
44class StaggeredFVAssembler : public MultiDomainFVAssembler<StaggeredMultiDomainTraits<TypeTag, TypeTag>,
45 StaggeredCouplingManager<StaggeredMultiDomainTraits<TypeTag, TypeTag>>,
46 diffMethod, isImplicit>
47{
50 diffMethod, isImplicit>;
51
54
55public:
56 using typename ParentType::ResidualType;
57 using typename ParentType::SolutionVector;
61
63 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
64 std::shared_ptr<const GridGeometry> gridGeometry,
65 std::shared_ptr<GridVariables> gridVariables)
66 : ParentType(std::make_tuple(problem, problem),
67 std::make_tuple(gridGeometry->faceFVGridGeometryPtr(), gridGeometry->cellCenterFVGridGeometryPtr()),
68 std::make_tuple(gridVariables->faceGridVariablesPtr(), gridVariables->cellCenterGridVariablesPtr()),
69 std::make_shared<CouplingManager>())
70 {
71 static_assert(isImplicit, "Explicit assembler for stationary problem doesn't make sense!");
72 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
73 }
74
76 StaggeredFVAssembler(std::shared_ptr<const Problem> problem,
77 std::shared_ptr<const GridGeometry> gridGeometry,
78 std::shared_ptr<GridVariables> gridVariables,
79 std::shared_ptr<const TimeLoop> timeLoop,
81 : ParentType(std::make_tuple(problem, problem),
82 std::make_tuple(gridGeometry->faceFVGridGeometryPtr(), gridGeometry->cellCenterFVGridGeometryPtr()),
83 std::make_tuple(gridVariables->faceGridVariablesPtr(), gridVariables->cellCenterGridVariablesPtr()),
84 std::make_shared<CouplingManager>(),
85 timeLoop,
86 prevSol)
87 {
88 this->couplingManager_->setSubProblems(std::make_tuple(problem, problem));
89 }
90
92 { return ParentType::gridVariables(Dune::index_constant<0>()); }
93
94 const auto& gridVariables() const
95 { return ParentType::gridVariables(Dune::index_constant<0>()); }
96
98 { return ParentType::gridGeometry(Dune::index_constant<0>()).actualGridGeometry(); }
99
100};
101
102} // namespace Dumux
103
104#endif
A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa,...
Definition: multidomain/fvassembler.hh:85
typename MDTraits::SolutionVector SolutionVector
Definition: multidomain/fvassembler.hh:108
static constexpr bool isImplicit()
Returns true if the assembler considers implicit assembly.
Definition: multidomain/fvassembler.hh:116
CMType CouplingManager
Definition: multidomain/fvassembler.hh:111
const auto & gridGeometry(Dune::index_constant< i > domainId) const
the finite volume grid geometry of domain i
Definition: multidomain/fvassembler.hh:366
GridVariables< i > & gridVariables(Dune::index_constant< i > domainId)
the grid variables of domain i
Definition: multidomain/fvassembler.hh:376
std::shared_ptr< CouplingManager > couplingManager_
the coupling manager coupling the sub domains
Definition: multidomain/fvassembler.hh:429
const auto & problem(Dune::index_constant< i > domainId) const
the problem of domain i
Definition: multidomain/fvassembler.hh:361
typename MDTraits::ResidualVector ResidualType
Definition: multidomain/fvassembler.hh:109
Base coupling manager for the staggered discretization.
Definition: staggeredcouplingmanager.hh:31
A linear system assembler (residual and Jacobian) for staggered finite volume schemes....
Definition: staggeredfvassembler.hh:47
const auto & gridVariables() const
Definition: staggeredfvassembler.hh:94
typename MDTraits::SolutionVector SolutionVector
Definition: multidomain/fvassembler.hh:108
auto & gridVariables()
Definition: staggeredfvassembler.hh:91
const GridGeometry & gridGeometry() const
Definition: staggeredfvassembler.hh:97
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:63
GetPropType< TypeTag, Properties::GridGeometry > GridGeometry
Definition: staggeredfvassembler.hh:58
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 time-dependent problems.
Definition: staggeredfvassembler.hh:76
GetPropType< TypeTag, Properties::GridVariables > GridVariables
Definition: staggeredfvassembler.hh:59
typename ParentType::CouplingManager CouplingManager
Definition: staggeredfvassembler.hh:60
Manages the handling of time dependent problems.
Definition: common/timeloop.hh:84
Defines all properties used in Dumux.
Manages the handling of time dependent problems.
An enum class to define various differentiation methods available in order to compute the derivatives...
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
A linear system assembler (residual and Jacobian) for finite volume schemes with multiple domains.
Definition: adapt.hh:17
The interface of the coupling manager for multi domain problems.
Linear algebra traits for mixeddimension problems.