Multi Resolution Molecular Dynamics 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
GhostLayer.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
22#include "data/Atoms.hpp"
23#include "data/Subdomain.hpp"
24
25namespace mrmd
26{
27namespace communication
28{
33{
34private:
35 IndexView correspondingRealAtom_;
36 impl::GhostExchange ghostExchange_;
37
38public:
39 void exchangeRealAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
40 {
41 impl::PeriodicMapping::mapIntoDomain(atoms, subdomain);
42 }
43
44 void createGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
45 {
46 correspondingRealAtom_ = ghostExchange_.createGhostAtomsXYZ(atoms, subdomain);
47 }
48
49 void updateGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
50 {
51 assert(correspondingRealAtom_.extent(0) >= atoms.size());
52
53 impl::UpdateGhostAtoms::updateOnlyPos(atoms, correspondingRealAtom_, subdomain);
54 }
55
57 {
58 impl::AccumulateForce::ghostToReal(atoms, correspondingRealAtom_);
59 }
60};
61
62} // namespace communication
63} // namespace mrmd
High-level interface for managing ghost atoms at the periodic boundaries.
Definition GhostLayer.hpp:33
void createGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:44
void updateGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:49
void exchangeRealAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:39
void contributeBackGhostToReal(data::Atoms &atoms)
Definition GhostLayer.hpp:56
KOKKOS_INLINE_FUNCTION auto size() const
Definition Atoms.hpp:85
Everything related to ghost particles and periodic boundary conditions.
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