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

📄 pfile.h

📁 An object-oriented C++ implementation of Davidson method for finding a few selected extreme eigenpai
💻 H
字号:

#ifndef pFileH
#define pFileH


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

class PotentialFromFile: public PotentialBase
{
    private:

        // returns round value
    	ntyp Round(ftyp ) const;

        //The pointer for object of GridParam classs
        const GridParam *gp;

        //The pointer for table of potential values, read from file
        ftyp *vfile;

    public:

    	//reads potential from file
        PotentialFromFile(const char *, const GridParam *);

        //returns V(x)
        ftyp operator()(const ftyp &) const;
        //returns V(x,y)
        ftyp operator()(const ftyp &, const ftyp &) const;
        //returns V(x,y,z)
        ftyp operator()(const ftyp &, const ftyp &, const ftyp &) const;

        ~PotentialFromFile();
};


#endif

/*

 If you want reads potential values from file, then the potential
 values has to be written in this way:
 
 in case of 1D:

     for (ntyp j=1; j<=nx; j++) {
    	ftyp x=xmin+(j-1)*dx;
        filename<<V(x)<<endl;
    }

 in case of 2D:

     for (ntyp k=1; k<=ny; k++){
        ftyp y = ymin+(k-1)*dy;
        for (ntyp j=1; j<=nx; j++){
            ftyp x = xmin+(j-1)*dx;
            filename<<V(x, y)<<endl;
        }
    }


 in case of 3D:

    for (ntyp l=1; l<=nz; l++){
        ftyp z = zmin+(l-1)*dz;
        for (ntyp k=1; k<=ny; k++){
            ftyp y = ymin+(k-1)*dy;
            for (ntyp j=1; j<=nx; j++){
                ftyp x = xmin+(j-1)*dx;
                filename<<V(x,y,z)<<endl;
            }
        }
    }



*/

⌨️ 快捷键说明

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