version 3.11-dev
Loading...
Searching...
No Matches
experimental/assembly/cclocalassembler.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//
14#ifndef DUMUX_EXPERIMENTAL_CC_LOCAL_ASSEMBLER_HH
15#define DUMUX_EXPERIMENTAL_CC_LOCAL_ASSEMBLER_HH
16
17#include <dune/common/reservedvector.hh>
18#include <dune/grid/common/gridenums.hh> // for GhostEntity
19#include <dune/istl/matrixindexset.hh>
20
33
35
36namespace Dumux::Experimental {
37
47template<class TypeTag, class Assembler, class Implementation>
48class CCLocalAssemblerBase : public Experimental::FVLocalAssemblerBase<TypeTag, Assembler, Implementation>
49{
52 using FVElementGeometry = typename GridGeometry::LocalView;
53 using Element = typename FVElementGeometry::Element;
54 using SubControlVolumeFace = typename GridGeometry::SubControlVolumeFace;
55 using GridView = typename GridGeometry::GridView;
59 using ElementVolumeVariables = typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView;
61
62public:
63
64 using ParentType::ParentType;
65
66 template <class ResidualVector, class StageParams, class PartialReassembler = DefaultPartialReassembler, class CouplingFunction = Noop>
67 void assembleJacobianAndResidual(JacobianMatrix& jac, ResidualVector& res, GridVariables& gridVariables,
68 const StageParams& stageParams, ResidualVector& temporal, ResidualVector& spatial,
69 ResidualVector& constrainedDofs,
70 const PartialReassembler* partialReassembler = nullptr,
71 const CouplingFunction& maybeAssembleCouplingBlocks = noop)
72 {
73 this->asImp_().bindLocalViews();
74 const auto globalI = this->fvGeometry().gridGeometry().elementMapper().index(this->element());
75
76 this->localResidual().spatialWeight(1.0);
77 this->localResidual().temporalWeight(1.0);
78
79 spatial[globalI] = this->evalLocalFluxAndSourceResidual(this->curElemVolVars())[0];
80 temporal[globalI] = this->localResidual().evalStorage(this->fvGeometry(), this->curElemVolVars())[0];
81 res[globalI] = 0.0;
82 if (!stageParams.skipSpatial(stageParams.size()-1))
83 res[globalI] += spatial[globalI]*stageParams.spatialWeight(stageParams.size()-1);
84 if (!stageParams.skipTemporal(stageParams.size()-1))
85 res[globalI] += temporal[globalI]*stageParams.temporalWeight(stageParams.size()-1);
86
87 this->localResidual().spatialWeight(stageParams.spatialWeight(stageParams.size()-1),
88 stageParams.skipSpatial(stageParams.size()-1));
89 this->localResidual().temporalWeight(stageParams.temporalWeight(stageParams.size()-1),
90 stageParams.skipTemporal(stageParams.size()-1));
91
92
93 if (partialReassembler
94 && partialReassembler->elementColor(globalI) == EntityColor::green)
95 {
96 // assemble the coupling blocks for coupled models (does nothing if not coupled)
97 maybeAssembleCouplingBlocks(res[globalI]);
98 }
99 else
100 {
101 this->asImp_().assembleJacobian(jac, gridVariables, res[globalI]); // forward to the internal implementation
102
103 // assemble the coupling blocks for coupled models (does nothing if not coupled)
104 maybeAssembleCouplingBlocks(res[globalI]);
105 }
106 }
107
111 template <class ResidualVector>
112 void assembleResidual(ResidualVector& res)
113 {
114 this->asImp_().bindLocalViews();
115 const auto globalI = this->assembler().gridGeometry().elementMapper().index(this->element());
116 res[globalI] = this->asImp_().evalLocalResidual()[0]; // forward to the internal implementation
117
119 if constexpr (Problem::enableInternalDirichletConstraints())
120 {
121 const auto applyDirichlet = [&] (const auto& scvI,
122 const auto& dirichletValues,
123 const auto eqIdx,
124 const auto pvIdx)
125 {
126 res[scvI.dofIndex()][eqIdx] = this->curElemVolVars()[scvI].priVars()[pvIdx] - dirichletValues[pvIdx];
127 };
128
129 this->asImp_().enforceInternalDirichletConstraints(applyDirichlet);
130 }
131 }
132
136 NumEqVector evalFlux(const Element& neighbor,
137 const SubControlVolumeFace& scvf) const
138 {
139 return this->localResidual().evalFlux(
140 this->asImp_().problem(), neighbor,
141 this->fvGeometry(), this->curElemVolVars(),
142 this->elemFluxVarsCache(), scvf
143 );
144 }
145
149 template<class SubResidualVector>
150 void assembleCurrentResidual(SubResidualVector& spatialRes, SubResidualVector& temporalRes)
151 {
152 this->asImp_().bindLocalViews();
153 const auto globalI = this->fvGeometry().gridGeometry().elementMapper().index(this->element());
154 spatialRes[globalI] = this->evalLocalFluxAndSourceResidual(this->curElemVolVars())[0];
155 temporalRes[globalI] = this->localResidual().evalStorage(this->fvGeometry(), this->curElemVolVars())[0];
156
157 if constexpr (Problem::enableInternalDirichletConstraints())
158 DUNE_THROW(Dune::NotImplemented, "Not implemented");
159 }
160
165 template<class... Args>
166 void maybeUpdateCouplingContext(Args&&...) {}
167
172 template<class... Args>
174};
175
185template<class TypeTag, class Assembler, DiffMethod diffMethod = DiffMethod::numeric, class Implementation = void>
187
194template<class TypeTag, class Assembler, class Implementation>
195class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, Implementation>
196: public CCLocalAssemblerBase<TypeTag, Assembler,
197 NonVoidOr<CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, Implementation>, Implementation>>
198{
204 using FVElementGeometry = typename GridGeometry::LocalView;
205 using Element = typename FVElementGeometry::Element;
208 using Problem = typename GridVariables::GridVolumeVariables::Problem;
209
210 static constexpr int numEq = GetPropType<TypeTag, Properties::ModelTraits>::numEq();
212
213 using FluxStencil = Dumux::FluxStencil<FVElementGeometry>;
214 static constexpr int maxElementStencilSize = GridGeometry::maxElementStencilSize;
216
217public:
218 using ParentType::ParentType;
219
222
227 void assembleJacobian(JacobianMatrix& A, GridVariables& gridVariables, const NumEqVector& origResidual)
228 {
229 if (this->isImplicit())
230 assembleJacobianImplicit_(A, gridVariables, origResidual);
231 else
232 assembleJacobianExplicit_(A, gridVariables, origResidual);
233 }
234
235private:
236
241 void assembleJacobianImplicit_(JacobianMatrix& A, GridVariables& gridVariables, const NumEqVector& origResidual)
242 {
244 // Calculate derivatives of all dofs in stencil with respect to the dofs in the element. In the //
245 // neighboring elements we do so by computing the derivatives of the fluxes which depend on the //
246 // actual element. In the actual element we evaluate the derivative of the entire residual. //
248
249 // get some aliases for convenience
250 const auto& element = this->element();
251 const auto& fvGeometry = this->fvGeometry();
252 const auto& gridGeometry = this->fvGeometry().gridGeometry();
253 auto&& curElemVolVars = this->curElemVolVars();
254 auto&& elemFluxVarsCache = this->elemFluxVarsCache();
255
256 // get stencil information
257 const auto globalI = gridGeometry.elementMapper().index(element);
258 const auto& connectivityMap = gridGeometry.connectivityMap();
259 const auto numNeighbors = connectivityMap[globalI].size();
260
261 // container to store the neighboring elements
262 Dune::ReservedVector<Element, maxElementStencilSize> neighborElements;
263 neighborElements.resize(numNeighbors);
264
265 // assemble the undeflected residual
267 Residuals origResiduals(numNeighbors + 1); origResiduals = 0.0;
268 origResiduals[0] = origResidual;
269
270 // lambda for convenient evaluation of the fluxes across scvfs in the neighbors
271 // if the neighbor is a ghost we don't want to add anything to their residual
272 // so we return 0 and omit computing the flux
273 auto evalNeighborFlux = [&] (const auto& neighbor, const auto& scvf)
274 {
275 if (neighbor.partitionType() == Dune::GhostEntity)
276 return NumEqVector(0.0);
277 else
278 return this->evalFlux(neighbor, scvf);
279 };
280
281 // get the elements in which we need to evaluate the fluxes
282 // and calculate these in the undeflected state
283 unsigned int j = 1;
284 for (const auto& dataJ : connectivityMap[globalI])
285 {
286 neighborElements[j-1] = gridGeometry.element(dataJ.globalJ);
287 for (const auto scvfIdx : dataJ.scvfsJ)
288 origResiduals[j] += evalNeighborFlux(neighborElements[j-1], fvGeometry.scvf(scvfIdx));
289
290 ++j;
291 }
292
293 // reference to the element's scv (needed later) and corresponding vol vars
294 const auto& scv = fvGeometry.scv(globalI);
295 auto& curVolVars = ParentType::getVolVarAccess(gridVariables.curGridVolVars(), curElemVolVars, scv);
296
297 // save a copy of the original privars and vol vars in order
298 // to restore the original solution after deflection
299 const auto& curSol = this->asImp_().curSol();
300 const auto origPriVars = curSol[globalI];
301 const auto origVolVars = curVolVars;
302
303 // element solution container to be deflected
304 auto elemSol = elementSolution<FVElementGeometry>(origPriVars);
305
306 // derivatives in the neighbors with respect to the current elements
307 // in index 0 we save the derivative of the element residual with respect to it's own dofs
308 Residuals partialDerivs(numNeighbors + 1);
309
310 for (int pvIdx = 0; pvIdx < numEq; ++pvIdx)
311 {
312 partialDerivs = 0.0;
313
314 auto evalResiduals = [&](PrimaryVariable priVar)
315 {
316 Residuals partialDerivsTmp(numNeighbors + 1);
317 partialDerivsTmp = 0.0;
318 // update the volume variables and the flux var cache
319 elemSol[0][pvIdx] = priVar;
320 this->asImp_().maybeUpdateCouplingContext(scv, elemSol, pvIdx);
321 curVolVars.update(elemSol, this->asImp_().problem(), element, scv);
322 elemFluxVarsCache.update(element, fvGeometry, curElemVolVars);
323 if (enableGridFluxVarsCache)
324 gridVariables.gridFluxVarsCache().updateElement(element, fvGeometry, curElemVolVars);
325
326 // calculate the residual with the deflected primary variables
327 partialDerivsTmp[0] = this->evalLocalResidual()[0];
328
329 // calculate the fluxes in the neighbors with the deflected primary variables
330 for (std::size_t k = 0; k < numNeighbors; ++k)
331 for (auto scvfIdx : connectivityMap[globalI][k].scvfsJ)
332 partialDerivsTmp[k+1] += evalNeighborFlux(neighborElements[k], fvGeometry.scvf(scvfIdx));
333
334 return partialDerivsTmp;
335 };
336
337 // derive the residuals numerically
338 static const NumericEpsilon<PrimaryVariable, numEq> eps_{this->asImp_().problem().paramGroup()};
339 static const int numDiffMethod = getParamFromGroup<int>(this->asImp_().problem().paramGroup(), "Assembly.NumericDifferenceMethod");
340 NumericDifferentiation::partialDerivative(evalResiduals, elemSol[0][pvIdx], partialDerivs, origResiduals,
341 eps_(elemSol[0][pvIdx], pvIdx), numDiffMethod);
342
343 // Correct derivative for ghost elements, i.e. set a 1 for the derivative w.r.t. the
344 // current primary variable and a 0 elsewhere. As we always solve for a delta of the
345 // solution with respect to the initial one, this results in a delta of 0 for ghosts.
346 if (this->elementIsGhost())
347 {
348 partialDerivs[0] = 0.0;
349 partialDerivs[0][pvIdx] = 1.0;
350 }
351
352 // restore the original state of the scv's volume variables
353 curVolVars = origVolVars;
354
355 // restore the current element solution
356 elemSol[0][pvIdx] = origPriVars[pvIdx];
357
358 // restore the undeflected state of the coupling context
359 this->asImp_().maybeUpdateCouplingContext(scv, elemSol, pvIdx);
360
361 // add the current partial derivatives to the global jacobian matrix
362 // no special treatment is needed if globalJ is a ghost because then derivatives have been assembled to 0 above
363 if constexpr (Problem::enableInternalDirichletConstraints())
364 {
365 // check if own element has internal Dirichlet constraint
366 const auto internalDirichletConstraintsOwnElement = this->asImp_().problem().hasInternalDirichletConstraint(this->element(), scv);
367 const auto dirichletValues = this->asImp_().problem().internalDirichlet(this->element(), scv);
368
369 for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
370 {
371 if (internalDirichletConstraintsOwnElement[eqIdx])
372 {
373 origResiduals[0][eqIdx] = origVolVars.priVars()[eqIdx] - dirichletValues[eqIdx];
374 A[globalI][globalI][eqIdx][pvIdx] = (eqIdx == pvIdx) ? 1.0 : 0.0;
375 }
376 else
377 A[globalI][globalI][eqIdx][pvIdx] += partialDerivs[0][eqIdx];
378 }
379
380 // off-diagonal entries
381 j = 1;
382 for (const auto& dataJ : connectivityMap[globalI])
383 {
384 const auto& neighborElement = neighborElements[j-1];
385 const auto& neighborScv = fvGeometry.scv(dataJ.globalJ);
386 const auto internalDirichletConstraintsNeighbor = this->asImp_().problem().hasInternalDirichletConstraint(neighborElement, neighborScv);
387
388 for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
389 {
390 if (internalDirichletConstraintsNeighbor[eqIdx])
391 A[dataJ.globalJ][globalI][eqIdx][pvIdx] = 0.0;
392 else
393 A[dataJ.globalJ][globalI][eqIdx][pvIdx] += partialDerivs[j][eqIdx];
394 }
395
396 ++j;
397 }
398 }
399 else // no internal Dirichlet constraints specified
400 {
401 for (int eqIdx = 0; eqIdx < numEq; eqIdx++)
402 {
403 // the diagonal entries
404 A[globalI][globalI][eqIdx][pvIdx] += partialDerivs[0][eqIdx];
405
406 // off-diagonal entries
407 j = 1;
408 for (const auto& dataJ : connectivityMap[globalI])
409 A[dataJ.globalJ][globalI][eqIdx][pvIdx] += partialDerivs[j++][eqIdx];
410 }
411 }
412 }
413
414 // restore original state of the flux vars cache in case of global caching.
415 // This has to be done in order to guarantee that everything is in an undeflected
416 // state before the assembly of another element is called. In the case of local caching
417 // this is obsolete because the elemFluxVarsCache used here goes out of scope after this.
418 // We only have to do this for the last primary variable, for all others the flux var cache
419 // is updated with the correct element volume variables before residual evaluations
420 if (enableGridFluxVarsCache)
421 gridVariables.gridFluxVarsCache().updateElement(element, fvGeometry, curElemVolVars);
422
423 // evaluate additional derivatives that might arise from the coupling (no-op if not coupled)
424 ElementResidualVector orig{origResidual};
425 this->asImp_().maybeEvalAdditionalDomainDerivatives(orig, A, gridVariables);
426 }
427
432 void assembleJacobianExplicit_(JacobianMatrix& A, GridVariables& gridVariables, const NumEqVector& origResidual)
433 {
434 if (this->assembler().isStationaryProblem())
435 DUNE_THROW(Dune::InvalidStateException, "Using explicit jacobian assembler with stationary local residual");
436
437 // assemble the undeflected residual
438 auto storageResidual = origResidual;
439
441 // Calculate derivatives of all dofs in stencil with respect to the dofs in the element. In the //
442 // neighboring elements all derivatives are zero. For the assembled element only the storage //
443 // derivatives are non-zero. //
445
446 // get some aliases for convenience
447 const auto& element = this->element();
448 const auto& fvGeometry = this->fvGeometry();
449 const auto& gridGeometry = this->fvGeometry().gridGeometry();
450 auto&& curElemVolVars = this->curElemVolVars();
451
452 // reference to the element's scv (needed later) and corresponding vol vars
453 const auto globalI = gridGeometry.elementMapper().index(element);
454 const auto& scv = fvGeometry.scv(globalI);
455 auto& curVolVars = ParentType::getVolVarAccess(gridVariables.curGridVolVars(), curElemVolVars, scv);
456
457 // save a copy of the original privars and vol vars in order
458 // to restore the original solution after deflection
459 const auto& curSol = this->asImp_().curSol();
460 const auto origPriVars = curSol[globalI];
461 const auto origVolVars = curVolVars;
462
463 // element solution container to be deflected
464 auto elemSol = elementSolution<FVElementGeometry>(origPriVars);
465
466 // derivatives in the neighbors with respect to the current elements
467 NumEqVector partialDeriv;
468 for (int pvIdx = 0; pvIdx < numEq; ++pvIdx)
469 {
470 // reset derivatives of element dof with respect to itself
471 partialDeriv = 0.0;
472
473 auto evalStorage = [&](PrimaryVariable priVar)
474 {
475 // update the volume variables and calculate
476 // the residual with the deflected primary variables
477 elemSol[0][pvIdx] = priVar;
478 curVolVars.update(elemSol, this->asImp_().problem(), element, scv);
479 return this->evalStorage()[0];
480 };
481
482 // for non-ghosts compute the derivative numerically
483 if (!this->elementIsGhost())
484 {
485 static const NumericEpsilon<PrimaryVariable, numEq> eps_{this->asImp_().problem().paramGroup()};
486 static const int numDiffMethod = getParamFromGroup<int>(this->asImp_().problem().paramGroup(), "Assembly.NumericDifferenceMethod");
487 NumericDifferentiation::partialDerivative(evalStorage, elemSol[0][pvIdx], partialDeriv, storageResidual,
488 eps_(elemSol[0][pvIdx], pvIdx), numDiffMethod);
489 }
490
491 // for ghost elements we assemble a 1.0 where the primary variable and zero everywhere else
492 // as we always solve for a delta of the solution with respect to the initial solution this
493 // results in a delta of zero for ghosts
494 else partialDeriv[pvIdx] = 1.0;
495
496 // restore the original state of the scv's volume variables
497 curVolVars = origVolVars;
498
499 // restore the current element solution
500 elemSol[0][pvIdx] = origPriVars[pvIdx];
501
502 // add the current partial derivatives to the global jacobian matrix
503 // only diagonal entries for explicit jacobians
504 if constexpr (Problem::enableInternalDirichletConstraints())
505 {
506 // check if own element has internal Dirichlet constraint
507 const auto internalDirichletConstraints = this->asImp_().problem().hasInternalDirichletConstraint(this->element(), scv);
508 const auto dirichletValues = this->asImp_().problem().internalDirichlet(this->element(), scv);
509
510 for (int eqIdx = 0; eqIdx < numEq; ++eqIdx)
511 {
512 // TODO: we need to set constrained dof flags for these dofs and not modify the residual here
513 // this function only takes care of the Jacobian
514 if (internalDirichletConstraints[eqIdx])
515 {
516 storageResidual[eqIdx] = origVolVars.priVars()[eqIdx] - dirichletValues[eqIdx];
517 A[globalI][globalI][eqIdx][pvIdx] = (eqIdx == pvIdx) ? 1.0 : 0.0;
518 }
519 else
520 A[globalI][globalI][eqIdx][pvIdx] += partialDeriv[eqIdx];
521 }
522 }
523 else
524 {
525 for (int eqIdx = 0; eqIdx < numEq; eqIdx++)
526 A[globalI][globalI][eqIdx][pvIdx] += partialDeriv[eqIdx];
527 }
528 }
529 }
530};
531
532} // end namespace Dumux
533
534#endif
The local element solution class for cell-centered methods.
A linear system assembler (residual and Jacobian) for general discretization schemes.
Definition assembly/assembler.hh:83
const GridDiscretization & gridGeometry() const
support old interfaces
Definition assembly/assembler.hh:307
void assembleJacobian(JacobianMatrix &A, GridVariables &gridVariables, const NumEqVector &origResidual)
Computes the derivatives with respect to the given element and adds them to the global matrix....
Definition experimental/assembly/cclocalassembler.hh:227
typename ParentType::LocalResidual LocalResidual
Definition experimental/assembly/cclocalassembler.hh:220
typename LocalResidual::ElementResidualVector ElementResidualVector
Definition experimental/assembly/cclocalassembler.hh:221
A base class for all local cell-centered assemblers.
Definition experimental/assembly/cclocalassembler.hh:49
void assembleResidual(ResidualVector &res)
Assemble the residual only.
Definition experimental/assembly/cclocalassembler.hh:112
void assembleJacobianAndResidual(JacobianMatrix &jac, ResidualVector &res, GridVariables &gridVariables, const StageParams &stageParams, ResidualVector &temporal, ResidualVector &spatial, ResidualVector &constrainedDofs, const PartialReassembler *partialReassembler=nullptr, const CouplingFunction &maybeAssembleCouplingBlocks=noop)
Definition experimental/assembly/cclocalassembler.hh:67
void maybeUpdateCouplingContext(Args &&...)
Update the coupling context for coupled models.
Definition experimental/assembly/cclocalassembler.hh:166
void maybeEvalAdditionalDomainDerivatives(Args &&...)
Update the additional domain derivatives for coupled models.
Definition experimental/assembly/cclocalassembler.hh:173
void assembleCurrentResidual(SubResidualVector &spatialRes, SubResidualVector &temporalRes)
Assemble the residual only.
Definition experimental/assembly/cclocalassembler.hh:150
NumEqVector evalFlux(const Element &neighbor, const SubControlVolumeFace &scvf) const
Evaluates the fluxes (element can potentially be a neighbor).
Definition experimental/assembly/cclocalassembler.hh:136
An assembler for Jacobian and residual contribution per element (cell-centered methods).
Definition experimental/assembly/cclocalassembler.hh:186
A base class for all local assemblers.
Definition experimental/assembly/fvlocalassemblerbase.hh:38
ElementVolumeVariables & curElemVolVars()
The current element volume variables.
Definition experimental/assembly/fvlocalassemblerbase.hh:234
ElementResidualVector evalLocalFluxAndSourceResidual() const
Convenience function to evaluate the flux and source terms (i.e, the terms without a time derivative)...
Definition experimental/assembly/fvlocalassemblerbase.hh:133
const Problem & problem() const
The problem.
Definition experimental/assembly/fvlocalassemblerbase.hh:210
LocalResidual & localResidual()
The local residual for the current element.
Definition experimental/assembly/fvlocalassemblerbase.hh:242
const Element & element() const
The current element.
Definition experimental/assembly/fvlocalassemblerbase.hh:218
const Assembler & assembler() const
The assembler.
Definition experimental/assembly/fvlocalassemblerbase.hh:214
FVElementGeometry & fvGeometry()
The global finite volume geometry.
Definition experimental/assembly/fvlocalassemblerbase.hh:230
Implementation & asImp_()
Definition experimental/assembly/fvlocalassemblerbase.hh:274
ElementFluxVariablesCache & elemFluxVarsCache()
The element flux variables cache.
Definition experimental/assembly/fvlocalassemblerbase.hh:238
std::decay_t< decltype(std::declval< Assembler >().localResidual())> LocalResidual
Definition experimental/assembly/fvlocalassemblerbase.hh:57
The grid variables class for general schemes, storing variables and data.
Definition discretization/gridvariables.hh:27
ReservedBlockVector< NumEqVector, Dumux::Detail::LocalDofs::maxNumLocalDofs< ElementDiscretization >()> ElementResidualVector
the container storing all element residuals
Definition assembly/localresidual.hh:56
The flux stencil specialized for different discretization schemes.
Definition fluxstencil.hh:33
static void partialDerivative(const Function &function, Scalar x0, FunctionEvalType &derivative, const FunctionEvalType &fx0, const int numericDifferenceMethod=1)
Computes the derivative of a function with respect to a function parameter.
Definition numericdifferentiation.hh:56
detects which entries in the Jacobian have to be recomputed
Definition partialreassembler.hh:418
A arithmetic block vector type based on DUNE's reserved vector.
Definition reservedblockvector.hh:26
Defines all properties used in Dumux.
Type traits.
An enum class to define various differentiation methods available in order to compute the derivatives...
An enum class to define the colors of elements and vertices required for partial Jacobian reassembly.
A base class for all local assemblers.
The flux stencil specialized for different discretization schemes.
DiffMethod
Differentiation methods in order to compute the derivatives of the residual i.e. the entries in the j...
Definition diffmethod.hh:25
@ numeric
Definition diffmethod.hh:26
@ green
does not need to be reassembled
Definition entitycolor.hh:40
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition numeqvector.hh:34
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::cctpfa||GridGeometry::discMethod==DiscretizationMethods::ccmpfa, CCElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for cell-centered schemes.
Definition cellcentered/elementsolution.hh:101
@ element
Definition fieldtype.hh:23
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:165
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
Definition assembly/assembler.hh:44
constexpr auto noop
Function that performs no operation.
Definition common/typetraits/typetraits.hh:29
A helper to deduce a vector with the same size as numbers of equations.
A class for numeric differentiation.
An adapter class for local assemblers using numeric differentiation.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Detects which entries in the Jacobian have to be recomputed.
A arithmetic block vector type based on DUNE's reserved vector.