version 3.11-dev
Loading...
Searching...
No Matches
multistagemultidomainassembler.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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
23#ifndef DUMUX_MULTIDOMAIN_MULTISTAGE_MULTIDOMAIN_ASSEMBLER_HH
24#define DUMUX_MULTIDOMAIN_MULTISTAGE_MULTIDOMAIN_ASSEMBLER_HH
25
26#include <vector>
27#include <memory>
28#include <type_traits>
29#include <tuple>
30#include <utility>
31
32#include <dune/common/hybridutilities.hh>
33#include <dune/istl/matrixindexset.hh>
34
43
46#include <dumux/multidomain/subdomaincvfelocalassembler_.hh>
48
51
52namespace Dumux::Experimental {
53
63template<class MDTraits, class CMType, DiffMethod diffMethod>
65{
66 template<std::size_t id>
67 using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
68
69public:
70 using Traits = MDTraits;
71 using Scalar = typename MDTraits::Scalar;
73
74 template<std::size_t id>
75 using LocalResidual = typename MDTraits::template SubDomain<id>::LocalResidual;
76
77 template<std::size_t id>
78 using GridVariables = typename MDTraits::template SubDomain<id>::GridVariables;
79
80 template<std::size_t id>
81 using GridDiscretization = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
82
83 template<std::size_t id>
84 using Problem = typename MDTraits::template SubDomain<id>::Problem;
85
86 using JacobianMatrix = typename MDTraits::JacobianMatrix;
87 using SolutionVector = typename MDTraits::SolutionVector;
88 using ResidualType = typename MDTraits::ResidualVector;
89 using CouplingManager = CMType;
90
91private:
92 using ProblemTuple = typename MDTraits::template TupleOfSharedPtrConst<Problem>;
93 using GridDiscretizationTuple = typename MDTraits::template TupleOfSharedPtrConst<GridDiscretization>;
94 using GridVariablesTuple = typename MDTraits::template TupleOfSharedPtr<GridVariables>;
96
97 template<std::size_t id>
98 using SubDomainAssemblerView = MultiDomainAssemblerSubDomainView<ThisType, id>;
99
100 template<class DiscretizationMethod, std::size_t id>
101 struct SubDomainAssemblerType;
102
103 template<std::size_t id, class DM>
104 struct SubDomainAssemblerType<DiscretizationMethods::CVFE<DM>, id>
105 {
106 using type = Dumux::Experimental::SubDomainCVFELocalAssembler<id, SubDomainTypeTag<id>, SubDomainAssemblerView<id>, diffMethod, true>;
107 };
108
109 template<std::size_t id>
110 using SubDomainAssembler = typename SubDomainAssemblerType<typename GridDiscretization<id>::DiscretizationMethod, id>::type;
111
112public:
124 GridDiscretizationTuple gridDiscretization,
125 GridVariablesTuple gridVariables,
126 std::shared_ptr<CouplingManager> couplingManager,
127 std::shared_ptr<const Experimental::MultiStageMethod<Scalar>> msMethod,
128 const SolutionVector& prevSol)
130 , timeSteppingMethod_(msMethod)
131 , problemTuple_(std::move(problem))
132 , gridDiscretizationTuple_(std::move(gridDiscretization))
133 , gridVariablesTuple_(std::move(gridVariables))
134 , prevSol_(&prevSol)
135 {
136 std::cout << "Instantiated multi-stage multi-domain assembler." << std::endl;
137
139 && Grid::Capabilities::allGridsSupportsMultithreading(gridDiscretizationTuple_)
141 && getParam<bool>("Assembly.Multithreading", true);
142
143 maybeComputeColors_();
144 }
145
150 {
151 resetJacobian_();
152 resetResidual_();
153 spatialOperatorEvaluations_.back() = 0.0;
154 temporalOperatorEvaluations_.back() = 0.0;
155
156 if (stageParams_->size() != spatialOperatorEvaluations_.size())
157 DUNE_THROW(Dune::InvalidStateException, "Wrong number of stage residuals. Call prepareStage first.");
158
159 using namespace Dune::Hybrid;
160 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainId)
161 {
162 auto& jacRow = (*jacobian_)[domainId];
163 auto& spatial = spatialOperatorEvaluations_.back()[domainId];
164 auto& temporal = temporalOperatorEvaluations_.back()[domainId];
165
166 assemble_(domainId, [&](const auto& element)
167 {
168 MultiDomainAssemblerSubDomainView view{*this, domainId};
169 SubDomainAssembler<domainId()> subDomainAssembler(view, element, curSol, *couplingManager_);
170 subDomainAssembler.assembleJacobianAndResidual(
171 jacRow, (*residual_)[domainId],
172 gridVariablesTuple_,
173 *stageParams_, temporal, spatial,
174 constrainedDofs_[domainId]
175 );
176 });
177
178 // add the contributions of all previous stages
179 auto constantResidualComponent = (*residual_)[domainId];
180 constantResidualComponent = 0.0;
181 for (std::size_t k = 0; k < stageParams_->size()-1; ++k)
182 {
183 if (!stageParams_->skipTemporal(k))
184 constantResidualComponent.axpy(stageParams_->temporalWeight(k), temporalOperatorEvaluations_[k][domainId]);
185 if (!stageParams_->skipSpatial(k))
186 constantResidualComponent.axpy(stageParams_->spatialWeight(k), spatialOperatorEvaluations_[k][domainId]);
187 }
188
189 for (std::size_t i = 0; i < constantResidualComponent.size(); ++i)
190 for (std::size_t ii = 0; ii < constantResidualComponent[i].size(); ++ii)
191 (*residual_)[domainId][i][ii] += constrainedDofs_[domainId][i][ii] > 0.5 ? 0.0 : constantResidualComponent[i][ii];
192
193 enforceProblemConstraints_(domainId, (*jacobian_)[domainId], (*residual_)[domainId], curSol[domainId]);
194 });
195 }
196
199 { DUNE_THROW(Dune::NotImplemented, "assembleResidual without Jacobian for multi-stage multi-domain assembly"); }
200
203 {
204 jacobian_ = std::make_shared<JacobianMatrix>();
205 residual_ = std::make_shared<ResidualType>();
206
207 setJacobianBuildMode_(*jacobian_);
208 setJacobianPattern_(*jacobian_);
209 setResidualSize_(*residual_);
210 }
211
214 {
215 using namespace Dune::Hybrid;
216 forEach(integralRange(Dune::Hybrid::size(gridVariablesTuple_)), [&](const auto domainId)
217 { this->gridVariables(domainId).update(curSol[domainId]); });
218
219 // cross-domain quantities have to reflect the current iterate
220 couplingManager_->updateSolution(curSol);
221 }
222
224 void resetTimeStep(const SolutionVector& curSol)
225 {
226 using namespace Dune::Hybrid;
227 forEach(integralRange(Dune::Hybrid::size(gridVariablesTuple_)), [&](const auto domainId)
228 { this->gridVariables(domainId).resetTimeStep(curSol[domainId]); });
229
230 // the coupling manager keeps its own copy of the solution, so reset it as well
231 couplingManager_->updateSolution(curSol);
232
233 this->clearStages();
234 }
235
237 template<class StageParamsPtr>
238 void prepareStage(SolutionVector& x, StageParamsPtr params)
239 {
240 stageParams_ = std::move(params);
241 const auto curStage = stageParams_->size() - 1;
242
243 // in the first stage, also assemble the operators at the previous time level (stage 0)
244 if (curStage == 1)
245 {
246 using namespace Dune::Hybrid;
247 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainId)
248 {
249 setProblemTime_(*std::get<domainId>(problemTuple_), stageParams_->timeAtStage(0));
250 });
251
252 resetResidual_();
253 spatialOperatorEvaluations_.push_back(*residual_);
254 temporalOperatorEvaluations_.push_back(*residual_);
255 assembleOperatorEvaluations_(x);
256 }
257
258 // The evaluations recorded while solving the previous stage belong to the last iterate
259 // the solver assembled, which is not the stage solution for a solver that stops after an
260 // update (e.g. Newton on the shift criterion) or assembles only once (a linear solver).
261 else
262 {
263 if (spatialOperatorEvaluations_.size() != curStage)
264 DUNE_THROW(Dune::InvalidStateException, "Invalid state. Maybe you forgot to call clearStages()");
265
266 using namespace Dune::Hybrid;
267 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainId)
268 {
269 setProblemTime_(*std::get<domainId>(problemTuple_), stageParams_->timeAtStage(curStage-1));
270 });
271 assembleOperatorEvaluations_(x);
272 }
273
274 using namespace Dune::Hybrid;
275 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainId)
276 {
277 setProblemTime_(*std::get<domainId>(problemTuple_), stageParams_->timeAtStage(curStage));
278 });
279
280 resetResidual_();
281 spatialOperatorEvaluations_.push_back(*residual_);
282 temporalOperatorEvaluations_.push_back(*residual_);
283 }
284
287 {
288 spatialOperatorEvaluations_.clear();
289 temporalOperatorEvaluations_.clear();
290 stageParams_.reset();
291 }
292
294 { return false; }
295
296 bool isImplicit() const
297 { return timeSteppingMethod_->implicit(); }
298
300 template<std::size_t i>
301 std::size_t numDofs(Dune::index_constant<i> domainId) const
302 { return std::get<domainId>(gridDiscretizationTuple_)->numDofs(); }
303
305 template<std::size_t i>
306 const auto& problem(Dune::index_constant<i> domainId) const
307 { return *std::get<domainId>(problemTuple_); }
308
310 template<std::size_t i>
311 const auto& gridDiscretization(Dune::index_constant<i> domainId) const
312 { return *std::get<domainId>(gridDiscretizationTuple_); }
313
315 template<std::size_t i>
316 const auto& gridView(Dune::index_constant<i> domainId) const
317 { return gridDiscretization(domainId).gridView(); }
318
320 template<std::size_t i>
321 GridVariables<i>& gridVariables(Dune::index_constant<i> domainId)
322 { return *std::get<domainId>(gridVariablesTuple_); }
323
325 template<std::size_t i>
326 const GridVariables<i>& gridVariables(Dune::index_constant<i> domainId) const
327 { return *std::get<domainId>(gridVariablesTuple_); }
328
330 { return *couplingManager_; }
331
333 { return *jacobian_; }
334
336 { return *residual_; }
337
338 const SolutionVector& prevSol() const
339 { return *prevSol_; }
340
343 { prevSol_ = &sol; }
344
346 std::pair<Scalar, Scalar> currentStageWeights() const
347 {
348 if (!stageParams_)
349 DUNE_THROW(Dune::InvalidStateException, "No stage params set. Call prepareStage first.");
350 const auto k = stageParams_->size() - 1;
351 return {stageParams_->temporalWeight(k), stageParams_->spatialWeight(k)};
352 }
353
354 template<std::size_t i>
355 LocalResidual<i> localResidual(Dune::index_constant<i> domainId) const
356 { return LocalResidual<i>(std::get<domainId>(problemTuple_).get(), nullptr); }
357
359 {
361 couplingManager_->computeColorsForAssembly();
362 }
363
364 template<std::size_t i, class AssembleElementFunc>
365 void assembleMultithreaded(Dune::index_constant<i>, AssembleElementFunc&& f) const
366 {
368 couplingManager_->assembleMultithreaded(Dune::index_constant<i>{}, std::forward<AssembleElementFunc>(f));
369 }
370
371protected:
372 std::shared_ptr<CouplingManager> couplingManager_;
373
374private:
376 void assembleOperatorEvaluations_(const SolutionVector& x)
377 {
378 using namespace Dune::Hybrid;
379 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainId)
380 {
381 auto& spatial = spatialOperatorEvaluations_.back()[domainId];
382 auto& temporal = temporalOperatorEvaluations_.back()[domainId];
383 spatial = 0.0;
384 temporal = 0.0;
385 assemble_(domainId, [&](const auto& element)
386 {
387 MultiDomainAssemblerSubDomainView view{*this, domainId};
388 SubDomainAssembler<domainId()> subDomainAssembler(view, element, x, *couplingManager_);
389 subDomainAssembler.assembleCurrentResidual(temporal, spatial);
390 });
391 });
392 }
393 void setJacobianBuildMode_(JacobianMatrix& jac) const
394 {
395 using namespace Dune::Hybrid;
396 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto i)
397 {
398 forEach(jac[i], [&](auto& jacBlock)
399 {
400 using BlockType = std::decay_t<decltype(jacBlock)>;
401 if (jacBlock.buildMode() == BlockType::BuildMode::unknown)
402 jacBlock.setBuildMode(BlockType::BuildMode::random);
403 else if (jacBlock.buildMode() != BlockType::BuildMode::random)
404 DUNE_THROW(Dune::NotImplemented, "Only BCRS matrices with random build mode are supported");
405 });
406 });
407 }
408
409 void setJacobianPattern_(JacobianMatrix& jac) const
410 {
411 using namespace Dune::Hybrid;
412 forEach(std::make_index_sequence<JacobianMatrix::N()>(), [&](const auto domainI)
413 {
414 forEach(integralRange(Dune::Hybrid::size(jac[domainI])), [&](const auto domainJ)
415 {
416 const auto pattern = getJacobianPattern_(domainI, domainJ);
417 pattern.exportIdx(jac[domainI][domainJ]);
418 });
419 });
420 }
421
422 void setResidualSize_(ResidualType& res) const
423 {
424 using namespace Dune::Hybrid;
425 forEach(integralRange(Dune::Hybrid::size(res)), [&](const auto domainId)
426 { res[domainId].resize(this->numDofs(domainId)); });
427 }
428
429 void resetResidual_()
430 {
431 if (!residual_)
432 {
433 residual_ = std::make_shared<ResidualType>();
434 setResidualSize_(*residual_);
435 }
436
437 setResidualSize_(constrainedDofs_);
438 (*residual_) = 0.0;
439 constrainedDofs_ = 0.0;
440 }
441
442 void resetJacobian_()
443 {
444 if (!jacobian_)
445 {
446 jacobian_ = std::make_shared<JacobianMatrix>();
447 setJacobianBuildMode_(*jacobian_);
448 setJacobianPattern_(*jacobian_);
449 }
450 (*jacobian_) = 0.0;
451 }
452
453 void maybeComputeColors_()
454 {
455 if constexpr (CouplingManagerSupportsMultithreadedAssembly<CouplingManager>::value)
456 if (enableMultithreading_)
457 couplingManager_->computeColorsForAssembly();
458 }
459
460 template<std::size_t i, class AssembleElementFunc>
461 void assemble_(Dune::index_constant<i> domainId, AssembleElementFunc&& assembleElement) const
462 {
463 bool succeeded = false;
464 try
465 {
466 if constexpr (CouplingManagerSupportsMultithreadedAssembly<CouplingManager>::value)
467 {
468 if (enableMultithreading_)
469 {
470 couplingManager_->assembleMultithreaded(
471 domainId, std::forward<AssembleElementFunc>(assembleElement)
472 );
473 return;
474 }
475 }
476
477 for (const auto& element : elements(gridView(domainId)))
478 assembleElement(element);
479
480 succeeded = true;
481 }
482 catch (NumericalProblem& e)
483 {
484 std::cout << "rank " << gridView(domainId).comm().rank()
485 << " caught an exception while assembling: " << e.what() << "\n";
486 succeeded = false;
487 }
488
489 if (gridView(domainId).comm().size() > 1)
490 succeeded = gridView(domainId).comm().min(succeeded);
491
492 if (!succeeded)
493 DUNE_THROW(NumericalProblem, "A process did not succeed in linearizing the system");
494 }
495
497 template<std::size_t i, class JacRow, class Res, class Sol>
498 void enforceProblemConstraints_(Dune::index_constant<i> domainI, JacRow& jacRow, Res& res, const Sol& curSol) const
499 {
501 {
502 auto& jac = jacRow[domainI];
503
504 auto applyDirichletConstraint = [&](const auto& dofIdx, const auto& values,
505 const auto eqIdx, const auto pvIdx)
506 {
507 res[dofIdx][eqIdx] = curSol[dofIdx][pvIdx] - values[pvIdx];
508
509 auto& row = jac[dofIdx];
510 for (auto col = row.begin(); col != row.end(); ++col)
511 row[col.index()][eqIdx] = 0.0;
512 jac[dofIdx][dofIdx][eqIdx][pvIdx] = 1.0;
513
514 using namespace Dune::Hybrid;
515 forEach(makeIncompleteIntegerSequence<JacobianMatrix::N(), domainI>(), [&](const auto couplingId)
516 {
517 auto& rowCoupling = jacRow[couplingId][dofIdx];
518 for (auto c = rowCoupling.begin(); c != rowCoupling.end(); ++c)
519 rowCoupling[c.index()][eqIdx] = 0.0;
520 });
521 };
522
523 for (const auto& constraintData : this->problem(domainI).constraints())
524 {
525 const auto& info = constraintData.constraintInfo();
526 const auto& values = constraintData.values();
527 const auto dofIdx = constraintData.dofIndex();
528 for (int eqIdx = 0; eqIdx < info.size(); ++eqIdx)
529 if (info.isConstraintEquation(eqIdx))
530 applyDirichletConstraint(dofIdx, values, eqIdx, info.eqToPriVarIndex(eqIdx));
531 }
532 }
533 }
534
535 template<std::size_t i, std::size_t j, typename std::enable_if_t<(i==j), int> = 0>
536 Dune::MatrixIndexSet getJacobianPattern_(Dune::index_constant<i> domainI,
537 Dune::index_constant<j>) const
538 {
539 const auto& gridDisc = gridDiscretization(domainI);
540 auto pattern = timeSteppingMethod_->implicit() ? getJacobianPattern<true>(gridDisc)
541 : getJacobianPattern<false>(gridDisc);
542 couplingManager_->extendJacobianPattern(domainI, pattern);
543 return pattern;
544 }
545
546 template<std::size_t i, std::size_t j, typename std::enable_if_t<(i!=j), int> = 0>
547 Dune::MatrixIndexSet getJacobianPattern_(Dune::index_constant<i> domainI,
548 Dune::index_constant<j> domainJ) const
549 {
550 if (timeSteppingMethod_->implicit())
552 domainI, gridDiscretization(domainI),
553 domainJ, gridDiscretization(domainJ));
554 else
556 domainI, gridDiscretization(domainI),
557 domainJ, gridDiscretization(domainJ));
558 }
559
560 template<class P>
561 void setProblemTime_(const P& p, const Scalar t)
562 {
563 if constexpr (requires { p.setTime(t); })
564 p.setTime(t);
565 else
566 static_assert(!requires (P& q) { q.setTime(Scalar{}); },
567 "The multi-stage assembler sets the stage time through a const problem: setTime has to be const.");
568 }
569
570 std::shared_ptr<const Experimental::MultiStageMethod<Scalar>> timeSteppingMethod_;
571 std::vector<ResidualType> spatialOperatorEvaluations_;
572 std::vector<ResidualType> temporalOperatorEvaluations_;
573 ResidualType constrainedDofs_;
574 std::shared_ptr<const StageParams> stageParams_;
575
576 ProblemTuple problemTuple_;
577 GridDiscretizationTuple gridDiscretizationTuple_;
578 GridVariablesTuple gridVariablesTuple_;
579
580 const SolutionVector* prevSol_ = nullptr;
581
582 std::shared_ptr<JacobianMatrix> jacobian_;
583 std::shared_ptr<ResidualType> residual_;
584
585 bool enableMultithreading_ = false;
586};
587
588} // end namespace Dumux::Experimental
589
590#endif
Subdomain-specific views on multidomain assemblers.
Traits shared by the multi-domain assemblers.
Abstract interface for one-step multi-stage method parameters in Shu/Osher form.
Definition multistagemethods.hh:75
ResidualType & residual()
Definition multistagemultidomainassembler.hh:335
void assembleMultithreaded(Dune::index_constant< i >, AssembleElementFunc &&f) const
Definition multistagemultidomainassembler.hh:365
const SolutionVector & prevSol() const
Definition multistagemultidomainassembler.hh:338
typename MDTraits::JacobianMatrix JacobianMatrix
Definition multistagemultidomainassembler.hh:86
void computeColorsForAssembly()
Definition multistagemultidomainassembler.hh:358
std::size_t numDofs(Dune::index_constant< i > domainId) const
the number of dof locations of domain i
Definition multistagemultidomainassembler.hh:301
GridVariables< i > & gridVariables(Dune::index_constant< i > domainId)
Definition multistagemultidomainassembler.hh:321
const auto & problem(Dune::index_constant< i > domainId) const
Definition multistagemultidomainassembler.hh:306
const auto & gridView(Dune::index_constant< i > domainId) const
the grid view of domain i
Definition multistagemultidomainassembler.hh:316
typename MDTraits::ResidualVector ResidualType
Definition multistagemultidomainassembler.hh:88
typename MDTraits::Scalar Scalar
Definition multistagemultidomainassembler.hh:71
std::shared_ptr< CouplingManager > couplingManager_
Definition multistagemultidomainassembler.hh:372
bool isStationaryProblem() const
Definition multistagemultidomainassembler.hh:293
void resetTimeStep(const SolutionVector &curSol)
Reset the grid variables and the coupling manager to the given solution (e.g. after a failed time ste...
Definition multistagemultidomainassembler.hh:224
void prepareStage(SolutionVector &x, StageParamsPtr params)
Prepare the assembler for the next stage of the time integration.
Definition multistagemultidomainassembler.hh:238
MDTraits Traits
Definition multistagemultidomainassembler.hh:70
CMType CouplingManager
Definition multistagemultidomainassembler.hh:89
typename MDTraits::template SubDomain< id >::LocalResidual LocalResidual
Definition multistagemultidomainassembler.hh:75
typename MDTraits::template SubDomain< id >::Problem Problem
Definition multistagemultidomainassembler.hh:84
JacobianMatrix & jacobian()
Definition multistagemultidomainassembler.hh:332
void updateGridVariables(const SolutionVector &curSol)
Update the grid variables and the coupling manager for the given solution.
Definition multistagemultidomainassembler.hh:213
const GridVariables< i > & gridVariables(Dune::index_constant< i > domainId) const
the grid variables of domain i
Definition multistagemultidomainassembler.hh:326
GetPropType< SubDomainTypeTag< id >, Properties::GridGeometry > GridDiscretization
Definition multistagemultidomainassembler.hh:81
void setPreviousSolution(const SolutionVector &sol)
Set the solution at the previous time level.
Definition multistagemultidomainassembler.hh:342
MultiStageMultiDomainAssembler(ProblemTuple problem, GridDiscretizationTuple gridDiscretization, GridVariablesTuple gridVariables, std::shared_ptr< CouplingManager > couplingManager, std::shared_ptr< const Experimental::MultiStageMethod< Scalar > > msMethod, const SolutionVector &prevSol)
The constructor.
Definition multistagemultidomainassembler.hh:123
void setLinearSystem()
Set up the Jacobian and residual storage.
Definition multistagemultidomainassembler.hh:202
void assembleJacobianAndResidual(const SolutionVector &curSol)
Assembles the Jacobian and residual of the current stage.
Definition multistagemultidomainassembler.hh:149
typename MDTraits::template SubDomain< id >::GridVariables GridVariables
Definition multistagemultidomainassembler.hh:78
void assembleResidual(const SolutionVector &)
Assembling the residual without the Jacobian is not supported.
Definition multistagemultidomainassembler.hh:198
std::pair< Scalar, Scalar > currentStageWeights() const
The temporal and spatial weight of the current stage.
Definition multistagemultidomainassembler.hh:346
LocalResidual< i > localResidual(Dune::index_constant< i > domainId) const
Definition multistagemultidomainassembler.hh:355
bool isImplicit() const
Definition multistagemultidomainassembler.hh:296
Experimental::MultiStageParams< Scalar > StageParams
Definition multistagemultidomainassembler.hh:72
const auto & gridDiscretization(Dune::index_constant< i > domainId) const
Definition multistagemultidomainassembler.hh:311
void clearStages()
Clear all stored stage evaluations.
Definition multistagemultidomainassembler.hh:286
typename MDTraits::SolutionVector SolutionVector
Definition multistagemultidomainassembler.hh:87
const CouplingManager & couplingManager() const
Definition multistagemultidomainassembler.hh:329
Data object for the parameters of a given stage.
Definition multistagetimestepper.hh:31
The CVFE scheme multidomain local assembler.
Definition experimental/assembly/subdomaincvfelocalassembler.hh:207
Subdomain-specific view on a multidomain assembler. Allows retrieval of sub-domain specific objects w...
Definition assemblerview.hh:33
Defines all properties used in Dumux.
Helper function to generate Jacobian pattern for multi domain models.
An enum class to define various differentiation methods available in order to compute the derivatives...
Some exceptions thrown in DuMux.
dune-grid capabilities compatibility layer
Dune::MatrixIndexSet getJacobianPattern(const GridGeometry &gridGeometry)
Helper function to generate Jacobian pattern for cell-centered methods.
Definition jacobianpattern.hh:29
Dune::MatrixIndexSet getCouplingJacobianPattern(const CouplingManager &couplingManager, Dune::index_constant< i > domainI, const GridGeometryI &gridGeometryI, Dune::index_constant< j > domainJ, const GridGeometryJ &gridGeometryJ)
Helper function to generate coupling Jacobian pattern (off-diagonal blocks) for cell-centered schemes...
Definition couplingjacobianpattern.hh:33
constexpr bool isSerial()
Checking whether the backend is serial.
Definition multithreading.hh:45
T getParam(Args &&... args)
A free function to get a parameter from the parameter tree singleton.
Definition parameters.hh:155
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
Helper function to generate Jacobian pattern for different discretization methods.
The available discretization methods in Dumux.
Parameters for different multistage time stepping methods.
A time stepper performing a single time step of a transient simulation.
Multithreading in Dumux.
constexpr bool hasSubProblemGlobalConstraints()
Definition assemblytraits.hh:30
Definition method.hh:20
Definition cvfe/hybrid/elementvariables.hh:32
Definition assembly/assembler.hh:46
bool allGridsSupportsMultithreading(const std::tuple< GridDiscretizations... > &gridDiscretizations)
Whether the grid views of all grid discretizations support multithreading.
Definition gridcapabilities.hh:44
typename Detail::ConcatSeq< decltype(std::make_index_sequence< e >{}), e+1, decltype(std::make_index_sequence<(n > e) ?(n - e - 1) :0 >{})>::type makeIncompleteIntegerSequence
Definition utility.hh:58
Type trait that is specialized for coupling manager supporting multithreaded assembly.
Definition assemblytraits.hh:43
Utilities for template meta programming.