eOn 3.2.0
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
MinimumImage.cpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: BSD-3-Clause
2
#include "
eon/PbcSimd.h
"
3
#include <minimage.hpp>
4
#include <stdexcept>
5
6
namespace
eonc::pbc
{
7
void
closestDisplacements
(
double
*data,
size_t
coordinates,
8
const
double
*rowMajorCell) {
9
if
(coordinates % 3 != 0)
10
throw
std::invalid_argument(
11
"periodic differences require Cartesian triples"
);
12
if
(coordinates == 0)
13
return
;
14
const
auto
cell = minimage::Cell::from_con(rowMajorCell);
15
for
(
size_t
j = 0; j < coordinates; j += 3) {
16
const
auto
image = cell.displacement_euclidean(
17
{0.0, 0.0, 0.0}, {data[j], data[j + 1], data[j + 2]});
18
for
(
size_t
k = 0; k < 3; ++k)
19
data[j + k] = image[k];
20
}
21
}
22
}
// namespace eonc::pbc
PbcSimd.h
eonc::pbc
Definition
MinimumImage.cpp:6
eonc::pbc::closestDisplacements
void closestDisplacements(double *data, size_t coordinates, const double *rowMajorCell)
Definition
MinimumImage.cpp:7
client
MinimumImage.cpp
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf