ProblemTimeInterface.h 3.02 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file ProblemTimeInterface.h */

#ifndef AMDIS_PROBLEMTIMEINTERFACE_H
#define AMDIS_PROBLEMTIMEINTERFACE_H

#include "Flag.h"

namespace AMDiS {

  class AdaptInfo;

  // ============================================================================
  // ===== class ProblemTimeInterface ===========================================
  // ============================================================================

  /**
   * \ingroup Problem 
   *
   * \brief
   * Interface for time dependent problems. Concrete problems must override
   * all pure virtual methods. 
   */
  class ProblemTimeInterface
  {
  public:
    virtual ~ProblemTimeInterface() {};

    /** \brief
     * Executes all needed operations when the simulation time changes.
     */
    virtual void setTime(AdaptInfo *adaptInfo) = 0;

    /** \brief
     * Called at the beginning of each timestep
     */
    virtual void initTimestep(AdaptInfo *adaptInfo) = 0;

    /** \brief
     * Called at the end of each timestep.
     */
    virtual void closeTimestep(AdaptInfo *adaptInfo) = 0;

    /** \brief
     * Solves the initial problem.
     */
    virtual void solveInitialProblem(AdaptInfo *adaptInfo) = 0;  

    /** \brief
     * Solves the initial problem.
     */
    virtual void transferInitialSolution(AdaptInfo *adaptInfo) = 0;  

    /** \brief
     * Function that serializes the problem plus information about the iteration.
     */
75
    virtual void serialize(std::ostream &out) = 0;
76
77
78
79

    /** \brief
     * Function that deserializes the problem plus information about the iteration.
     */
80
    virtual void deserialize(std::istream &in) = 0;
81
82
83
84
85
  };

}

#endif