1#ifndef R1_SWEEP_PARAMETER_H
2#define R1_SWEEP_PARAMETER_H
11#include <util/containers/DArray.h>
12#include <util/containers/GArray.h>
15#include <pscf/sweep/ParameterType.h>
130 { systemPtr_ = &system; }
138 { parameterTypesPtr_ = &array; }
152 {
return parameterTypeId_; }
158 {
return (parameterTypeId_ != -1); }
182 void update(
double newVal);
187 std::string
type()
const;
234 template <
class Archive>
235 void serialize(Archive& ar,
const unsigned int version);
240 enum ParamType {
Block, Chi, Kuhn, Phi_Polymer, Phi_Solvent,
241 Mu_Polymer, Mu_Solvent,
Solvent, Cell_Param,
266 int parameterTypeId_;
275 void checkId(
int i,
int n, std::string
const & name)
const;
282 void readParamType(std::istream& in);
294 void set_(
double newVal);
307 template <
class Archive>
312 if (Archive::is_loading()) {
313 if (id_.isAllocated()) id_.deallocate();
314 if (nId_ > 0) id_.allocate(nId_);
316 for (
int i = 0; i < nId_; ++i) {
Block within a block polymer.
Solver and descriptor for a solvent species in a mixture.
std::string type() const
Return a string representation of the parameter type.
int id(int i) const
Get a id for a sub-object or element to which this is applied.
int parameterTypeId() const
Get the array index for the specialized sweep parameter.
SweepParameter()
Default constructor.
void checkIds() const
Check that the indices of this parameter are in range.
double current()
Return the current system parameter value.
friend std::ostream & operator<<(std::ostream &, SweepParameter const &)
Extractor for writing a SweepParameter to ostream.
bool isSpecialized() const
Is this SweepParameter a specialized parameter type?
void serialize(Archive &ar, const unsigned int version)
Serialize to or from an archive.
void update(double newVal)
Update the corresponding parameter value in the system.
void writeParamType(std::ostream &out) const
Write the parameter type to an output stream.
void getInitial()
Store the pre-sweep value of the corresponding parameter.
double initial() const
Return the initial system parameter value.
void setSystem(System &system)
Set the system associated with this object.
double change() const
Return the total change planned for this parameter during sweep.
friend std::istream & operator>>(std::istream &, SweepParameter &)
Inserter for reading a SweepParameter from an istream.
void setParameterTypesArray(GArray< ParameterType > &array)
Set the pointer to the array of specialized sweep parameter types.
ParameterType & parameterType() const
Get the ParameterType object for a specialized sweep parameter.
Main class in SCFT simulation of one system.
Dynamically allocatable contiguous array template.
An automatically growable array, analogous to a std::vector.
void serializeEnum(Archive &ar, T &data, const unsigned int version=0)
Serialize an enumeration value.
SCFT with real 1D fields.
PSCF package top-level namespace.
Utility classes for scientific computation.
Declaration of a specialized sweep parameter type.