mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote branch 'OpenCFD/master' into olesenm
This commit is contained in:
@ -375,6 +375,44 @@ int main(int argc, char *argv[])
|
|||||||
// mesh wrapper; does subsetting and decomposition
|
// mesh wrapper; does subsetting and decomposition
|
||||||
vtkMesh vMesh(mesh, cellSetName);
|
vtkMesh vMesh(mesh, cellSetName);
|
||||||
|
|
||||||
|
|
||||||
|
// Scan for all possible lagrangian clouds
|
||||||
|
HashSet<fileName> allCloudDirs;
|
||||||
|
forAll(timeDirs, timeI)
|
||||||
|
{
|
||||||
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
fileNameList cloudDirs
|
||||||
|
(
|
||||||
|
readDir
|
||||||
|
(
|
||||||
|
runTime.timePath()/regionPrefix/cloud::prefix,
|
||||||
|
fileName::DIRECTORY
|
||||||
|
)
|
||||||
|
);
|
||||||
|
forAll(cloudDirs, i)
|
||||||
|
{
|
||||||
|
IOobjectList sprayObjs
|
||||||
|
(
|
||||||
|
mesh,
|
||||||
|
runTime.timeName(),
|
||||||
|
cloud::prefix/cloudDirs[i]
|
||||||
|
);
|
||||||
|
|
||||||
|
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||||
|
|
||||||
|
if (positionsPtr)
|
||||||
|
{
|
||||||
|
if (allCloudDirs.insert(cloudDirs[i]))
|
||||||
|
{
|
||||||
|
Info<< "At time: " << runTime.timeName()
|
||||||
|
<< " detected cloud directory : " << cloudDirs[i]
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
runTime.setTime(timeDirs[timeI], timeI);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
@ -926,38 +964,33 @@ int main(int argc, char *argv[])
|
|||||||
//
|
//
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|
||||||
fileNameList cloudDirs
|
forAllConstIter(HashSet<fileName>, allCloudDirs, iter)
|
||||||
(
|
|
||||||
readDir
|
|
||||||
(
|
|
||||||
runTime.timePath()/regionPrefix/cloud::prefix,
|
|
||||||
fileName::DIRECTORY
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(cloudDirs, i)
|
|
||||||
{
|
{
|
||||||
|
const fileName& cloudName = iter.key();
|
||||||
|
|
||||||
|
// Always create the cloud directory.
|
||||||
|
mkDir(fvPath/cloud::prefix/cloudName);
|
||||||
|
|
||||||
|
fileName lagrFileName
|
||||||
|
(
|
||||||
|
fvPath/cloud::prefix/cloudName/cloudName
|
||||||
|
+ "_" + timeDesc + ".vtk"
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< " Lagrangian: " << lagrFileName << endl;
|
||||||
|
|
||||||
|
|
||||||
IOobjectList sprayObjs
|
IOobjectList sprayObjs
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
runTime.timeName(),
|
runTime.timeName(),
|
||||||
cloud::prefix/cloudDirs[i]
|
cloud::prefix/cloudName
|
||||||
);
|
);
|
||||||
|
|
||||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||||
|
|
||||||
if (positionsPtr)
|
if (positionsPtr)
|
||||||
{
|
{
|
||||||
mkDir(fvPath/cloud::prefix/cloudDirs[i]);
|
|
||||||
|
|
||||||
fileName lagrFileName
|
|
||||||
(
|
|
||||||
fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i]
|
|
||||||
+ "_" + timeDesc + ".vtk"
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< " Lagrangian: " << lagrFileName << endl;
|
|
||||||
|
|
||||||
wordList labelNames(sprayObjs.names(labelIOField::typeName));
|
wordList labelNames(sprayObjs.names(labelIOField::typeName));
|
||||||
Info<< " labels :";
|
Info<< " labels :";
|
||||||
print(Info, labelNames);
|
print(Info, labelNames);
|
||||||
@ -999,18 +1032,19 @@ int main(int argc, char *argv[])
|
|||||||
vMesh,
|
vMesh,
|
||||||
binary,
|
binary,
|
||||||
lagrFileName,
|
lagrFileName,
|
||||||
cloudDirs[i]
|
cloudName,
|
||||||
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
// Write number of fields
|
// Write number of fields
|
||||||
writer.writeParcelHeader
|
writer.writeParcelHeader
|
||||||
(
|
(
|
||||||
labelNames.size()
|
labelNames.size()
|
||||||
+ scalarNames.size()
|
+ scalarNames.size()
|
||||||
+ vectorNames.size()
|
+ vectorNames.size()
|
||||||
+ sphereNames.size()
|
+ sphereNames.size()
|
||||||
+ symmNames.size()
|
+ symmNames.size()
|
||||||
+ tensorNames.size()
|
+ tensorNames.size()
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fields
|
// Fields
|
||||||
@ -1021,6 +1055,20 @@ int main(int argc, char *argv[])
|
|||||||
writer.writeIOField<symmTensor>(symmNames);
|
writer.writeIOField<symmTensor>(symmNames);
|
||||||
writer.writeIOField<tensor>(tensorNames);
|
writer.writeIOField<tensor>(tensorNames);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lagrangianWriter writer
|
||||||
|
(
|
||||||
|
vMesh,
|
||||||
|
binary,
|
||||||
|
lagrFileName,
|
||||||
|
cloudName,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
|
// Write number of fields
|
||||||
|
writer.writeParcelHeader(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,8 @@ Foam::lagrangianWriter::lagrangianWriter
|
|||||||
const vtkMesh& vMesh,
|
const vtkMesh& vMesh,
|
||||||
const bool binary,
|
const bool binary,
|
||||||
const fileName& fName,
|
const fileName& fName,
|
||||||
const word& cloudName
|
const word& cloudName,
|
||||||
|
const bool dummyCloud
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
vMesh_(vMesh),
|
vMesh_(vMesh),
|
||||||
@ -51,19 +52,28 @@ Foam::lagrangianWriter::lagrangianWriter
|
|||||||
writeFuns::writeHeader(os_, binary_, mesh.time().caseName());
|
writeFuns::writeHeader(os_, binary_, mesh.time().caseName());
|
||||||
os_ << "DATASET POLYDATA" << std::endl;
|
os_ << "DATASET POLYDATA" << std::endl;
|
||||||
|
|
||||||
Cloud<passiveParticle> parcels(mesh, cloudName_, false);
|
if (dummyCloud)
|
||||||
|
|
||||||
nParcels_ = parcels.size();
|
|
||||||
|
|
||||||
os_ << "POINTS " << parcels.size() << " float" << std::endl;
|
|
||||||
|
|
||||||
DynamicList<floatScalar> partField(3*parcels.size());
|
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
|
||||||
{
|
{
|
||||||
writeFuns::insert(elmnt().position(), partField);
|
nParcels_ = 0;
|
||||||
|
|
||||||
|
os_ << "POINTS " << nParcels_ << " float" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Cloud<passiveParticle> parcels(mesh, cloudName_, false);
|
||||||
|
|
||||||
|
nParcels_ = parcels.size();
|
||||||
|
|
||||||
|
os_ << "POINTS " << nParcels_ << " float" << std::endl;
|
||||||
|
|
||||||
|
DynamicList<floatScalar> partField(3*parcels.size());
|
||||||
|
|
||||||
|
forAllConstIter(Cloud<passiveParticle>, parcels, elmnt)
|
||||||
|
{
|
||||||
|
writeFuns::insert(elmnt().position(), partField);
|
||||||
|
}
|
||||||
|
writeFuns::write(os_, binary_, partField);
|
||||||
}
|
}
|
||||||
writeFuns::write(os_, binary_, partField);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,8 @@ public:
|
|||||||
const vtkMesh&,
|
const vtkMesh&,
|
||||||
const bool binary,
|
const bool binary,
|
||||||
const fileName&,
|
const fileName&,
|
||||||
const word&
|
const word&,
|
||||||
|
const bool dummyCloud
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -165,11 +165,6 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OStringStream ostr;
|
|
||||||
|
|
||||||
ostr<< edges[edgeI].start() << ":" << edges[edgeI].end() << " - "
|
|
||||||
<< edges[edgeI].type();
|
|
||||||
|
|
||||||
// search each block
|
// search each block
|
||||||
forAll(blkMesh, blockI)
|
forAll(blkMesh, blockI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -91,7 +91,7 @@ void Foam::LUscalarMatrix::solve(Field<Type>& sourceSol) const
|
|||||||
{
|
{
|
||||||
OPstream::write
|
OPstream::write
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
Pstream::scheduled,
|
||||||
slave,
|
slave,
|
||||||
reinterpret_cast<const char*>
|
reinterpret_cast<const char*>
|
||||||
(
|
(
|
||||||
@ -105,7 +105,7 @@ void Foam::LUscalarMatrix::solve(Field<Type>& sourceSol) const
|
|||||||
{
|
{
|
||||||
IPstream::read
|
IPstream::read
|
||||||
(
|
(
|
||||||
Pstream::blocking,
|
Pstream::scheduled,
|
||||||
Pstream::masterNo(),
|
Pstream::masterNo(),
|
||||||
reinterpret_cast<char*>(sourceSol.begin()),
|
reinterpret_cast<char*>(sourceSol.begin()),
|
||||||
sourceSol.byteSize()
|
sourceSol.byteSize()
|
||||||
|
|||||||
Reference in New Issue
Block a user