Merge branch 'master' into cvm

This commit is contained in:
graham
2009-07-09 10:24:23 +01:00
379 changed files with 11316 additions and 5281 deletions

View File

View File

View File

@ -78,6 +78,7 @@ int main(int argc, char *argv[])
if (sourceType == "patch")
{
fileName sourceCasePath(dict.lookup("sourceCase"));
sourceCasePath.expand();
fileName sourceRootDir = sourceCasePath.path();
fileName sourceCaseDir = sourceCasePath.name();
word patchName(dict.lookup("sourcePatch"));

View File

@ -1,16 +0,0 @@
argList::validArgs.clear();
argList::noParallel();
argList::validOptions.insert("sourceCase", "source case");
argList::validOptions.insert("sourcePatch", "source patch");
argList::validOptions.insert("surface", "surface file");
argList::validOptions.insert("mergeFaces", "");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}

View File

@ -209,6 +209,8 @@ snapControls
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Per final patch (so not geometry!) the layer information
@ -230,14 +232,13 @@ addLayersControls
//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// is the thickness of the layer furthest away from the wall.
// See relativeSizes parameter.
finalLayerThickness 0.3;
//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
// See relativeSizes parameter.
minThickness 0.25;
//- If points get not extruded do nGrow layers of connected faces that are

View File

