include/qcbec.h

00001 /***************************************************************************
00002  *   Quantum Construct (qC++)                                                                  *
00003  *   The Quantum Physics Computational Library                                         *
00004  *   Copyright (C) 2005 by Shekhar S. Chandra                                      *
00005  *   Shekhar.Chandra@sci.monash,edu.au                                     *
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /*
00023         Ver Info - QCBEC.h
00024         1.0.0 - Original Implementation
00025 */
00026 
00027 #ifndef QCBEC_H
00028 #define QCBEC_H
00029 
00030 #include "qcquantumsystem.h"
00031 #include "qccomplexfield.h"
00032 #include "qcphase.h"
00033 
00039 template <int rank>
00040 class QCBEC : public QCQuantumSystem<complexType,rank>
00041 {
00042 public:
00043     // -------------------------------------------------------
00049     QCBEC(void);
00053     ~QCBEC(void);
00055 
00056     // -------------------------------------------------------
00062     void setTrapFrequency(parameterType omegaValue)
00063     {   this->SystemParameters.setParameter(0,omegaValue);        }
00067     void setChemicalPotential(parameterType chemValue)
00068     {   this->SystemParameters.setParameter(1,chemValue);        }
00072     void setSelfInteraction(parameterType gValue)
00073     {   this->SystemParameters.setParameter(2,gValue);            }
00077     void setHBar(parameterType hbarValue)
00078     {   this->SystemParameters.setParameter(3,hbarValue);         }
00082     void setMass(parameterType massValue)
00083     {   this->SystemParameters.setParameter(4,massValue);         }
00087     void setAngularFrequency(parameterType bigOmegaValue)
00088     {   this->SystemParameters.setParameter(5,bigOmegaValue);     }
00092     void setWindingNumber(parameterType nValue)
00093     {   this->SystemParameters.setParameter(6,nValue);            }
00097         void setDisturbance(parameterType height, int position, int width);
00099 
00100     // -------------------------------------------------------
00106         parameterType getTrapFrequency()
00107         {   return this->SystemParameters.getParameter(0);            }
00111         parameterType getChemicalPotential()
00112         {   return this->SystemParameters.getParameter(1);            }
00116         parameterType getSelfInteraction()
00117         {   return this->SystemParameters.getParameter(2);            }
00121         parameterType getHBar()
00122         {   return this->SystemParameters.getParameter(3);            }
00126         parameterType getMass()
00127         {   return this->SystemParameters.getParameter(4);            }
00131         parameterType getAngularFrequency()
00132         {   return this->SystemParameters.getParameter(5);            }
00136         parameterType getWindingNumber()
00137         {   return this->SystemParameters.getParameter(5);            }
00141         void getDisturbance(parameterType &height, int &position, int &width);
00143 
00144         // -------------------------------------------------------
00150     virtual void windPhase()
00151     {   Phase.applyVortex(OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);    }
00155     virtual void constantPhase()
00156     {   Phase.applyUniform(OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);   }
00160     virtual void randomPhase()
00161     {   Phase.applyRandom(OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset);    }
00165     virtual void applyPhaseDisturbance()
00166     {   Phase.applyDisturbanceTypeII(OrderParameter,this->deltaX,this->deltaY,this->xOffset,this->yOffset); }
00171     virtual void evolve(bool forwards);
00175     virtual void setupConstant();
00179     virtual void setupSteadyState();
00183     virtual void setupVortexSteadyState();
00187     virtual void setupSteadyStateGS();
00191     virtual void setupSteadyStateFSI();
00195     virtual void writeResults();
00197 
00198 protected:
00199     QCPhase Phase; 
00200     QCComplexField<rank> OrderParameter; 
00202 };
00203 
00204 #endif // QCBEC_H
00205 
00206 template <int rank>
00207 QCBEC<rank>::QCBEC()
00208 {
00209     this->ptrField = &OrderParameter;
00210     this->SystemParameters.setNoOfParameters(7);
00211 }
00212 
00213 template <int rank>
00214 QCBEC<rank>::~QCBEC()
00215 {
00216     //dtor
00217 }
00218 
00219 template <int rank>
00220 void QCBEC<rank>::setDisturbance(parameterType height, int position, int width)
00221 {
00222         Phase.setDisturbHeight(height);
00223         Phase.setDisturbPosition(position);
00224         Phase.setDisturbWidth(width);
00225 }
00226 
00227 template <int rank>
00228 void QCBEC<rank>::getDisturbance(parameterType &height, int &position, int &width)
00229 {
00230         height = Phase.getDisturbHeight();
00231         position = Phase.getDisturbPosition();
00232         width = Phase.getDisturbWidth();
00233 }
00234 
00235 template <int rank>
00236 void QCBEC<rank>::evolve(bool forwards)
00237 {
00238     this->Evolve.evolveForwards(forwards);
00239     this->Evolve.usingTDGP(OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->SystemParameters);
00240 }
00241 
00242 template <int rank>
00243 void QCBEC<rank>::setupConstant()
00244 {
00245     this->SteadyState.setConstant(OrderParameter);
00246 }
00247 
00248 template <int rank>
00249 void QCBEC<rank>::setupSteadyState()
00250 {
00251     this->SteadyState.usingTDGPFixedPoint(OrderParameter,this->deltaR,this->SystemParameters);
00252         this->SteadyState.transferSolutionTo(OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->deltaR);
00253         this->SteadyState.output1DSolution("Radial.csv",this->deltaR);
00254 }
00255 
00256 template <int rank>
00257 void QCBEC<rank>::setupVortexSteadyState()
00258 {
00259     this->SteadyState.usingTDGPVortexFixedPoint(OrderParameter,this->deltaR,this->SystemParameters);
00260         this->SteadyState.transferSolutionTo(OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->deltaR);
00261         this->SteadyState.output1DSolution("Radial.csv",this->deltaR);
00262 }
00263 
00264 template <int rank>
00265 void QCBEC<rank>::setupSteadyStateFSI()
00266 {
00267     /*this->SteadyState.usingTDGPFastSI(OrderParameter,this->deltaR,this->SystemParameters);
00268     this->SteadyState.transferSolutionTo(OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->deltaR);
00269     this->SteadyState.output1DSolution("FSITest.csv",this->deltaR);*/
00270 }
00271 
00272 template <int rank>
00273 void QCBEC<rank>::setupSteadyStateGS()
00274 {
00275     //this->SteadyState.usingTDGPGaussSeidel(OrderParameter,this->xOffset,this->yOffset,this->deltaX,this->deltaY,this->SystemParameters);
00276 }
00277 
00278 template <int rank>
00279 void QCBEC<rank>::writeResults()
00280 {
00281     OrderParameter.writeNormToFile("FinalNorm.csv");
00282         Phase.outputPhaseFunction(OrderParameter,"FinalPhase.csv");
00283 }

Generated on Sat May 13 13:22:48 2006 for Quantum Construct (qC++) by  doxygen 1.4.6-NO