1#ifndef RP_MAX_ORDER_PARAMETER_TPP
2#define RP_MAX_ORDER_PARAMETER_TPP
4#include "MaxOrderParameter.h"
6#include <rp/system/System.h>
7#include <rp/fts/simulator/Simulator.h>
8#include <rp/solvers/Mixture.h>
9#include <rp/field/Domain.h>
10#include <rp/field/WFields.h>
12#include <pscf/field/FFT.h>
13#include <pscf/crystal/shiftToMinimum.h>
14#include <pscf/crystal/UnitCell.h>
16#include <pscf/backend/VecOp.h>
17#include <pscf/mesh/Mesh.h>
18#include <pscf/math/IntVec.h>
20#include <util/param/ParamComposite.h>
21#include <util/misc/FileMaster.h>
22#include <util/misc/ioUtil.h>
23#include <util/format/Int.h>
24#include <util/format/Dbl.h>
35 template <
int D,
class T>
46 template <
int D,
class T>
50 const int nMonomer =
system().mixture().nMonomer();
56 meshDimensions_ =
system().domain().mesh().dimensions();
60 if (!wK_.isAllocated()){
62 wK_.allocate(meshDimensions_);
63 psi_.allocate(kMeshDimensions_);
72 template <
int D,
class T>
97 for (
int i = 2; i < kSize_; ++i){
98 if (psi_h_[i] > maxPsi_){
105 Mesh<D> kMesh(kMeshDimensions_);
108 Gmax_ = shiftToMinimum(Gmax_, meshDimensions_, unitCell);
119 template <
int D,
class T>
128 for (
int i = 0; i < D; i++){
129 file <<
Int(Gmax_[i],3) <<
" ";
Description of a regular grid of points in a periodic domain.
IntVec< D > position(int rank) const
Get the position IntVec<D> of a grid point with a specified rank.
Simulator< D, T > & simulator()
Get the parent Simulator by reference.
System< D, T > & system()
Get the parent System by reference.
int nSamplePerOutput() const
Get value of nSamplePerOutput.
AverageAnalyzer(Simulator< D, T > &simulator, System< D, T > &system)
Constructor.
std::ofstream outputFile_
Output file stream.
virtual void setup()
Setup before loop.
double compute() override
Compute and return the max order parameter.
MaxOrderParameter(Simulator< D, T > &simulator, System< D, T > &system)
Constructor.
void outputValue(int step, double value) override
Output a sampled or block average value.
void setup() override
Setup before simulation loop.
Base class for field theoretic PS-FTS simulator.
Base class template for classes that represent a complete system.
Base template for UnitCell<D> classes, D=1, 2 or 3.
Dbl()
Default constructor.
Int()
Default constructor.
void setClassName(const char *className)
Set class name string.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void sqAbsV(Array< double > &a, Array< fftw_complex > const &b)
Square of absolute magnitude, a[i] = |b[i]|^2 (complex).
Code for programs that simulate real-valued periodic fields.
PSCF package top-level namespace.