mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
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:
@ -177,7 +177,8 @@ bool liggghtsCommandModel::runThisCommand(int couplingStep)
|
|||||||
{
|
{
|
||||||
if (verbose_) Info << "couplingStep = " << couplingStep << endl;
|
if (verbose_) Info << "couplingStep = " << couplingStep << endl;
|
||||||
bool runIt=false;
|
bool runIt=false;
|
||||||
if(
|
if
|
||||||
|
(
|
||||||
(!runEveryWriteStep_ && firstCouplingStep_ <= couplingStep && lastCouplingStep_ >= couplingStep) ||
|
(!runEveryWriteStep_ && firstCouplingStep_ <= couplingStep && lastCouplingStep_ >= couplingStep) ||
|
||||||
(runEveryWriteStep_ && particleCloud_.mesh().time().outputTime())
|
(runEveryWriteStep_ && particleCloud_.mesh().time().outputTime())
|
||||||
)
|
)
|
||||||
|
|||||||
@ -64,8 +64,6 @@ private:
|
|||||||
|
|
||||||
word command_;
|
word command_;
|
||||||
|
|
||||||
//word myName_;
|
|
||||||
|
|
||||||
wordList filePathList_;
|
wordList filePathList_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -64,8 +64,7 @@ runLiggghts::runLiggghts
|
|||||||
liggghtsCommandModel(dict,sm,i),
|
liggghtsCommandModel(dict,sm,i),
|
||||||
propsDict_(dict.subOrEmptyDict(typeName + "Props")),
|
propsDict_(dict.subOrEmptyDict(typeName + "Props")),
|
||||||
command_("run"),
|
command_("run"),
|
||||||
preNo_(propsDict_.lookupOrDefault<bool>("preNo", true)),
|
preNo_(propsDict_.lookupOrDefault<bool>("preNo", true))
|
||||||
stdInterval_(0)
|
|
||||||
{
|
{
|
||||||
if (propsDict_.found("verbose"))
|
if (propsDict_.found("verbose"))
|
||||||
{
|
{
|
||||||
@ -108,9 +107,13 @@ bool runLiggghts::runCommand(int couplingStep)
|
|||||||
{
|
{
|
||||||
//change command to "run xxx pre no"
|
//change command to "run xxx pre no"
|
||||||
if (preNo_ && (couplingStep > firstCouplingStep_))
|
if (preNo_ && (couplingStep > firstCouplingStep_))
|
||||||
|
{
|
||||||
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval(),"pre","no","post","no");
|
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval(),"pre","no","post","no");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval());
|
strCommand_ = createCommand(command_, particleCloud_.dataExchangeM().couplingInterval());
|
||||||
|
}
|
||||||
|
|
||||||
return runThisCommand(couplingStep);
|
return runThisCommand(couplingStep);
|
||||||
}
|
}
|
||||||
@ -118,10 +121,14 @@ bool runLiggghts::runCommand(int couplingStep)
|
|||||||
void runLiggghts::set(int interval)
|
void runLiggghts::set(int interval)
|
||||||
{
|
{
|
||||||
if (preNo_)
|
if (preNo_)
|
||||||
|
{
|
||||||
strCommand_ = createCommand(command_, interval,"pre","no","post","no");
|
strCommand_ = createCommand(command_, interval,"pre","no","post","no");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
strCommand_ = createCommand(command_, interval);
|
strCommand_ = createCommand(command_, interval);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -63,8 +63,6 @@ private:
|
|||||||
|
|
||||||
bool preNo_;
|
bool preNo_;
|
||||||
|
|
||||||
int stdInterval_;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -79,10 +79,14 @@ writeLiggghts::writeLiggghts
|
|||||||
{
|
{
|
||||||
path_ = fileName(propsDict_.lookup("path"));
|
path_ = fileName(propsDict_.lookup("path"));
|
||||||
if (!checkPath(path_))
|
if (!checkPath(path_))
|
||||||
|
{
|
||||||
FatalError << "The path you provided in writeLiggghtsProps is incorrect: " << path_ << "\n" << abort(FatalError);
|
FatalError << "The path you provided in writeLiggghtsProps is incorrect: " << path_ << "\n" << abort(FatalError);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
Info << "Using user defined path to write LIGGGHTS restart file: " << path_ << endl;
|
Info << "Using user defined path to write LIGGGHTS restart file: " << path_ << endl;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (propsDict_.found("writeName"))
|
if (propsDict_.found("writeName"))
|
||||||
{
|
{
|
||||||
@ -107,9 +111,13 @@ writeLiggghts::writeLiggghts
|
|||||||
|
|
||||||
command_ += " " + path_ + "/" + writeName_;
|
command_ += " " + path_ + "/" + writeName_;
|
||||||
if (overwrite_)
|
if (overwrite_)
|
||||||
|
{
|
||||||
strCommand_=string(command_);
|
strCommand_=string(command_);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
command_ += "_";
|
command_ += "_";
|
||||||
|
}
|
||||||
|
|
||||||
Info << "writeLiggghts: A restart file writeName_" << command_ << " is written." << endl;
|
Info << "writeLiggghts: A restart file writeName_" << command_ << " is written." << endl;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user