Beispiel #1
0
	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;
			}
		}
	}
Beispiel #2
0
	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
	}
	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");
	}
	void process(ParamList& pl, Everything& e)
	{	double qTemp;
		e.eInfo.qNet.clear();
		//First q (required):
		pl.get(qTemp, 0., "QNet", true);
		e.eInfo.qNet.push_back(qTemp);
		//Second q (optional):
		pl.get(qTemp, std::numeric_limits<double>::quiet_NaN(), "QNet");
		if(!std::isnan(qTemp)) e.eInfo.qNet.push_back(qTemp);
	}
	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");
	}
	void process(ParamList& pl, Everything& e)
	{	CoulombParams& cp = e.coulombParams;
		pl.get(cp.geometry, CoulombParams::Periodic, truncationTypeMap, "truncationType");
		if(cp.geometry==CoulombParams::Periodic) return; //no parameters
		//Get direction for the partially periodic modes:
		if(cp.geometry==CoulombParams::Slab
		|| cp.geometry==CoulombParams::Wire
		|| cp.geometry==CoulombParams::Cylindrical)
			pl.get(cp.iDir, 0, truncationDirMap, "dir", true);
		//Get optional radius for the cylindrical/spherical modes:
		if(cp.geometry==CoulombParams::Cylindrical
		|| cp.geometry==CoulombParams::Spherical)
			pl.get(cp.Rc, 0., "Rc");
	}
	void process(ParamList& pl, Everything& e)
	{	CoulombParams& cp = e.coulombParams;
		//Select default regularization based on geometry:
		bool isIsolated = cp.geometry==CoulombParams::Isolated
				|| cp.geometry==CoulombParams::Spherical;
		cp.exchangeRegularization = isIsolated
			? CoulombParams::None
			: CoulombParams::WignerSeitzTruncated;
		pl.get(cp.exchangeRegularization, cp.exchangeRegularization, exRegMethodMap, "method");
		//Check compatibility of regularization with geometry:
		if(isIsolated && cp.exchangeRegularization!=CoulombParams::None)
			throw string("exchange-regularization <method> must be None for non-periodic"
				" coulomb-interaction <geometry> = Spherical or Isolated");
	}
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.eInfo.mu, 0.0, "mu", true);
		pl.get(e.eInfo.Cmeasured, 1.0, "Cinitial");
		pl.get(e.eInfo.dnMixFraction, 0.7, "dnMix");
	}
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.eVars.subspaceRotationFactor, 30.0, "factor");
	}
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.eVars.HauxFilename, string(), "filename", true);
	}
	void process(ParamList& pl, Everything& e)
	{	string key; pl.get(key, string(), "read", true);
		if(key!=string("read")) throw "First parameter must be 'read', encountered " + key;
		pl.get(e.eInfo.initialFillingsFilename, string(), "filename", true);
		pl.get(e.eInfo.nBandsOld, 0, "nBandsOld");
	}
Beispiel #12
0
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.cntrl.fluidGummel_nIterations, 10, "maxIterations");
		pl.get(e.cntrl.fluidGummel_Atol, 1e-5, "Atol");
	}
Beispiel #13
0
	void process(ParamList& pl, Everything& e)
	{
		pl.get(e.eVars.fluidParams.vdwScale, 0.75, "scale");
	}
Beispiel #14
0
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.eVars.fluidInitialStateFilename, string(), "filename", true);
	}
	void process(ParamList& pl, Everything& e)
	{	pl.get(e.coulombParams.ionMargin, 0., "margin", true);
		if(e.coulombParams.ionMargin < 1.) throw string("<margin> must be at least 1 bohr.");
	}
Beispiel #16
0
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
		}
	}
}