votca 2024.2-dev
Loading...
Searching...
No Matches
potentialfunctionlj126.cc
Go to the documentation of this file.
1/*
2 * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
19
20namespace votca {
21namespace csg {
23 double min, double max)
24 : PotentialFunction(name, 2, min, max) {}
25
26double PotentialFunctionLJ126::CalculateF(const double r) const {
27
28 if (r >= min_ && r <= cut_off_) {
29 return lam_(0) / std::pow(r, 12) - lam_(1) / std::pow(r, 6);
30 } else {
31 return 0.0;
32 }
33}
34
35// calculate first derivative w.r.t. ith parameter
36double PotentialFunctionLJ126::CalculateDF(Index i, double r) const {
37
38 if (r >= min_ && r <= cut_off_) {
39
40 switch (i) {
41 case 0:
42 return 1.0 / std::pow(r, 12);
43 case 1:
44 return -1.0 / std::pow(r, 6);
45 }
46 }
47 return 0.0;
48}
49
50// calculate second derivative w.r.t. ith and jth parameters
52
53 return 0.0;
54}
55} // namespace csg
56} // namespace votca
double CalculateD2F(Index i, Index j, double r) const override
PotentialFunctionLJ126(const std::string &name, double min=0.0, double max=10.0)
double CalculateF(double r) const override
double CalculateDF(Index i, double r) const override
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26