Commit 4d364cdb authored by mark's avatar mark

STYLE: reduce typing by providing flatOutput function

parent 586222c5
......@@ -129,6 +129,23 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Global function
template<class T>
FlatListOutput<T> flatOutput(const UList<T>& input)
{
return FlatListOutput<T>(input);
}
//- Global function
template<class T>
FlatListOutput<T> flatOutput(const char separator, const UList<T>& input)
{
return FlatListOutput<T>(separator, input);
}
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -118,10 +118,10 @@ Foam::label Foam::adiosWrite::writeCloud
Info<< "cloud: " << cld.name() << " (" << cInfo.nTotal()
<< " parcels, " << encoded.length() << " min-size) type: "
<< cld.type() << nl
<< " types: " << FlatListOutput<word>(encoded.types()) << nl
<< " names: " << FlatListOutput<word>(encoded.names()) << nl
<< " offset:" << FlatListOutput<label>(encoded.offsets()) << nl
<< " sizes: " << FlatListOutput<label>(encoded.sizes()) << endl;
<< " types: " << flatOutput(encoded.types()) << nl
<< " names: " << flatOutput(encoded.names()) << nl
<< " offset:" << flatOutput(encoded.offsets()) << nl
<< " sizes: " << flatOutput(encoded.sizes()) << endl;
}
else
{
......@@ -271,7 +271,7 @@ Foam::label Foam::adiosWrite::writeCloud
}
// Info<< frag.name() << " (" << frag.type() << ") = "
// << FlatListOutput<int>(SubList<int>(labelBuffer, i)) << nl;
// << flatOutput(SubList<int>(labelBuffer, i)) << nl;
defineVariable
(
......@@ -297,7 +297,7 @@ Foam::label Foam::adiosWrite::writeCloud
}
// Info<< frag.name() << " (" << frag.type() << ") = "
// << FlatListOutput<scalar>(SubList<scalar>(scalarBuffer, i)) << nl;
// << flatOutput(SubList<scalar>(scalarBuffer, i)) << nl;
defineVariable
(
......@@ -335,7 +335,7 @@ Foam::label Foam::adiosWrite::writeCloud
);
// Info<< frag.name() << " (" << frag.type() << ") = "
// << FlatListOutput<scalar>(SubList<scalar>(scalarBuffer, i)) << nl;
// << flatOutput(SubList<scalar>(scalarBuffer, i)) << nl;
writeVariable(varName/frag.name(), scalarBuffer);
}
......@@ -378,10 +378,10 @@ Foam::label Foam::adiosWrite::printCloud
Info<< "cloud: " << cld.name() << " (" << cInfo.nTotal()
<< " parcels, " << encoded.length() << " min-size) type: "
<< cld.type() << nl
<< " types: " << FlatListOutput<word>(encoded.types()) << nl
<< " names: " << FlatListOutput<word>(encoded.names()) << nl
<< " offset:" << FlatListOutput<label>(encoded.offsets()) << nl
<< " sizes: " << FlatListOutput<label>(encoded.sizes()) << endl;
<< " types: " << flatOutput(encoded.types()) << nl
<< " names: " << flatOutput(encoded.names()) << nl
<< " offset:" << flatOutput(encoded.offsets()) << nl
<< " sizes: " << flatOutput(encoded.sizes()) << endl;
// ASCII output
......
......@@ -63,8 +63,8 @@ Foam::adiosTime Foam::adiosWrite::readData(const fileName& bpFile)
wordList cloudNames = readerClouds.sortedToc();
Info<<"region " << regName << " has reader:" << nl
<< " fields: " << FlatListOutput<word>(fieldNames) << nl
<< " clouds: " << FlatListOutput<word>(cloudNames) << endl;
<< " fields: " << flatOutput(fieldNames) << nl
<< " clouds: " << flatOutput(cloudNames) << endl;
// fields
forAll(fieldNames, fieldI)
......
......@@ -99,7 +99,7 @@ void Foam::adiosWrite::regionInfo::read
WarningInFunction
<< nl
<< missing.size() << " objects not found in database:" << nl
<< " " << FlatListOutput<word>(missing) << endl;
<< " " << flatOutput(missing) << endl;
}
}
......
......@@ -157,7 +157,7 @@ void Foam::adiosWrite::read(const dictionary& dict)
WarningInFunction
<< warn.size() << " unknown regions specified in adiosDict:"
<< nl
<< " " << FlatListOutput<word>(warn) << endl;
<< " " << flatOutput(warn) << endl;
}
if (nbad)
......@@ -167,7 +167,7 @@ void Foam::adiosWrite::read(const dictionary& dict)
FatalErrorInFunction
<< bad.size() << " bad region specifications in adiosDict:"
<< nl
<< " " << FlatListOutput<word>(bad) << nl
<< " " << flatOutput(bad) << nl
<< "must be dictionary format with region-name as the keyword"
<< nl
<< exit(FatalIOError);
......@@ -526,8 +526,8 @@ Foam::label Foam::adiosWrite::writeFields
WarningInFunction
<< nl
<< badFields.size() << " fields not handled by adiosWrite" << nl
<< " names: " << FlatListOutput<word>(names) << nl
<< " types: " << FlatListOutput<word>(types) << nl << endl;
<< " names: " << flatOutput(names) << nl
<< " types: " << flatOutput(types) << nl << endl;
}
......@@ -596,8 +596,8 @@ Foam::label Foam::adiosWrite::writeClouds(const regionInfo& rInfo)
WarningInFunction
<< nl
<< badClouds.size() << " clouds not handled by adiosWrite" << nl
<< " names: " << FlatListOutput<word>(names) << nl
<< " types: " << FlatListOutput<word>(types) << nl << endl;
<< " names: " << flatOutput(names) << nl
<< " types: " << flatOutput(types) << nl << endl;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment