Skip to content
Snippets Groups Projects
Commit 4c622dd9 authored by samuel.hayden's avatar samuel.hayden
Browse files

Input file now has cell type option

parent 40efb48c
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,15 @@
/* Parsed Data */
ParseInputFile::ParseInputFile(const ParseCommandLine& cmdln)
: _hasCells(false), _hasRadii(false), _hasCellSize(false), _hasPositions(false),
: _hasCells(false), _hasRadii(false), _hasCellSize(false), _hasPositions(false), _hasCellType(false),
_nx(0), _ny(0), _nz(0), _cx(0.0), _cy(0.0), _cz(0.0)
{
if (cmdln.hasKey("celltype"))
{
_cellType = cmdln.getValue("celltype");
_hasCellType = true;
}
if (cmdln.hasKey("input"))
if (!parseFile(cmdln.getValue("input")))
return;
......@@ -57,6 +63,13 @@ bool ParseInputFile::parseFile(const std::string filepath)
iss >> nPoints;
parsePositions(file, nPoints);
}
else if (argument == "CellType" && !_hasCellType)
{
iss >> _cellType;
for (auto& c : _cellType)
c = tolower(c);
_hasCellType = true;
}
}
return true;
}
......
......@@ -15,8 +15,10 @@ private:
bool _hasRadii; // nRadii > 0
bool _hasCellSize; // Cell size given
bool _hasPositions; // Cell positions defined
bool _hasCellType; // Cell type defined
/* Parsed Data */
std::string _cellType; // Type of unit cell
size_t _nx, _ny, _nz; // nCells
double _cx, _cy, _cz; // cell size
std::vector<double> _radii; // Cell radii
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment