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

📄 species.h

📁 pic 模拟程序!面向对象
💻 H
字号:
/*====================================================================species.h	The Species class describes the characteristics of a particle 	species, including charge q and mass m.Revision History0.9	(JohnV 01-25-95)	Original version.0.91	(JohnV 06-26-95)	Add name, make internal counter idCOunt for speciesID.1.0	(JohnV 01-18-96)	Modified subcycling code originally by CooperD.1.1   (JohnV 12-13-96)  Added supercycleIndex for supercycling (push faster than       field solve).1.11  (JohnV 01-02-97)  Added collisionModel, eCreate, iCreate for more flexible      mcc package.====================================================================*/#ifndef	__SPECIES_H#define	__SPECIES_H#include "oopiclist.h"#include "ovector.h"#include "ostring.h"#include "misc.h"#define NR_U2_LIMIT 1.E15#define NR_V2_LIMIT 9.89E14enum CollisionModel {none, electron, ion, test, boltzmann};  //test = boltzmann test particles                                                             //boltzmann = boltzmann electronsclass Species{	static int idCount;						//	internal counter for unique id													//	This is initialized = 0 in misc.cpp	int speciesID;								//	unique id for this species	ostring name;								//	unique name for this species	Scalar q_over_m;							//	charge (C) / mass (kg)	Scalar m;                 // mass (kg) 	Scalar q;									//	charge in C	Scalar threshold;        // threshold for test collisionModel (eV)	int particleLimit;	///*********************************************************///	/// (Bruhwiler/Dimitrov, October 2000)	//  Flag specifying that RMS beam sizes should be plotted.  	//  Default value is 0 (no plotting); =1 for plotting.	int rmsDiagnosticsFlag; 	///*********************************************************///	int subcycleIndex;						// formerly speciesSub	int subcycleCount;						// formerly speciesSubIndex	int supercycleIndex;                // push faster than timestep	CollisionModel collisionModel;      // electron, ion, etc	Scalar KineticEnergy;       // Kinetic energy of all the particles (MKS)public:	Species(ostring _name, Scalar _q, Scalar _m, int subIndex, int superIndex, 		CollisionModel cm, Scalar _threshold, int _particleLimit, 		int _rmsDiagnosticsFlag) 	  {	    name = _name,	q = _q, q_over_m = _q/_m, m=_m, subcycleIndex = subIndex; 	    supercycleIndex = superIndex; collisionModel = cm; speciesID = idCount++;		    subcycleCount = MAX(subIndex/2,1); threshold = _threshold; 	    particleLimit = _particleLimit; rmsDiagnosticsFlag = _rmsDiagnosticsFlag;	  }	BOOL cycleNow() {return ((collisionModel==boltzmann) ? FALSE : (subcycleCount >= subcycleIndex));}	CollisionModel get_collisionModel() {return collisionModel;}	Scalar get_threshold() {return threshold;}	int get_particleLimit() {return particleLimit;}	int get_rmsDiagnosticsFlag() {return rmsDiagnosticsFlag;}	Scalar get_q() {return q;}	Scalar get_m() {return m;}	int get_subcycleIndex() {return subcycleIndex;}	BOOL isSubcycled() {return (subcycleIndex > 1);}	void incSubcycleCount() {subcycleCount++;}	void resetSubcycleCount() {subcycleCount = 1;}	int get_supercycleIndex() {return supercycleIndex;}	Scalar get_q_over_m() {return q_over_m;}	int getID() {return speciesID;}	ostring get_name() {return name;}	const char *get_name_ptr() { return name.c_str(); } 	static void reset_idCount() {idCount=0;}	void zeroKineticEnergy() {KineticEnergy = 0;}	void addKineticEnergy(Scalar deltaE) {KineticEnergy+=deltaE;}	Scalar getKineticEnergy() {return KineticEnergy;}};//typedef oopicList<Species> SpeciesList;#endif	//	ifndef __SPECIES_H

⌨️ 快捷键说明

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