00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef QC2COMPONENTBEC_H
00028 #define QC2COMPONENTBEC_H
00029
00030 #include "qcbec.h"
00031
00037 template <int rank>
00038 class QC2ComponentBEC : public QCBEC<rank>
00039 {
00040 public:
00041
00047 QC2ComponentBEC(void);
00051 ~QC2ComponentBEC(void);
00055 void setSize(int noOfRows, int noOfCols);
00057
00058
00064 void setg11(parameterType g11)
00065 { this->SystemParameters.setParameter(7,g11); }
00069 void setg12(parameterType g12)
00070 { this->SystemParameters.setParameter(8,g12); }
00074 void setg22(parameterType g22)
00075 { this->SystemParameters.setParameter(9,g22); }
00079 void setg21(parameterType g21)
00080 { this->SystemParameters.setParameter(10,g21); }
00082
00083
00089 parameterType getg11()
00090 { return this->SystemParameters.getParameter(7); }
00094 parameterType getg12()
00095 { return this->SystemParameters.getParameter(8); }
00099 parameterType getg22()
00100 { return this->SystemParameters.getParameter(9); }
00104 parameterType getg21()
00105 { return this->SystemParameters.getParameter(10); }
00109 Array<complexType,rank>* accessComp1()
00110 { return this->OrderParameter.accessArray(); }
00114 Array<complexType,rank>* accessComp2()
00115 { return OrderParameter2.accessArray(); }
00117
00118
00124 void windPhase();
00128 void constantPhase();
00132 void randomPhase();
00136 void applyPhaseDisturbance();
00141 void evolve(bool forwards);
00145 void setupSteadyState();
00149 void writeResults();
00153 void writeImage(int shot, string filePrefix, string extension);
00155
00156 protected:
00157 QCComplexField<rank> OrderParameter2;
00158 };
00159
00160 #endif // QC2COMPONENTBEC_H
00161
00162 template <int rank>
00163 QC2ComponentBEC<rank>::QC2ComponentBEC()
00164 {
00165 this->SystemParameters.setNoOfParameters(11);
00166 }
00167
00168 template <int rank>
00169 QC2ComponentBEC<rank>::~QC2ComponentBEC()
00170 {
00171
00172 }
00173
00174 template <int rank>
00175 void QC2ComponentBEC<rank>::setSize(int noOfRows, int noOfCols)
00176 {
00177 this->OrderParameter.setSize(noOfRows,noOfCols);
00178 OrderParameter2.setSize(noOfRows,noOfCols);
00179 }
00180
00181 template <int rank>
00182 void QC2ComponentBEC<rank>::windPhase()
00183 {
00184 this->Phase.applyVortex(this->OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00185 this->Phase.applyVortex(OrderParameter2,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00186 }
00187
00188 template <int rank>
00189 void QC2ComponentBEC<rank>::constantPhase()
00190 {
00191 this->Phase.applyUniform(this->OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00192 this->Phase.applyUniform(OrderParameter2,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00193 }
00194
00195 template <int rank>
00196 void QC2ComponentBEC<rank>::randomPhase()
00197 {
00198 this->Phase.applyRandom(this->OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00199 this->Phase.applyRandom(OrderParameter2,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00200 }
00201
00202 template <int rank>
00203 void QC2ComponentBEC<rank>::applyPhaseDisturbance()
00204 {
00205 this->Phase.applyDisturbanceTypeII(this->OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00206 this->Phase.applyDisturbanceTypeII(OrderParameter2,this->deltaX,this->deltaY,this->xOffset,this->yOffset);
00207 }
00208
00209 template <int rank>
00210 void QC2ComponentBEC<rank>::evolve(bool forwards)
00211 {
00212 this->Evolve.evolveForwards(forwards);
00213 this->Evolve.usingTDGP2Component(this->OrderParameter,OrderParameter2,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->SystemParameters);
00214 }
00215
00216 template <int rank>
00217 void QC2ComponentBEC<rank>::setupSteadyState()
00218 {
00219 this->SteadyState.usingTDGPVortexFixedPoint(this->OrderParameter,this->deltaR,this->SystemParameters);
00220 this->SteadyState.transferSolutionTo(this->OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->deltaR);
00221 this->SteadyState.usingTDGPVortexFixedPoint(OrderParameter2,this->deltaR,this->SystemParameters);
00222 this->SteadyState.transferSolutionTo(OrderParameter2,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->deltaR);
00223 }
00224
00225 template <int rank>
00226 void QC2ComponentBEC<rank>::writeResults()
00227 {
00228 this->OrderParameter.writeNormToFile("FinalNormComp1.csv");
00229 this->Phase.outputPhaseFunction(this->OrderParameter,"FinalPhaseComp1.csv");
00230 OrderParameter2.writeNormToFile("FinalNormComp2.csv");
00231 this->Phase.outputPhaseFunction(OrderParameter2,"FinalPhaseComp2.csv");
00232 }
00233
00234 template <int rank>
00235 void QC2ComponentBEC<rank>::writeImage(int shot, string filePrefix, string extension)
00236 {
00237 char digit = static_cast<char> (shot + 48);
00238 string filename1 = filePrefix + '1' + digit + extension;
00239 string filename2 = filePrefix + '2' + digit + extension;
00240
00241 this->ptrField->writeToFile(filename1.c_str());
00242 OrderParameter2.writeToFile(filename2.c_str());
00243 }