Merge commit 'bundle/home' into olesenm

This commit is contained in:
Mark Olesen
2008-11-24 08:44:47 +01:00
45 changed files with 783 additions and 647 deletions

View File

@ -43,9 +43,14 @@ int main(int argc, char *argv[])
ldl[0](3) = 3;
ldl[0](1) = 1;
ldl[0].setSize(5); // increase allocated size
ldl[1].setSize(10); // increase allocated size
ldl[1](2) = 2;
ldl[0].allocSize(5); // increase allocated size
ldl[1].allocSize(10); // increase allocated size
ldl[0].reserve(15); // should increase allocated size
ldl[1].reserve(5); // should not decrease allocated size
ldl[1](3) = 2; // allocates space and sets value
// this works without a segfault, but doesn't change the list size
ldl[0][4] = 4;
ldl[1] = 3;
@ -78,7 +83,7 @@ int main(int argc, char *argv[])
{
dlA.append(i);
}
dlA.setSize(10);
dlA.allocSize(10);
Info<< "<dlA>" << dlA << "</dlA>" << nl << "sizes: "
<< " " << dlA.size() << "/" << dlA.allocSize() << endl;
@ -95,6 +100,14 @@ int main(int argc, char *argv[])
Info<< "<dlB>" << dlB << "</dlB>" << nl << "sizes: "
<< " " << dlB.size() << "/" << dlB.allocSize() << endl;
// try with a normal list:
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.allocSize() << endl;
return 0;
}

View File

@ -70,6 +70,13 @@ int main(int argc, char *argv[])
Info << "sorted: " << b << endl;
Info << "indices: " << b.indices() << endl;
labelList flatten;
flatten.transfer(b);
Info << "flatten: " << flatten << endl;
Info << "sorted: " << b << endl;
Info << "indices: " << b.indices() << endl;
Info << "End\n" << endl;
return 0;

View File

@ -109,7 +109,7 @@ Foam::label Foam::checkTopology
{
Info<< " Number of regions: " << rs.nRegions() << " (OK)."
<< endl;
}
else
{
@ -214,7 +214,7 @@ Foam::label Foam::checkTopology
const pointField& pts = pp.points();
const labelList& mp = pp.meshPoints();
boundBox bb(vector::zero, vector::zero);
boundBox bb; // zero-sized
if (returnReduce(mp.size(), sumOp<label>()) > 0)
{
bb.min() = pts[mp[0]];

View File

@ -273,7 +273,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
}
}
return map;
return map;
}
@ -418,11 +418,7 @@ int main(int argc, char *argv[])
// Read point on individual processors to determine merge tolerance
// (otherwise single cell domains might give problems)
boundBox bb
(
point(GREAT, GREAT, GREAT),
point(-GREAT, -GREAT, -GREAT)
);
boundBox bb = boundBox::invertedBox;
for (label procI = 0; procI < nProcs; procI++)
{

View File

@ -199,7 +199,6 @@ int main(int argc, char *argv[])
if (args.options().found("clean"))
{
surf.cleanup(true);
surf.checkOrientation(true);
}
if (fromCsys.valid())

View File

@ -104,13 +104,19 @@ int main(int argc, char *argv[])
{
triSurface surf(importName);
Info<< "Read surface:" << endl;
surf.writeStats(Info);
Info<< endl;
if (args.options().found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
surf.checkOrientation(true);
surf.writeStats(Info);
Info<< endl;
}
Info << "writing " << exportName;
Info<< "writing " << exportName;
if (scaleFactor <= 0)
{
Info<< " without scaling" << endl;
@ -119,6 +125,8 @@ int main(int argc, char *argv[])
{
Info<< " with scaling " << scaleFactor << endl;
surf.scalePoints(scaleFactor);
surf.writeStats(Info);
Info<< endl;
}
// write sorted by region
@ -128,34 +136,16 @@ int main(int argc, char *argv[])
{
UnsortedMeshedSurface<face> surf(importName);
if (args.options().found("clean"))
{
surf.cleanup(true);
surf.checkOrientation(true);
}
Info << "writing " << exportName;
if (scaleFactor <= 0)
{
Info<< " without scaling" << endl;
}
else
{
Info<< " with scaling " << scaleFactor << endl;
surf.scalePoints(scaleFactor);
}
surf.write(exportName);
}
#if 1
else if (args.options().found("triFace"))
{
MeshedSurface<triFace> surf(importName);
Info<< "Read surface:" << endl;
surf.writeStats(Info);
Info<< endl;
if (args.options().found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
surf.checkOrientation(true);
surf.writeStats(Info);
Info<< endl;
}
Info<< "writing " << exportName;
@ -167,6 +157,39 @@ int main(int argc, char *argv[])
{
Info<< " with scaling " << scaleFactor << endl;
surf.scalePoints(scaleFactor);
surf.writeStats(Info);
Info<< endl;
}
surf.write(exportName);
}
#if 1
else if (args.options().found("triFace"))
{
MeshedSurface<triFace> surf(importName);
Info<< "Read surface:" << endl;
surf.writeStats(Info);
Info<< endl;
if (args.options().found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
surf.writeStats(Info);
Info<< endl;
}
Info<< "writing " << exportName;
if (scaleFactor <= 0)
{
Info<< " without scaling" << endl;
}
else
{
Info<< " with scaling " << scaleFactor << endl;
surf.scalePoints(scaleFactor);
surf.writeStats(Info);
Info<< endl;
}
surf.write(exportName);
}
@ -175,10 +198,16 @@ int main(int argc, char *argv[])
{
MeshedSurface<face> surf(importName);
Info<< "Read surface:" << endl;
surf.writeStats(Info);
Info<< endl;
if (args.options().found("clean"))
{
Info<< "Cleaning up surface" << endl;
surf.cleanup(true);
surf.checkOrientation(true);
surf.writeStats(Info);
Info<< endl;
}
Info<< "writing " << exportName;
@ -190,6 +219,8 @@ int main(int argc, char *argv[])
{
Info<< " with scaling " << scaleFactor << endl;
surf.scalePoints(scaleFactor);
surf.writeStats(Info);
Info<< endl;
}
surf.write(exportName);
}