Commit 0049efda authored by Andrew Wildman's avatar Andrew Wildman Committed by Torin Stetina
Browse files

Fix infinite loop if output file is specified as the input, and check if basis...

Fix infinite loop if output file is specified as the input, and check if basis section is defined in input
parent 835b6864
......@@ -147,11 +147,12 @@ namespace ChronusQ {
nTotalE = std::accumulate(atoms.begin(),atoms.end(),-charge,
[&](int c, const Atom &a){ return a.atomicNumber + c; }
);
if((nTotalE % 2) != 0 and (multip % 2) != 0) {
if(not ((nTotalE % 2) != 0 xor (multip % 2) != 0) or
multip > nTotalE + 1) {
std::stringstream ss;
ss << "Multiplicity = " << multip << " is not compatible with "
<< "NTotalE = " << nTotalE;
<< "total electrons = " << nTotalE;
CErr(ss.str(),std::cout);
}
......
......@@ -83,11 +83,14 @@ namespace ChronusQ {
OPTOPT( basisDef = input.getData<std::string>(section+".BASISDEF"); )
// Check for consistency
if ( basisName.empty() and basisDef.empty() ){
return std::make_shared<BasisSet>();
// CErr("Basis file or specification not found!");
if ( basisName.empty() and basisDef.empty() ) {
if ( section == "BASIS" )
CErr("Basis file or specification not found!");
else
return std::make_shared<BasisSet>();
}
BASIS_FUNCTION_TYPE bType = REAL_GTO;
try{
std::string bTypeString = input.getData<std::string>(section+".BASISTYPE");
......
......@@ -152,6 +152,8 @@ namespace ChronusQ {
}
if ( atoms.size() == 0 )
CErr("MOLECULE.GEOM must not be empty and must be indented");
// Set the Atoms vector in Molecule (calls Molecule::update())
mol.setAtoms(atoms);
......
......@@ -250,18 +250,14 @@ namespace ChronusQ {
bool doPP = false;
OPTOPT(
std::string jt = input.getData<std::string>("RESPONSE.TYPE");
if( not jt.compare("RESIDUE") ) jobTyp = RESIDUE;
else if( not jt.compare("FDR") ) jobTyp = FDR;
else if( not jt.compare("MOR") ) doMOR = true;
else CErr(jt + " NOT RECOGNIZED RESPONSE.TYPE");
);
std::string jt = "RESIDUE";
OPTOPT( jt = input.getData<std::string>("RESPONSE.TYPE"); );
if( not jt.compare("RESIDUE") ) jobTyp = RESIDUE;
else if( not jt.compare("FDR") ) jobTyp = FDR;
else if( not jt.compare("MOR") ) doMOR = true;
else CErr(jt + " NOT RECOGNIZED RESPONSE.TYPE");
// Determine propagator
......
......@@ -61,6 +61,10 @@ namespace ChronusQ {
std::string outFileName, std::string rstFileName,
std::string scrFileName) {
// Check to make sure input and output file name are different.
if( inFileName == outFileName )
CErr("Input file name and output file name cannot be identical.");
int rank = MPIRank();
int size = MPISize();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment