DUNE-ACFEM (2.5.1)

splittingfemscheme.hh
1#ifndef __DUNE_ACFEM_SPLITTINGFEMSCHEME_HH__
2#define __DUNE_ACFEM_SPLITTINGFEMSCHEME_HH__
3
4// iostream includes
5#include <iostream>
6
7// include grid part
8#include <dune/fem/gridpart/adaptiveleafgridpart.hh>
9
10// include discrete function space
11#include <dune/fem/space/lagrange.hh>
12
13// adaptation ...
14#include <dune/fem/function/adaptivefunction.hh>
15#include <dune/fem/space/common/adaptmanager.hh>
16
17// include discrete function
18#include <dune/fem/function/blockvectorfunction.hh>
19
20// Newton's iteration
21#include <dune/fem/solver/newtoninverseoperator.hh>
22
23// lagrange interpolation
24#include <dune/fem/operator/lagrangeinterpolation.hh>
25
26// include norms
27#include <dune/fem/misc/l2norm.hh>
28#include <dune/fem/misc/h1norm.hh>
29
30// include parameter handling
31#include <dune/fem/io/parameter.hh>
32
33// include vtk output and checkpointing
34#include <dune/fem/io/file/dataoutput.hh>
35#include <dune/fem/io/file/datawriter.hh>
36
37// blah blah blah if only Dune were as hip as it ought to be
38
39// local includes
40#include "../algorithms/femschemeinterface.hh"
41#include "../models/modelinterface.hh"
42#include "../functions/gridfunctionwrapper.hh"
43#include "../operators/ellipticoperator.hh"
44#include "../operators/functionals/l2innerproductfunctional.hh"
45#include "../operators/functionals/l2boundaryfunctional.hh"
46#include "../operators/functionals/functionalexpression.hh"
47#include "../operators/constraints/dirichletconstraints.hh"
48#include "../operators/constraints/emptyblockconstraints.hh"
49#include "../estimators/parabolicestimator.hh"
50#include "../estimators/trueerrorestimator.hh"
51#include "../algorithms/marking.hh"
52#include "../models/timeview.hh"
53#include "../common/dataoutput.hh"
54
55// Select an appropriate solver, depending on ModelType and solver-family (ISTL, PESC ...)
56#include "../common/solverselector.hh"
57
58namespace Dune {
59
60 namespace ACFem {
61
92 template<class DiscreteFunction,
93 class ImplicitModel,
94 class ExplicitDataFunction,
95 class ExplicitModel,
96 class InitialGuessFunction>
98 : public BasicFemScheme
99 {
100 public:
102 typedef DiscreteFunction DiscreteFunctionType;
103
105 typedef typename DiscreteFunctionType::GridType GridType;
106
108 typedef typename DiscreteFunctionType::GridPartType GridPartType;
109
111 typedef typename DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
112
114 typedef ImplicitModel ImplicitModelType;
116 typedef ExplicitModel ExplicitModelType;
118
119 typedef
120 decltype(std::declval<ImplicitModelType>() + std::declval<ExplicitModelType>())
121 SumModelType;
123
125 typedef ExplicitDataFunction ExplicitDataType;
126 typedef
127 typename GridFunctionConverter<ExplicitDataType, GridPartType>::WrappedGridFunctionType
128 ExplicitDataFunctionType;
129
131 typedef InitialGuessFunction InitialGuessType;
132 typedef
133 typename GridFunctionConverter<InitialGuessType, GridPartType>::WrappedGridFunctionType
134 InitialGuessFunctionType;
135
137 typedef typename ImplicitModelType::FunctionSpaceType FunctionSpaceType;
138
139 // or: (must coincide)
140 //typedef typenema DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType;
141
142 // choose type of discrete function, Matrix implementation and solver implementation
144 typedef typename SolverSelectorType::LinearOperatorType LinearOperatorType;
145 typedef typename SolverSelectorType::LinearInverseOperatorType LinearInverseOperatorType;
146
148 typedef
149 Fem::NewtonInverseOperator<LinearOperatorType, LinearInverseOperatorType>
151
154 typedef Dune::Fem::RestrictProlongDefault<DiscreteFunctionType> RestrictionProlongationType;
155
157 typedef Dune::Fem::AdaptationManager<GridType, RestrictionProlongationType> AdaptationManagerType;
158
160 typedef typename ImplicitModelType::DirichletIndicatorType DirichletIndicatorType;
161
163 typedef typename ImplicitModelType::DirichletBoundaryFunctionType DirichletBoundaryFunctionType;
164
166 typedef typename ImplicitModelType::DirichletWeightFunctionType DirichletWeightFunctionType;
167
169 typedef
170 decltype(std::declval<DirichletBoundaryFunctionType>()
171 /
172 std::declval<typename DirichletWeightFunctionType::GridFunctionType>())
174
177
180
182 typedef DifferentiableEllipticOperator<LinearOperatorType, ImplicitModelType, ConstraintsOperatorType> ImplicitOperatorType;
183
186 typedef EllipticOperator<ExplicitModelType,
187 ExplicitDataFunctionType, DiscreteFunctionType,
189
201 // Isn't ther a more simpler way for doing this?
202 typedef typename SumModelType::BulkForcesFunctionType BulkForcesFunctionType;
203 typedef
204 L2InnerProductFunctional<DiscreteFunctionSpaceType, BulkForcesFunctionType>
205 BulkForcesFunctional;
206 typedef typename SumModelType::NeumannBoundaryFunctionType BoundaryFluxFunctionType;
207 typedef
208 L2BoundaryFunctional<DiscreteFunctionSpaceType,
209 BoundaryFluxFunctionType,
210 typename ImplicitModelType::NeumannIndicatorType>
211 BoundaryFluxFunctional;
213
215 typedef InitialGuessFunctionType ExactSolutionFunctionType; // slight abuse
216
218 typedef std::tuple<DiscreteFunctionType *, const ExactSolutionFunctionType *> IOTupleType;
219
221 typedef DataOutput<GridType, IOTupleType> DataOutputType;
222
224 typedef Dune::Fem::CheckPointer<GridType> CheckPointerType;
225
247 const ModelInterface<ImplicitModelType>& implicitModel,
248 const ExplicitDataType& explicitData,
249 const ModelInterface<ExplicitModelType>& explicitModel,
250 const InitialGuessType& initialGuess,
251 const std::string name = "femscheme")
252 : solution_(solution)
253 , implicitModel_(asImp(implicitModel))
254 , explicitData_(explicitData)
255 , explicitModel_(asImp(explicitModel))
256 , initialGuess_(initialGuess)
257 , name_(name)
258 , grid_(solution.space().gridPart().grid())
259 , gridPart_(solution.space().gridPart())
260 , discreteSpace_(solution.space())
261 , residual_("residual", discreteSpace_)
262 , update_("update", discreteSpace_)
263 // create Dirichlet contraints
264 , boundaryValues_(implicitModel_().dirichletBoundaryFunction(gridPart_))
265 , boundaryWeight_(implicitModel_().dirichletWeightFunction(gridPart_))
266 , dirichletConstraints_(discreteSpace_,
267 boundaryValues_ / boundaryWeight_.function(),
268 implicitModel_().dirichletIndicator())
269 // the elliptic operator (implicit)
270 , implicitOperator_(implicitModel_().operatorParts(), dirichletConstraints_)
271 // the elliptic operator (explicit)
272 , explicitOperator_(explicitModel_().operatorParts())
273 // create linear operator (domainSpace,rangeSpace)
274 , linearOperator_("assembled elliptic operator", discreteSpace_, discreteSpace_)
275 , solverEps_(Dune::Fem::Parameter::getValue<double>(name_ + ".solvereps", 1e-8))
276 // the right-hand-side
277 , sumModel_(implicitModel_() + explicitModel_())
278 , bulkForces_(sumModel_.bulkForcesFunction(gridPart_))
279 , boundaryFlux_(sumModel_.neumannBoundaryFunction(gridPart_))
280 // other stuff
281 , sequence_(-1)
282 , ioTuple_(&solution_, &initialGuess_())
283 , dataOutput_(0)
284 {}
285
286 virtual ~SplittingFemSchemeBase() {
287 if (dataOutput_) {
288 delete dataOutput_;
289 }
290 }
291
292 virtual void initialize()
293 {
294 // select Lagrange interpolation
295 Fem::LagrangeInterpolation<InitialGuessFunctionType, DiscreteFunctionType> interpolation;
296
297 if (std::is_same<
298 InitialGuessFunctionType,
300 solution_.clear();
301 } else {
302 // apply lagrange interpolation
303 interpolation(initialGuess_(), solution_);
304 }
305 }
306
308 virtual void solve(bool forceMatrixAssembling = true)
309 {
310 // If we have a RHS _function_ then also take that into
311 // account. Note that it would be comparatively cheap to
312 // omit the enclosing if-claus, because the default
313 // configuration results into an efficient no-op. There is
314 // also no point to optimize further into the case
315 // Forces-but-no-Neumann or Neumann-but-no-forces for the
316 // same reason.
317 auto rhsFunctional =
318 BulkForcesFunctional(discreteSpace_, bulkForces_)
319 +
320 BoundaryFluxFunctional(discreteSpace_, boundaryFlux_, implicitModel_().neumannIndicator())
321 +
322 sumModel_.forcesFunctional(discreteSpace_);
323
324 if (!isZero(rhsFunctional)) { // avoid copying thousands of zero values
325 rhsFunctional.coefficients(residual_);
326 } else {
327 residual_.clear();
328 }
329
330 // Compute the contribution from the time derivative
331 explicitOperator_(explicitData_(), update_);
332 residual_ -= update_;
333
334 if (ImplicitModelConstituents::hasDirichletBoundary) {
335 // set Dirichlet constraints, new time
336 dirichletConstraints_.rebuildValues(); // force update
337 dirichletConstraints_.constrain(solution_);
338
339 // do no spoil the new Dirichlet-values
340 dirichletConstraints_.zeroConstrain(residual_);
341 }
342
343 if (ImplicitModelType::isLinear) {
344 linearSolve(residual_, forceMatrixAssembling); // sove Lu = res
345 } else {
346 nonLinearSolve(residual_); // solve Lu = res
347 }
348 }
349
350 protected:
351
354 {
355 assert(!ImplicitModelType::isLinear);
356
357 NonLinearInverseOperatorType newton(implicitOperator_);
358
359 newton(rhs, solution_);
360
361 assert(newton.converged());
362 }
363
368 virtual void linearSolve(DiscreteFunctionType& rhs, bool forceMatrixAssembling)
369 {
370 assert(ImplicitModelType::isLinear);
371
372 if (sequence_ != discreteSpace_.sequence() || forceMatrixAssembling) {
373 // assemble linear operator (i.e. setup matrix) The jacobian
374 // incorporates the constraints defined by the constraint class.
375 implicitOperator_.jacobian(solution_, linearOperator_);
376
377 // update sequence number
378 sequence_ = discreteSpace_.sequence();
379 }
380
381 // inverse operator using linear operator
382 LinearInverseOperatorType solver(linearOperator_, solverEps_, solverEps_);
383
384 // Apply the affine linear operator to the start value. This
385 // computes the initial residual. In the linear case, Lagrange space,
386 // Dirichlet data g, this computes
387 //
388 // update_ = A u - g
389 //
390 // where it is allowed that A is affine-linear, without having
391 // to apply a non-linear solver for this trivial non-linearity
392 implicitOperator_(solution_, update_);
393 rhs -= update_; // rhs = rhs - A u ...
394
395 // solve system. Zero initial values for the update_ vector are
396 // ok, because the information about the previous solution already
397 // is contained in residual_.
398 update_.clear();
399 solver(rhs, update_);
400
401 // subtract the update, difference should be the solution.
402 solution_ += update_; // ... so u = u + invA(rhs - Au)
403 }
404
405 public:
406
408 virtual int output()
409 {
410 if (!dataOutput_) {
411 // NOTE: this should allocated dynamically, otherwise a
412 // derived class has problems to define completely different
413 // IO-schemes Also DataOutputType likes to already generate
414 // some files during construction, so make sure this never happens
415 dataOutput_ = new DataOutputType(grid_, ioTuple_, DataOutputParameters());
416 }
417
418 if (!dataOutput_->willWrite()) {
419 return -1;
420 }
421
422 dataOutput_->write();
423
424 return dataOutput_->writeStep() - 1;
425 }
426
428 virtual double residual() const
429 {
430 assert(0);
431 return -1;
432 }
433
441 virtual double error() const
442 {
443 // can also use H1-norm
444 typedef Dune::Fem::L2Norm<GridPartType> NormType;
445
446 // the DiscreteFunctionSpaceAdapter sets the order per default
447 // to 111 == \infty. We set therefore the order just high
448 // enough that we see the asymptotic error. If the polynomial
449 // order is D, then the error should decay with (h^D). In
450 // principle it should thus suffice to use a quadrature of
451 // degree D.
452 NormType norm(gridPart_, 2*discreteSpace_.order()+2);
453 return norm.distance(initialGuess_(), solution_);
454 }
455
456 virtual size_t size() const
457 {
458 typedef typename DiscreteFunctionSpaceType::BlockMapperType BlockMapperType;
459 typedef Dune::Fem::SlaveDofs<DiscreteFunctionSpaceType, BlockMapperType> SlaveDofsType;
460 typedef typename SlaveDofsType::SingletonKey SlaveDofsKeyType;
461 typedef Dune::Fem::SingletonList<SlaveDofsKeyType, SlaveDofsType> SlaveDofsProviderType;
462
463 SlaveDofsKeyType key(discreteSpace_, discreteSpace_.blockMapper());
464 SlaveDofsType& slaveDofs(SlaveDofsProviderType::getObject(key));
465
466 slaveDofs.rebuild();
467
468 // slaveDofs.size() is off by one
469 size_t numberOfDofs = discreteSpace_.blockMapper().size() - slaveDofs.size() + 1;
470
471 numberOfDofs = grid_.comm().sum(numberOfDofs);
472
473 numberOfDofs *= DiscreteFunctionSpaceType::localBlockSize;
474
475 return numberOfDofs;
476 }
477
478 protected:
479 DiscreteFunctionType& solution_; // the unknown
481 ExpressionStorage<ExplicitDataFunctionType> explicitData_; // this is already the GRID function
482 ExpressionStorage<ExplicitModelType> explicitModel_; // old time-step
483 ExpressionStorage<InitialGuessFunctionType> initialGuess_; // this is already the GRID function
484 const std::string name_;
485
486 GridType& grid_; // hierarchical grid
487 GridPartType& gridPart_; // grid part(view), here the leaf grid the discrete space is build with
488
489 const DiscreteFunctionSpaceType& discreteSpace_; // discrete function space
490 DiscreteFunctionType residual_; // initial residual
491 DiscreteFunctionType update_; // distance to solution
492
493 DirichletBoundaryFunctionType boundaryValues_;
494 DirichletWeightFunctionType boundaryWeight_;
495 ConstraintsOperatorType dirichletConstraints_; // dirichlet boundary constraints
496 EmptyConstraintsType emptyConstraints_; // do-nothing constraints.
497
498 ImplicitOperatorType implicitOperator_; // the affine-linear operator.
499 ExplicitOperatorType explicitOperator_;
500
501 LinearOperatorType linearOperator_; // the linear operator (i.e. jacobian of the operator)
502
503 const double solverEps_ ; // eps for linear solver
504
505 SumModelType sumModel_;
506 BulkForcesFunctionType bulkForces_;
507 BoundaryFluxFunctionType boundaryFlux_;
508
509 mutable int sequence_; // sequence number
510
511 IOTupleType ioTuple_; // tuple with pointers
512 DataOutputType *dataOutput_; // data output class
513 };
514
515 template<class DiscreteFunction,
516 class ImplicitModel,
517 class ExplicitDataFunction = ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
518 typename ImplicitModel::GridPartType>,
519 class ExplicitModel = ZeroModel<typename ImplicitModel::FunctionSpaceType,
520 typename ImplicitModel::GridPartType>,
521 class InitialGuessFunction = ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
522 typename ImplicitModel::GridPartType> >
523 class SplittingFemScheme;
524
526 template<class DiscreteFunction,
527 class ImplicitModel,
528 class ExplicitDataFunction,
529 class ExplicitModel,
530 class InitialGuessFunction>
532 : public SplittingFemSchemeBase<DiscreteFunction, ImplicitModel, ExplicitDataFunction, ExplicitModel, InitialGuessFunction>
533 {
534 typedef
536 BaseType;
537 public:
538 typedef DiscreteFunction DiscreteFunctionType;
539 typedef ImplicitModel ImplicitModelType;
540 typedef ExplicitDataFunction ExplicitDataType;
541 typedef ExplicitModel ExplicitModelType;
542 typedef InitialGuessFunction InitialGuessType;
543
545 const ImplicitModelType& implicitModel,
546 const ExplicitDataType& explicitData,
547 const ExplicitModelType& explicitModel,
548 const InitialGuessType& initialGuess,
549 const std::string name = "femscheme")
550 : BaseType(solution, implicitModel, explicitData, explicitModel, initialGuess, name)
551 {}
552 };
553
554 // Instantiate default stuff. This cannot be stuffed in to one
555 // class because default arguments must not depend on other
556 // arguments.
557
559 template<class DiscreteFunction,
560 class ImplicitModel,
561 class ExplicitDataFunction,
562 class ExplicitModel>
563 class SplittingFemScheme<DiscreteFunction, ImplicitModel, ExplicitDataFunction, ExplicitModel,
564 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
565 typename ImplicitModel::GridPartType> >
566 : public SplittingFemSchemeBase<DiscreteFunction, ImplicitModel, ExplicitDataFunction, ExplicitModel,
567 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
568 typename ImplicitModel::GridPartType> >
569
570 {
571 public:
572 typedef DiscreteFunction DiscreteFunctionType;
573 typedef ImplicitModel ImplicitModelType;
574 typedef ExplicitDataFunction ExplicitDataType;
575 typedef ExplicitModel ExplicitModelType;
576 typedef
579 private:
580 typedef
582 BaseType;
583 public:
584
585 // Normal constructor
586 SplittingFemScheme(DiscreteFunctionType& solution,
587 const ImplicitModelType& implicitModel,
588 const ExplicitDataType& explicitData,
589 const ExplicitModelType& explicitModel,
590 const InitialGuessType& initialGuess,
591 const std::string name = "femscheme")
592 : BaseType(solution, implicitModel, explicitData, initialGuess, name)
593 {}
594
595 // Constructor with artificial default argument
596 SplittingFemScheme(DiscreteFunctionType& solution,
597 const ImplicitModelType& implicitModel,
598 const ExplicitDataType& explicitData,
599 const ExplicitModelType& explicitModel,
600 const std::string name = "femscheme")
601 : BaseType(solution, implicitModel, explicitData, explicitModel,
602 InitialGuessType(solution.space().gridPart()),
603 name)
604 {}
605 };
606
608 template<class DiscreteFunction, class ImplicitModel, class InitialGuess>
609 class SplittingFemScheme<DiscreteFunction, ImplicitModel,
610 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
611 typename ImplicitModel::GridPartType>,
612 ZeroModel<typename ImplicitModel::FunctionSpaceType,
613 typename ImplicitModel::GridPartType>,
614 InitialGuess>
615 : public SplittingFemSchemeBase<DiscreteFunction, ImplicitModel,
616 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
617 typename ImplicitModel::GridPartType>,
618 ZeroModel<typename ImplicitModel::FunctionSpaceType,
619 typename ImplicitModel::GridPartType>,
620 InitialGuess>
621 {
622 public:
623 typedef DiscreteFunction DiscreteFunctionType;
624 typedef ImplicitModel ImplicitModelType;
625 typedef
628 typedef
631 typedef InitialGuess InitialGuessType;
632 private:
633 typedef
635 BaseType;
636 public:
637
638 // Normal constructor
639 SplittingFemScheme(DiscreteFunctionType& solution,
640 const ImplicitModelType& implicitModel,
641 const ExplicitDataType& explicitData,
642 const ExplicitModelType& explicitModel,
643 const InitialGuessType& initialGuess,
644 const std::string name = "femscheme")
645 : BaseType(solution, implicitModel, explicitData, initialGuess, name)
646 {}
647
648 // Constructor with artificial default arguments
649 SplittingFemScheme(DiscreteFunctionType& solution,
650 const ImplicitModelType& implicitModel,
651 const InitialGuessType& initialGuess,
652 const std::string name = "femscheme")
653 : BaseType(solution, implicitModel,
654 ExplicitDataType(solution.space().gridPart()),
656 initialGuess,
657 name)
658 {}
659 };
660
662 template<class DiscreteFunction, class ImplicitModel>
663 class SplittingFemScheme<DiscreteFunction, ImplicitModel,
664 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
665 typename ImplicitModel::GridPartType>,
666 ZeroModel<typename ImplicitModel::FunctionSpaceType,
667 typename ImplicitModel::GridPartType>,
668 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
669 typename ImplicitModel::GridPartType> >
670 : public SplittingFemSchemeBase<DiscreteFunction, ImplicitModel,
671 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
672 typename ImplicitModel::GridPartType>,
673 ZeroModel<typename ImplicitModel::FunctionSpaceType,
674 typename ImplicitModel::GridPartType>,
675 ZeroGridFunction<typename ImplicitModel::FunctionSpaceType,
676 typename ImplicitModel::GridPartType> >
677 {
678 public:
679 typedef DiscreteFunction DiscreteFunctionType;
680 typedef ImplicitModel ImplicitModelType;
681 typedef
684 typedef
687 typedef
690 private:
691 typedef
693 BaseType;
694 public:
695
696 // Normal constructor
697 SplittingFemScheme(DiscreteFunctionType& solution,
698 const ImplicitModelType& implicitModel,
699 const ExplicitDataType& explicitData,
700 const ExplicitModelType& explicitModel,
701 const InitialGuessType& initialGuess,
702 const std::string name = "femscheme")
703 : BaseType(solution, implicitModel, explicitData, initialGuess, name)
704 {}
705
706 // Constructor with artificial default arguments
707 SplittingFemScheme(DiscreteFunctionType& solution,
708 const ImplicitModelType& implicitModel,
709 const std::string name = "femscheme")
710 : BaseType(solution, implicitModel,
711 ExplicitDataType(solution.space().gridPart()),
713 InitialGuessType(solution.space().gridPart()),
714 name)
715 {}
716 };
717
718 template <class DiscreteFunction, class ImplicitModel, class ExplicitDataFunction, class ExplicitModel>
719 void singleSolve(DiscreteFunction& solution,
720 const ImplicitModel& implicitModel,
721 const ExplicitDataFunction& explicitData,
722 const ExplicitModel& explicitModel,
723 const std::string name = "femscheme")
724 {
726 scheme( solution, implicitModel, explicitData, explicitModel, name );
727 scheme.solve(true);
728 }
729
731
732 } // namespace ACFem
733
734} // namespace Dune
735
736#endif // __DUNE_ACFEM_SPLITTINGFEMSCHEME_HH__
Abstract non-adaptive basic FEM scheme.
Definition: femschemeinterface.hh:24
Potentially overwrite some parameters.
Definition: dataoutput.hh:37
void zeroConstrain(DiscreteFunctionType &w) const
Unconditionally set the values of all masked DoFs to zero.
Definition: bulkblockconstraints.hh:250
void constrain(DiscreteFunctionType &w) const
The solution operator; unconditionally install the given constraints into the argument.
Definition: bulkblockconstraints.hh:224
void rebuildValues()
Interpolate the Dirichlet values in any case, but leave slave-DoFs as is if nothing changed.
Definition: dirichletconstraints.hh:190
A class defining an elliptic operator.
Definition: ellipticoperator.hh:86
Interface class for second order elliptic models.
Definition: modelinterface.hh:192
Basic fem-scheme class.
Definition: splittingfemscheme.hh:99
decltype(std::declval< DirichletBoundaryFunctionType >()/std::declval< typename DirichletWeightFunctionType::GridFunctionType >()) EffectiveDirichletFunctionType
type of effective Dirichlet values
Definition: splittingfemscheme.hh:173
virtual size_t size() const
return some measure about the number of DOFs in use
Definition: splittingfemscheme.hh:456
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of the discrete function space
Definition: splittingfemscheme.hh:111
DiscreteFunctionType::GridType GridType
type of hierarchic grid
Definition: splittingfemscheme.hh:105
ImplicitModelType::DirichletIndicatorType DirichletIndicatorType
types for various data
Definition: splittingfemscheme.hh:160
virtual void linearSolve(DiscreteFunctionType &rhs, bool forceMatrixAssembling)
Perform only one step of the Newton scheme for the affine-linear case.
Definition: splittingfemscheme.hh:368
SplittingFemSchemeBase(DiscreteFunctionType &solution, const ModelInterface< ImplicitModelType > &implicitModel, const ExplicitDataType &explicitData, const ModelInterface< ExplicitModelType > &explicitModel, const InitialGuessType &initialGuess, const std::string name="femscheme")
Constructor.
Definition: splittingfemscheme.hh:246
DiscreteFunction DiscreteFunctionType
Type of the discrete solution function.
Definition: splittingfemscheme.hh:102
Dune::Fem::CheckPointer< GridType > CheckPointerType
type of check-pointer (dumps unaltered simulation data)
Definition: splittingfemscheme.hh:224
DataOutput< GridType, IOTupleType > DataOutputType
type of data writer (produces VTK data)
Definition: splittingfemscheme.hh:221
InitialGuessFunction InitialGuessType
Initial Guess.
Definition: splittingfemscheme.hh:131
ImplicitModelType::DirichletBoundaryFunctionType DirichletBoundaryFunctionType
type of Dirichlet boundary values
Definition: splittingfemscheme.hh:163
std::tuple< DiscreteFunctionType *, const ExactSolutionFunctionType * > IOTupleType
type of input/output tuple
Definition: splittingfemscheme.hh:218
EllipticOperator< ExplicitModelType, ExplicitDataFunctionType, DiscreteFunctionType, EmptyConstraintsType > ExplicitOperatorType
explicit part of differential operator.
Definition: splittingfemscheme.hh:188
DirichletConstraints< LinearOperatorType, EffectiveDirichletFunctionType, DirichletIndicatorType > ConstraintsOperatorType
type of Dirichlet constraints
Definition: splittingfemscheme.hh:176
InitialGuessFunctionType ExactSolutionFunctionType
adapter to turn exact solution into a grid function (for visualization)
Definition: splittingfemscheme.hh:215
DifferentiableEmptyBlockConstraints< LinearOperatorType > EmptyConstraintsType
empty constraints for the explicit operator (old solution is already constrained)
Definition: splittingfemscheme.hh:179
virtual void nonLinearSolve(DiscreteFunctionType &rhs)
Run the full Newton-scheme ...
Definition: splittingfemscheme.hh:353
virtual double residual() const
calculate residual (in small l^2)
Definition: splittingfemscheme.hh:428
Dune::Fem::AdaptationManager< GridType, RestrictionProlongationType > AdaptationManagerType
type of adaptation manager handling adapation and DoF compression
Definition: splittingfemscheme.hh:157
Fem::NewtonInverseOperator< LinearOperatorType, LinearInverseOperatorType > NonLinearInverseOperatorType
Non-linear solver.
Definition: splittingfemscheme.hh:150
DifferentiableEllipticOperator< LinearOperatorType, ImplicitModelType, ConstraintsOperatorType > ImplicitOperatorType
define differential operator, implicit part
Definition: splittingfemscheme.hh:182
ImplicitModel ImplicitModelType
type of the mathematical model
Definition: splittingfemscheme.hh:114
virtual void initialize()
initialize the solution
Definition: splittingfemscheme.hh:292
Dune::Fem::RestrictProlongDefault< DiscreteFunctionType > RestrictionProlongationType
type of restriction/prolongation projection for adaptive simulations (use default here,...
Definition: splittingfemscheme.hh:154
ImplicitModelType::FunctionSpaceType FunctionSpaceType
type of function space (scalar functions, )
Definition: splittingfemscheme.hh:137
virtual double error() const
Calculate L2/H1 error.
Definition: splittingfemscheme.hh:441
ImplicitModelType::DirichletWeightFunctionType DirichletWeightFunctionType
type of Dirichlet weight function
Definition: splittingfemscheme.hh:166
DiscreteFunctionType::GridPartType GridPartType
type of the grid view
Definition: splittingfemscheme.hh:108
virtual void solve(bool forceMatrixAssembling=true)
solve the system
Definition: splittingfemscheme.hh:308
virtual int output()
data I/O
Definition: splittingfemscheme.hh:408
ExplicitDataFunction ExplicitDataType
Data for explicit model.
Definition: splittingfemscheme.hh:125
Constructor.
Definition: splittingfemscheme.hh:533
A grid-function always returning 0.
Definition: constantfunction.hh:352
Define a simple zero model to optimize expression templates.
Definition: zeromodel.hh:28
constexpr bool isZero(Expression &&)
Specialize to evaluate to true for zero expressions.
Definition: expressionoperations.hh:469
const Implementation & asImp(const Fem::BartonNackmanInterface< Interface, Implementation > &arg)
Up-cast to the implementation for any Fem::BartonNackmanInterface.
Definition: expressionoperations.hh:71
A helper class which identifies which components are provided by the given model.
Definition: modelinterface.hh:447
Select one appropriate (linear) solver depending on whether the model is symmetric and/or semidefinit...
Definition: solverselector.hh:90
A grid-function tight to zero.
Definition: constantfunction.hh:324
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Aug 13, 22:30, 2024)