PSCF v1.1
pspc/sweep/SweepParameter.h
1#ifndef PSPC_SWEEP_PARAMETER_H
2#define PSPC_SWEEP_PARAMETER_H
3
4/*
5* PSCF - Polymer Self-Consistent Field Theory
6*
7* Copyright 2016 - 2022, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <iostream>
12
13namespace Pscf {
14namespace Pspc {
15
16 template <int D> class System;
17
82 template <int D>
84 {
85
86 public:
87
92
99
108 void setSystem(System<D>& system)
109 { systemPtr_ = &system;}
110
114 void getInitial();
115
121 void update(double newVal);
122
126 std::string type() const;
127
133 void writeParamType(std::ostream& out) const;
134
148 int id(int i) const
149 { return id_[i];}
150
154 double current()
155 { return get_(); }
156
160 double initial() const
161 { return initial_; }
162
166 double change() const
167 { return change_; }
168
175 template <class Archive>
176 void serialize(Archive ar, const unsigned int version);
177
178 private:
179
181 enum ParamType { Block, Chi, Kuhn, Phi_Polymer, Phi_Solvent,
182 Mu_Polymer, Mu_Solvent, Solvent, Cell_Param,
183 Chi_Bottom, Chi_Top, Null};
184
186 ParamType type_;
187
189 int nID_;
190
192 DArray<int> id_;
193
195 double initial_;
196
198 double change_;
199
201 System<D>* systemPtr_;
202
208 void readParamType(std::istream& in);
209
213 double get_();
214
220 void set_(double newVal);
221
225 bool isFilmIterator() const;
226
227 // friends:
228
229 template <int U>
230 friend
231 std::istream& operator >> (std::istream&, SweepParameter<U>&);
232
233 template <int U>
234 friend
235 std::ostream&
236 operator << (std::ostream&, SweepParameter<U> const&);
237
238 };
239
246 template <int D>
247 std::istream& operator >> (std::istream& in,
248 SweepParameter<D>& param);
249
256 template <int D>
257 std::ostream& operator << (std::ostream& out,
258 SweepParameter<D> const & param);
259
260}
261}
262#include "SweepParameter.tpp"
263#endif
Block within a branched polymer.
Solver and descriptor for a solvent species.
Class for storing data about an individual sweep parameter.
std::string type() const
Return a string representation of the parameter type.
void getInitial()
Store the pre-sweep value of the corresponding parameter.
double initial() const
Return the initial system parameter value.
void serialize(Archive ar, const unsigned int version)
Serialize to or from an archive.
int id(int i) const
Get a id for a sub-object or element to which this is applied.
void update(double newVal)
Update the corresponding parameter value in the system.
double change() const
Return the total change planned for this parameter during sweep.
double current()
Return the current system parameter value.
void setSystem(System< D > &system)
Set the system associated with this object.
void writeParamType(std::ostream &out) const
Write the parameter type to an output stream.
Main class for SCFT simulation of one system.
Definition: pspc/System.h:76
Dynamically allocatable contiguous array template.
Definition: DArray.h:32
C++ namespace for polymer self-consistent field theory (PSCF).
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
Definition: Pair.h:44
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Definition: Pair.h:57