Skip to content

Commit

Permalink
Merge pull request #26 from alinelena/dlpconfig
Browse files Browse the repository at this point in the history
dlpoly field update
  • Loading branch information
trisyoungs authored Dec 4, 2016
2 parents fd1df9e + 7af8c30 commit 37f71ec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
56 changes: 34 additions & 22 deletions src/plugins/io_dlpoly/field_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,31 +140,43 @@ bool DLPExpressionPlugin::importData()

// First line is header information - use as FF name
QString line;
if (!fileParser_.readLine(line)) return false;

Forcefield* newFF;
if (!fileParser_.readLine(line)) {
newFF = createForcefield(QString("unnamed field"));
}else{
newFF = createForcefield(line);
}
// Create a new forcefield
Forcefield* newFF = createForcefield(line);

// Next line is energy unit
if (!fileParser_.parseLine() ) return false;
QString unitString = fileParser_.argc(1).toLower();
Prefs::EnergyUnit unit = Prefs::energyUnit(unitString);
if (unit == Prefs::nEnergyUnits)
{
Messenger::error("FIELD file energy unit (%s) is not compatible with Aten.", qPrintable(unitString));
return false;
}

// Next is number of molecule types described in the file
if (!fileParser_.parseLine() ) return false;
if (fileParser_.argc(0).toLower() != "molecules")
{
Messenger::error("Didn't find 'molecules' directive where expected.");
return false;
// Next meaningful line is energy units
if (!fileParser_.parseLine(Parser::StripComments+Parser::SkipBlanks) ) return false;
QString word = fileParser_.argc(0).toLower();
if (word == "units"){
QString unitString = fileParser_.argc(1).toLower();
Prefs::EnergyUnit unit = Prefs::energyUnit(unitString);
if (unit == Prefs::nEnergyUnits)
{
Messenger::error("FIELD file energy unit (%s) is not compatible with Aten.", qPrintable(unitString));
return false;
}
}

int nMols;
// Next is number of molecule types described or multipolar data section in the file
if (!fileParser_.parseLine(Parser::StripComments+Parser::SkipBlanks)) return false;
word = fileParser_.argc(0).toLower();

if ((word == "mult")||(word=="multipolar")) {
if (!fileParser_.parseLine(Parser::StripComments+Parser::SkipBlanks)) return false;
//more stuff may need to be read from here but last line needs to be a reading
}
if (fileParser_.argc(0).toLower() == "molecules"){
nMols = fileParser_.argi(1);
Messenger::print("Number of molecule types specified in FIELD file : %i", nMols);
} else {
Messenger::error("Didn't find 'molecules' directive where expected.");
return false;
}
int nMols = fileParser_.argi(1);
Messenger::print("Number of molecule types specified in FIELD file : %i", nMols);

// Loop over molecule types
for (int mol=0; mol<nMols; ++mol)
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/method_mopac71/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ target_include_directories(mopac71opt PRIVATE
#

if(UNIX AND NOT APPLE)
install(TARGETS mopac71mwthod mopac71control mopac71opt
install(TARGETS mopac71method mopac71control mopac71opt
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins
)
Expand Down

0 comments on commit 37f71ec

Please sign in to comment.