PSCF v1.2
Debye.cpp
1/*
2* PSCF - Polymer Self-Consistent Field Theory
3*
4* Copyright 2016 - 2025, The Regents of the University of Minnesota
5* Distributed under the terms of the GNU General Public License.
6*/
7
8#include "Debye.h"
9#include <cmath>
10
11namespace Pscf {
12namespace Debye {
13
14 /*
15 * Homopolymer correlation function.
16 */
17 double d(double ksq, double length, double kuhn)
18 {
19 double x = ksq*length*kuhn*kuhn/6.0;
20 double g;
21 if (x < 1.0E-5) {
22 g = 1.0 - x*x/3.0;
23 } else {
24 g = 2.0 * (std::exp(-x) - 1.0 + x) / (x * x);
25 }
26 return length*length*g;
27 }
28
29 /*
30 * End factor for one block.
31 */
32 double e(double ksq, double length, double kuhn)
33 {
34 double x = ksq*length*kuhn*kuhn/6.0;
35 double h;
36 if (x < 1.0E-5) {
37 h = 1.0 - x/2.0 + x*x/6.0;
38 } else {
39 h = (1.0 - std::exp(-x)) / x;
40 }
41 return length*h;
42 }
43
44} // namespace Debye
45} // namespace Pscf
double d(double ksq, double length, double kuhn)
Compute and return a homopolymer correlation function.
Definition Debye.cpp:17
double e(double ksq, double length, double kuhn)
Compute and return one-sided correlation factor for one block.
Definition Debye.cpp:32
PSCF package top-level namespace.
Definition param_pc.dox:1