Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

Conflicts:
	tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/polyMesh/boundary
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/0/rho
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/polyMesh/boundary
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/RASProperties
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/thermophysicalProperties
	tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/topAir/turbulenceProperties
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho
	tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/fixedInlet
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/sideAndTopPatches
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/nut
	tutorials/incompressible/simpleFoam/windTurbineTerrain/0/p
	tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/RASProperties
	tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict
This commit is contained in:
henry
2010-06-23 16:56:45 +01:00
309 changed files with 158964 additions and 2602 deletions

View File

@ -31,6 +31,41 @@ Description
using namespace Foam;
template<class T>
void printInfo
(
const word& tag,
const UList<T>& lst,
const bool showSize = false
)
{
Info<< "<" << tag;
if (showSize)
{
Info<< " size=\"" << lst.size() << "\"";
}
Info<< ">" << lst << "</" << tag << ">" << endl;
}
template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void printInfo
(
const word& tag,
const DynamicList<T, SizeInc, SizeMult, SizeDiv>& lst,
const bool showSize = false
)
{
Info<< "<" << tag;
if (showSize)
{
Info<< " size=\"" << lst.size()
<< "\" capacity=\"" << lst.capacity() << "\"";
}
Info<< ">" << lst << "</" << tag << ">" << endl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
@ -104,10 +139,8 @@ int main(int argc, char *argv[])
List<label> lstA;
lstA.transfer(dlB);
Info<< "Transferred to normal list" << endl;
Info<< "<lstA>" << lstA << "</lstA>" << nl << "sizes: "
<< " " << lstA.size() << endl;
Info<< "<dlB>" << dlB << "</dlB>" << nl << "sizes: "
<< " " << dlB.size() << "/" << dlB.capacity() << endl;
printInfo("lstA", lstA, true);
printInfo("dlB", dlB, true);
// Copy back and append a few time
for (label i=0; i < 3; i++)
@ -116,15 +149,12 @@ int main(int argc, char *argv[])
}
Info<< "appended list a few times" << endl;
Info<< "<dlB>" << dlB << "</dlB>" << nl << "sizes: "
<< " " << dlB.size() << "/" << dlB.capacity() << endl;
printInfo("dlB", dlB, true);
// assign the list (should maintain allocated space)
dlB = lstA;
Info<< "assigned list" << endl;
Info<< "<dlB>" << dlB << "</dlB>" << nl << "sizes: "
<< " " << dlB.size() << "/" << dlB.capacity() << endl;
printInfo("dlB", dlB, true);
// Copy back and append a few time
for (label i=0; i < 3; i++)
@ -136,38 +166,30 @@ int main(int argc, char *argv[])
// check allocation granularity
DynamicList<label, 6, 0> dlC;
Info<< "<dlC>" << dlC << "</dlC>" << nl << "sizes: "
<< " " << dlC.size() << "/" << dlC.capacity() << endl;
printInfo("dlC", dlC, true);
dlC.reserve(dlB.size());
dlC = dlB;
Info<< "<dlC>" << dlC << "</dlC>" << nl << "sizes: "
<< " " << dlC.size() << "/" << dlC.capacity() << endl;
printInfo("dlC", dlC, true);
List<label> lstB(dlC.xfer());
Info<< "Transferred to normal list via the xfer() method" << endl;
Info<< "<lstB>" << lstB << "</lstB>" << nl << "sizes: "
<< " " << lstB.size() << endl;
Info<< "<dlC>" << dlC << "</dlC>" << nl << "sizes: "
<< " " << dlC.size() << "/" << dlC.capacity() << endl;
printInfo("lstB", lstB, true);
printInfo("dlC", dlC, true);
DynamicList<label> dlD(lstB.xfer());
Info<< "Transfer construct from normal list" << endl;
Info<< "<lstB>" << lstB << "</lstB>" << nl << "sizes: "
<< " " << lstB.size() << endl;
Info<< "<dlD>" << dlD << "</dlD>" << nl << "sizes: "
<< " " << dlD.size() << "/" << dlD.capacity() << endl;
printInfo("lstB", lstB, true);
printInfo("dlD", dlD, true);
DynamicList<label,10> dlE1(10);
DynamicList<label> dlE2(dlE1); // construct dissimilar
Info<< "<dlE1>" << dlE1 << "</dlE1>" << nl << "sizes: "
<< " " << dlE1.size() << "/" << dlE1.capacity() << endl;
Info<< "<dlE2>" << dlE2 << "</dlE2>" << nl << "sizes: "
<< " " << dlE2.size() << "/" << dlE2.capacity() << endl;
printInfo("dlE1", dlE1, true);
printInfo("dlE2", dlE2, true);
for (label elemI=0; elemI < 5; ++elemI)
{
@ -175,19 +197,42 @@ int main(int argc, char *argv[])
dlE2.append(elemI);
}
Info<< "<dlE2>" << dlE2 << "</dlE2>" << endl;
printInfo("dlE2", dlE2, true);
DynamicList<label> dlE3(dlE2); // construct identical
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
printInfo("dlE3", dlE3, true);
dlE3 = dlE1; // assign dissimilar
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
printInfo("dlE3", dlE3, true);
dlE3 = dlE2; // assign identical
Info<< "<dlE3>" << dlE3 << "</dlE3>" << endl;
printInfo("dlE3", dlE3, true);
DynamicList<label> dlE4(reorder(identity(dlE3.size()), dlE3));
Info<< "<dlE4>" << dlE4 << "</dlE4>" << endl;
printInfo("dlE4", dlE4, true);
printInfo("dlE3", dlE3, true);
{
DynamicList<label> addr(10);
addr.append(3);
addr.append(1);
addr.append(2);
forAll(dlE2, i)
{
dlE2[i] *= 10;
}
UIndirectList<label> uil
(
dlE2, addr
);
Info<< "use UIndirectList " << uil << " remapped from " << dlE2 << endl;
dlE4 = uil;
printInfo("dlE4", dlE4, true);
}
Info<< "\nEnd\n";

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,15 +27,49 @@ Description
#include "IOstreams.H"
#include "pTraits.H"
#include "vector.H"
#include "tensor.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
template<class T>
void printTraits()
{
Info<< pTraits<T>::typeName
<< ": zero=" << pTraits<T>::zero
<< " one=" << pTraits<T>::one << endl;
}
template<class T>
void printTraits(const pTraits<T>& p)
{
Info<< p.typeName << " == " << p << endl;
}
int main()
{
Info<< pTraits<scalar>::typeName << endl;
printTraits<bool>();
printTraits<label>();
printTraits<scalar>();
printTraits<vector>();
printTraits<tensor>();
{
pTraits<bool> b(true);
printTraits(b);
}
{
pTraits<label> l(100);
printTraits(l);
}
printTraits(pTraits<scalar>(3.14159));
Info<< "End\n" << endl;