potentialbase.h

来自「An object-oriented C++ implementation of」· C头文件 代码 · 共 45 行

H
45
字号

#ifndef potentialbaseH
#define potentialbaseH

#include "../davidson/defaulttd.h"
#include "../davidson/gridparam.h"

class PotentialBase
{
	protected:
        //potential type
        ntyp typV;

	private:

        //saves values of the potential into files (1D, 2D, 3D)
        void SaveCor1D(const GridParam &, ofstream &) const;
        void SaveCor2D(const GridParam &, ofstream &) const;        void SaveCor3D(const GridParam &, ofstream &) const;
        
	public:
        //default constructor of PotentialBase class
    	PotentialBase():typV(-1){};

        //saves values of potential to file
        void SaveToFiles(char *,const GridParam &) const;

        /* returns the auxiliary identifier of the potential type
           (value of the data member TypV which must be set in the derived class
           constructor) */
        ntyp GetTypV() const;

        //Step function (returns 1 for x>=0, in other case returns 0) 
        ntyp Theta(const ftyp &) const;

        //returns V(x)
        virtual ftyp operator()(const ftyp &) const=0;
        //returns V(x,y)
        virtual ftyp operator()(const ftyp &, const ftyp &) const=0;
        //returns V(x,y,z)
        virtual ftyp operator()(const ftyp &, const ftyp &, const ftyp &) const=0;
};

#endif

⌨️ 快捷键说明

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