Multi Resolution Molecular Dynamics 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
RestoreH5MD.hpp
Go to the documentation of this file.
1// Copyright 2024 Sebastian Eibl
2// Copyright 2026 Julian Friedrich Hille
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// https://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include <string>
19
20#include "cmake.hpp"
21#include "data/Atoms.hpp"
22#include "data/Subdomain.hpp"
23#include "hdf5.hpp"
24
25namespace mrmd::io
26{
33{
34public:
35 explicit RestoreH5MD(const std::string& particleGroupName = "atoms")
36 : particleGroupName_(particleGroupName)
37 {
38 }
39
40 void restore(const std::string& filename,
41 data::Subdomain& subdomain,
42 data::Atoms& atoms,
43 const idx_t frameIndex = -1);
44
45 bool restorePos = true;
46 bool restoreVel = true;
47 bool restoreForce = true;
48 bool restoreType = true;
49 bool restoreMass = true;
50 bool restoreCharge = true;
52
53 std::string posDataset = "position";
54 std::string velDataset = "velocity";
55 std::string forceDataset = "force";
56 std::string typeDataset = "type";
57 std::string massDataset = "mass";
58 std::string chargeDataset = "charge";
59 std::string relativeMassDataset = "relativeMass";
60
61private:
62 template <typename T>
63 void read(hid_t fileId,
64 const std::string& dataset,
65 std::vector<T>& data,
66 const idx_t frameIndex);
67
68 std::string particleGroupName_;
69};
70
71} // namespace mrmd::io
bool restoreVel
Definition RestoreH5MD.hpp:46
bool restorePos
Definition RestoreH5MD.hpp:45
std::string velDataset
Definition RestoreH5MD.hpp:54
RestoreH5MD(const std::string &particleGroupName="atoms")
Definition RestoreH5MD.hpp:35
std::string chargeDataset
Definition RestoreH5MD.hpp:58
void restore(const std::string &filename, data::Subdomain &subdomain, data::Atoms &atoms, const idx_t frameIndex=-1)
Definition RestoreH5MD.cpp:224
bool restoreMass
Definition RestoreH5MD.hpp:49
std::string relativeMassDataset
Definition RestoreH5MD.hpp:59
bool restoreCharge
Definition RestoreH5MD.hpp:50
std::string massDataset
Definition RestoreH5MD.hpp:57
bool restoreType
Definition RestoreH5MD.hpp:48
std::string typeDataset
Definition RestoreH5MD.hpp:56
bool restoreForce
Definition RestoreH5MD.hpp:47
bool restoreRelativeMass
Definition RestoreH5MD.hpp:51
std::string forceDataset
Definition RestoreH5MD.hpp:55
std::string posDataset
Definition RestoreH5MD.hpp:53
All fundamental data containers used in MRMD.
DeviceAtoms Atoms
Definition Atoms.hpp:177
Save and load simulation data.
int hid_t
Definition hdf5.hpp:72
int64_t idx_t
Definition datatypes.hpp:91
Axis-aligned simulation box with a surrounding ghost layer.
Definition Subdomain.hpp:46