Multi Resolution Molecular Dynamics 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
MultiResGhostLayer.hpp
Go to the documentation of this file.
1// Copyright 2024 Sebastian Eibl
2// Copyright 2026 Julian Friedrich Hille
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16
21#include "data/Atoms.hpp"
22#include "data/Molecules.hpp"
23#include "data/Subdomain.hpp"
24
25namespace mrmd
26{
27namespace communication
28{
34{
35private:
36 IndexView correspondingRealAtom_;
37 impl::MultiResPeriodicGhostExchange ghostExchange_;
38
39public:
41 data::Atoms& atoms,
42 const data::Subdomain& subdomain)
43 {
44 realAtomsExchange(subdomain, molecules, atoms);
45 }
46
48 data::Atoms& atoms,
49 const data::Subdomain& subdomain)
50 {
51 correspondingRealAtom_ = ghostExchange_.createGhostAtomsXYZ(molecules, atoms, subdomain);
52 }
53
54 void updateGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
55 {
56 assert(correspondingRealAtom_.extent(0) >= atoms.size());
57
58 impl::UpdateGhostAtoms::updateOnlyPos(atoms, correspondingRealAtom_, subdomain);
59 }
60
62 {
63 impl::AccumulateForce::ghostToReal(atoms, correspondingRealAtom_);
64 }
65};
66
67} // namespace communication
68} // namespace mrmd
High-level interface for managing ghost atoms at the periodic boundaries in a multi-resolution simula...
Definition MultiResGhostLayer.hpp:34
void exchangeRealAtoms(data::Molecules &molecules, data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:40
void createGhostAtoms(data::Molecules &molecules, data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:47
void updateGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:54
void contributeBackGhostToReal(data::Atoms &atoms)
Definition MultiResGhostLayer.hpp:61
KOKKOS_INLINE_FUNCTION auto size() const
Definition Atoms.hpp:85
Everything related to ghost particles and periodic boundary conditions.
void realAtomsExchange(const data::Subdomain &subdomain, const data::Molecules &molecules, const data::Atoms &atoms)
Intended for single process use.
Definition MultiResRealAtomsExchange.cpp:23
DeviceMolecules Molecules
Definition Molecules.hpp:176
DeviceAtoms Atoms
Definition Atoms.hpp:177
Top-level namespace of MRMD.
Kokkos::View< idx_t * > IndexView
Definition datatypes.hpp:153
Axis-aligned simulation box with a surrounding ghost layer.
Definition Subdomain.hpp:46