@ -38,7 +38,7 @@ Description
#include "Time.H"
#include "timeSelector.H"
#include "OFstream.H"
#include "passiveParticle.H"
#include "passiveParticleCloud.H"
using namespace Foam;
@ -61,7 +61,8 @@ int main(int argc, char *argv[])
fileName vtkPath(runTime.path()/"VTK");
mkDir(vtkPath);
Info<< "Scanning times to determine track data" << nl << endl;
Info<< "Scanning times to determine track data for cloud " << cloudName
<< nl << endl;
labelList maxIds(Pstream::nProcs(), -1);
forAll(timeDirs, timeI)
@ -69,35 +70,33 @@ int main(int argc, char *argv[])
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
IOobject positionsHeader
(
"positions",
runTime.timeName(),
cloud::prefix/cloudName,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
);
Info<< " Reading particle positions" << endl;
passiveParticleCloud myCloud(mesh, cloudName);
Info<< " Read " << returnReduce(myCloud.size(), sumOp<label>())
<< " particles" << endl;
if (positionsHeader.headerOk())
forAllConstIter(passiveParticleCloud, myCloud, iter)
{
Info<< " Reading particle positions" << endl;
Cloud<passiveParticle> myCloud(mesh, cloudName, false);
label origId = iter().origId();
label origProc = iter().origProc();
forAllConstIter(Cloud<passiveParticle>, myCloud, iter)
{
label origId = iter().origId();
label origProc = iter().origProc();
maxIds[origProc] = max(maxIds[origProc], origId);
}
maxIds[origProc] = max(maxIds[origProc], origId);
}
}
Pstream::listCombineGather(maxIds, maxOp<label>());
Pstream::listCombineGather(maxIds, maxEqOp<label>());
Pstream::listCombineScatter(maxIds);
labelList numIds = maxIds + 1;
Info<< nl << "Particle statistics:" << endl;
forAll(maxIds, procI)
{
Info<< " Found " << numIds[procI] << " particles originating"
<< " from processor " << procI << endl;
}
Info<< nl << endl;
// calc starting ids for particles on each processor
List<label> startIds(numIds.size(), 0);
for (label i = 0; i < numIds.size()-1; i++)
@ -106,98 +105,87 @@ int main(int argc, char *argv[])
}
label nParticle = startIds[startIds.size()-1] + numIds[startIds.size()-1];
// number of tracks to generate
label nTracks = nParticle/sampleFrequency;
// storage for all particle tracks
List<DynamicList<vector> > allTracks(nTracks);
Info<< "\nGenerating " << nTracks << " particle tracks" << nl << endl;
Info<< "\nGenerating " << nTracks << " particle tracks for cloud "
<< cloudName << nl << endl;
forAll(timeDirs, timeI)
{
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
IOobject positionsHeader
List<pointField> allPositions(Pstream::nProcs());
List<labelField> allOrigIds(Pstream::nProcs());
List<labelField> allOrigProcs(Pstream::nProcs());
// Read particles. Will be size 0 if no particles.
Info<< " Reading particle positions" << endl;
passiveParticleCloud myCloud(mesh, cloudName);
// collect the track data on all processors that have positions
allPositions[Pstream::myProcNo()].setSize
(
"positions",
runTime.timeName(),
cloud::prefix/cloudName,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
myCloud.size(),
point::zero
);
allOrigIds[Pstream::myProcNo()].setSize(myCloud.size(), 0);
allOrigProcs[Pstream::myProcNo()].setSize(myCloud.size(), 0);
if (positionsHeader.headerOk())
label i = 0;
forAllConstIter(passiveParticleCloud, myCloud, iter)
{
Info<< " Reading particle positions" << endl;
Cloud<passiveParticle> myCloud(mesh, cloudName, false);
allPositions[Pstream::myProcNo()][i] = iter().position();
allOrigIds[Pstream::myProcNo()][i] = iter().origId();
allOrigProcs[Pstream::myProcNo()][i] = iter().origProc();
i++;
}
// collect the track data on the master processor
List<pointField> allPositions(Pstream::nProcs());
allPositions[Pstream::myProcNo()].setSize
(
myCloud.size(),
point::zero
);
// collect the track data on the master processor
Pstream::gatherList(allPositions);
Pstream::gatherList(allOrigIds);
Pstream::gatherList(allOrigProcs);
List<labelField> allOrigIds(Pstream::nProcs());
allOrigIds[Pstream::myProcNo()].setSize(myCloud.size(), 0);
List<labelField> allOrigProcs(Pstream::nProcs());
allOrigProcs[Pstream::myProcNo()].setSize(myCloud.size(), 0);
label i = 0;
forAllConstIter(Cloud<passiveParticle>, myCloud, iter)
Info<< " Constructing tracks" << nl << endl;
if (Pstream::master())
{
forAll(allPositions, procI)
{
allPositions[Pstream::myProcNo()][i] = iter().position();
allOrigIds[Pstream::myProcNo()][i] = iter().origId();
allOrigProcs[Pstream::myProcNo()][i] = iter().origProc();
i++;
}
Pstream::gatherList(allPositions);
Pstream::gatherList(allOrigIds);
Pstream::gatherList(allOrigProcs);
Info<< " Constructing tracks" << nl << endl;
if (Pstream::master())
{
forAll(allPositions, procI)
forAll(allPositions[procI], i)
{
forAll(allPositions[procI], i)
{
label globalId =
startIds[allOrigProcs[procI][i]]
+ allOrigIds[procI][i];
label globalId =
startIds[allOrigProcs[procI][i]]
+ allOrigIds[procI][i];
if (globalId % sampleFrequency == 0)
if (globalId % sampleFrequency == 0)
{
label trackId = globalId/sampleFrequency;
if (allTracks[trackId].size() < maxPositions)
{
label trackId = globalId/sampleFrequency;
if (allTracks[trackId].size() < maxPositions)
{
allTracks[trackId].append
(
allPositions[procI][i]
);
}
allTracks[trackId].append
(
allPositions[procI][i]
);
}
}
}
}
}
else
{
Info<< " No particles read" << nl << endl;
}
}
if (Pstream::master())
{
Info<< "\nWriting particle tracks" << nl << endl;
OFstream vtkTracks(vtkPath/"particleTracks.vtk");
Info<< "\nWriting particle tracks to " << vtkTracks.name()
<< nl << endl;
// Total number of points in tracks + 1 per track
label nPoints = 0;
forAll(allTracks, trackI)

View File

View File

View File

View File