MRMD 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//
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/Subdomain.hpp"
23
24namespace mrmd
25{
26namespace communication
27{
29{
30private:
31 IndexView correspondingRealAtom_;
32 impl::GhostExchange ghostExchange_;
33
34public:
35 void exchangeRealAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
36 {
38 }
39
40 void createGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
41 {
42 correspondingRealAtom_ = ghostExchange_.createGhostAtomsXYZ(atoms, subdomain);
43 }
44
45 void updateGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
46 {
47 assert(correspondingRealAtom_.extent(0) >= atoms.size());
48
49 impl::UpdateGhostAtoms::updateOnlyPos(atoms, correspondingRealAtom_, subdomain);
50 }
51
53 {
54 impl::AccumulateForce::ghostToReal(atoms, correspondingRealAtom_);
55 }
56};
57
58} // namespace communication
59} // namespace mrmd
Definition GhostLayer.hpp:29
void createGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:40
void updateGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:45
void exchangeRealAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostLayer.hpp:35
void contributeBackGhostToReal(data::Atoms &atoms)
Definition GhostLayer.hpp:52
Definition GhostExchange.hpp:29
IndexView createGhostAtomsXYZ(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition GhostExchange.cpp:171
Data structure for storing information about atoms on the host and the device.
Definition Atoms.hpp:35
KOKKOS_INLINE_FUNCTION auto size() const
Definition Atoms.hpp:85
void ghostToReal(data::Atoms &atoms, const IndexView &correspondingRealAtom)
Definition AccumulateForce.cpp:25
void mapIntoDomain(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition PeriodicMapping.cpp:30
void updateOnlyPos(data::Atoms &atoms, const IndexView &correspondingRealAtom, const data::Subdomain &subdomain)
Definition UpdateGhostAtoms.cpp:31
Definition BerendsenBarostat.cpp:18
Kokkos::View< idx_t * > IndexView
Definition datatypes.hpp:153
|X|O|OOOOOOOOOO |X|O|OOOOOOOOOO |X|O+-------— <– minInnerCorner |X|OOOOOOOOOOOO |X+---------— <– minC...
Definition Subdomain.hpp:38