MRMD 0.4.0
Multi Resolution Molecular Dynamics
Loading...
Searching...
No Matches
Coulomb.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
17#include "data/Atoms.hpp"
18#include "datatypes.hpp"
19#include "util/math.hpp"
20
21namespace mrmd
22{
23namespace action
24{
25namespace impl
26{
28{
29public:
30 KOKKOS_INLINE_FUNCTION
31 real_t computeForce(const real_t& distSqr, const real_t q1, const real_t q2) const
32 {
33 real_t prefac = 138.935458_r * q1 * q2;
34 return prefac / distSqr;
35 }
36
37 KOKKOS_INLINE_FUNCTION
38 real_t computeEnergy(const real_t& distSqr, const real_t q1, const real_t q2) const
39 {
40 auto r = std::sqrt(distSqr);
41 real_t prefac = 138.935458_r * q1 * q2;
42 return prefac / r;
43 }
44};
45} // namespace impl
46
47} // namespace action
48} // namespace mrmd
Definition Coulomb.hpp:28
KOKKOS_INLINE_FUNCTION real_t computeEnergy(const real_t &distSqr, const real_t q1, const real_t q2) const
Definition Coulomb.hpp:38
KOKKOS_INLINE_FUNCTION real_t computeForce(const real_t &distSqr, const real_t q1, const real_t q2) const
Definition Coulomb.hpp:31
Definition BerendsenBarostat.cpp:18
double real_t
Definition datatypes.hpp:99