netxsimdg
Loading...
Searching...
No Matches
DummyDynamics.cpp
Go to the documentation of this file.
1
9
10#include "include/gridNames.hpp"
11
12#include <string>
13#include <vector>
14
15
16namespace Nextsim {
17
18static const std::vector<std::string> namedFields = { hiceName, ciceName, uName, vName };
19DummyDynamics::DummyDynamics()
20 : IDynamics()
21{
22}
23
24void DummyDynamics::setData(const ModelState::DataMap& ms)
25{
26 IDynamics::setData(ms);
27
28 // Set the data in the kernel arrays.
29 for (const auto& fieldName : namedFields) {
30 kernel.setData(fieldName, ms.at(fieldName));
31 }
32}
33
34void DummyDynamics::update(const TimestepTime& tst)
35{
36 kernel.setData(hiceName, hice.data());
37 kernel.setData(ciceName, cice.data());
38 kernel.setData(uName, uice);
39 kernel.setData(vName, vice);
40
41 kernel.update(tst);
42
43 hice.data() = kernel.getDG0Data(hiceName);
44 cice.data() = kernel.getDG0Data(ciceName);
45 uice = kernel.getDG0Data(uName);
46 vice = kernel.getDG0Data(vName);
47}
48
49}