MRMD 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{
27
29{
30public:
31 explicit RestoreH5MD(const std::string& particleGroupName = "atoms")
32 : particleGroupName_(particleGroupName)
33 {
34 }
35
36 void restore(const std::string& filename,
37 data::Subdomain& subdomain,
38 data::Atoms& atoms,
39 const idx_t frameIndex = -1);
40
41 bool restorePos = true;
42 bool restoreVel = true;
43 bool restoreForce = true;
44 bool restoreType = true;
45 bool restoreMass = true;
46 bool restoreCharge = true;
48
49 std::string posDataset = "position";
50 std::string velDataset = "velocity";
51 std::string forceDataset = "force";
52 std::string typeDataset = "type";
53 std::string massDataset = "mass";
54 std::string chargeDataset = "charge";
55 std::string relativeMassDataset = "relativeMass";
56
57private:
58 template <typename T>
59 void read(hid_t fileId,
60 const std::string& dataset,
61 std::vector<T>& data,
62 const idx_t frameIndex);
63
64 std::string particleGroupName_;
65};
66
67} // namespace mrmd::io
Data structure for storing information about atoms on the host and the device.
Definition Atoms.hpp:35
Definition RestoreH5MD.hpp:29
bool restoreVel
Definition RestoreH5MD.hpp:42
bool restorePos
Definition RestoreH5MD.hpp:41
std::string velDataset
Definition RestoreH5MD.hpp:50
RestoreH5MD(const std::string &particleGroupName="atoms")
Definition RestoreH5MD.hpp:31
std::string chargeDataset
Definition RestoreH5MD.hpp:54
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:45
std::string relativeMassDataset
Definition RestoreH5MD.hpp:55
bool restoreCharge
Definition RestoreH5MD.hpp:46
std::string massDataset
Definition RestoreH5MD.hpp:53
bool restoreType
Definition RestoreH5MD.hpp:44
std::string typeDataset
Definition RestoreH5MD.hpp:52
bool restoreForce
Definition RestoreH5MD.hpp:43
bool restoreRelativeMass
Definition RestoreH5MD.hpp:47
std::string forceDataset
Definition RestoreH5MD.hpp:51
std::string posDataset
Definition RestoreH5MD.hpp:49
Definition DumpCSV.cpp:25
int hid_t
Definition hdf5.hpp:72
int64_t idx_t
Definition datatypes.hpp:91
|X|O|OOOOOOOOOO |X|O|OOOOOOOOOO |X|O+-------— <– minInnerCorner |X|OOOOOOOOOOOO |X+---------— <– minC...
Definition Subdomain.hpp:38