⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmdsclasses.h

📁 XMDS is a code generator that integrates equations. You write them down in human readable form in a
💻 H
📖 第 1 页 / 共 4 页
字号:
// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateEX// *****************************************************************************// *****************************************************************************//! Class to integrate equations in explicit pictureclass xmdsIntegrateEX : public virtual xmdsIntegrate {public :  //! Constructor of xmdsIntegrateEX object  xmdsIntegrateEX(                  const xmdsSimulation *const yourSimulation,                  const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateEX();  //! Processes the element  void processElement(                      const Element *const yourElement);protected :  //! Writes the function prototypes to outfile  void writePrototypes(                       FILE *const outfile) const;  //! Writes the routines to outfile  void writeRoutines(                     FILE *const outfile) const;private :  //! Writes the routine for calculating the k-operator field to file  void writeCalculatekOperatorFieldRoutine(                                           FILE *const outfile) const;  //! Writes the routine for calculating the component terms for constant k-operators to file  void writeCalculateCOTermsConstantKRoutine(                                             FILE *const outfile) const;  //! Writes the routine for calculating the component terms for time dependent k-operators to file  void writeCalculateCOTermsTimeDepKRoutine(                                            FILE *const outfile) const;};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateSI// *****************************************************************************// *****************************************************************************//! Class to integrate equations using the semi-implicit methodclass xmdsIntegrateSI : public virtual xmdsIntegrate {public :  //! Constructor of xmdsIntegrateSI object  xmdsIntegrateSI(                  const xmdsSimulation *const yourSimulation,                  const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateSI();  //! Processes the element  void processElement(                      const Element *const yourElement);protected :  //! Returns the number of iterations  unsigned long nIterations() const;private :  unsigned long mynIterations;  //!< The number of iterations to be performed};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateRK4// *****************************************************************************// *****************************************************************************//! Class to integrate equations using the fourth order Runge-Kutta methodclass xmdsIntegrateRK4 : public virtual xmdsIntegrate {public :  //! Constructor of xmdsIntegrateRK4 object  xmdsIntegrateRK4(                   const xmdsSimulation *const yourSimulation,                   const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateRK4();  //! Processes an element  void processElement(                      const Element *const yourElement);protected :  //! Writes the function prototypes to outfile  void writePrototypes(                       FILE *const outfile) const;  //! Writes the routines to outfile  void writeRoutines(                     FILE *const outfile) const;  //! Writes the single step code to outfile  virtual void writeSingleStepCode(                                   FILE *const outfile,                                   const stepCaseEnum& stepCase) const = 0;private :  //! Write the main integrate routine to file  void writeMainIntegrateRoutine(                                 FILE *const outfile) const;  //! Write the routine to calculate the cross field to file  void writeCalculateCrossFieldRoutine(                                       FILE *const outfile) const;};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateSIIP// *****************************************************************************// *****************************************************************************//! Class to integrate equations using the semi-implicit method in the interaction pictureclass xmdsIntegrateSIIP :       public xmdsIntegrateIP,                                public xmdsIntegrateSI{public :  //! Constructor of xmdsIntegrateSIIP object  xmdsIntegrateSIIP(                    const xmdsSimulation *const yourSimulation,                    const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateSIIP();  //! Processes an element  void processElement(                      const Element *const yourElement);private :  //! Write the integrate SIIP prototypes to file  void writePrototypes(                       FILE *const outfile) const;  //! Write the integrate SIIP x-space prototypes to file  void writexSpacePrototype(                            FILE *const outfile) const;  //! Write the integrate SIIP routines to file  void writeRoutines(                     FILE *const outfile) const;  //! Write the main SIIP integrate routine to file  void writeMainIntegrateRoutine(                                 FILE *const outfile) const;  //! Write the integrate SIIP x-space routine to file  void writexSpaceRoutine(                          FILE *const outfile) const;  //! Write the integrate SIIP single step code to file  void writeSingleStepCode(                           FILE *const outfile,                           const stepCaseEnum& stepCase) const;};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateSIEX// *****************************************************************************// *****************************************************************************//! Class to integrate the equations using the semi-implicit method in the explicit pictureclass xmdsIntegrateSIEX : public xmdsIntegrateEX,                          public xmdsIntegrateSI {public :  //! Constructor of xmdsIntegrateSIEX object  xmdsIntegrateSIEX(                    const xmdsSimulation *const yourSimulation,                    const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateSIEX();  //! Processes an element  void processElement(                      const Element *const yourElement);private :  //! Write the integrate SIEX prototypes to file  void writePrototypes(                       FILE *const outfile) const;  //! Write the integrate SIEX routines to file  void writeRoutines(                     FILE *const outfile) const;  //! Write the main SIEX integrate routine to file  void writeMainIntegrateRoutine(                                 FILE *const outfile) const;  //! Write the integrate SIEX cross-field calculating routine to file  void writeCalculateCrossFieldRoutine(                                       FILE *const outfile) const;  //! Write the integrate SIEX single step code to file  void writeSingleStepCode(                           FILE *const outfile,                           const stepCaseEnum& stepCase) const;};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateRK4IP// *****************************************************************************// *****************************************************************************//! Class to integrate equations using the fourth order Runge-Kutta method in the interaction pictureclass xmdsIntegrateRK4IP :      public xmdsIntegrateIP,                                public xmdsIntegrateRK4{public :  //! Constructor of xmdsIntetrageRK4IP object  xmdsIntegrateRK4IP(                     const xmdsSimulation *const yourSimulation,                     const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateRK4IP();  //! Processes an element  void processElement(                      const Element *const yourElement);private :  //! Write the integrate RK4IP prototypes to file  void writePrototypes(                       FILE *const outfile) const;  //! Write the integrate RK4IP routines to file  void writeRoutines(                     FILE *const outfile) const;  //! Write the integrate RK4IP single step code to file  void writeSingleStepCode(                           FILE *const outfile,                           const stepCaseEnum& stepCase) const;};// *****************************************************************************// *****************************************************************************//                              xmdsIntegrateRK4EX// *****************************************************************************// *****************************************************************************//! Class to integrate equations using the fourth order Runge-Kutta method in the explicit pictureclass xmdsIntegrateRK4EX : public xmdsIntegrateEX,                           public xmdsIntegrateRK4 {public :  //! Constructor of an xmdsIntegrateRK4EX object  xmdsIntegrateRK4EX(                     const xmdsSimulation *const yourSimulation,                     const bool& yourVerboseMode);  //! Destructor  ~xmdsIntegrateRK4EX();  //! Processes an element  void processElement(                      const Element *const yourElement);private :  //! Write the integrate RK4EX prototypes to file  void writePrototypes(                       FILE *const outfile) const;  //! Write the integrate RK4EX routines to file  void writeRoutines(                     FILE *const outfile) const;  //! Write the integrate RK4EX single step code to file  void writeSingleStepCode(                           FILE *const outfile,                           const stepCaseEnum& stepCase) const;};// *****************************************************************************// *****************************************************************************//                              xmdsSimulation// *****************************************************************************// *****************************************************************************//! Class to organise a simulation in xmdsclass xmdsSimulation : public xmdsElement {public :  //! Structure of parameters used in an xmds simulation  struct simulationParametersStruct {    XMLString rawFileName;    //!< Raw simulation file name    XMLString simulationName; //!< Simulation name    XMLString propDimName;    //!< Propagation dimension name    XMLString authorName;     //!< Name of the author the xmds script    XMLString description;    //!< Description of what the script is supposed to do    long nThreads;            //!< Number of threads    bool stochastic;          //!< Is this a stochastic simulation?    long nPaths;              //!< Number of paths    bool mpiAvailable;        //!< Is mpi available?    bool usempi;              //!< Use mpi?    bool bing;                //!< Play sound when simulation is finished?    long seed[2];             //!< Random number seed    long nNoises;             //!< Number of noise terms    XMLString noiseKind;      //!< The kind of noise to be generated    double noiseMean;         //!< The mean of the noise distribution; only used for Poissonian distributions    bool errorCheck;          //!< Should I error check?    bool useWisdom;           //!< Should wisdom be used?    bool usePrefs;            //!< Should the values in the preferences file be used?    bool binaryOutput;        //!< Is binary output required?    bool useDouble;           //!< Should double precision be used?    bool benchmark;           //!< Time the main loop?    XMLString version;        //!< The current xmds version number    XMLString release;        //!< The current xmds release number  };  //! Structure of arguments on command line to simulation  struct argvStruct {    mutable list<string> nameList;             //!< List storing the argument names    mutable list<string> typeList;             //!< List storing the argument types    mutable list<string> defaultValueList;     //!< List storing the argument default values    mutable list<string> shortOptionList;      //!< List storing the short option names    mutable list<string> typeConversionList;   //!< List storing how to perform the type conversion  };  //! Constructor of xmdsSimulation object  xmdsSimulation(                 const char *const yourRawFileName,                 const bool& yourVerboseMode,                 const bool& mpiAvailable);  //! Destructor  ~xmdsSimulation();  //! Process element within xmds simulation  void processElement(                      const Element *const yourElement);  //! Returns structure holding parameters controlling the simulation  const simulationParametersStruct* parameters() const;  //! Returns the structure containing the command line argument information  argvStruct* argStruct() const;  //! Returns an xmdsArgv object  xmdsArgv* argv() const;  //! Returns an xmdsField object  xmdsField* field() const;  //! Returns an xmdsOutput object to manage output to file  const xmdsOutput* output() const;  //! Returns an xmdsSequence object  const xmdsSequence* sequence() const;  //! Returns the next segment number in the simulation sequence  unsigned long nextSegmentNumber() const;  //! Inserts relevant code at relevant point in output C++ file  void makeCode(                const unsigned long& inFileSplitPoint) const;private :    simulationParametersStruct    myParameters;            //!< Structure of parameters of simulation  mutable argvStruct            myArgStruct;             //!< Structure of command line arguments to simulation  mutable list<string>          myArgvNameList;          //!< List of names of command line arguments  xmdsArgv*                     myArgv;                  //!< The command line argument "vector" object  xmdsField*                    myField;                 //!< The xmdsField object  xmdsOutput*                   myOutput;                //!< The xmdsOutput object  xmdsSequence*                 mySequence;              //!< The xmdsSequence object  mutable unsigned long         myCurrentSegmentNumber;  //!< The current segment number  //! Write the simulation include statements to file  void writeIncludes(                     FILE *const outfile) const;  //! Write the simulation define statements to file  void writeDefines(                    FILE *const outfile) const;  //! Write the simulation global variables to file  void writeGlobals(                    FILE *const outfile) const;  //! Write the simulation prototypes to file  void writePrototypes(                       FILE *const outfile) const;  //! Write the simulation routines to file  void writeRoutines(                     FILE *const outfile) const;  //! Create an xmdsGlobals object  xmdsGlobals* createxmdsGlobals();  //! Create an xmdsField object  xmdsField* createxmdsField();  //! Create an xmdsArgv object  xmdsArgv* createxmdsArgv();  //! Create an xmdsOutput object  xmdsOutput* createxmdsOutput();  //! Create an xmdsSequence object  xmdsSequence* createxmdsSequence();};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -