1#ifndef RPG_BASIS_FIELD_STATE_TPP
2#define RPG_BASIS_FIELD_STATE_TPP
11#include "BasisFieldState.h"
12#include "FieldState.tpp"
13#include <rpg/system/System.h>
14#include <rpg/solvers/Mixture.h>
15#include <rpg/field/Domain.h>
16#include <prdc/crystal/Basis.h>
58 int nMonomer =
system().mixture().nMonomer();
60 if (
fields().isAllocated()) {
63 fields().allocate(nMonomer);
66 int nBasis =
system().domain().basis().nBasis();
68 for (
int i = 0; i < nMonomer; ++i) {
69 if (
field(i).isAllocated()) {
72 field(i).allocate(nBasis);
85 system().domain().fieldIo().readFieldsBasis(filename,
fields(),
95 system().domain().fieldIo().writeFieldsBasis(filename,
fields(),
110 int nMonomer =
system().mixture().nMonomer();
111 int nBasis =
system().domain().basis().nBasis();
113 for (i = 0; i < nMonomer; ++i) {
116 for (j = 0; j < nBasis; ++j) {
117 stateField[j] = systemField[j];
void allocate()
Allocate all fields.
void getSystemState()
Copy the current state of the associated system.
void read(const std::string &filename)
Read state from file.
BasisFieldState()
Default constructor.
~BasisFieldState()
Destructor.
void setSystemState(bool newCellParams)
Set the state of the associated system to this state.
void write(const std::string &filename)
Write state to file.
const UnitCell< D > & unitCell() const
const DArray< FT > & fields() const
const DArray< double > & field(int monomerId) const
Main class, representing a complete physical 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.
Periodic fields and crystallography.
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.