StandardProblemIteration.hpp 1.49 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#pragma once

#include <string>

#include "Flag.hpp"
#include "ProblemIterationInterface.hpp"

namespace AMDiS
{
  // forward declarations
  class AdaptInfo;
  class ProblemStatBase;
13

14
  /// A master problem for a single non coupled problem.
15
16
  class StandardProblemIteration
      : public virtual ProblemIterationInterface
17
18
19
  {
  public:
    /// constructor
20
    explicit StandardProblemIteration(ProblemStatBase& prob)
21
      : problem_(prob)
22
23
24
25
26
27
28
29
30
31
32
33
    {}

    /// Implementation of \ref ProblemIterationIterface::beginIteration()
    virtual void beginIteration(AdaptInfo& adaptInfo) override;

    /// Implementation of \ref ProblemIterationInterface::oneIteration()
    virtual Flag oneIteration(AdaptInfo& adaptInfo, Flag toDo) override;

    /// Implementation of \ref ProblemIterationInterface::endIteration()
    virtual void endIteration(AdaptInfo& adaptInfo) override;

    /// Returns the name of the problem.
Praetorius, Simon's avatar
Praetorius, Simon committed
34
    virtual std::string const& name() const override;
35

Praetorius, Simon's avatar
Praetorius, Simon committed
36
    virtual int numProblems() const override
37
38
39
40
41
    {
      return 1;
    }

    /// Return the managed ProblemStat \ref problem, by number
Praetorius, Simon's avatar
Praetorius, Simon committed
42
    virtual ProblemStatBase& problem(int number = 0) override;
43
44

    /// Return the managed ProblemStat \ref problem, by name
Praetorius, Simon's avatar
Praetorius, Simon committed
45
    virtual ProblemStatBase& problem(std::string const& name) override;
46

47
48
49
50
51
52
  protected:
    /// Nested assemblage and mesh adaption.
    Flag buildAndAdapt(AdaptInfo& adaptInfo, Flag toDo);

  protected:
    /// The problem to solve.
53
    ProblemStatBase& problem_;
54
55
56
  };

} // end namespace AMDiS