AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
ProblemInstat.inc.hpp
1#pragma once
2
3#include <string>
4#include <vector>
5
6#include <amdis/AdaptInfo.hpp>
7
8namespace AMDiS {
9
10template <class Traits>
12{
13 AMDIS_FUNCNAME("ProblemInstat::transferInitialSolution()");
14
15 test_exit(adaptInfo.time() == adaptInfo.startTime(),
16 "after initial solution: time != start time");
17 problemStat_->writeFiles(adaptInfo, true);
18}
19
20
21template <class Traits>
23{
24 bool force = (adaptInfo.time() >= adaptInfo.endTime());
25 problemStat_->writeFiles(adaptInfo, force);
26}
27
28
29template <class Traits>
31{
32 // create vector for old solution
33 if (initFlag.isSet(INIT_UH_OLD))
34 createUhOld();
35}
36
37
38template <class Traits>
40{
41 AMDIS_FUNCNAME("ProblemInstat::createUhOld()");
42
43 if (oldSolution_)
44 warning("oldSolution already created\n");
45 else // create oldSolution
46 oldSolution_.reset(new SolutionVector(*problemStat_->solutionVector()));
47}
48
49
50template <class Traits>
52{
53 if (oldSolution_)
54 *oldSolution_ = *problemStat_->solutionVector();
55}
56
57} // end namespace AMDiS
Holds adapt parameters and infos about the problem.
Definition: AdaptInfo.hpp:26
double endTime() const
Returns endTime_.
Definition: AdaptInfo.hpp:552
double startTime() const
Returns startTime_.
Definition: AdaptInfo.hpp:546
double const & time() const
Gets time_.
Definition: AdaptInfo.hpp:464
The Flag class encapsulates flags which represents simple information. Used e.g. while mesh traversal...
Definition: Flag.hpp:14
constexpr bool isSet(Flag const &f) const
Checks whether all set bits of f.flags_ are set in flags_ too.
Definition: Flag.hpp:156
void closeTimestep(AdaptInfo &adaptInfo) override
Implementation of ProblemTimeInterface::closeTimestep().
Definition: ProblemInstat.inc.hpp:22
void createUhOld()
Used in initialize() to create the oldSolution_.
Definition: ProblemInstat.inc.hpp:39
void initTimestep(AdaptInfo &adaptInfo) override
Implementation of ProblemTimeInterface::initTimestep().
Definition: ProblemInstat.inc.hpp:51
void initialize(Flag initFlag=INIT_NOTHING)
Initialisation of the problem.
Definition: ProblemInstat.inc.hpp:30
void transferInitialSolution(AdaptInfo &adaptInfo) override
Implementation of ProblemTimeInterface::transferInitialSolution().
Definition: ProblemInstat.inc.hpp:11