Put driver output of static block decomposition in a separate function

For symmetry with the dynamic case, and for avoiding a call to “return” in the
middle of StaticModel::writeDriverOutput().
master
Sébastien Villemot 2022-09-21 18:47:14 +02:00
parent 5b12354dc3
commit b403cef871
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 9 additions and 2 deletions

View File

@ -1146,9 +1146,13 @@ StaticModel::writeDriverOutput(ostream &output, bool block) const
<< temporary_terms_idxs.at(mlv)+1 << ';' << endl;
output << "};" << endl;
if (!block)
return;
if (block)
writeBlockDriverOutput(output);
}
void
StaticModel::writeBlockDriverOutput(ostream &output) const
{
for (int blk = 0; blk < static_cast<int>(blocks.size()); blk++)
{
output << "block_structure_stat.block(" << blk+1 << ").Simulation_Type = " << static_cast<int>(blocks[blk].simulation_type) << ";" << endl

View File

@ -116,6 +116,9 @@ private:
(failure can happen in normalization). */
virtual bool computingPassBlock(const eval_context_t &eval_context, bool no_tmp_terms);
// Write the block structure of the model in the driver file
void writeBlockDriverOutput(ostream &output) const;
protected:
string
modelClassName() const override