13#include <rp/fts/simulator/Simulator.h>
14#include <rp/fts/simulator/SimulatorFactory.h>
15#include <rp/fts/compressor/Compressor.h>
16#include <rp/fts/compressor/CompressorFactory.h>
17#include <rp/scft/sweep/Sweep.h>
18#include <rp/scft/sweep/SweepFactory.h>
19#include <rp/scft/iterator/Iterator.h>
20#include <rp/scft/iterator/IteratorFactory.h>
21#include <rp/scft/ScftThermo.h>
22#include <rp/environment/EnvironmentFactory.h>
23#include <rp/solvers/Mixture.h>
24#include <rp/solvers/MixtureModifier.h>
25#include <rp/field/Domain.h>
26#include <rp/field/FieldIo.h>
27#include <rp/field/Mask.h>
28#include <rp/field/WFields.h>
29#include <rp/field/CFields.h>
30#include <rp/environment/Environment.h>
32#include <pscf/field/WaveList.h>
33#include <pscf/field/FFT.h>
34#include <pscf/field/RField.h>
35#include <pscf/field/RFieldDft.h>
36#include <pscf/crystal/Basis.h>
37#include <pscf/crystal/UnitCell.h>
39#include <pscf/interaction/Interaction.h>
40#include <pscf/mesh/Mesh.h>
41#include <pscf/math/IntVec.h>
43#include <util/containers/DArray.h>
44#include <util/containers/FSArray.h>
45#include <util/param/BracketPolicy.h>
46#include <util/param/ParamComponent.h>
47#include <util/signal/Signal.h>
48#include <util/format/Str.h>
49#include <util/format/Int.h>
50#include <util/format/Dbl.h>
51#include <util/misc/ioUtil.h>
52#include <util/misc/FileMaster.h>
70 void checkCommandInput(std::istream& in, std::string
const & command)
73 Log::file() <<
"\nError reading the arguments of command "
74 << command << std::endl;
84 template <
int D,
class T>
91 mixtureModifierPtr_(nullptr),
93 interactionPtr_(nullptr),
95 environmentPtr_(nullptr),
96 environmentFactoryPtr_(nullptr),
97 iteratorPtr_(nullptr),
98 iteratorFactoryPtr_(nullptr),
100 sweepFactoryPtr_(nullptr),
101 simulatorPtr_(nullptr),
102 simulatorFactoryPtr_(nullptr),
103 fileMasterPtr_(nullptr),
104 tmpUnitCellPtr_(nullptr),
106 isAllocatedGrid_(false),
107 isAllocatedBasis_(false),
133 environmentFactoryPtr_
141 domain_().setFileMaster(*fileMasterPtr_);
142 w().setFieldIo(domain_().fieldIo());
143 w().setReadUnitCell(domain_().unitCell());
144 w().setWriteUnitCell(domain_().unitCell());
145 h().setFieldIo(domain_().fieldIo());
146 h().setReadUnitCell(*tmpUnitCellPtr_);
147 h().setWriteUnitCell(domain_().unitCell());
148 mask().setFieldIo(domain_().fieldIo());
149 mask().setReadUnitCell(*tmpUnitCellPtr_);
150 mask().setWriteUnitCell(domain_().unitCell());
151 c_().setFieldIo(domain_().fieldIo());
152 c_().setWriteUnitCell(domain_().unitCell());
183 Signal<void>& cellSignal = domain_().unitCell().signal();
188 basisSignal.
addObserver(*
this, &System<D,T>::allocateFieldsBasis);
203 template <
int D,
class T>
207 if (environmentPtr_) {
208 delete environmentPtr_;
217 delete simulatorPtr_;
221 delete environmentFactoryPtr_;
222 delete iteratorFactoryPtr_;
223 delete sweepFactoryPtr_;
224 delete simulatorFactoryPtr_;
228 delete mixtureModifierPtr_;
229 delete interactionPtr_;
232 delete fileMasterPtr_;
233 delete tmpUnitCellPtr_;
247 template <
int D,
class T>
267 while ((
c = getopt(argc, argv,
"ed:p:c:i:o:t:")) != -1) {
297 Log::file() <<
"Unknown option -" << optopt << std::endl;
313 fileMaster().setParamFileName(std::string(pArg));
315 UTIL_THROW(
"Missing required -p option - no parameter file");
320 fileMaster().setCommandFileName(std::string(cArg));
322 UTIL_THROW(
"Missing required -c option - no command file");
337 fileMaster().setOutputPrefix(std::string(oArg));
343 UTIL_THROW(
"Error: Non-positive thread count -t option");
345 T::setThreadCount(tArg);
353 template <
int D,
class T>
358 polymerModel_ = PolymerModel::Thread;
372 readParamComposite(in, mixture_());
375 int nm = mixture_().nMonomer();
376 int np = mixture_().nPolymer();
377 int ns = mixture_().nSolvent();
384 interaction().setNMonomer(nm);
385 readParamComposite(in, interaction());
388 readParamComposite(in, domain_());
390 UTIL_CHECK(domain_().unitCell().nParameter() > 0);
392 domain_().fieldIo().setNMonomer(nm);
395 mixture_().associate(domain_().mesh(), domain_().fft(),
396 domain_().unitCell(), domain_().waveList());
397 mixture_().setFieldIo(domain_().fieldIo());
398 mixture_().allocate();
401 allocateFieldsGrid();
404 std::string className;
407 environmentFactoryPtr_->readObjectOptional(in, *
this,
412 if (environmentPtr_) {
413 environment().setNParams(domain_().unitCell().nParameter());
419 iteratorFactoryPtr_->readObjectOptional(in, *
this,
422 if (iteratorPtr_->isSymmetric()) {
427 Log::file() << indent() <<
" Iterator{ [absent] }\n";
433 if (hasIterator() && !isEnd) {
435 sweepFactoryPtr_->readObjectOptional(in, *
this,
438 Log::file() << indent() <<
" Sweep{ [absent] }\n";
445 simulatorFactoryPtr_->readObjectOptional(in, *
this,
451 Log::file() << indent() <<
" Simulator{ [absent] }\n";
467 template <
int D,
class T>
478 template <
int D,
class T>
485 template <
int D,
class T>
489 std::string command, filename, inFileName, outFileName;
495 bool readNext =
true;
507 if (command ==
"FINISH") {
511 if (command ==
"READ_W_BASIS") {
512 readEcho(in, filename);
513 w().readBasis(filename);
514 UTIL_CHECK(domain_().unitCell().isInitialized());
515 UTIL_CHECK(domain_().basis().isInitialized());
521 if (command ==
"READ_W_RGRID") {
522 readEcho(in, filename);
523 w().readRGrid(filename);
524 UTIL_CHECK(domain_().unitCell().isInitialized());
529 if (command ==
"SET_UNIT_CELL") {
532 checkCommandInput(in, command);
533 Log::file() <<
" " << unitCell << std::endl;
535 UTIL_CHECK(domain_().unitCell().isInitialized());
540 if (command ==
"COMPUTE") {
544 if (command ==
"ITERATE") {
546 bool isContinuation =
false;
547 int fail = iterate(isContinuation);
553 if (command ==
"SWEEP") {
558 if (command ==
"COMPRESS") {
561 int fail = simulator().compressor().compress();
566 <<
"COMPRESS failed; no further commands "
567 <<
"are executed" << std::endl;
572 if (command ==
"SIMULATE") {
576 checkCommandInput(in, command);
580 if (command ==
"ANALYZE" || command ==
"ANALYZE_TRAJECTORY") {
585 checkCommandInput(in, command);
588 std::string classname;
589 readEcho(in, classname);
590 readEcho(in, filename);
592 simulator().analyze(min, max, classname, filename);
594 if (command ==
"WRITE_PARAM") {
595 readEcho(in, filename);
597 fileMaster().openOutputFile(filename, file);
598 writeParamNoSweep(file);
601 if (command ==
"WRITE_THERMO") {
602 readEcho(in, filename);
604 fileMaster().openOutputFile(filename, file,
609 if (command ==
"WRITE_STRESS") {
610 readEcho(in, filename);
613 if (!mixture_().hasStress()) {
616 fileMaster().openOutputFile(filename, file,
618 mixture_().writeStress(file);
619 if (hasEnvironment()) {
620 environment().writeStress(file);
624 if (command ==
"WRITE_W_BASIS") {
625 readEcho(in, filename);
626 w().writeBasis(filename);
628 if (command ==
"WRITE_W_RGRID") {
629 readEcho(in, filename);
630 w().writeRGrid(filename);
632 if (command ==
"WRITE_C_BASIS") {
633 readEcho(in, filename);
634 c().writeBasis(filename);
636 if (command ==
"WRITE_C_RGRID") {
637 readEcho(in, filename);
638 c().writeRGrid(filename);
640 if (command ==
"WRITE_BLOCK_C_RGRID") {
641 readEcho(in, filename);
643 mixture_().writeBlockCRGrid(filename);
645 if (command ==
"WRITE_Q_SLICE") {
646 int polymerId, blockId, directionId, segmentId;
647 readEcho(in, filename);
652 checkCommandInput(in, command);
653 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
654 <<
Str(
"block ID ", 21) << blockId <<
"\n"
655 <<
Str(
"direction ID ", 21) << directionId
657 <<
Str(
"segment ID ", 21) << segmentId
660 mixture_().writeQSlice(filename, polymerId, blockId,
661 directionId, segmentId);
663 if (command ==
"WRITE_Q_TAIL") {
664 readEcho(in, filename);
665 int polymerId, blockId, directionId;
669 checkCommandInput(in, command);
670 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
671 <<
Str(
"block ID ", 21) << blockId <<
"\n"
672 <<
Str(
"direction ID ", 21) << directionId
675 mixture_().writeQTail(filename, polymerId, blockId, directionId);
677 if (command ==
"WRITE_Q") {
678 readEcho(in, filename);
679 int polymerId, blockId, directionId;
683 checkCommandInput(in, command);
684 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
685 <<
Str(
"block ID ", 21) << blockId <<
"\n"
686 <<
Str(
"direction ID ", 21) << directionId
689 mixture_().writeQ(filename, polymerId, blockId, directionId);
691 if (command ==
"WRITE_Q_ALL") {
692 readEcho(in, filename);
694 mixture_().writeQAll(filename);
696 if (command ==
"WRITE_STARS") {
697 readEcho(in, filename);
698 domain_().writeStars(filename);
700 if (command ==
"WRITE_WAVES") {
701 readEcho(in, filename);
702 domain_().writeWaves(filename);
704 if (command ==
"WRITE_GROUP") {
705 readEcho(in, filename);
706 domain_().writeGroup(filename);
708 if (command ==
"BASIS_TO_RGRID") {
709 readEcho(in, inFileName);
710 readEcho(in, outFileName);
713 if (command ==
"RGRID_TO_BASIS") {
714 readEcho(in, inFileName);
715 readEcho(in, outFileName);
718 if (command ==
"KGRID_TO_RGRID") {
719 readEcho(in, inFileName);
720 readEcho(in, outFileName);
723 if (command ==
"RGRID_TO_KGRID") {
724 readEcho(in, inFileName);
725 readEcho(in, outFileName);
728 if (command ==
"BASIS_TO_KGRID") {
729 readEcho(in, inFileName);
730 readEcho(in, outFileName);
733 if (command ==
"KGRID_TO_BASIS") {
734 readEcho(in, inFileName);
735 readEcho(in, outFileName);
738 if (command ==
"CHECK_RGRID_SYMMETRY") {
740 readEcho(in, inFileName);
741 readEcho(in, epsilon);
746 <<
"Symmetry of r-grid file matches this space group"
747 << std::endl << std::endl;
750 <<
"Symmetry of r-grid file does not match this\n"
751 <<
"space group to within error threshold of "
752 <<
Dbl(epsilon) <<
" ." << std::endl << std::endl;
755 if (command ==
"COMPARE_BASIS") {
756 std::string filecompare1, filecompare2;
757 readEcho(in, filecompare1);
758 readEcho(in, filecompare2);
761 if (command ==
"COMPARE_RGRID") {
762 std::string filecompare1, filecompare2;
763 readEcho(in, filecompare1);
764 readEcho(in, filecompare2);
767 if (command ==
"SCALE_BASIS") {
769 readEcho(in, inFileName);
770 readEcho(in, outFileName);
771 readEcho(in, factor);
774 if (command ==
"SCALE_RGRID") {
776 readEcho(in, inFileName);
777 readEcho(in, outFileName);
778 readEcho(in, factor);
781 if (command ==
"EXPAND_RGRID_DIMENSION") {
782 readEcho(in, inFileName);
783 readEcho(in, outFileName);
788 checkCommandInput(in, command);
791 Log::file() <<
Str(
"Expand dimension to: ") << d <<
"\n";
796 for (
int i = 0; i < d-D; i++) {
797 in >> newGridDimensions[i];
800 checkCommandInput(in, command);
802 <<
Str(
"Numbers of grid points in added dimensions : ");
803 for (
int i = 0; i < d-D; i++) {
804 Log::file() << newGridDimensions[i] <<
" ";
809 d, newGridDimensions);
812 if (command ==
"REPLICATE_UNIT_CELL") {
813 readEcho(in, inFileName);
814 readEcho(in, outFileName);
818 for (
int i = 0; i < D; i++){
822 checkCommandInput(in, command);
823 for (
int i = 0; i < D; i++){
824 Log::file() <<
"Replicate unit cell in direction "
832 if (command ==
"ESTIMATE_W_BASIS") {
833 readEcho(in, inFileName);
834 readEcho(in, outFileName);
836 interaction().chi());
838 if (command ==
"READ_H_BASIS") {
839 readEcho(in, filename);
840 h().readBasis(filename);
843 if (command ==
"READ_H_RGRID") {
844 readEcho(in, filename);
845 h().readRGrid(filename);
848 if (command ==
"WRITE_H_BASIS") {
849 readEcho(in, filename);
850 if (hasEnvironment() && environment().needsUpdate()) {
851 environment().generate();
853 h().writeBasis(filename);
855 if (command ==
"WRITE_H_RGRID") {
856 readEcho(in, filename);
857 if (hasEnvironment() && environment().needsUpdate()) {
858 environment().generate();
860 h().writeRGrid(filename);
862 if (command ==
"READ_MASK_BASIS") {
863 readEcho(in, filename);
864 mask().readBasis(filename);
866 if (command ==
"READ_MASK_RGRID") {
867 readEcho(in, filename);
868 mask().readRGrid(filename);
870 if (command ==
"WRITE_MASK_BASIS") {
871 readEcho(in, filename);
872 if (hasEnvironment() && environment().needsUpdate()) {
873 environment().generate();
875 mask().writeBasis(filename);
877 if (command ==
"WRITE_MASK_RGRID") {
878 readEcho(in, filename);
879 if (hasEnvironment() && environment().needsUpdate()) {
880 environment().generate();
882 mask().writeRGrid(filename);
884 if (command ==
"WRITE_TIMERS") {
885 readEcho(in, filename);
887 fileMaster().openOutputFile(filename, file);
891 if (command ==
"CLEAR_TIMERS") {
895 << command << std::endl;
906 template <
int D,
class T>
920 template <
int D,
class T>
938 mixture_().compute(
w().rgrid(), c_().rgrid(),
mask().phiTot());
939 mixture_().setIsSymmetric(
w().isSymmetric());
940 c_().setHasData(
true);
944 if (
w().isSymmetric()) {
946 domain_().fieldIo().convertRGridToBasis(
c().rgrid(), c_().basis(),
948 c_().setIsSymmetric(
true);
960 template <
int D,
class T>
964 if (!mixture_().hasStress()) {
965 mixture_().computeStress(
mask().phiTot());
977 int nParameter = domain_().unitCell().nParameter();
978 for (
int i = 0; i < nParameter; ++i) {
979 flexibleParams.
append(
false);
981 environment().computeStress(mixture_(), flexibleParams);
990 template <
int D,
class T>
1015 int error =
iterator().solve(isContinuation);
1023 if (!mixture_().hasStress()) {
1039 template <
int D,
class T>
1061 template <
int D,
class T>
1074 template <
int D,
class T>
1077 c_().setHasData(
false);
1089 template <
int D,
class T>
1092 if (!
w().hasData() || !
w().isSymmetric()) {
1095 if (
h().hasData() && !
h().isSymmetric()) {
1098 if (
mask().hasData() && !
mask().isSymmetric()) {
1109 template <
int D,
class T>
1114 UTIL_CHECK(domain_().lattice() == unitCell.lattice());
1117 domain_().unitCell() = unitCell;
1120 if (domain_().hasGroup() && !domain_().basis().isInitialized()) {
1121 domain_().makeBasis();
1125 UTIL_CHECK(domain_().unitCell().isInitialized());
1126 UTIL_CHECK(domain_().unitCell().lattice() == domain_().lattice());
1127 if (domain_().hasGroup()) {
1128 UTIL_CHECK(domain_().basis().isInitialized());
1137 template <
int D,
class T>
1145 domain_().unitCell().set(domain_().lattice(), parameters);
1147 domain_().unitCell().setParameters(parameters);
1151 if (domain_().hasGroup() && !domain_().basis().isInitialized()) {
1152 domain_().makeBasis();
1156 UTIL_CHECK(domain_().unitCell().isInitialized());
1157 UTIL_CHECK(domain_().unitCell().lattice() == domain_().lattice());
1158 if (domain_().hasGroup()) {
1159 UTIL_CHECK(domain_().basis().isInitialized());
1168 template <
int D,
class T>
1172 mixture_().clearUnitCellData();
1173 domain_().waveList().clearUnitCellData();
1187 template <
int D,
class T>
1190 out <<
"System{" << std::endl;
1198 domain().writeParam(out);
1205 out <<
"}" << std::endl;
1213 template <
int D,
class T>
1229 template <
int D,
class T>
1245 template <
int D,
class T>
1246 void System<D,T>::allocateFieldsGrid()
1250 int nMonomer = mixture_().nMonomer();
1256 IntVec<D> const & dimensions = domain_().mesh().dimensions();
1259 w().setNMonomer(nMonomer);
1260 w().allocateRGrid(dimensions);
1263 c_().setNMonomer(nMonomer);
1264 c_().allocateRGrid(dimensions);
1267 h().setNMonomer(nMonomer);
1270 if (hasEnvironment()) {
1271 if (environment().generatesMask()) {
1272 mask().allocateRGrid(dimensions);
1274 if (environment().generatesExternalFields()) {
1275 h().allocateRGrid(dimensions);
1279 isAllocatedGrid_ =
true;
1285 template <
int D,
class T>
1286 void System<D,T>::allocateFieldsBasis()
1290 const int nMonomer = mixture_().nMonomer();
1294 UTIL_CHECK(domain_().basis().isInitialized());
1295 const int nBasis = domain_().basis().nBasis();
1301 w().allocateBasis(nBasis);
1302 c_().allocateBasis(nBasis);
1305 if (hasEnvironment()) {
1306 if (environment().generatesMask()) {
1307 mask().allocateBasis(nBasis);
1309 if (environment().generatesExternalFields()) {
1310 h().allocateBasis(nBasis);
1314 isAllocatedBasis_ =
true;
1320 template <
int D,
class T>
1321 void System<D,T>::readEcho(std::istream& in, std::string&
string)
const
1325 UTIL_THROW(
"Unable to read a string parameter.");
1333 template <
int D,
class T>
1334 void System<D,T>::readEcho(std::istream& in,
double& value)
const
1338 UTIL_THROW(
"Unable to read floating point parameter.");
An IntVec<D, T> is a D-component vector of elements of integer type T.
Interaction(bool isCompressible=false)
Constructor.
EnvironmentFactory(System< D, T > &system)
Constructor.
File input/output, format conversions and other utilities for fields.
void compareFieldsBasis(DArray< DArray< double > > const &field1, DArray< DArray< double > > const &field2) const
Compare array of fields in basis form, write a report to Log file.
void scaleFieldsRGrid(DArray< RField< D, T > > &fields, double factor) const
Scale an array of r-grid fields by a scalar.
virtual bool hasSymmetry(RFieldDft< D, T > const &in, double epsilon=1.0e-8, bool verbose=true) const
Check if a k-grid field has the declared space group symmetry.
void convertRGridToBasis(RField< D, T > const &in, DArray< double > &out, bool checkSymmetry=true, double epsilon=1.0e-8) const
Convert a single field from r-grid to basis form.
void scaleFieldsBasis(DArray< DArray< double > > &fields, double factor) const
Multiply an array of fields in basis format by a real scalar.
virtual void convertBasisToKGrid(DArray< double > const &components, RFieldDft< D, T > &dft) const
Convert a single field from basis to Fourier (k-grid) form.
virtual void expandRGridDimension(std::ostream &out, DArray< RField< D, T > > const &fields, UnitCell< D > const &unitCell, int d, DArray< int > const &newGridDimensions) const
Increase D for an array of r-grid fields, write to ostream.
void convertBasisToRGrid(DArray< double > const &in, RField< D, T > &out) const
Convert a single field from basis to r-grid format.
void convertRGridToKGrid(DArray< RField< D, T > > const &in, DArray< RFieldDft< D, T > > &out) const
Convert an array of fields from r-grid to k-grid (Fourier) format.
void estimateWBasis(DMatrix< double > const &chi, DArray< DArray< double > > &fields) const
Convert c fields to estimated w fields, in basis format.
void convertKGridToRGrid(DArray< RFieldDft< D, T > > const &in, DArray< RField< D, T > > &out) const
Convert an array of field from k-grid to r-grid format.
virtual void convertKGridToBasis(RFieldDft< D, T > const &in, DArray< double > &out, bool checkSymmetry=true, double epsilon=1.0e-8) const
Convert a single field from Fourier (k-grid) to basis form.
virtual void replicateUnitCell(std::ostream &out, DArray< RField< D, T > > const &fields, UnitCell< D > const &unitCell, IntVec< D > const &replicas) const
Write r-grid fields in a replicated unit cell to std::ostream.
virtual void compareFieldsRGrid(DArray< RField< D, T > > const &field1, DArray< RField< D, T > > const &field2) const
Compare two fields in r-grid form, write a report to Log file.
IteratorFactory(System< D, T > &system)
Constructor.
MixtureModifier()
Constructor.
Mixture()
Default constructor.
ScftThermo(System< D, T > const &system)
Constructor.
SimulatorFactory(System< D, T > &system)
Constructor.
void clearData()
Clear field eigen-components and Hamiltonian components.
SweepFactory(System< D, T > &system)
Constructor.
int readCommands()
Read and process commands from the default command file.
void simulate(int nStep)
Perform a field theoretic simulation (PS-FTS).
Simulator< D, T > const & simulator() const
Get the Simulator (const).
Environment const & environment() const
Get the Environment (const).
Mask< D, CPT > const & mask() const
bool hasSimulator() const
Does this system have a Simulator?
void computeStress()
Compute SCFT stress.
CFields< D, CPT > const & c() const
bool hasEnvironment() const
Does this system have an Environment?
FileMaster const & fileMaster() const
bool hasSymmetricInputFields()
Are the w fields, external fields and mask (if any) all symmetric?
bool hasSweep() const
Does this system have a Sweep?
WFields< D, CPT > const & h() const
int readCommands(std::istream &in)
Read and process commands from an input stream.
ScftThermo< D, T > const & scft() const
Get the ScftThermo object (const).
void clearUnitCellData()
Notify System members that unit cell parameters have been modified.
void clearCFields()
Mark c-fields, propagators and free energies as outdated.
virtual void readParam(std::istream &in)
Read input parameters (with opening and closing lines).
void setUnitCell(UnitCell< D > const &unitCell)
Set parameters of the associated unit cell.
virtual void readParameters(std::istream &in)
Read body of parameter block (without opening and closing lines).
void compute(bool needStress=false)
Solve the modified diffusion equation once, without iteration.
int iterate(bool isContinuation=false)
Iteratively solve a SCFT problem.
void readParam()
Read input parameters from default param file.
void clearTimers()
Clear all timers.
Interaction const & interaction() const
Get the Interaction (const).
Mixture< D, T > const & mixture() const
Get the Mixture (const).
WaveList< D, T > & waveList()
Get the WaveList (non-const).
bool hasIterator() const
Does this system have an Iterator?
MixtureModifier< D, CPT > & mixtureModifier()
void writeParamNoSweep(std::ostream &out) const
Write partial parameter file to an ostream.
void writeTimers(std::ostream &out) const
Write timer information to an output stream.
Domain< D, T > const & domain() const
Get the Domain (const).
WFields< D, CPT > const & w() const
void setOptions(int argc, char **argv)
Process command line options.
Iterator< D, T > const & iterator() const
Get the Iterator (const).
Base template for UnitCell<D> classes, D=1, 2 or 3.
Dynamically allocatable contiguous array template.
void allocate(int capacity)
Allocate the underlying C array.
Dbl()
Default constructor.
A fixed capacity (static) contiguous array with a variable logical size.
void append(Data const &data)
Append data to the end of the array.
static std::ostream & file()
Get log ostream by reference.
std::string indent() const
Return indent string for this object (string of spaces).
static bool echo()
Get echo parameter.
static void setEcho(bool echo=true)
Enable or disable echoing for all subclasses of ParamComponent.
Begin & readBegin(std::istream &in, const char *label, bool isRequired=true)
Add and read a class label and opening bracket.
void setClassName(const char *className)
Set class name string.
ScalarParam< Type > & readOptional(std::istream &in, const char *label, Type &value)
Add and read a new optional ScalarParam < Type > object.
std::string className() const
Get class name string.
End & readEnd(std::istream &in)
Add and read the closing bracket.
Notifier (or subject) in the Observer design pattern.
void addObserver(Observer &observer, void(Observer::*methodPtr)(const T &))
Register an observer.
Str()
Default constructor.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
bool hasSymmetry(AT const &in, Basis< D > const &basis, IntVec< D > const &dftDimensions, double epsilon=1.0e-8, bool verbose=true)
Check if a k-grid field has the declared space group symmetry.
double min(Array< double > const &in)
Get minimum of array elements .
double max(Array< double > const &in)
Get maximum of array elements (real).
Enumeration and functions to specify a model for polymer chains.
int nSet()
How many times has setModel been called?
Type model()
Get the global polymer model type enumeration value.
void setModel(Type model)
Set the global polymer model enumeration value.
bool isBead()
Is the bead model in use ?
bool isLocked()
Has the model type been locked (i.e., made immutable) ?
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.
void set(BracketPolicy::Type policy)
Set policy regarding use of bracket delimiters on arrays.