PSCF v1.3
Debye.cpp
1/*
2* PSCF - Polymer Self-Consistent Field
3*
4* Copyright 2015 - 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 * Intrablock correlation function (thread model)
16 */
17 double dt(double ksq, double length, double kuhn)
18 {
19 double x = length*ksq*kuhn*kuhn/6.0;
20 double d;
21 if (x < 1.0E-5) {
22 d = 1.0 - ((x*x)/3.0);
23 } else {
24 d = 2.0 * (std::exp(-x) - 1.0 + x) / (x * x);
25 }
26 d *= length*length;
27 return d;
28 }
29
30 /*
31 * Intrablock correlation function (bead model)
32 */
33 double db(double ksq, double nBead, double kuhn)
34 {
35 double y = ksq*kuhn*kuhn/6.0;
36 double x = nBead*y;
37 double d;
38 if (x < 1.0E-5) {
39 d = 1.0 - (x*x)/3.0;
40 d *= nBead*nBead;
41 } else {
42 double z = std::exp(-y);
43 double u = 1 - z;
44 d = 2.0 * z * (std::exp(-x) + nBead*u - 1.0) / (u*u);
45 d += nBead;
46 }
47 return d;
48 }
49
50 /*
51 * End factor for one block (thread model)
52 */
53 double et(double ksq, double length, double kuhn)
54 {
55 double x = ksq*length*kuhn*kuhn/6.0;
56 double e;
57 if (x < 1.0E-5) {
58 e = 1.0 - x/2.0 + x*x/6.0;
59 } else {
60 e = (1.0 - std::exp(-x)) / x;
61 }
62 e *= length;
63 return e;
64 }
65
66 /*
67 * End factor for one block (bead model)
68 */
69 double eb(double ksq, double nBead, double kuhn)
70 {
71 double y = ksq*kuhn*kuhn/6.0;
72 double x = nBead*y;
73 double e;
74 if (x < 1.0E-5) {
75 e = 1.0 - x/2.0 + x*x/6.0;
76 e *= nBead;
77 } else {
78 double z = std::exp(-y);
79 e = (1.0 - std::exp(-x)) / (1 - z);
80 }
81 return e;
82 }
83
84} // namespace Debye
85} // namespace Pscf
double dt(double ksq, double length, double kuhn)
Compute and return intrablock correlation function (thread model)
Definition Debye.cpp:17
double et(double ksq, double length, double kuhn)
Compute and return one-sided factor for one block (thread model).
Definition Debye.cpp:53
double eb(double ksq, double nBead, double kuhn)
Compute and return one-sided factor for one block (thread model).
Definition Debye.cpp:69
double db(double ksq, double nBead, double kuhn)
Compute and return an intrablock correlation function (bead model)
Definition Debye.cpp:33
Functions used to compute intramolecular correlation functions.
Definition Debye.cpp:12
PSCF package top-level namespace.
Definition param_pc.dox:1