MRMD 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//
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{
30{
31private:
32 IndexView correspondingRealAtom_;
34
35public:
37 data::Atoms& atoms,
38 const data::Subdomain& subdomain)
39 {
40 realAtomsExchange(subdomain, molecules, atoms);
41 }
42
44 data::Atoms& atoms,
45 const data::Subdomain& subdomain)
46 {
47 correspondingRealAtom_ = ghostExchange_.createGhostAtomsXYZ(molecules, atoms, subdomain);
48 }
49
50 void updateGhostAtoms(data::Atoms& atoms, const data::Subdomain& subdomain)
51 {
52 assert(correspondingRealAtom_.extent(0) >= atoms.size());
53
54 impl::UpdateGhostAtoms::updateOnlyPos(atoms, correspondingRealAtom_, subdomain);
55 }
56
58 {
59 impl::AccumulateForce::ghostToReal(atoms, correspondingRealAtom_);
60 }
61};
62
63} // namespace communication
64} // namespace mrmd
Definition MultiResGhostLayer.hpp:30
void exchangeRealAtoms(data::Molecules &molecules, data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:36
void createGhostAtoms(data::Molecules &molecules, data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:43
void updateGhostAtoms(data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResGhostLayer.hpp:50
void contributeBackGhostToReal(data::Atoms &atoms)
Definition MultiResGhostLayer.hpp:57
Definition MultiResPeriodicGhostExchange.hpp:62
IndexView createGhostAtomsXYZ(data::Molecules &molecules, data::Atoms &atoms, const data::Subdomain &subdomain)
Definition MultiResPeriodicGhostExchange.cpp:250
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
Definition Molecules.hpp:29
void ghostToReal(data::Atoms &atoms, const IndexView &correspondingRealAtom)
Definition AccumulateForce.cpp:25
void updateOnlyPos(data::Atoms &atoms, const IndexView &correspondingRealAtom, const data::Subdomain &subdomain)
Definition UpdateGhostAtoms.cpp:31
void realAtomsExchange(const data::Subdomain &subdomain, const data::Molecules &molecules, const data::Atoms &atoms)
Intended for single process use.
Definition MultiResRealAtomsExchange.cpp:23
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