PSCF v1.3
r1d/sweep/Sweep.h
1#ifndef R1D_SWEEP_H
2#define R1D_SWEEP_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 <pscf/sweep/SweepTmpl.h> // base class
12#include <r1d/SystemAccess.h> // base class
13#include <r1d/misc/HomogeneousComparison.h> // member
14#include <r1d/misc/FieldIo.h> // member
15#include <util/containers/DArray.h> // member
16
17#include <util/global.h>
18
19namespace Pscf {
20namespace R1d
21{
22
23 using namespace Util;
24
30 class Sweep : public SweepTmpl< DArray<System::WField> >,
31 public SystemAccess
32 {
33
34 public:
35
36 typedef DArray<System::WField> State;
37
38 typedef SweepTmpl<State> Base;
39
46
50 ~Sweep();
51
57 virtual void readParameters(std::istream& in);
58
64 virtual void outputSolution(std::string const & stateFileName);
65
71 virtual void outputSummary(std::ostream& outFile);
72
73 protected:
74
77
83 virtual void checkAllocation(State & state);
84
88 virtual void setup();
89
95 virtual void setParameters(double s);
96
102 virtual void extrapolate(double s);
103
109 virtual int solve(bool isContinuation);
110
117 virtual void reset();
118
126 virtual void getSolution();
127
131 virtual void cleanup();
132
133 private:
134
136 HomogeneousComparison comparison_;
137
139 FieldIo fieldIo_;
140
142 std::ofstream logFile_;
143
145 void assignFields(State& lhs, State const & rhs) const;
146
147 };
148
149} // namespace R1d
150} // namespace Pscf
151#endif
Read and write fields to file.
Command to compute properties of homogeneous reference system.
int homogeneousMode_
Mode for comparison to homogeneous system (none -> -1)
virtual void outputSolution(std::string const &stateFileName)
Output information after obtaining a converged solution.
virtual void getSolution()
Update state(0) and output data after successful convergence.
virtual void outputSummary(std::ostream &outFile)
Output data to a running summary.
virtual void extrapolate(double s)
Create initial guess for new w fields by polynomial extrapolation.
virtual void readParameters(std::istream &in)
Read ns and baseFileName parameters.
virtual void reset()
Reset system to previous solution after iterature failure.
virtual void setParameters(double s)
Set non-adjustable system parameters to new values.
virtual void checkAllocation(State &state)
Check allocation of w fields in one state, allocate if needed.
Sweep(System &system)
Constructor.
virtual void setup()
Setup operation at beginning sweep.
virtual void cleanup()
Close log file after end of sweep.
virtual int solve(bool isContinuation)
Call the current iterator to solve one SCFT problem.
SystemAccess()
Default constructor.
const System & system() const
Get parent System by reference.
Main class in SCFT simulation of one system.
Definition r1d/System.h:65
DArray< System::WField > & state(int i)
Definition SweepTmpl.h:127
Dynamically allocatable contiguous array template.
Definition DArray.h:32
File containing preprocessor macros for error handling.
SCFT with real 1D fields.
PSCF package top-level namespace.
Definition param_pc.dox:1