PSCF v1.3.2
BinaryRelaxIterator.h
1#ifndef R1D_BINARY_RELAX_ITERATOR_H
2#define R1D_BINARY_RELAX_ITERATOR_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 "Iterator.h"
12#include <r1d/solvers/Mixture.h>
13#include <pscf/math/LuSolver.h>
14#include <util/containers/Array.h>
15#include <util/containers/DArray.h>
16#include <util/containers/DMatrix.h>
17
18
19namespace Pscf {
20namespace R1d
21{
22
23 using namespace Util;
24
40 {
41
42 public:
43
48
55
59 virtual ~BinaryRelaxIterator();
60
66 void readParameters(std::istream& in);
67
74 int solve(bool isContinuation = false);
75
76 private:
77
78
80 DArray<FieldT> wFieldsNew_;
81
83 DArray<FieldT> cFieldsNew_;
84
86 DArray<double> cArray_;
87
89 DArray<double> wArray_;
90
92 DArray<double> residual_;
93
95 DArray<double> residualNew_;
96
99
100 DArray<FieldT> dWNew_;
101
103 double dWNorm_;
104
105 double dWNormNew_;
106
108 double epsilon_;
109
111 double lambdaPlus_;
112
114 double lambdaMinus_;
115
117 int maxItr_;
118
120 bool isAllocated_;
121
123 bool isCanonical_;
124
128 void allocate();
129
138 void computeDW(Array<FieldT> const & wOld,
139 Array<FieldT> const & cFields,
140 Array<FieldT> & dW,
141 double & dWNorm);
142
150 void updateWFields(Array<FieldT> const & wOld,
151 Array<FieldT> const & dW_,
152 Array<FieldT> & wNew);
153
154 };
155
156} // namespace R1d
157} // namespace Pscf
158#endif
Mixture::FieldT FieldT
Monomer chemical potential field.
virtual ~BinaryRelaxIterator()
Destructor.
int solve(bool isContinuation=false)
Iterate self-consistent field equations to solution.
void readParameters(std::istream &in)
Read all parameters and initialize.
BinaryRelaxIterator(System &system)
Constructor.
Iterator()
Default constructor.
Propagator::FieldT FieldT
Field type.
DArray< System::CField > & cFields()
Get array of all chemical potential fields.
const System & system() const
Get parent System by reference.
Main class in SCFT simulation of one system.
Definition r1d/System.h:65
Array container class template.
Definition Array.h:34
Dynamically allocatable contiguous array template.
Definition DArray.h:32
SCFT with real 1D fields.
PSCF package top-level namespace.