StandardProblemIteration.hpp 1.43 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
    {}

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

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

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

    /// Returns the name of the problem.
34
    std::string const& name() const override;
35

36
    int numProblems() const override
37
38
39
40
41
    {
      return 1;
    }

    /// Return the managed ProblemStat \ref problem, by number
42
    ProblemStatBase& problem(int number = 0) override;
43
44

    /// Return the managed ProblemStat \ref problem, by name
45
    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