StandardProblemIteration.h 2.61 KB
Newer Older
1
2
3
4
5
6
7
/******************************************************************************
 *
 * AMDiS - Adaptive multidimensional simulations
 *
 * Copyright (C) 2013 Dresden University of Technology. All Rights Reserved.
 * Web: https://fusionforge.zih.tu-dresden.de/projects/amdis
 *
8
 * Authors:
9
10
11
12
13
14
15
16
17
 * Simon Vey, Thomas Witkowski, Andreas Naumann, Simon Praetorius, et al.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 *
 * This file is part of AMDiS
 *
 * See also license.opensource.txt in the distribution.
18
 *
19
 ******************************************************************************/
20
21


22
23
24
25
26
27

/** \file StandardProblemIteration.h */

#ifndef AMDIS_STANDARDPROBLEMITERATION_H
#define AMDIS_STANDARDPROBLEMITERATION_H

Thomas Witkowski's avatar
Thomas Witkowski committed
28
#include "AMDiS_fwd.h"
29
30
31
32
#include "ProblemIterationInterface.h"

namespace AMDiS {

33
  /// A master problem for a single non coupled problem.
34
  class StandardProblemIteration : public virtual ProblemIterationInterface
35
36
  {
  public:
37
38
39
40
41
42
43
44
    /// constructor
    StandardProblemIteration(ProblemStatBase *prob)
      : problem(prob)
    {}

    virtual ~StandardProblemIteration() {}

    /// Implementation of \ref ProblemIterationIterface::beginIteration()
45
    void beginIteration(AdaptInfo *adaptInfo) override;
46

47
    /// Implementation of \ref ProblemIterationInterface::oneIteration()
48
    Flag oneIteration(AdaptInfo *adaptInfo, Flag toDo) override;
49

50
    /// Implementation of \ref ProblemIterationInterface::endIteration()
51
    void endIteration(AdaptInfo *adaptInfo) override;
52

53
    /// Implementation of \ref ProblemIterationInterface::getNumProblems()
Praetorius, Simon's avatar
Praetorius, Simon committed
54
    int getNumProblems() const override
55
56
    {
      return 1;
57
    }
58

59
    /// Implementation of \ref ProblemIterationInterface::getProblem(int)
60
    ProblemStatBase *getProblem(int number = 0) override
61
    {
62
      return problem;
63
    }
Praetorius, Simon's avatar
Praetorius, Simon committed
64
65
66
67
68
69
    
    /// Implementation of \ref ProblemIterationInterface::getProblem(int)
    ProblemStatBase const* getProblem(int number = 0) const override
    {
      return problem;
    }
70

71
    /// Returns the name of the problem.
Praetorius, Simon's avatar
Praetorius, Simon committed
72
    std::string getName() const override;
73

74
    /// Function that serializes the problem plus information about the iteration.
75
    void serialize(std::ostream &out) override;
76

77
    /// Function that deserializes the problem plus information about the iteration.
78
    void deserialize(std::istream &in) override;
79

80
    /// Nested assemblage and mesh adaption.
81
82
83
    Flag buildAndAdapt(AdaptInfo *adaptInfo, Flag toDo);

  protected:
84
85
86
87
88
    /// The problem to solve.
    ProblemStatBase *problem;

    /// Info level
    static int info;
89
90
91
92
93
94
  };

}

#endif