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

📄 pwell.cpp

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

#include "../davidson/pWell.h"
#include <math.h>

PotentialWell::PotentialWell(const ftyp &a, const ftyp &V0):
			 PotentialBase()
{
	typV=1;
	PotentialWell::a=a;
    PotentialWell::V0=V0;
}

ftyp PotentialWell::operator()(const ftyp &x) const
{    return fabs(x)<=a?-V0:0;}ftyp PotentialWell::operator()(const ftyp &x, const ftyp &y) const{    return sqrt(x*x+y*y)<=a?-V0:0;}ftyp PotentialWell::operator()(const ftyp &x, const ftyp &y, const ftyp &z) const{    return sqrt(x*x+y*y+z*z)<=a?-V0:0;}

void PotentialWell::SetAV0(const ftyp &a, const ftyp &V0)
{    PotentialWell::a  = a;    PotentialWell::V0 = V0;}ftyp PotentialWell::GetV0() const{	return V0;}ftyp PotentialWell::GetA() const{	return a;}

⌨️ 快捷键说明

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