PSCF v1.3
rpg/fts/analyzer/MaxOrderParameter.h
1#ifndef RPG_MAX_ORDER_PARAMETER_H
2#define RPG_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#include <prdc/cuda/RField.h> // member
13#include <prdc/cuda/RFieldDft.h> // member
14#include <pscf/math/IntVec.h> // member
15
16namespace Pscf {
17namespace Rpg {
18
19 template <int D> class System;
20 template <int D> class Simulator;
21
22 using namespace Util;
23 using namespace Pscf::Prdc;
24 using namespace Pscf::Prdc::Cuda;
25
41 template <int D>
43 {
44
45 public:
46
51
55 virtual ~MaxOrderParameter();
56
60 void setup();
61
65 virtual double compute();
66
73 virtual void outputValue(int step, double value);
74
80
81 protected:
82
85 using AverageAnalyzer<D>::outputFile_;
87
88 private:
89
91 int kSize_;
92
94 IntVec<D> kMeshDimensions_;
95
97 bool isInitialized_;
98
100 RFieldDft<D> wK_;
101
103 RField<D> wc0_;
104
106 double maxOrderParameter_;
107
109 IntVec<D> GminStar_;
110
111 };
112
113 #ifndef RPG_MAX_ORDER_PARAMETER_TPP
114 // Suppress implicit instantiation
115 extern template class MaxOrderParameter<1>;
116 extern template class MaxOrderParameter<2>;
117 extern template class MaxOrderParameter<3>;
118 #endif
119
120}
121}
122#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.
Field of real double precision values on an FFT mesh.
Definition cpu/RField.h:29
virtual void readParameters(std::istream &in)
Read interval, outputFileName and (optionally) nSamplePerOutput.
virtual void sample(long iStep)
Compute a sampled value and update the accumulator.
AverageAnalyzer(Simulator< D > &simulator, System< D > &system)
Constructor.
int nSamplePerOutput() const
Get value of nSamplePerOutput.
Simulator< D > & simulator()
Return reference to parent simulator.
System< D > & system()
Return reference to parent system.
virtual void output()
Write final results to file after a simulation.
MaxOrderParameter is used to detect an order-disorder transition.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
virtual double compute()
Compute and return the max order parameter.
void setup()
Setup before simulation loop.
MaxOrderParameter(Simulator< D > &simulator, System< D > &system)
Constructor.
Field theoretic simulator (base class).
Main class, representing one complete system.
void setClassName(const char *className)
Set class name string.
Fields, FFTs, and utilities for periodic boundary conditions (CUDA)
Definition Reduce.cpp:14
Periodic fields and crystallography.
Definition CField.cpp:11
SCFT and PS-FTS with real periodic fields (GPU)
PSCF package top-level namespace.
Definition param_pc.dox:1