11#include <util/param/ParamComposite.h>
12#include <prdc/cpu/CField.h>
13#include <util/random/Random.h>
14#include <util/containers/DArray.h>
15#include <util/containers/DMatrix.h>
22 template <
int D>
class System;
23 template <
int D>
class Step;
28 using namespace Prdc::Cpu;
57 Simulator(Simulator<D>& ) =
delete;
120 virtual void analyze(
int min,
int max,
121 std::string classname,
122 std::string filename);
190 double eval(
int i)
const;
227 double evecs(
int a,
int i)
const;
254 double sc(
int a)
const;
449 AnalyzerManager<D>& analyzerManager();
465 AnalyzerManager<D> analyzerManager_;
538 std::complex<double> hamiltonian_;
543 std::complex<double> idealHamiltonian_;
548 std::complex<double> fieldHamiltonian_;
604 bool hasHamiltonian_;
633 void readRandomSeed(std::istream& in);
640 void setup(
int nStep);
664 {
return (
bool)stepPtr_; }
678 {
return analyzerManager_; }
686 return *trajectoryReaderFactoryPtr_;
705 {
return evals_[a]; }
715 {
return evecs_(a, i); }
732 return idealHamiltonian_;
740 return fieldHamiltonian_;
746 {
return hasHamiltonian_; }
803 {
return iTotalStep_; }
Simulator for complex Langevin field theoretic simulation.
void allocate()
Allocate required memory.
bool hasHamiltonian() const
Has the Hamiltonian been computed for current w and c fields?
long iStep()
Return the current converged simulation step index.
virtual void simulate(int nStep)
Perform a complex Langevin field theoretic simulation.
void computeHamiltonian()
Compute the Hamiltonian used in PS-FTS.
bool isPositiveEval(int i) const
Is the associated eigenvalue of U positive?
bool hasCc() const
Are eigen-components of current c fields valid ?
std::complex< double > fieldHamiltonian() const
Get the quadratic field contribution to the Hamiltonian.
virtual void clearTimers()
Clear timers.
System< D > & system()
Get parent system by reference.
virtual void outputTimers(std::ostream &out) const
Output timing results.
bool hasDc() const
Are the current d fields valid ?
void computeCc()
Compute eigenvector components of the current c fields.
void clearData()
Clear field eigen-components and hamiltonian components.
DMatrix< double > const & evecs() const
Get the matrix of all eigenvectors of the interaction matrix.
void computeWc()
Compute eigenvector components of the current w fields.
DArray< CField< D > > const & cc() const
Get all eigenvector components of the current c fields.
DArray< double > const & evals() const
Get an array of the eigenvalues of the interaction matrix U.
DMatrix< double > const & u() const
Get the interaction matrix U by const reference.
bool hasWc() const
Are eigen-components of current w fields valid ?
DArray< CField< D > > const & wc() const
Get all eigenvector components of the current w fields.
long iTotalStep()
Return the current simulation step index.
Random & random()
Get random number generator by reference.
Step< D > & step()
Get the Step by reference.
virtual void readParameters(std::istream &in)
Read parameters for a simulation.
double eval(int i) const
Get a single eigenvalue of the interaction matrix.
std::complex< double > hamiltonian() const
Get the Hamiltonian used in PS-FTS.
DArray< CField< D > > const & dc() const
Get all of the current d fields.
void analyzeInteraction()
Perform eigenvalue analysis of the interaction matrix U.
bool hasStep() const
Does this Simulator have a Step object?
void computeDc()
Compute functional derivatives of the Hamiltonian.
std::complex< double > idealHamiltonian() const
Get ideal gas contribution to the Hamiltonian.
Step is an abstract base class for Brownian dynamics steps.
Main class for CL-FTS, representing a complete physical system.
Field of complex double precision values on an FFT mesh.
Dynamically allocatable contiguous array template.
Dynamically allocated Matrix.
ParamComposite()
Constructor.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
#define UTIL_ASSERT(condition)
Assertion macro suitable for debugging serial or parallel code.
Complex periodic fields, CL-FTS (CPU).
Periodic fields and crystallography.
PSCF package top-level namespace.