1#ifndef PSPG_BASIS_FIELD_STATE_TPP
2#define PSPG_BASIS_FIELD_STATE_TPP
11#include "BasisFieldState.h"
12#include "FieldState.tpp"
13#include <pspg/System.h>
14#include <pscf/crystal/Basis.h>
55 int nMonomer = system().mixture().nMonomer();
57 if (fields().isAllocated()) {
60 fields().allocate(nMonomer);
63 int nBasis = system().basis().nBasis();
65 for (
int i = 0; i < nMonomer; ++i) {
66 if (field(i).isAllocated()) {
69 field(i).allocate(nBasis);
82 system().fieldIo().readFieldsBasis(filename, fields(), unitCell());
91 system().fieldIo().writeFieldsBasis(filename, fields(), unitCell());
101 unitCell() = system().unitCell();
104 int nMonomer = system().mixture().nMonomer();
105 int nBasis = system().basis().nBasis();
107 for (i = 0; i < nMonomer; ++i) {
110 for (j = 0; j < nBasis; ++j) {
111 stateField[j] = systemField[j];
123 system().setWBasis(fields());
126 system().setUnitCell(unitCell());
void allocate()
Allocate all fields.
BasisFieldState()
Default constructor.
void write(const std::string &filename)
Write state to file.
~BasisFieldState()
Destructor.
void getSystemState()
Copy the current state of the associated system.
void setSystemState(bool newCellParams)
Set the state of the associated system to this state.
void read(const std::string &filename)
Read state from file.
Record of a state of a System (fields + unit cell).
Main class in SCFT simulation of one system.
Dynamically allocatable contiguous array template.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
C++ namespace for polymer self-consistent field theory (PSCF).
Utility classes for scientific computation.