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
18
#include "
communication/AccumulateForce.hpp
"
19
#include "
communication/GhostExchange.hpp
"
20
#include "
communication/PeriodicMapping.hpp
"
21
#include "
communication/UpdateGhostAtoms.hpp
"
22
#include "
data/Atoms.hpp
"
23
#include "
data/Subdomain.hpp
"
24
25
namespace
mrmd
26
{
27
namespace
communication
28
{
32
class
GhostLayer
33
{
34
private
:
35
IndexView
correspondingRealAtom_;
36
impl::GhostExchange ghostExchange_;
37
38
public
:
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
56
void
contributeBackGhostToReal
(
data::Atoms
& atoms)
57
{
58
impl::AccumulateForce::ghostToReal(atoms, correspondingRealAtom_);
59
}
60
};
61
62
}
// namespace communication
63
}
// namespace mrmd
AccumulateForce.hpp
Atoms.hpp
GhostExchange.hpp
PeriodicMapping.hpp
Subdomain.hpp
UpdateGhostAtoms.hpp
mrmd::communication::GhostLayer
High-level interface for managing ghost atoms at the periodic boundaries.
Definition
GhostLayer.hpp:33
mrmd::communication::GhostLayer::createGhostAtoms
void createGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition
GhostLayer.hpp:44
mrmd::communication::GhostLayer::updateGhostAtoms
void updateGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition
GhostLayer.hpp:49
mrmd::communication::GhostLayer::exchangeRealAtoms
void exchangeRealAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition
GhostLayer.hpp:39
mrmd::communication::GhostLayer::contributeBackGhostToReal
void contributeBackGhostToReal(data::Atoms &atoms)
Definition
GhostLayer.hpp:56
mrmd::data::impl::GeneralAtoms::size
KOKKOS_INLINE_FUNCTION auto size() const
Definition
Atoms.hpp:85
mrmd::communication
Everything related to ghost particles and periodic boundary conditions.
mrmd::data::Atoms
DeviceAtoms Atoms
Definition
Atoms.hpp:177
mrmd
Top-level namespace of MRMD.
mrmd::IndexView
Kokkos::View< idx_t * > IndexView
Definition
datatypes.hpp:153
mrmd::data::Subdomain
Axis-aligned simulation box with a surrounding ghost layer.
Definition
Subdomain.hpp:46
mrmd
communication
GhostLayer.hpp
Generated by
1.15.0