clean-up and pretty formatting of liggghtsCommandModel and its derived classes

removed an unused member "int stdInterval_" of the class runLiggghts
This commit is contained in:
Gerhard Holzinger
2017-10-23 17:39:18 +02:00
parent e329da4227
commit 963b717811
7 changed files with 52 additions and 40 deletions

View File

@ -177,7 +177,8 @@ bool liggghtsCommandModel::runThisCommand(int couplingStep)
{
if (verbose_) Info << "couplingStep = " << couplingStep << endl;
bool runIt=false;
if(
if
(
(!runEveryWriteStep_ && firstCouplingStep_ <= couplingStep && lastCouplingStep_ >= couplingStep) ||
(runEveryWriteStep_ && particleCloud_.mesh().time().outputTime())
)

View File

@ -64,8 +64,6 @@ private:
word command_;
//word myName_;
wordList filePathList_;
public:

View File

@ -64,8 +64,7 @@ runLiggghts::runLiggghts
liggghtsCommandModel(dict,sm,i),
propsDict_(dict.subOrEmptyDict(typeName + "Props")),
command_("run"),
preNo_(propsDict_.lookupOrDefault<bool>("preNo", true)),
stdInterval_(0)
preNo_(propsDict_.lookupOrDefault<bool>("preNo", true))
{
if (propsDict_.found("verbose"))
{
@ -108,9 +107,13 @@ bool runLiggghts::runCommand(int couplingStep)
{
//change command to "run xxx pre no"
if (preNo_ && (couplingStep > firstCouplingStep_))
{
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval(),"pre","no","post","no");
}
else
{
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval());
}
return runThisCommand(couplingStep);
}
@ -118,10 +121,14 @@ bool runLiggghts::runCommand(int couplingStep)
void runLiggghts::set(int interval)
{
if (preNo_)
{
strCommand_ = createCommand(command_, interval,"pre","no","post","no");
}
else
{
strCommand_ = createCommand(command_, interval);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -63,8 +63,6 @@ private:
bool preNo_;
int stdInterval_;
public:
//- Runtime type information

View File

@ -79,10 +79,14 @@ writeLiggghts::writeLiggghts
{
path_ = fileName(propsDict_.lookup("path"));
if (!checkPath(path_))
{
FatalError << "The path you provided in writeLiggghtsProps is incorrect: " << path_ << "\n" << abort(FatalError);
}
else
{
Info << "Using user defined path to write LIGGGHTS restart file: " << path_ << endl;
}
}
if (propsDict_.found("writeName"))
{
@ -107,9 +111,13 @@ writeLiggghts::writeLiggghts
command_ += " " + path_ + "/" + writeName_;
if (overwrite_)
{
strCommand_=string(command_);
}
else
{
command_ += "_";
}
Info << "writeLiggghts: A restart file writeName_" << command_ << " is written." << endl;