DUNE-ACFEM (unstable)

parabolicfemscheme.hh
1 #ifndef __DUNE_ACFEM_PARABOLIC_FEMSCHEME_HH__
2 #define __DUNE_ACFEM_PARABOLIC_FEMSCHEME_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/adaptationmanager.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 // natural interpolation
24 #include <dune/fem/space/common/interpolate.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 // local includes
38 #include "../algorithms/femschemeinterface.hh"
39 #include "../algorithms/operatorselector.hh"
40 #include "../operators/ellipticoperator.hh"
41 #include "../operators/constraints/dirichletconstraints.hh"
42 #include "../operators/functionals/functionals.hh"
43 #include "../functions/functions.hh"
44 #include "../estimators/parabolicestimator.hh"
45 #include "../estimators/trueerrorestimator.hh"
46 #include "../algorithms/marking.hh"
47 #include "../common/timeview.hh"
48 #include "../common/dataoutput.hh"
49 
50 // Select an appropriate solver, depending on ModelType and solver-family (ISTL, PESC ...)
51 #include "../common/solverselector.hh"
52 
53 namespace Dune {
54 
55  namespace ACFem {
56 
84  template<class DiscreteFunction,
85  class TimeProvider,
86  class ImplicitModel,
87  class ExplicitModel,
88  class InitialValue,
89  class RHSFunctional,
90  template<class> class QuadratureTraits = DefaultQuadratureTraits>
92  : public TransientAdaptiveFemScheme
93  {
94  public:
96  typedef DiscreteFunction DiscreteFunctionType;
97 
99  typedef typename DiscreteFunctionType::GridType GridType;
100 
102  typedef typename DiscreteFunctionType::GridPartType GridPartType;
103 
105  typedef typename DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
106 
108  typedef TimeProvider TimeProviderType;
109 
117  using DiscreteModelType = DiscreteModel<ImplicitModel, DiscreteFunctionSpaceType>;
118  using ImplicitTraits = ModelTraits<DiscreteModelType>;
119 
123  using ImplicitModelType = ImplicitModel;
124  using ExplicitModelType = ExplicitModel;
125 
127  typedef InitialValue InitialValueType;
128 
129  typedef RHSFunctional RHSFunctionalType;
130 
132  typedef typename DiscreteModelType::FunctionSpaceType FunctionSpaceType;
133 
134  // or: (must coincide)
135  //typedef typenema DiscreteFunctionSpaceType::FunctionSpaceType FunctionSpaceType;
136 
137  // choose type of discrete function, Matrix implementation and solver implementation
139  typedef typename SolverSelectorType::LinearOperatorType LinearOperatorType;
140  typedef typename SolverSelectorType::LinearInverseOperatorType LinearInverseOperatorType;
141  typedef typename LinearInverseOperatorType::SolverParameterType LinearSolverParameterType;
142 
144  typedef
145  Fem::NewtonInverseOperator<LinearOperatorType, LinearInverseOperatorType>
147 
150  typedef Dune::Fem::RestrictProlongDefault<DiscreteFunctionType> RestrictionProlongationType;
151 
153  typedef Dune::Fem::AdaptationManager<GridType, RestrictionProlongationType> AdaptationManagerType;
154 
157 
159  using ConstraintsOperatorType = DirichletConstraints<DiscreteFunctionSpaceType, DiscreteModelType>;
160 
162  typedef DifferentiableEllipticOperator<
163  LinearOperatorType, DiscreteModelType, const ConstraintsOperatorType&, QuadratureTraits>
165 
168  typedef EllipticOperator<ExplicitModelType,
171 
173  typedef
175  DiscreteModelType,
176  ExplicitModelType>
178 
180  typedef MarkingStrategy<GridPartType> MarkingStrategyType;
181 
183  typedef
186 
188  typedef MarkingStrategy<GridPartType> InitialMarkingStrategyType;
189 
192 
194  typedef std::tuple<DiscreteFunctionType *> IOTupleType;
195 
197  typedef DataOutput<GridType, IOTupleType> DataOutputType;
198 
200  typedef Dune::Fem::CheckPointer<GridType> CheckPointerType;
201 
225  const TimeProviderType& timeProvider,
226  const ImplicitModelType& implicitModel,
227  const ExplicitModelType& explicitModel,
228  const InitialValueType& initialValue,
229  const RHSFunctionalType& rhsFunctional,
230  const std::string name = "heat")
231  : grid_(solution.space().gridPart().grid()),
232  timeProvider_(timeProvider),
233  implicitModel_(asExpression(discreteModel(implicitModel, solution.space()))),
234  explicitModel_(explicitModel),
235  name_(name),
236  gridPart_(solution.space().gridPart()),
237  discreteSpace_(solution.space()),
238  initialValue_(initialValue),
239  rhsFunctional_(rhsFunctional),
240  solution_(solution),
241  oldSolution_("old solution", discreteSpace_),
242  residual_("residual", discreteSpace_),
243  update_("update", discreteSpace_),
244  estimator_(timeProvider_, implicitModel_, explicitModel_, oldSolution_),
245  markingStrategy_(gridPart_, estimator_, name_ + ".adaptation.space"),
246  initialEstimator_(initialValue_),
247  initialMarkingStrategy_(gridPart_, initialEstimator_, name_ + ".adaptation" + ".initial"),
248  // restriction/prolongation operator
249  restrictProlong_(0),
250  // adaptation manager
251  adaptationManager_(0),
252  // create Dirichlet contraints
253  constraints_(discreteSpace_, implicitModel_),
254  // the elliptic operator (implicit)
255  implicitOperator_(implicitModel_, constraints_),
256  explicitOperator_(explicitModel_),
257  // create linear operator (domainSpace,rangeSpace)
258  linearOperator_("assembled elliptic operator", discreteSpace_, discreteSpace_),
259  solverParams_(ImplicitTraits::isAffineLinear ? name_ + ".solver." : name_ + ".linear."),
260  // other stuff
261  sequence_(-1),
262  ioTuple_(&solution_),
263  dataOutput_(0),
264  checkPointer_(grid_, timeProvider_)
265  {
266  // Make the solution of the current timestep persistent for check-pointing.
267  Dune::Fem::persistenceManager << solution_;
268 
269  oldSolution_.clear();
270  solution_.clear();
271  chooseDefaultSolverMethod<SolverSelectorType>(solverParams_);
272  }
273 
275  : grid_(other.grid_),
276  timeProvider_(other.timeProvider_),
277  implicitModel_(other.implicitModel_),
278  explicitModel_(other.explicitModel_),
279  name_(other.name_),
280  gridPart_(other.gridPart_),
281  discreteSpace_(other.discreteSpace_),
282  initialValue_(other.initialValue_),
283  rhsFunctional_(other.rhsFunctional_),
284  solution_(other.solution_),
285  oldSolution_("old solution", discreteSpace_),
286  residual_("residual", discreteSpace_),
287  update_("update", discreteSpace_),
288  estimator_(timeProvider_, implicitModel_, explicitModel_, oldSolution_),
289  markingStrategy_(gridPart_, estimator_, name_ + ".adaptation.space"),
290  initialEstimator_(other.initialEstimator_),
291  initialMarkingStrategy_(other.initialMarkingStrategy_),
292  // restriction/prolongation operator
293  restrictProlong_(0),
294  // adaptation manager
295  adaptationManager_(0),
296  // create Dirichlet contraints
297  constraints_(discreteSpace_, implicitModel_),
298  // the elliptic operator (implicit)
299  implicitOperator_(implicitModel_, constraints_),
300  explicitOperator_(explicitModel_),
301  // create linear operator (domainSpace,rangeSpace)
302  linearOperator_("assembled elliptic operator", discreteSpace_, discreteSpace_),
303  solverParams_(other.solverParams_),
304  // other stuff
305  sequence_(-1),
306  ioTuple_(&solution_),
307  dataOutput_(0),
308  checkPointer_(grid_, timeProvider_)
309  {
310  // Make the solution of the current timestep persistent for check-pointing.
311  Dune::Fem::persistenceManager << solution_;
312 
313  oldSolution_.clear();
314  solution_.clear();
315  chooseDefaultSolverMethod<SolverSelectorType>(solverParams_);
316  }
317 
318  virtual ~ParabolicFemScheme() {
319  if (dataOutput_) {
320  delete dataOutput_;
321  }
322  if (adaptationManager_) {
323  delete adaptationManager_;
324  }
325  if (restrictProlong_) {
326  delete restrictProlong_;
327  }
328  }
329 
330  virtual void initialize()
331  {
332  // initialValue_ already has to be a grid-function
333 
334  // apply natural interpolation
335  interpolate(initialValue_, oldSolution_);
336 
337  // copy it over
338  solution_.assign(oldSolution_);
339 
340  // std::cout << solution_ << std::endl;
341  }
342 
343  virtual std::string name() const
344  {
345  return name_;
346  }
347 
348  virtual void restart(const std::string& name = "") {
349  std::string name_ = name;
350  if (name_ == "") {
351  name_ = Dune::Fem::CheckPointerParameters().checkPointPrefix();
352  }
353  checkPointer_.restoreData(grid_, name_);
354  next();
355  }
356 
361  virtual void next()
362  {
363  oldSolution_.assign(solution_);
364  }
365 
367  virtual void solve(bool forceMatrixAssembling = true)
368  {
369  // Need to copy the data again in case the mesh was adapted in
370  // between because the AdaptationManager only works on a single function ATM.
371  solution_.assign(oldSolution_);
372 
373  if (ImplicitTraits::template Exists<PDEModel::dirichlet>::value) {
374  // set Dirichlet constraints, new time
375  constraints_.updateValues(); // DO NOT CHANGE THIS LINE. DON'T!!!!
376  constraints_.constrain(solution_);
377  }
378 
379  residual_.clear();
380  residual_ += rhsFunctional_;
381 
382  // Compute the contribution from the time derivative
383  explicitOperator_(oldSolution_, update_);
384  residual_ -= update_;
385 
386  // do no spoil the new Dirichlet-values
387  constraints_.zeroConstrain(residual_);
388 
389  if (ImplicitTraits::isAffineLinear) {
390  linearSolve(residual_, forceMatrixAssembling); // sove Lu = res
391  } else {
392  nonLinearSolve(residual_); // solve Lu = res
393  }
394  }
395 
396  protected:
397 
400  {
401  assert(!ImplicitTraits::isAffineLinear);
402 
403  Dune::Fem::NewtonParameter newtonParam(solverParams_, name_ + ".newton.");
404  NonLinearInverseOperatorType newton(newtonParam);
405  newton.bind(implicitOperator_);
406 
407  newton(rhs, solution_);
408 
409  converged_ = newton.converged();
410  assert(newton.converged());
411  }
412 
417  virtual void linearSolve(DiscreteFunctionType& rhs, bool forceMatrixAssembling)
418  {
419  assert(ImplicitTraits::isAffineLinear);
420 
421  if (sequence_ != discreteSpace_.sequence() || forceMatrixAssembling) {
422  // assemble linear operator (i.e. setup matrix) The jacobian
423  // incorporates the constraints defined by the constraint class.
424  implicitOperator_.jacobian(solution_, linearOperator_);
425 
426  // update sequence number
427  sequence_ = discreteSpace_.sequence();
428  }
429 
430  // inverse operator using linear operator
431  //
432  // Note: ATM, we use the difference quotient for the time
433  // derivative, i.e. 1/tau as factor in from of the
434  // mass-matrix. Consequently, the solver-tolerance should be
435  // scaled by the time-step size, at least when we use any
436  // preconditioner.
437  //double scaledEps_ = solverEps_ * timeProvider_.inverseDeltaT();
438  LinearInverseOperatorType solver(solverParams_);
439  solver.bind(linearOperator_);
440 
441  // Apply the affine linear operator to the start value. This
442  // computes the initial residual. In the linear case, Lagrange space,
443  // Dirichlet data g, this computes
444  //
445  // update_ = A u - g
446  //
447  // where it is allowed that A is affine-linear, without having
448  // to apply a non-linear solver for this trivial non-linearity
449  implicitOperator_(solution_, update_);
450  rhs -= update_; // rhs = rhs - A u ...
451 
452  // solve system. Zero initial values for the update_ vector are
453  // ok, because the information about the previous solution already
454  // is contained in residual_.
455  update_.clear();
456  solver(rhs, update_);
457  converged_ = (static_cast<int>(solver.iterations()) < solverParams_.maxIterations());
458 
459  // subtract the update, difference should be the solution.
460  solution_ += update_; // ... so u = u + invA(rhs - Au)
461  }
462 
463  public:
464 
466  virtual bool mark(const double tolerance)
467  {
468  return markingStrategy_.mark(tolerance);
469  }
470 
472  virtual double estimate()
473  {
474  return estimator_.estimate(solution_);
475  }
476 
478  virtual double timeEstimate()
479  {
480  return estimator_.timeEstimate();
481  }
482 
483  virtual double initialEstimate()
484  {
485  return initialEstimator_.estimate(solution_);
486  }
487 
488  virtual bool initialMarking(const double tolerance)
489  {
490  return initialMarkingStrategy_.mark(tolerance);
491  }
492 
494  virtual void adapt()
495  {
496  // there can only one adaptation manager per grid, and the
497  // RestrictionProlongationType which determines which
498  // functions are restricted/prolongated is built into the
499  // AdaptationManagerType. In order to allow for override by
500  // derived classes, allocation that adaptationManager_
501  // dynamically (and thus not at all, if ThisType::adapt() is
502  // never called.
503 
504  if (!adaptationManager_) {
505  // restriction/prolongation operator
506  restrictProlong_ = new RestrictionProlongationType(oldSolution_);
507 
508  // adaptation manager
509  adaptationManager_ = new AdaptationManagerType(grid_, *restrictProlong_);
510  }
511 
512  // adaptation and load balancing
513  adaptationManager_->adapt();
514  if (adaptationManager_->loadBalance()) {
515  // TODO: re-initialize stuff as needed.
516  }
517  }
518 
520  virtual int output()
521  {
522  // write checkpoint in order to be able to restart after a crash
523  checkPointer_.write(timeProvider_);
524 
525  if (!dataOutput_) {
526  // NOTE: this should allocated dynamically, otherwise a
527  // derived class has problems to define completely different
528  // IO-schemes Also DataOutputType likes to already generate
529  // some files during construction, so make sure this never happens
530  dataOutput_ = new DataOutputType(grid_, ioTuple_, timeProvider_, DataOutputParameters());
531  }
532 
533  if (!dataOutput_->willWrite(timeProvider_)) {
534  return -1;
535  }
536 
537  dataOutput_->write(timeProvider_);
538 
539  return dataOutput_->writeStep() - 1;
540  }
541 
543  virtual bool converged() const
544  {
545  return converged_;
546  }
547 
549  virtual double residual() const
550  {
551  assert(0);
552  return -1;
553  }
554 
562  virtual double error() const
563  {
564  // can also use H1-norm
565  typedef Dune::Fem::L2Norm<GridPartType> NormType;
566 
567  // the DiscreteFunctionSpaceAdapter sets the order per default
568  // to 111 == \infty. We set therefore the order just high
569  // enough that we see the asymptotic error. If the polynomial
570  // order is D, then the error should decay with (h^D). In
571  // principle it should thus suffice to use a quadrature of
572  // degree D.
573  NormType norm(gridPart_, 2*discreteSpace_.order()+2);
574  return norm.distance(initialValue_, solution_);
575  }
576 
577  virtual size_t size() const
578  {
579  // NOTE: slaveDofs.size() is always one TOO LARGE.
580  size_t numberOfDofs = discreteSpace_.blockMapper().size() - discreteSpace_.slaveDofs().size() + 1;
581 
582  numberOfDofs = grid_.comm().sum(numberOfDofs);
583 
584  return numberOfDofs;
585  }
586 
587  protected:
588  GridType& grid_; // hierarchical grid
589  const TimeProviderType& timeProvider_; // maybe change to TimeView later ...
590  DiscreteModelType implicitModel_; // new time-step
591  ExplicitModelType explicitModel_; // old time-step
592  std::string name_;
593 
594  GridPartType& gridPart_; // grid part(view), here the leaf grid the discrete space is build with
595 
596  const DiscreteFunctionSpaceType& discreteSpace_; // discrete function space
597  InitialValueType initialValue_;
598  RHSFunctionalType rhsFunctional_;
599  DiscreteFunctionType& solution_; // the unknown
600  DiscreteFunctionType oldSolution_; // the solution from the previous timestep
601  DiscreteFunctionType residual_; // initial residual
602  DiscreteFunctionType update_; // distance to solution
603 
604  EstimatorType estimator_; // residual error estimator
605  MarkingStrategyType markingStrategy_;
606 
607  InitialEstimatorType initialEstimator_;
608  InitialMarkingStrategyType initialMarkingStrategy_;
609 
610  RestrictionProlongationType *restrictProlong_; // local restriction/prolongation object
611  AdaptationManagerType *adaptationManager_; // adaptation manager handling adaptation
612 
613  ConstraintsOperatorType constraints_; // dirichlet boundary constraints
614 
615  ImplicitOperatorType implicitOperator_; // implicit non-linear operator
616  ExplicitOperatorType explicitOperator_; // explicit operator
617 
618  LinearOperatorType linearOperator_; // the linear operator (i.e. jacobian of the operator)
619 
620  LinearSolverParameterType solverParams_; // the Solver Parameters from Dune::Fem
621  bool converged_ = false; // check whether solver has converged
622 
623  EmptyConstraintsType emptyBlockConstraints_;
624 
625  mutable int sequence_; // sequence number
626 
627  IOTupleType ioTuple_; // tuple with pointers
628  DataOutputType *dataOutput_; // data output class
629  CheckPointerType checkPointer_;
630 
631  };
632 
638  template<class DiscreteFunction,
639  class TimeProvider,
640  class ImplicitModel,
641  class ExplicitModel,
642  class InitialValue,
643  class RHSFunctional,
644  template<class> class QuadratureTraits>
645  std::enable_if_t<IsLinearFunctional<RHSFunctional>::value,
646  ParabolicFemScheme<DiscreteFunction,
647  TimeProvider,
648  ImplicitModel,
649  ExplicitModel,
650  InitialValue,
651  RHSFunctional,
653  parabolicFemScheme(DiscreteFunction& solution,
654  const TimeProvider& timeProvider,
655  const ImplicitModel& implicitModel,
656  const ExplicitModel& explicitModel,
657  const InitialValue& initialValue,
658  const RHSFunctional& rhsFunctional,
660  const std::string& name = "acfem.schemes.parabolic")
661  {
662  typedef ParabolicFemScheme<DiscreteFunction,
663  TimeProvider,
664  ImplicitModel,
665  ExplicitModel,
666  InitialValue,
667  RHSFunctional,
669  ReturnType;
670 
671  return ReturnType(solution,
672  timeProvider,
673  implicitModel,
674  explicitModel,
675  initialValue,
676  rhsFunctional,
677  name);
678  }
679 
681  template<class DiscreteFunction,
682  class TimeProvider,
683  class ImplicitModel,
684  class ExplicitModel,
685  class InitialValue,
686  template<class> class QuadratureTraits>
687  auto
688  parabolicFemScheme(DiscreteFunction& solution,
689  const TimeProvider& timeProvider,
690  const ImplicitModel& implicitModel,
691  const ExplicitModel& explicitModel,
692  const InitialValue& initialValue,
694  const std::string& name = "acfem.schemes.parabolic")
695  {
696  typedef ParabolicFemScheme<DiscreteFunction,
697  TimeProvider,
698  ImplicitModel,
699  ExplicitModel,
700  InitialValue,
703  ReturnType;
704 
705  return ReturnType(solution,
706  timeProvider,
707  implicitModel,
708  explicitModel,
709  initialValue,
710  zeroFunctional(solution.space()),
711  name);
712  }
713 
715  template<class DiscreteFunction,
716  class TimeProvider,
717  class ImplicitModel,
718  class ExplicitModel,
719  class InitialValue,
720  class RHSFunctional>
721  std::enable_if_t<IsLinearFunctional<RHSFunctional>::value,
722  ParabolicFemScheme<DiscreteFunction,
723  TimeProvider,
724  ImplicitModel,
725  ExplicitModel,
726  InitialValue,
727  RHSFunctional,
728  DefaultQuadratureTraits> >
729  parabolicFemScheme(DiscreteFunction& solution,
730  const TimeProvider& timeProvider,
731  const ImplicitModel& implicitModel,
732  const ExplicitModel& explicitModel,
733  const InitialValue& initialValue,
734  const RHSFunctional& rhsFunctional,
735  const std::string& name = "acfem.schemes.parabolic")
736  {
737  typedef ParabolicFemScheme<DiscreteFunction,
738  TimeProvider,
739  ImplicitModel,
740  ExplicitModel,
741  InitialValue,
742  RHSFunctional,
744  ReturnType;
745 
746  return ReturnType(solution,
747  timeProvider,
748  implicitModel,
749  explicitModel,
750  initialValue,
751  rhsFunctional,
752  name);
753  }
754 
756  template<class DiscreteFunction,
757  class TimeProvider,
758  class ImplicitModel,
759  class ExplicitModel,
760  class InitialValue>
761  auto
762  parabolicFemScheme(DiscreteFunction& solution,
763  const TimeProvider& timeProvider,
764  const ImplicitModel& implicitModel,
765  const ExplicitModel& explicitModel,
766  const InitialValue& initialValue,
767  const std::string& name = "acfem.schemes.parabolic")
768  {
769  typedef ParabolicFemScheme<DiscreteFunction,
770  TimeProvider,
771  ImplicitModel,
772  ExplicitModel,
773  InitialValue,
776  ReturnType;
777 
778  return ReturnType(solution,
779  timeProvider,
780  implicitModel,
781  explicitModel,
782  initialValue,
783  zeroFunctional(solution.space()),
784  name);
785  }
786 
788 
790 
791  } // ACFem
792 
793 } // Dune
794 
795 #endif // __PARABOLIC_FEMSCHEME_HH__
Potentially overwrite some parameters.
Definition: dataoutput.hh:37
A class defining an elliptic operator.
Definition: ellipticoperator.hh:87
The zero functional.
Definition: zero.hh:24
Residual estimator for the heat equation.
Definition: parabolicestimator.hh:68
RangeFieldType estimate(const DiscreteFunctionType &uh)
calculate estimator
Definition: parabolicestimator.hh:224
Basic parabolic fem-scheme class.
Definition: parabolicfemscheme.hh:93
virtual std::string name() const
name of the Fem Scheme
Definition: parabolicfemscheme.hh:343
virtual double timeEstimate()
return the most recent time estimate
Definition: parabolicfemscheme.hh:478
virtual void adapt()
do the adaptation for a given marking
Definition: parabolicfemscheme.hh:494
virtual bool converged() const
check whether solver has converged
Definition: parabolicfemscheme.hh:543
InitialValueType ExactSolutionFunctionType
adapter to turn exact solution into a grid function (for visualization)
Definition: parabolicfemscheme.hh:191
DirichletConstraints< DiscreteFunctionSpaceType, DiscreteModelType > ConstraintsOperatorType
type of Dirichlet constraints
Definition: parabolicfemscheme.hh:159
DiscreteModelType::FunctionSpaceType FunctionSpaceType
type of function space (scalar functions, )
Definition: parabolicfemscheme.hh:132
DataOutput< GridType, IOTupleType > DataOutputType
type of data writer (produces VTK data)
Definition: parabolicfemscheme.hh:197
virtual double error() const
Calculate L2/H1 error.
Definition: parabolicfemscheme.hh:562
ParabolicFemScheme(DiscreteFunctionType &solution, const TimeProviderType &timeProvider, const ImplicitModelType &implicitModel, const ExplicitModelType &explicitModel, const InitialValueType &initialValue, const RHSFunctionalType &rhsFunctional, const std::string name="heat")
Constructor.
Definition: parabolicfemscheme.hh:224
TimeProvider TimeProviderType
access to the simulation time and time-step
Definition: parabolicfemscheme.hh:108
virtual void next()
Close the current time-step.
Definition: parabolicfemscheme.hh:361
MarkingStrategy< GridPartType > MarkingStrategyType
type of marking strategy for space adaptivity
Definition: parabolicfemscheme.hh:180
virtual int output()
data I/O
Definition: parabolicfemscheme.hh:520
virtual void initialize()
initialize the solution
Definition: parabolicfemscheme.hh:330
virtual bool mark(const double tolerance)
mark elements for adaptation
Definition: parabolicfemscheme.hh:466
Dune::Fem::CheckPointer< GridType > CheckPointerType
type of check-pointer (dumps unaltered simulation data)
Definition: parabolicfemscheme.hh:200
DifferentiableEllipticOperator< LinearOperatorType, DiscreteModelType, const ConstraintsOperatorType &, QuadratureTraits > ImplicitOperatorType
define differential operator, implicit part
Definition: parabolicfemscheme.hh:164
EllipticOperator< ExplicitModelType, DiscreteFunctionType, DiscreteFunctionType, EmptyConstraintsType, QuadratureTraits > ExplicitOperatorType
explicit part of differential operator.
Definition: parabolicfemscheme.hh:170
ParabolicEulerEstimator< DiscreteFunctionType, TimeProviderType, DiscreteModelType, ExplicitModelType > EstimatorType
type of error estimator
Definition: parabolicfemscheme.hh:177
InitialValue InitialValueType
Initial value.
Definition: parabolicfemscheme.hh:127
MarkingStrategy< GridPartType > InitialMarkingStrategyType
Initial marking.
Definition: parabolicfemscheme.hh:188
virtual void linearSolve(DiscreteFunctionType &rhs, bool forceMatrixAssembling)
Perform only one step of the Newton scheme for the affine-linear case.
Definition: parabolicfemscheme.hh:417
Fem::NewtonInverseOperator< LinearOperatorType, LinearInverseOperatorType > NonLinearInverseOperatorType
Non-linear solver.
Definition: parabolicfemscheme.hh:146
Dune::Fem::RestrictProlongDefault< DiscreteFunctionType > RestrictionProlongationType
type of restriction/prolongation projection for adaptive simulations (use default here,...
Definition: parabolicfemscheme.hh:150
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
type of the discrete function space
Definition: parabolicfemscheme.hh:105
virtual double estimate()
calculate error estimator
Definition: parabolicfemscheme.hh:472
TrueErrorEstimator< InitialValueType, Dune::Fem::L2Norm< GridPartType > > InitialEstimatorType
intial estimator
Definition: parabolicfemscheme.hh:185
std::tuple< DiscreteFunctionType * > IOTupleType
type of input/output tuple
Definition: parabolicfemscheme.hh:194
DiscreteFunctionType::GridPartType GridPartType
type of the grid view
Definition: parabolicfemscheme.hh:102
virtual size_t size() const
return some measure about the number of DOFs in use
Definition: parabolicfemscheme.hh:577
Dune::Fem::AdaptationManager< GridType, RestrictionProlongationType > AdaptationManagerType
type of adaptation manager handling adapation and DoF compression
Definition: parabolicfemscheme.hh:153
virtual void solve(bool forceMatrixAssembling=true)
solve the system
Definition: parabolicfemscheme.hh:367
DiscreteFunction DiscreteFunctionType
Type of the discrete solution function.
Definition: parabolicfemscheme.hh:96
EmptyBlockConstraints< DiscreteFunctionSpaceType > EmptyConstraintsType
empty constraints for the explicit operator (old solution is already constrained)
Definition: parabolicfemscheme.hh:156
virtual double residual() const
calculate residual (in small l^2)
Definition: parabolicfemscheme.hh:549
virtual void nonLinearSolve(DiscreteFunctionType &rhs)
Run the full Newton-scheme ...
Definition: parabolicfemscheme.hh:399
DiscreteFunctionType::GridType GridType
type of hierarchic grid
Definition: parabolicfemscheme.hh:99
ImplicitModel ImplicitModelType
type of the mathematical model
Definition: parabolicfemscheme.hh:123
"estimator" which return the "true" error with respect to some given function in some standard norm.
Definition: trueerrorestimator.hh:30
RangeFieldType estimate(const DiscreteFunctionType &uh)
calculate estimator
Definition: trueerrorestimator.hh:66
constexpr decltype(auto) asExpression(T &&t)
Return a non-closure expression as is.
Definition: interface.hh:122
std::enable_if_t< IsLinearFunctional< RHSFunctional >::value, ParabolicFemScheme< DiscreteFunction, TimeProvider, ImplicitModel, ExplicitModel, InitialValue, RHSFunctional, QuadratureTraits > > parabolicFemScheme(DiscreteFunction &solution, const TimeProvider &timeProvider, const ImplicitModel &implicitModel, const ExplicitModel &explicitModel, const InitialValue &initialValue, const RHSFunctional &rhsFunctional, const QuadratureTraits< typename DiscreteFunction::DiscreteFunctionSpaceType::GridPartType > &quadTraits, const std::string &name="acfem.schemes.parabolic")
Basic parabolic fem-scheme class.
Definition: parabolicfemscheme.hh:653
DefaultQuadratureTraits< GridPart > QuadratureTraits
Traits class with ordinary quadratures in the bulk and on the skeleton.
Definition: quadrature.hh:132
ModelIntrospection::Traits< Model > ModelTraits
Traits class for models.
Definition: modeltraits.hh:898
Helper traits-class, defining likely quadrature types.
Definition: quadrature.hh:23
Select one appropriate (linear) solver depending on whether the model is symmetric and/or semidefinit...
Definition: solverselector.hh:91
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 2, 22:35, 2024)