PSCF v1.4.0
AmbdInteraction.h
1#ifndef PSCF_AMBD_INTERACTION_H
2#define PSCF_AMBD_INTERACTION_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <util/containers/DMatrix.h> // member
12
13// Forward declaration
14namespace Pscf {
15 class Interaction;
16}
17
18namespace Pscf {
19
20 using namespace Util;
21
42 {
43
44 public:
45
50
54 virtual ~AmbdInteraction();
55
61 void setNMonomer(int nMonomer);
62
68 void update(Interaction const & interaction);
69
76 double chi(int i, int j) const;
77
84 double chiInverse(int i, int j) const;
85
101 double p(int i, int j) const;
102
106 double sumChiInverse() const;
107
111 int nMonomer() const;
112
113 private:
114
115 // Symmetric matrix of interaction parameters (local copy).
116 DMatrix<double> chi_;
117
118 // Inverse of matrix chi_.
119 DMatrix<double> chiInverse_;
120
121 // Idempotent matrix P used in residual definition.
123
124 // Sum of elements of matrix chiInverse_
125 double sumChiInverse_;
126
128 int nMonomer_;
129
131 bool isAllocated_;
132
133 };
134
135 // Inline function
136
137 inline int AmbdInteraction::nMonomer() const
138 { return nMonomer_; }
139
140 inline double AmbdInteraction::chi(int i, int j) const
141 { return chi_(i, j); }
142
143 inline double AmbdInteraction::chiInverse(int i, int j) const
144 { return chiInverse_(i, j); }
145
146 inline double AmbdInteraction::p(int i, int j) const
147 { return p_(i, j); }
148
149 inline double AmbdInteraction::sumChiInverse() const
150 { return sumChiInverse_; }
151
152} // namespace Pscf
153#endif
double chiInverse(int i, int j) const
Return one element of the inverse chi matrix.
double chi(int i, int j) const
Return one element of the chi matrix.
int nMonomer() const
Get number of monomer types.
double sumChiInverse() const
Return sum of elements of the inverse chi matrix.
AmbdInteraction()
Constructor.
void setNMonomer(int nMonomer)
Set number of monomers and allocate required memory.
void update(Interaction const &interaction)
Update all computed quantities.
virtual ~AmbdInteraction()
Destructor.
double p(int i, int j) const
Return one element of the potent matrix P.
Interaction model for complex Langevin FTS.
Definition Interaction.h:24
Dynamically allocated Matrix.
Definition DMatrix.h:25
PSCF package top-level namespace.