Commit 55e5a777 authored by shunbo's avatar shunbo
Browse files

initial commit

parents
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "ListStream.H"
#include "wordList.H"
#include "IOstreams.H"
#include "argList.H"
using namespace Foam;
Ostream& toString(Ostream& os, const UList<char>& list)
{
os << '"';
for (const char c : list)
{
os << c;
}
os << '"';
return os;
}
template<class BufType>
void printInfo(const BufType& buf)
{
Info<< nl << "=========================" << endl;
buf.print(Info);
toString(Info, buf.list());
Info<< nl << "=========================" << endl;
}
void printTokens(Istream& is)
{
label count = 0;
token t;
while (is.good())
{
is >> t;
if (t.good())
{
++count;
Info<<"token: " << t << endl;
}
}
Info<< count << " tokens" << endl;
}
// Generate some dictionary-like content
template<class OS>
void outputDict(OS& os)
{
os.beginBlock("testDict");
os.writeEntry("bool", "false");
os.writeEntry("scalar", 3.14159);
os.endBlock();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
// Buffer storage
DynamicList<char> storage(16);
OListStream obuf(std::move(storage));
obuf.setBlockSize(100);
printInfo(obuf);
// Fill with some content
for (label i = 0; i < 50; ++i)
{
obuf<< 1002 << " " << "abcd" << " "
<< "def" << " " << 3.14159 << ";\n";
}
printInfo(obuf);
obuf.rewind();
printInfo(obuf);
for (label i=0; i < 10; ++i)
{
obuf << "item" << i << "\n";
}
printInfo(obuf);
obuf.shrink();
Info<< "after shrink" << nl;
printInfo(obuf);
// Add some more
for (label i=10; i < 15; ++i)
{
obuf << "more" << i << nl;
}
Info<< "appended more" << nl;
printInfo(obuf);
// Overwrite at some position
obuf.stdStream().rdbuf()->pubseekpos(0.60 * obuf.size());
obuf << "<" << nl << "OVERWRITE" << nl;
Info<<"after overwrite" << nl;
printInfo(obuf);
Info<< "transfer contents to a List or IListStream" << nl;
IListStream ibuf;
// Reclaim data storage from OListStream -> IListStream
{
List<char> data;
obuf.swap(data);
ibuf.swap(data);
}
Info<<"original:";
printInfo(obuf);
Info<<"new input:" << nl;
printInfo(ibuf);
printTokens(ibuf);
// Create from other storage types
DynamicList<char> written;
Info<< nl;
{
Info<<"create std::move(List)" << endl;
List<char> list(16, 'A');
Info<<"input:";
toString(Info, list) << endl;
OListStream buf1(std::move(list));
Info<<"orig:";
toString(Info, list) << endl;
printInfo(buf1);
for (label i = 0; i < 26; ++i)
{
buf1 << char('A' +i);
}
for (label i = 0; i < 26; ++i)
{
buf1 << char('a' +i);
}
Info<<"orig:";
toString(Info, list) << endl;
printInfo(buf1);
// Move back to written
buf1.swap(written);
printInfo(buf1);
}
Info<<"'captured' content ";
toString(Info, written);
Info<< nl
<< "content size=" << written.size()
<< " capacity=" << written.capacity() << nl;
Info<< nl << "Test dictionary" << nl;
{
OListStream os1;
outputDict(os1);
Info<< "Regular" << nl;
printInfo(os1);
}
{
OListStream os2;
os2.indentSize(0);
outputDict(os2);
Info<< "Compact" << nl;
printInfo(os2);
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //
Test-OSspecific.C
EXE = $(FOAM_USER_APPBIN)/Test-OSspecific
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Report some basic os-specific values
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Info<< "Report some basic OS-specific values" << nl;
Info<< nl
<< "host : " << hostName() << nl
<< "user : " << userName() << nl
<< "home : " << home() << nl;
Info<< nl
<< "cwd : " << cwd() << nl
<< "cwd -P : " << cwd(false) << nl
<< "cwd -L : " << cwd(true) << nl;
Info<< nl
<< "libs : " << dlLoaded() << nl;
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //
Test-OStringStream.C
EXE = $(FOAM_USER_APPBIN)/Test-OStringStream
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "IOstreams.H"
#include "StringStream.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Info<< "Begin test OStringStream" << endl;
OStringStream os;
os << "output with some values " << 1 << " entry" << endl;
Info<< "contains:" << nl
<< os.str() << endl;
os.rewind();
Info<< "after rewind:" << nl
<< os.str() << endl;
os << "####";
Info<< "overwrite with short string:" << nl
<< os.str() << endl;
os.reset();
os << "%%%% reset";
Info<< "after reset:" << nl
<< os.str() << endl;
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //
Test-OTstream.C
EXE = $(FOAM_USER_APPBIN)/Test-OTstream
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "ITstream.H"
#include "OTstream.H"
#include "primitiveFields.H"
#include "argList.H"
using namespace Foam;
void printTokens(const UList<token>& toks)
{
label count = 0;
for (const token& t : toks)
{
Info<< "token: " << t.info() << nl;
++count;
}
Info<< count << " tokens" << nl << endl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
// Test fields
{
scalarField fld1({1, 2, 3, 4});
OTstream os;
fld1.writeEntry("field", os);
Info<< "Field: " << fld1 << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
{
scalarField fld1(10, scalar(5));
OTstream os;
fld1.writeEntry("field", os);
Info<< "Field: " << fld1 << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
{
vector val(1,2, 3);
OTstream os;
os << val;
Info<< "Value: " << val << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
{
bool val(true);
OTstream os;
os << val;
Info<< "Value: " << val << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
{
tensorField fld1(1, tensor::I);
OTstream os;
fld1.writeEntry("field", os);
Info<< "Field: " << fld1 << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
{
labelList fld1(identity(5));
OTstream os;
fld1.writeEntry("field", os);
Info<< "Field: " << fld1 << nl
<< "Tokens: " << flatOutput(os) << nl;
printTokens(os);
}
Info<< "\nEnd\n" << endl;
return 0;
}
// ************************************************************************* //
Test-PDRblockMesh.C
EXE = $(FOAM_USER_APPBIN)/Test-PDRblockMesh
EXE_INC = \
-DFULLDEBUG \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude
EXE_LIBS = \
-lblockMesh
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test accessors for PDRblock
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "PDRblock.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
argList::noFunctionObjects();
argList::addOption("dict", "file", "Alternative PDRblockMeshDict");
#include "setRootCase.H"
#include "createTime.H"
const word dictName("PDRblockMeshDict");
#include "setSystemRunTimeDictionaryIO.H"
Info<< "Reading " << dictIO.name() << nl << endl;
IOdictionary meshDict(dictIO);
PDRblock mesh(meshDict, true);
// Write summary
Info<< "----------------" << nl
<< "Mesh Information" << nl
<< "----------------" << nl
<< " " << "bounds: " << mesh.bounds() << nl
<< " " << "nPoints: " << mesh.nPoints()
<< " " << (mesh.sizes() + labelVector::one) << nl
<< " " << "nCells: " << mesh.nCells()
<< " " << mesh.sizes() << nl
<< " " << "nFaces: " << mesh.nFaces() << nl
<< " " << "nInternalFaces: " << mesh.nInternalFaces() << nl;
Info<< "----------------" << nl
<< "Addressing" << nl
<< "----------------" << nl
<< " " << "volume: " << mesh.bounds().volume() << nl
<< " " << "avg-vol: "<< (mesh.bounds().volume() / mesh.nCells()) << nl;
Info<< nl << "Check sizes: " << mesh.bounds().span() << nl;
for (direction cmpt=0; cmpt < vector::nComponents; ++cmpt)
{
// Three different ways of getting the same information
// not all are equally efficient
scalar totalWidth = 0;
// Using location
forAll(mesh.grid()[cmpt], i)
{
totalWidth += mesh.grid()[cmpt].width(i);
}
Info<< vector::componentNames[cmpt] << " min/max "
<< minMax(mesh.grid()[cmpt])
<< ' ' << mesh.grid()[cmpt].first()
<< ' ' << mesh.grid()[cmpt].last()
<< " " << mesh.grid()[cmpt].size() << " cells" << nl;
// Use global (i,j,k) accessors, with mid-mesh for other directions
const label nx = mesh.sizes().x() / (cmpt == vector::X ? 1 : 2);
const label ny = mesh.sizes().y() / (cmpt == vector::Y ? 1 : 2);
const label nz = mesh.sizes().z() / (cmpt == vector::Z ? 1 : 2);
scalar totalSpan = 0;
scalar totalDelta = 0;
switch (cmpt)
{
case vector::X:
{
for (label i=0; i < nx; ++i)
{
totalSpan += mesh.span(i, ny, nz).x();
totalDelta += mesh.dx(i);
}
}
break;
case vector::Y:
{
for (label j=0; j < ny; ++j)
{
totalSpan += mesh.span(nx, j, nz).y();
totalDelta += mesh.dy(j);
}
}
break;
case vector::Z:
{
for (label k=0; k < nz; ++k)
{
totalSpan += mesh.span(nx, ny, k).z();
totalDelta += mesh.dz(k);
}
}
break;
}
Info<< " width = " << totalWidth << " delta = " << totalDelta
<< " span = " << totalSpan << nl;
}
{
const labelVector mid = mesh.sizes() / 2;
Info<< nl << "Mid-mesh information at " << mid << nl
<< " centre = " << mesh.C(mid) << nl
<< " volume = " << mesh.V(mid) << nl
<< " length = " << mesh.width(mid) << nl;
}
// Test findCell
{
Info<< nl << "findCell:" << nl;
for
(
const point& pt
: {
mesh.bounds().centre(),
mesh.bounds().min() - 0.1 * mesh.bounds().span(),
mesh.bounds().max() + 0.1 * mesh.bounds().span()
}
)
{
labelVector ijk = mesh.findCell(pt);
Info<< " " << pt << " = " << ijk;
if (cmptMin(ijk) < 0) Info<< " [not found]";
Info<< nl;
}
}
Info<< nl;
// Fatal with FULLDEBUG
{
const bool oldThrowingError = FatalError.throwing(true);
const label nx = mesh.sizes().x();
const label ny = mesh.sizes().y();
const label nz = mesh.sizes().z();
// Here we get error in x-y-z order
try
{
mesh.checkIndex(nx, ny, nz);
}
catch (const Foam::error& err)
{
Info<< nl << "Expected: Caught accesor error\n "
<< err.message().c_str() << nl;
}
// No order for the error since it is called parameter-wise
try
{
Info<< "centre at mesh(nx, ny, nz) = "
<< mesh.C(mesh.sizes()) << nl;
}
catch (const Foam::error& err)
{
Info<< nl << "Expected: Caught accesor error\n "
<< err.message().c_str() << nl;
}
// Sizing error
try
{
mesh.checkSizes(labelVector(nx+1, ny, nz));
}
catch (const Foam::error& err)
{
Info<< nl << "Expected: Caught sizing error\n "
<< err.message().c_str() << nl;
}
try
{
mesh.checkSizes(labelMax/4);
}
catch (const Foam::error& err)
{
Info<< nl << "Expected: Caught sizing error\n "
<< err.message().c_str() << nl;
}
FatalError.throwing(oldThrowingError);
}
Info<< "\nEnd\n" << nl;
return 0;
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object PDRblockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Point scaling (optional)
scale 1.0;
x
{
points ( -13.28 -0.10 6.0 19.19 );
nCells ( 10 12 10 );
ratios ( -5.16 1 5.16 );
}
y
{
points ( -12.98 0 5.50 18.48 );
nCells ( 10 11 10 );
ratios ( -5.16 1 5.16 );
}
z
{
points ( 0.00 4.80 17.26 );
nCells ( 10 10 );
ratios ( 1 5.16 );
}
defaultPatch
{
name walls;
type wall;
}
// Faces: 0=x-min, 1=x-max, 2=y-min, 3=y-max, 4=z-min, 5=z-max
boundary
(
outer
{
type patch;
faces ( 0 1 2 3 5 );
}
mergingFaces
{
type wall;
faces ();
}
blockedFaces
{
type wall;
faces ();
}
ground
{
type wall;
faces ( 4 );
}
);
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs (blockMesh);
application PDRblockMesh;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0;
deltaT 0;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{}
gradSchemes
{}
divSchemes
{}
laplacianSchemes
{}
interpolationSchemes
{}
snGradSchemes
{}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
Test-PackedList.C
EXE = $(FOAM_USER_APPBIN)/Test-PackedList
/*
check for consistent behaviour with non-optimized code
*/
EXE_INC = \
-DFULLDEBUG -g -O0
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "uLabel.H"
#include "IOobject.H"
#include "IOstreams.H"
#include "IFstream.H"
#include "bitSet.H"
#include <climits>
using namespace Foam;
template<unsigned Width>
inline void reportInfo()
{
const unsigned offset = PackedList<Width>::elem_per_block;
unsigned useSHL = ((1u << (Width * offset)) - 1);
unsigned useSHR = (~0u >> (sizeof(unsigned)*CHAR_BIT - Width * offset));
Info<< nl
<< "PackedList<" << Width << ">" << nl
<< " max_value: " << PackedList<Width>::max_value << nl
<< " packing: " << PackedList<Width>::elem_per_block << nl
<< " utilization: " << (Width * offset) << nl;
Info<< " Masking:" << nl
<< " shift << "
<< unsigned(Width * offset) << nl
<< " shift >> "
<< unsigned((sizeof(unsigned)*CHAR_BIT) - Width * offset)
<< nl;
hex(Info);
Info<< " maskLower: "
<< PackedList<Width>::mask_lower(PackedList<Width>::elem_per_block)
<< nl
<< " useSHL: " << useSHL << nl
<< " useSHR: " << useSHR << nl;
if (useSHL != useSHR)
{
Info<< "WARNING: different results for SHL and SHR" << nl;
}
Info<< nl;
dec(Info);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
argList::addArgument("file .. fileN");
argList::addBoolOption("mask", "report information about the bit masks");
argList::addBoolOption("count", "test the count() method");
argList::addBoolOption
(
"info",
"print an ascii representation of the storage"
);
argList args(argc, argv, false, true);
if (args.found("mask"))
{
Info<< "bit width: " << unsigned(sizeof(unsigned)*CHAR_BIT) << endl;
reportInfo<1>();
reportInfo<2>();
reportInfo<3>();
reportInfo<4>();
reportInfo<5>();
reportInfo<6>();
reportInfo<7>();
reportInfo<8>();
reportInfo<9>();
reportInfo<10>();
reportInfo<11>();
reportInfo<12>();
reportInfo<13>();
reportInfo<14>();
reportInfo<15>();
reportInfo<16>();
return 0;
}
else if (args.size() <= 1)
{
args.printUsage();
}
for (label argi=1; argi < args.size(); ++argi)
{
const auto srcFile = args.get<fileName>(argi);
Info<< nl << "reading " << srcFile << nl;
IFstream ifs(srcFile);
List<label> rawLst(ifs);
bitSet packLst(rawLst);
Info<< "size: " << packLst.size() << nl;
if (args.found("count"))
{
unsigned int rawCount = 0;
forAll(rawLst, elemI)
{
if (rawLst[elemI])
{
rawCount++;
}
}
Info<< "raw count: " << rawCount << nl
<< "packed count: " << packLst.count() << nl;
}
if (args.found("info"))
{
Info<< packLst.info();
}
Info<< nl;
IOobject::writeDivider(Info);
}
return 0;
}
// ************************************************************************* //
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