1#ifndef RP_SWEEP_PARAMETER_H
2#define RP_SWEEP_PARAMETER_H
11#include <pscf/sweep/ParameterType.h>
12#include <util/containers/DArray.h>
13#include <util/containers/GArray.h>
114 template <
int D,
class T>
129 { systemPtr_ = &system; }
137 { parameterTypesPtr_ = &array; }
151 {
return parameterTypeId_; }
157 {
return (parameterTypeId_ != -1); }
172 void update(
double newVal);
177 std::string
type()
const;
236 template <
class Archive>
256 enum ParamType { Block, Chi, Kuhn, Phi_Polymer, Phi_Solvent,
257 Mu_Polymer, Mu_Solvent, Solvent, Cell_Param,
276 typename T::System* systemPtr_;
282 int parameterTypeId_;
289 void readParamType(std::istream& in);
301 void set_(
double newVal);
305 template <
int DT,
class TT>
309 template <
int DT,
class TT>
318 template <
int D,
class T>
319 template <
class Archive>
321 const unsigned int version)
325 for (
int i = 0; i < nId_; ++i) {
338 template <
int D,
class T>
343 param.readParamType(in);
346 for (
int i = 0; i < param.nId_; ++i) {
361 template <
int D,
class T>
367 for (
int i = 0; i < param.nId_; ++i) {
371 out << param.change_;
Class template for storing data about an individual sweep parameter.
void getInitial()
Get initial value of this parameter.
SweepParameter()
Default constructor.
std::string type() const
Return a string representation of the parameter type.
void writeParamType(std::ostream &out) const
Write the parameter type to an output stream.
void serialize(Archive ar, const unsigned int version)
Serialize to or from an archive.
ParameterType & parameterType() const
Get the ParameterType object for a specialized sweep parameter.
double initial() const
Get the initial system parameter value.
int parameterTypeId() const
Get the array index for the specialized sweep parameter.
int id(int i) const
Get id for a sub-object or element to which this is applied.
void update(double newVal)
Update the corresponding parameter value in the system.
void setParameterTypesArray(GArray< ParameterType > &array)
Set the pointer to the array of specialized sweep parameter types.
bool isSpecialized() const
Is this SweepParameter a specialized parameter type?
double current()
Get the current system parameter value.
void setSystem(typename T::System &system)
Set the system associated with this object.
double change() const
Get the total change planned for this parameter during sweep.
int nId() const
Number of indices associated with this parameter.
Dynamically allocatable contiguous array template.
An automatically growable array, analogous to a std::vector.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void serializeEnum(Archive &ar, T &data, const unsigned int version=0)
Serialize an enumeration value.
Class templates for real-valued periodic fields.
PSCF package top-level namespace.
std::istream & operator>>(std::istream &in, Pair< Data > &pair)
Input a Pair from an istream.
std::ostream & operator<<(std::ostream &out, const Pair< Data > &pair)
Output a Pair to an ostream, without line breaks.
Declaration of a specialized sweep parameter type.