PSCF v1.3
rpg/fts/analyzer/FourthOrderParameter.h
1#ifndef RPG_FOURTH_ORDER_PARAMETER_H
2#define RPG_FOURTH_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 <prdc/cuda/RField.h> // member
14#include <prdc/cuda/RFieldDft.h> // member
15#include <pscf/math/IntVec.h> // member
16
17
18namespace Pscf {
19namespace Rpg {
20
21 template <int D> class System;
22 template <int D> class Simulator;
23
24 using namespace Util;
25 using namespace Pscf::Prdc;
26 using namespace Pscf::Prdc::Cuda;
27
45 template <int D>
47 {
48
49 public:
50
55
59 virtual ~FourthOrderParameter();
60
64 virtual void setup();
65
69 virtual double compute();
70
77 virtual void outputValue(int step, double value);
78
90 void computePrefactor();
91
97
98 protected:
99
102 using AverageAnalyzer<D>::outputFile_;
104
105 private:
106
108 int kSize_;
109
111 IntVec<D> kMeshDimensions_;
112
114 bool isInitialized_;
115
117 RFieldDft<D> wK_;
118
120 RField<D> wc0_;
121
123 RField<D> prefactor_;
124
126 double FourthOrderParameter_;
127
128 };
129
130 #ifndef RPG_FOURTH_ORDER_PARAMETER_TPP
131 // Suppress implicit instantiation
132 extern template class FourthOrderParameter<1>;
133 extern template class FourthOrderParameter<2>;
134 extern template class FourthOrderParameter<3>;
135 #endif
136
137}
138}
139#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.
FourthOrderParameter is used to detect an order-disorder transition.
virtual double compute()
Compute and return the fourth order parameter.
FourthOrderParameter(Simulator< D > &simulator, System< D > &system)
Constructor.
virtual void outputValue(int step, double value)
Output a sampled or block average value.
virtual void setup()
Setup before simulation loop.
void computePrefactor()
Compute prefactor for each Fourier wavevector.
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