📄 speciesg.cpp
字号:
/*====================================================================speciesg.cppClass definitions for the SpeciesParams class. This classinstantiates a SpeciesParams object from input data. Thelist of these objects will instantiate a SpeciesList in thephysics kernel at runtime.Revision/Author/Date0.9 (JohnV 01-27-95) Original code.0.91 (JohnV 06-26-95) Change speciesID -> speciesName1.1 (JohnV 12-13-96) Add supercycleIndex, rename speciesSub -> subcycleIndex.====================================================================*/#include "speciesg.h"#include "species.h"SpeciesParams::SpeciesParams() : ParameterGroup(){ name = "Species"; speciesName.setNameAndDescription("name", "unique name string"); speciesName.setValue("NULL"); parameterList.add(&speciesName); q.setNameAndDescription("q", "charge (C)"); q.setValue("1.60206e-19"); parameterList.add(&q); m.setNameAndDescription("m", "mass (kg)"); m.setValue("9.1093897e-31"); parameterList.add(&m); subcycleIndex.setNameAndDescription("subcycle", "subcycle index"); subcycleIndex.setValue("1"); parameterList.add(&subcycleIndex); supercycleIndex.setNameAndDescription("supercycle", "supercycle index"); supercycleIndex.setValue("1"); parameterList.add(&supercycleIndex); collisionModel.setNameAndDescription("collisionModel", "model for collisions"); collisionModel.setValue("none"); parameterList.add(&collisionModel); threshold.setNameAndDescription("threshold", "threshold energy (eV)"); threshold.setValue("0"); parameterList.add(&threshold); particleLimit.setNameAndDescription("particleLimit", "This species particle limit"); particleLimit.setValue("1e8"); parameterList.add(&particleLimit); // setting the default value of the rmsDiagnosticsFlag rmsDiagnosticsFlag.setNameAndDescription("rmsDiagnosticsFlag", "Flag = 1 for calculation and plotting of RMS diagnostics; Default value is 0."); rmsDiagnosticsFlag.setValue("0"); parameterList.add(&rmsDiagnosticsFlag);}Species* SpeciesParams::createCounterPart(){ if (get_subcycleIndex() > 1) supercycleIndex.setValue("1"); Species* species; species = new Species(get_speciesName(), get_q(), get_m(), get_subcycleIndex(), get_supercycleIndex(), get_collisionModel(), get_threshold(), get_particleLimit(), get_rmsDiagnosticsFlag() ); species->zeroKineticEnergy(); return species;/* return new Species(get_speciesName(), get_q(), get_m(), get_subcycleIndex(), get_supercycleIndex(), get_collisionModel(), get_threshold(), get_particleLimit());*/}CollisionModel SpeciesParams::get_collisionModel(){ CollisionModel model = none; if ((collisionModel.getValue()==(ostring)"electron")|(collisionModel.getValue()==(ostring)"1")) model = electron; else if ((collisionModel.getValue()==(ostring)"ion")|(collisionModel.getValue()==(ostring)"2")) model = ion; else if ((collisionModel.getValue()==(ostring)"test")|(collisionModel.getValue()==(ostring)"3")) model = test; else if ((collisionModel.getValue()==(ostring)"boltzmann")|(collisionModel.getValue()==(ostring)"4")) model = boltzmann; return (model);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -