ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
wca.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19/** \file
20 *
21 * Implementation of \ref wca.hpp
22 */
23#include "wca.hpp"
24
25#ifdef WCA
27
28#include <cmath>
29#include <stdexcept>
30
31WCA_Parameters::WCA_Parameters(double epsilon, double sigma)
32 : eps{epsilon}, sig{sigma} {
33 if (epsilon < 0.) {
34 throw std::domain_error("WCA parameter 'epsilon' has to be >= 0");
35 }
36 if (sigma < 0.) {
37 throw std::domain_error("WCA parameter 'sigma' has to be >= 0");
38 }
39 if (sigma != 0.) {
40 cut = sigma * std::pow(2., 1. / 6.);
41 }
42}
43
44#endif /* ifdef WCA */
Various procedures concerning interactions between particles.
WCA_Parameters()=default
Routines to calculate the Weeks-Chandler-Andersen potential between particle pairs.