本文整理汇总了C++中ParamList::get方法的典型用法代码示例。如果您正苦于以下问题:C++ ParamList::get方法的具体用法?C++ ParamList::get怎么用?C++ ParamList::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParamList
的用法示例。
在下文中一共展示了ParamList::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void process(ParamList& pl, Everything& e)
{ Phonon& phonon = ((PhononEverything&)e).phonon;
while(true)
{ PhononMember key; pl.get(key, PM_delim, phononMemberMap, "key");
if(key==PM_delim) break;
switch(key)
{ case PM_sup:
for(int j=0; j<3; j++)
{ char paramName[8]; sprintf(paramName, "N%d", j);
pl.get(phonon.sup[j], 0, paramName, true);
if(phonon.sup[j]<=0)
throw string("supercell dimensions must be positive");
}
break;
case PM_dr:
pl.get(phonon.dr, 0., "dr", true);
break;
case PM_T:
pl.get(phonon.T, 0., "T", true);
phonon.T *= Kelvin;
break;
case PM_Fcut:
pl.get(phonon.Fcut, 0., "Fcut", true);
if(phonon.Fcut < 0.) throw string("<Fcut> must be non-negative");
break;
case PM_delim: //should never be encountered
break;
}
}
}
示例2: process
void process(ParamList& pl, Everything& e)
{ FluidSolverParams& fsp = e.eVars.fluidParams;
pl.get(fsp.fluidType, FluidNone, fluidTypeMap, "type");
if((e.coulombParams.geometry != CoulombParams::Periodic) && (fsp.fluidType != FluidNone))
e.coulombParams.embedFluidMode = true; //require embedding in fluid mode (periodic Coulomb kernels in larger box)
pl.get(fsp.T, 298., "Temperature"); fsp.T *= Kelvin; //convert to atomic units
pl.get(fsp.P, 1.01325, "Pressure"); fsp.P *= Bar; //convert to atomic units
}
示例3: process
void process(ParamList& pl, Everything& e)
{ ElecInfo& eInfo = e.eInfo;
pl.get(eInfo.mixInterval, 0, "mixInterval", true);
//Determine algorithm based on mixInterval:
if(eInfo.mixInterval<0) throw string("<mixInterval> must be positive");
eInfo.fillingsUpdate = eInfo.mixInterval ? ElecInfo::FermiFillingsMix : ElecInfo::FermiFillingsAux;
pl.get(eInfo.kT, 0.0, "kT", true);
if(eInfo.mixInterval) pl.get(eInfo.fillingMixFraction, 0.5, "alpha");
}
示例4: process
void process(ParamList& pl, Everything& e)
{ e.coulombParams.embed = true;
vector3<>& c = e.coulombParams.embedCenter;
pl.get(c[0], 0., "c0", true);
pl.get(c[1], 0., "c1", true);
pl.get(c[2], 0., "c2", true);
if(e.iInfo.coordsType==CoordsCartesian) c = inv(e.gInfo.R) * c; //Transform coordinates if necessary
if(e.coulombParams.geometry==CoulombParams::Periodic)
throw string("coulomb-truncation-embed should only be specified for truncated geometries");
}
示例5: process
void CommandMinimize::process(ParamList& pl, Everything& e)
{ MinimizeParams& mp = target(e);
while(true)
{ MinimizeParamsMember key;
pl.get(key, MPM_Delim, mpmMap, "key");
switch(key)
{ case MPM_dirUpdateScheme: pl.get(mp.dirUpdateScheme, MinimizeParams::PolakRibiere, dirUpdateMap, "dirUpdateScheme", true); break;
case MPM_linminMethod: pl.get(mp.linminMethod, MinimizeParams::Quad, linminMap, "linminMethod", true); break;
case MPM_nIterations: pl.get(mp.nIterations, 0, "nIterations", true); break;
case MPM_history: pl.get(mp.history, 0, "history", true); break;
case MPM_knormThreshold: pl.get(mp.knormThreshold, 0., "knormThreshold", true); break;
case MPM_energyDiffThreshold: pl.get(mp.energyDiffThreshold, 0., "energyDiffThreshold", true); break;
case MPM_nEnergyDiff: pl.get(mp.nEnergyDiff, 0, "nEnergyDiff", true); break;
case MPM_alphaTstart: pl.get(mp.alphaTstart, 0., "alphaTstart", true); break;
case MPM_alphaTmin: pl.get(mp.alphaTmin, 0., "alphaTmin", true); break;
case MPM_updateTestStepSize: pl.get(mp.updateTestStepSize, true, boolMap, "updateTestStepSize", true); break;
case MPM_alphaTreduceFactor: pl.get(mp.alphaTreduceFactor, 0., "alphaTreduceFactor", true); break;
case MPM_alphaTincreaseFactor: pl.get(mp.alphaTincreaseFactor, 0., "alphaTincreaseFactor", true); break;
case MPM_nAlphaAdjustMax: pl.get(mp.nAlphaAdjustMax, 0, "nAlphaAdjustMax", true); break;
case MPM_wolfeEnergy: pl.get(mp.wolfeEnergy, 0., "wolfeEnergy", true); break;
case MPM_wolfeGradient: pl.get(mp.wolfeGradient, 0., "wolfeGradient", true); break;
case MPM_fdTest: pl.get(mp.fdTest, false, boolMap, "fdTest", true); break;
case MPM_Delim: return; //end of input
}
}
}