mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
objectRegistry fixes
- objectRegistry gets a rename() that also adjusts the dbDir - cloud reworked to use static variables subInstance and defaultName. This avoids writing "lagrangian" everywhere string fixes - avoid masking of std::string::replace in string.H - avoid old strstream in PV3FoamReader
This commit is contained in:
@ -312,7 +312,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir(runTime.timePath()/"lagrangian", fileName::DIRECTORY)
|
||||
readDir(runTime.timePath()/cloud::subInstance, fileName::DIRECTORY)
|
||||
);
|
||||
|
||||
// Particles
|
||||
@ -344,7 +344,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::subInstance/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
@ -418,7 +418,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::subInstance/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
lagrangianFieldDecomposer::readFields
|
||||
|
||||
@ -88,7 +88,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
|
||||
(
|
||||
field.name(),
|
||||
procMesh_.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
procMesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef reconstructLagrangian_H
|
||||
#define reconstructLagrangian_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
@ -47,7 +47,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -61,10 +61,10 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
|
||||
{
|
||||
// Check object on local mesh
|
||||
IOobject localIOobject
|
||||
(
|
||||
(
|
||||
fieldName,
|
||||
meshes[i].time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
meshes[i],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -277,7 +277,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
readDir
|
||||
(
|
||||
databases[procI].timePath()/regionPrefix/"lagrangian",
|
||||
databases[procI].timePath()/regionPrefix/cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -295,7 +295,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
procMeshes.meshes()[procI],
|
||||
databases[procI].timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::subInstance/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
@ -35,6 +35,7 @@ SourceFiles
|
||||
#ifndef ensightCloudField_H
|
||||
#define ensightCloudField_H
|
||||
|
||||
#include "Cloud.H"
|
||||
#include "IOobject.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -211,7 +211,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList cloudDirs = readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::subInstance/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = cloudObjs.lookup("positions");
|
||||
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudIter.key()
|
||||
cloud::subInstance/cloudIter.key()
|
||||
);
|
||||
|
||||
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
|
||||
@ -426,7 +426,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
fileNameList currentCloudDirs = readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -449,7 +449,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
fieldName,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
mesh,
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
||||
@ -42,7 +42,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
||||
|
||||
caseFile
|
||||
<< setw(16) << "measured: 2"
|
||||
<< fileName(dataMask/"lagrangian"/cloudName/"positions").c_str()
|
||||
<< fileName(dataMask/cloud::subInstance/cloudName/"positions").c_str()
|
||||
<< nl;
|
||||
}
|
||||
caseFile
|
||||
@ -122,7 +122,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
|
||||
ensightType,
|
||||
fieldName,
|
||||
dataMask,
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
cloudNo,
|
||||
2
|
||||
);
|
||||
|
||||
@ -27,7 +27,6 @@ License
|
||||
#include "ensightOutputFunctions.H"
|
||||
|
||||
#include "passiveParticle.H"
|
||||
#include "Cloud.H"
|
||||
#include "IOField.H"
|
||||
#include "volFields.H"
|
||||
#include "surfaceFields.H"
|
||||
@ -101,7 +100,7 @@ void ensightParticlePositions
|
||||
{
|
||||
Cloud<passiveParticle> parcels(mesh, cloudName, false);
|
||||
|
||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
||||
fileName cloudDir = subDir/cloud::subInstance/cloudName;
|
||||
fileName postFileName = cloudDir/"positions";
|
||||
|
||||
// the ITER/lagrangian subdirectory must exist
|
||||
@ -165,7 +164,7 @@ void ensightLagrangianField
|
||||
{
|
||||
Info<< " " << fieldObject.name() << flush;
|
||||
|
||||
fileName cloudDir = subDir/"lagrangian"/cloudName;
|
||||
fileName cloudDir = subDir/cloud::subInstance/cloudName;
|
||||
fileName postFileName = cloudDir/fieldObject.name();
|
||||
|
||||
string title =
|
||||
|
||||
@ -23,9 +23,7 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
miscellaneous collection of functions and template related
|
||||
to Ensight data
|
||||
Miscellaneous collection of functions and template related to Ensight data
|
||||
|
||||
SourceFiles
|
||||
ensightOutputFunctions.C
|
||||
@ -36,6 +34,7 @@ SourceFiles
|
||||
#define ensightOutputFunctions_H
|
||||
|
||||
#include "ensightFile.H"
|
||||
#include "Cloud.H"
|
||||
#include "polyMesh.H"
|
||||
#include "IOobject.H"
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ if (timeDirs.size() > 1)
|
||||
runTime.path()
|
||||
/ timeDirs[timeDirs.size() - 1].name()
|
||||
/ regionPrefix
|
||||
/ "lagrangian",
|
||||
/ cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
);
|
||||
|
||||
@ -55,7 +55,7 @@ if (timeDirs.size() > 1)
|
||||
(
|
||||
mesh,
|
||||
timeDirs[timeDirs.size() - 1].name(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::subInstance/cloudName
|
||||
);
|
||||
|
||||
bool hasPositions = false;
|
||||
|
||||
@ -324,7 +324,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const word& cloudName = cloudIter.key();
|
||||
|
||||
if (!isDir(runTime.timePath()/regionPrefix/"lagrangian"/cloudName))
|
||||
if
|
||||
(
|
||||
!isDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/
|
||||
cloud::subInstance/cloudName
|
||||
)
|
||||
)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -333,7 +340,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::subInstance/cloudName
|
||||
);
|
||||
|
||||
// check that the positions field is present for this time
|
||||
@ -365,7 +372,8 @@ int main(int argc, char *argv[])
|
||||
if (!fieldObject)
|
||||
{
|
||||
Info<< "missing "
|
||||
<< runTime.timeName()/"lagrangian"/cloudName/fieldName
|
||||
<< runTime.timeName()/cloud::subInstance/cloudName
|
||||
/ fieldName
|
||||
<< endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
||||
(
|
||||
sprayScalarNames[fieldI],
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -53,7 +53,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
|
||||
(
|
||||
sprayVectorNames[fieldI],
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -42,7 +42,7 @@ forAll(Times, timeI)
|
||||
|
||||
|
||||
// Same for spray
|
||||
IOobjectList sprayObjects(mesh, runTime.timeName(), "lagrangian");
|
||||
IOobjectList sprayObjects(mesh, runTime.timeName(), cloud::subInstance);
|
||||
{
|
||||
wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
|
||||
forAll(fieldNames, fieldI)
|
||||
|
||||
@ -44,21 +44,21 @@ Description
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
const label nTypes = 4;
|
||||
const word fieldTypes[] =
|
||||
{
|
||||
"volScalarField",
|
||||
"volVectorField",
|
||||
const word fieldTypes[] =
|
||||
{
|
||||
"volScalarField",
|
||||
"volVectorField",
|
||||
"surfaceScalarField",
|
||||
"lagrangian"
|
||||
cloud::subInstance
|
||||
};
|
||||
|
||||
# include "setRootCase.H"
|
||||
|
||||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
|
||||
# include "readConversionProperties.H"
|
||||
|
||||
|
||||
// get the available time-steps
|
||||
instantList TimeList = runTime.times();
|
||||
Info << TimeList << endl;
|
||||
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
||||
// Set Time
|
||||
runTime.setTime(TimeList[n], n);
|
||||
word CurTime = runTime.timeName();
|
||||
|
||||
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
# include "moveMesh.H"
|
||||
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
||||
// set the filename of the GMV file
|
||||
fileName gmvFileName = "plotGMV." + itoa(n);
|
||||
OFstream gmvFile(args.rootPath()/args.caseName()/gmvFileName);
|
||||
|
||||
|
||||
# include "gmvOutputHeader.H"
|
||||
# include "gmvOutput.H"
|
||||
# include "gmvOutputTail.H"
|
||||
|
||||
@ -2,13 +2,13 @@ for(label i=0; i < nTypes; i++)
|
||||
{
|
||||
wordList fieldNames = objects.names(fieldTypes[i]);
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
{
|
||||
gmvFile << "variable" << nl;
|
||||
}
|
||||
for(label j=0; j < fieldNames.size(); j++)
|
||||
{
|
||||
|
||||
|
||||
word fieldName = fieldNames[j];
|
||||
|
||||
IOobject fieldObject
|
||||
@ -19,8 +19,8 @@ for(label i=0; i < nTypes; i++)
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
);
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
{
|
||||
volScalarField gmvScalarField(fieldObject, mesh);
|
||||
gmvFile << fieldName << " 0" << nl;
|
||||
@ -30,8 +30,8 @@ for(label i=0; i < nTypes; i++)
|
||||
}
|
||||
gmvFile << nl;
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "volVectorField" )
|
||||
|
||||
if ( fieldTypes[i] == "volVectorField" )
|
||||
{
|
||||
if (fieldName == vComp)
|
||||
{
|
||||
@ -52,21 +52,21 @@ for(label i=0; i < nTypes; i++)
|
||||
gmvFile << nl;
|
||||
}
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "surfaceScalarField" )
|
||||
|
||||
if ( fieldTypes[i] == "surfaceScalarField" )
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "lagrangian")
|
||||
if ( fieldTypes[i] == cloud::subInstance )
|
||||
{
|
||||
IOobject lagrangianHeader
|
||||
(
|
||||
"positions",
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
);
|
||||
@ -74,9 +74,9 @@ for(label i=0; i < nTypes; i++)
|
||||
if (lagrangianHeader.headerOk())
|
||||
{
|
||||
Cloud<passiveParticle> particles(mesh);
|
||||
|
||||
IOobjectList objects(mesh, runTime.timeName(), "lagrangian");
|
||||
|
||||
|
||||
IOobjectList objects(mesh, runTime.timeName(), cloud::subInstance);
|
||||
|
||||
wordList lagrangianScalarNames = objects.names("scalarField");
|
||||
wordList lagrangianVectorNames = objects.names("vectorField");
|
||||
|
||||
@ -87,7 +87,7 @@ for(label i=0; i < nTypes; i++)
|
||||
}
|
||||
}
|
||||
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
if ( fieldTypes[i] == "volScalarField" )
|
||||
{
|
||||
gmvFile << "endvars" << nl;
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ forAll(lagrangianScalarNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
@ -73,7 +73,7 @@ forAll(lagrangianVectorNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -40,7 +40,7 @@ forAll(lagrangianScalarNames, i)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -914,7 +914,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
readDir
|
||||
(
|
||||
runTime.timePath()/regionPrefix/"lagrangian",
|
||||
runTime.timePath()/regionPrefix/cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -925,18 +925,18 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
runTime.timeName(),
|
||||
"lagrangian"/cloudDirs[i]
|
||||
cloud::subInstance/cloudDirs[i]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
if (positionsPtr)
|
||||
{
|
||||
mkDir(fvPath/"lagrangian"/cloudDirs[i]);
|
||||
mkDir(fvPath/cloud::subInstance/cloudDirs[i]);
|
||||
|
||||
fileName lagrFileName
|
||||
(
|
||||
fvPath/"lagrangian"/cloudDirs[i]/cloudDirs[i]
|
||||
fvPath/cloud::subInstance/cloudDirs[i]/cloudDirs[i]
|
||||
+ "_" + name(timeI) + ".vtk"
|
||||
);
|
||||
|
||||
|
||||
@ -39,6 +39,7 @@ SourceFiles
|
||||
|
||||
#include "globalPointPatch.H"
|
||||
#include "OFstream.H"
|
||||
#include "Cloud.H"
|
||||
#include "volFields.H"
|
||||
#include "pointFields.H"
|
||||
#include "vtkMesh.H"
|
||||
|
||||
@ -41,7 +41,7 @@ void Foam::lagrangianWriter::writeIOField(const wordList& objects)
|
||||
(
|
||||
object,
|
||||
vMesh_.mesh().time().timeName(),
|
||||
"lagrangian"/cloudName_,
|
||||
cloud::subInstance/cloudName_,
|
||||
vMesh_.mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
||||
@ -58,6 +58,11 @@ SourceFiles
|
||||
#ifndef vtkPV3Foam_H
|
||||
#define vtkPV3Foam_H
|
||||
|
||||
// do not include legacy strstream headers
|
||||
#ifndef VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||
# define VTK_EXCLUDE_STRSTREAM_HEADERS
|
||||
#endif
|
||||
|
||||
#include "className.H"
|
||||
#include "fileName.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
@ -268,7 +268,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
|
||||
(
|
||||
mesh,
|
||||
dbPtr_().timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::subInstance/cloudName
|
||||
);
|
||||
pruneObjectList(objects, selectedFields);
|
||||
|
||||
|
||||
@ -30,6 +30,8 @@ InClass
|
||||
#ifndef vtkPV3FoamLagrangianFields_H
|
||||
#define vtkPV3FoamLagrangianFields_H
|
||||
|
||||
#include "Cloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
|
||||
@ -53,7 +53,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::lagrangianVTKMesh - timePath "
|
||||
<< mesh.time().timePath()/"lagrangian"/cloudName << endl;
|
||||
<< mesh.time().timePath()/cloud::subInstance/cloudName << endl;
|
||||
printMemory();
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
(
|
||||
mesh,
|
||||
mesh.time().timeName(),
|
||||
"lagrangian"/cloudName
|
||||
cloud::subInstance/cloudName
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = sprayObjs.lookup("positions");
|
||||
|
||||
@ -34,6 +34,7 @@ License
|
||||
#include "IOPtrList.H"
|
||||
#include "polyBoundaryMeshEntries.H"
|
||||
#include "entry.H"
|
||||
#include "Cloud.H"
|
||||
#include "vtkPV3FoamReader.h"
|
||||
|
||||
// local headers
|
||||
@ -148,16 +149,16 @@ void Foam::vtkPV3Foam::updateInfoLagrangian()
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInfoLagrangian" << nl
|
||||
<< " " << dbPtr_->timePath()/"lagrangian" << endl;
|
||||
<< " " << dbPtr_->timePath()/cloud::subInstance << endl;
|
||||
}
|
||||
|
||||
|
||||
// use the db directly since this might be called without a mesh,
|
||||
// but the region must get added back in
|
||||
fileName lagrangianPrefix("lagrangian");
|
||||
fileName lagrangianPrefix(cloud::subInstance);
|
||||
if (meshRegion_ != polyMesh::defaultRegion)
|
||||
{
|
||||
lagrangianPrefix = meshRegion_/"lagrangian";
|
||||
lagrangianPrefix = meshRegion_/cloud::subInstance;
|
||||
}
|
||||
|
||||
// Search for list of lagrangian objects for this time
|
||||
@ -463,10 +464,10 @@ void Foam::vtkPV3Foam::updateInfoLagrangianFields()
|
||||
|
||||
// use the db directly since this might be called without a mesh,
|
||||
// but the region must get added back in
|
||||
fileName lagrangianPrefix("lagrangian");
|
||||
fileName lagrangianPrefix(cloud::subInstance);
|
||||
if (meshRegion_ != polyMesh::defaultRegion)
|
||||
{
|
||||
lagrangianPrefix = meshRegion_/"lagrangian";
|
||||
lagrangianPrefix = meshRegion_/cloud::subInstance;
|
||||
}
|
||||
|
||||
IOobjectList objects
|
||||
|
||||
@ -35,7 +35,7 @@ int USERD_get_gold_part_build_info
|
||||
for(label i=0; i<nPatches; i++)
|
||||
{
|
||||
word patchName(meshPtr->boundary()[i].name());
|
||||
strncpy(part_descriptions[i+1], patchName.c_str(), Z_BUFL);
|
||||
strncpy(part_descriptions[i+1], patchName.c_str(), Z_BUFL);
|
||||
}
|
||||
|
||||
label nHex08 = 0;
|
||||
@ -101,7 +101,7 @@ int USERD_get_gold_part_build_info
|
||||
*/
|
||||
|
||||
number_of_nodes[0] = meshPtr->nPoints();
|
||||
|
||||
|
||||
const polyBoundaryMesh& bMesh = meshPtr->boundaryMesh();
|
||||
|
||||
for(label i=0; i<nPatches; i++)
|
||||
@ -137,7 +137,12 @@ int USERD_get_gold_part_build_info
|
||||
|
||||
if (Numparts_available > nPatches+1)
|
||||
{
|
||||
strncpy(part_descriptions[nPatches+1], sprayName.c_str(), Z_BUFL);
|
||||
strncpy
|
||||
(
|
||||
part_descriptions[nPatches+1],
|
||||
cloud::subInstance.c_str(),
|
||||
Z_BUFL
|
||||
);
|
||||
number_of_elements[nPatches+1][Z_POINT] = sprayPtr->size();
|
||||
number_of_nodes[nPatches+1] = sprayPtr->size();
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ int USERD_set_filenames
|
||||
(
|
||||
"positions",
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
runTime,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
@ -179,7 +179,7 @@ int USERD_set_filenames
|
||||
|
||||
sprayPtr = new Cloud<passiveParticle>(*meshPtr);
|
||||
|
||||
IOobjectList objects(*meshPtr, runTime.timeName(), "lagrangian");
|
||||
IOobjectList objects(*meshPtr, runTime.timeName(), cloud::subInstance);
|
||||
|
||||
lagrangianScalarNames =
|
||||
(const wordList&)objects.names(sprayScalarFieldName);
|
||||
|
||||
@ -12,7 +12,7 @@ if (nVar >= 0)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -14,7 +14,7 @@ if (nVar >= 0)
|
||||
(
|
||||
name,
|
||||
runTime.timeName(),
|
||||
"lagrangian",
|
||||
cloud::subInstance,
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
||||
@ -32,7 +32,6 @@ static bool isSpray[maxNames];
|
||||
static word scalarName = "volScalarField";
|
||||
static word vectorName = "volVectorField";
|
||||
static word tensorName = "volTensorField";
|
||||
static word sprayName = "lagrangian";
|
||||
static word sprayScalarFieldName = "scalarField";
|
||||
static word sprayVectorFieldName = "vectorField";
|
||||
static word sprayTensorFieldName = "tensorField";
|
||||
|
||||
@ -34,6 +34,7 @@ Description
|
||||
#ifndef MapLagrangianFields_H
|
||||
#define MapLagrangianFields_H
|
||||
|
||||
#include "cloud.H"
|
||||
#include "GeometricField.H"
|
||||
#include "meshToMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
@ -60,8 +61,7 @@ void MapLagrangianFields
|
||||
|
||||
forAllIter(IOobjectList, fields, fieldIter)
|
||||
{
|
||||
Info<< " mapping lagrangian field "
|
||||
<< fieldIter()->name() << endl;
|
||||
Info<< " mapping lagrangian field " << fieldIter()->name() << endl;
|
||||
|
||||
// Read field (does not need mesh)
|
||||
IOField<Type> fieldSource(*fieldIter());
|
||||
@ -73,7 +73,7 @@ void MapLagrangianFields
|
||||
(
|
||||
fieldIter()->name(),
|
||||
meshTarget.time().timeName(),
|
||||
"lagrangian"/cloudName,
|
||||
cloud::subInstance/cloudName,
|
||||
meshTarget,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
|
||||
@ -94,7 +94,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
||||
(
|
||||
readDir
|
||||
(
|
||||
meshSource.time().timePath()/"lagrangian",
|
||||
meshSource.time().timePath()/cloud::subInstance,
|
||||
fileName::DIRECTORY
|
||||
)
|
||||
);
|
||||
@ -106,7 +106,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
|
||||
(
|
||||
meshSource,
|
||||
meshSource.time().timeName(),
|
||||
"lagrangian"/cloudDirs[cloudI]
|
||||
cloud::subInstance/cloudDirs[cloudI]
|
||||
);
|
||||
|
||||
IOobject* positionsPtr = objects.lookup("positions");
|
||||
|
||||
Reference in New Issue
Block a user