PSCF v1.3
rpc/fts/analyzer/MaxOrderParameter.h
1#ifndef RPC_MAX_ORDER_PARAMETER_H
2#define RPC_MAX_ORDER_PARAMETER_H
3
4/*
5* PSCF - Polymer Self-Consistent Field
6*
7* Copyright 2015 - 2025, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include "AverageAnalyzer.h" // base class
12
13#include <util/containers/DArray.h> // member
14#include <util/accumulators/Average.h> // member
15#include <prdc/cpu/RFieldDft.h> // member
16#include <map> // member
17
18#include <string>
19#include <iostream>
20
21namespace Pscf {
22namespace Rpc {
23
24 template <int D> class System;
25 template <int D> class Simulator;
26
27 using namespace Util;
28 using namespace Pscf::Prdc::Cpu;
29
47 template <int D>
49 {
50
51 public:
52
57
61 virtual ~MaxOrderParameter();
62
66 virtual void setup();
67
73
74 protected:
75
79 using AverageAnalyzer<D>::outputFile_;
80
84 virtual double compute();
85
92 virtual void outputValue(int step, double value);
93
94 private:
95
97 int kSize_;
98
100 IntVec<D> kMeshDimensions_;
101
103 RFieldDft<D> wK_;
104
106 double maxOrderParameter_;
107
109 IntVec<D> GminStar_;
110
112 bool isInitialized_;
113
114 };
115
116 #ifndef RPC_MAX_ORDER_PARAMETER_TPP
117 // Suppress implicit instantiation
118 extern template class MaxOrderParameter<1>;
119 extern template class MaxOrderParameter<2>;
120 extern template class MaxOrderParameter<3>;
121 #endif
122
123}
124}
125#endif
An IntVec<D, T> is a D-component vector of elements of integer type T.
Definition IntVec.h:27
Fourier transform of a real field on an FFT mesh.
AverageAnalyzer(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual void sample(long iStep)
Compute a sampled value and update the accumulator.
int nSamplePerOutput() const
Get value of nSamplePerOutput.
Simulator< D > & simulator()
Return reference to parent simulator.
virtual void output()
Write final results to file after a simulation.
System< D > & system()
Return reference to parent system.
virtual void readParameters(std::istream &in)
Read interval, outputFileName and (optionally) nSamplePerOutput.
MaxOrderParameter is used to detect an order-disorder transition.
virtual double compute()
Compute and return the max order parameter.
MaxOrderParameter(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual void setup()
Setup before simulation loop.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
Field theoretic simulator (base class).
Main class, representing one complete system.
void setClassName(const char *className)
Set class name string.
Fields and FFTs for periodic boundary conditions (CPU)
Definition CField.cpp:12
Real periodic fields, SCFT and PS-FTS (CPU).
Definition param_pc.dox:2
PSCF package top-level namespace.
Definition param_pc.dox:1