forked from glotzerlab/hoomd-component-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathExamplePairPotential.h
75 lines (58 loc) · 2.25 KB
/
ExamplePairPotential.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright (c) 2009-2025 The Regents of the University of Michigan.
// Part of HOOMD-blue, released under the BSD 3-Clause License.
#pragma once
#include <hoomd/VectorMath.h>
#include <hoomd/hpmc/PairPotential.h>
#include <pybind11/pybind11.h>
namespace hoomd
{
namespace hpmc
{
/** Example pair potential for use with HPMC simulations.
TODO: Rename the "ExamplePairPotential" to a class name that represents your potential.
"ExamplePair" appears many times in C++, CMakeLists, and Python files. Consider using a global
search and replace tool.
*/
class ExamplePairPotential : public PairPotential
{
public:
ExamplePairPotential(std::shared_ptr<SystemDefinition> sysdef);
virtual ~ExamplePairPotential() { }
virtual LongReal energy(const LongReal r_squared,
const vec3<LongReal>& r_ij,
const unsigned int type_i,
const quat<LongReal>& q_i,
const LongReal charge_i,
const unsigned int type_j,
const quat<LongReal>& q_j,
const LongReal charge_j) const;
/// Compute the non-additive cuttoff radius
LongReal computeRCutNonAdditive(unsigned int type_i, unsigned int type_j) const;
/// Set type-pair-dependent parameters to the potential.
void setParamsPython(pybind11::tuple particle_types, pybind11::dict params);
/// Get type-pair-dependent parameters.
pybind11::dict getParamsPython(pybind11::tuple particle_types);
protected:
/// per-type-pair parameters
struct ParamType
{
ParamType() { }
/// Construct a parameter set from a dictionary.
ParamType(pybind11::dict v);
/// Convert a parameter set to a dictionary.
pybind11::dict asDict();
// TODO: rename or add parameters as needed
LongReal m_A;
LongReal m_B;
LongReal m_r_cut;
};
/// Parameters per type pair.
std::vector<ParamType> m_params;
};
namespace detail
{
//! Export the ExampleUpdater class to python
void export_ExamplePairPotential(pybind11::module& m);
} // end namespace detail
} // end namespace hpmc
} // end namespace hoomd