PSCF v1.3
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
38 {
39
40 public:
41
46
53
57 virtual ~BinaryRelaxIterator();
58
64 void readParameters(std::istream& in);
65
72 int solve(bool isContinuation = false);
73
74 private:
75
76
78 DArray<FieldT> wFieldsNew_;
79
81 DArray<FieldT> cFieldsNew_;
82
84 DArray<double> cArray_;
85
87 DArray<double> wArray_;
88
90 DArray<double> residual_;
91
93 DArray<double> residualNew_;
94
97
98 DArray<FieldT> dWNew_;
99
101 double dWNorm_;
102
103 double dWNormNew_;
104
106 double epsilon_;
107
109 double lambdaPlus_;
110
112 double lambdaMinus_;
113
115 int maxItr_;
116
118 bool isAllocated_;
119
121 bool isCanonical_;
122
126 void allocate();
127
136 void computeDW(Array<FieldT> const & wOld,
137 Array<FieldT> const & cFields,
138 Array<FieldT> & dW,
139 double & dWNorm);
140
148 void updateWFields(Array<FieldT> const & wOld,
149 Array<FieldT> const & dW_,
150 Array<FieldT> & wNew);
151
152 };
153
154} // namespace R1d
155} // namespace Pscf
156#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.
Definition Iterator.cpp:19
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.
Definition param_pc.dox:1