Merge branch 'master' into dsmc

This commit is contained in:
Graham Macpherson
2009-04-09 10:58:32 +01:00
509 changed files with 15243 additions and 6309 deletions

View File

@ -32,7 +32,5 @@ if (dieselSpray.twoD())
gasMass0 *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
}
reduce(gasMass0, sumOp<scalar>());
gasMass0 -=
dieselSpray.injectedMass(runTime.value()) - dieselSpray.liquidMass();

View File

@ -23,8 +23,6 @@
gasMass *= 2.0*mathematicalConstant::pi/dieselSpray.angleOfWedge();
}
reduce(gasMass, sumOp<scalar>());
scalar addedMass = gasMass - gasMass0;
Info<< "Added gas mass................. | " << 1e6*addedMass << " mg"

View File

@ -59,7 +59,8 @@
rho = thermo->rho();
rho.relax();
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
<< endl;
pd == p - (rho*gh + pRef);
}

View File

@ -1,4 +1,3 @@
Info<< "Reading field p\n" << endl;
volScalarField p
(
@ -33,7 +32,7 @@
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue);
singlePhaseTransportModel laminarTransport(U, phi);

View File

@ -23,7 +23,7 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
turbDyMFoam
pimpleDyMFoam.C
Description
Transient solver for incompressible, flow of Newtonian fluids
@ -47,7 +47,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"

View File

@ -1,14 +1,14 @@
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
bool correctPhi = false;
if (piso.found("correctPhi"))
if (pimple.found("correctPhi"))
{
correctPhi = Switch(piso.lookup("correctPhi"));
correctPhi = Switch(pimple.lookup("correctPhi"));
}
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
if (pimple.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
}

View File

@ -28,6 +28,8 @@ Description
#include "UIndirectList.H"
#include "IOstreams.H"
#include "ListOps.H"
#include "OFstream.H"
using namespace Foam;
@ -52,29 +54,32 @@ int main(int argc, char *argv[])
UIndirectList<double> idl(completeList, addresses);
forAll(idl, i)
{
Info<< idl[i] << token::SPACE;
}
Info<< endl;
Info<< idl << "\n";
idl[1] = -666;
Info<< "idl[1] changed:" << idl() << endl;
Info<< "idl[1] changed:" << idl << endl;
idl = -999;
Info<< "idl changed:" << idl() << endl;
Info<< "idl changed:" << idl << endl;
UIndirectList<double> idl2(idl);
Info<< "idl2:" << idl2() << endl;
Info<< "idl2: " << idl2 << endl;
idl = idl2();
Info<< "idl assigned from UList:" << idl() << endl;
{
List<double> ident(idl.size());
forAll(ident, i)
{
ident[i] = ident.size() - i;
}
idl = ident;
}
Info<< "idl assigned from UList:" << idl << endl;
List<double> realList = UIndirectList<double>(completeList, addresses);

View File

@ -70,6 +70,28 @@ int main(int argc, char *argv[])
string test2("~OpenFOAM/controlDict");
Info<< test2 << " => " << test2.expand() << endl;
// replace controlDict with "newName"
{
string::size_type i = test2.rfind('/');
if (i == string::npos)
{
test2 = "newName";
}
else
{
// this uses the std::string::replace
test2.replace(i+1, string::npos, "newName");
}
Info<< "after replace: " << test2 << endl;
// do another replace
// this uses the Foam::string::replace
test2.replace("OpenFOAM", "openfoam");
Info<< "after replace: " << test2 << endl;
}
string s;
Sin.getLine(s);
@ -78,8 +100,7 @@ int main(int argc, char *argv[])
cout<< "output string with " << s2.length() << " characters\n";
cout<< "ostream<< >" << s2 << "<\n";
Info<< "Ostream<< >" << s2 << "<\n";
Info<< "hash:" << unsigned(string::hash()(s2)) << endl;
Info<< "hash:" << hex << string::hash()(s2) << endl;
Info << "End\n" << endl;

View File

@ -68,8 +68,7 @@ int main(int argc, char *argv[])
mesh
);
pointMesh pMesh(mesh);
volPointInterpolation pInterp(mesh, pMesh);
const volPointInterpolation& pInterp = volPointInterpolation::New(mesh);
pointScalarField pp(pInterp.interpolate(p));
pp.write();

View File

@ -39,24 +39,17 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
Info<< "\nEstimating error in scalar transport equation\n" << endl;
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "Reading transportProperties\n" << endl;
Info<< "\nEstimating error in scalar transport equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
@ -79,9 +72,9 @@ int main(int argc, char *argv[])
);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -38,25 +38,17 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< endl;
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "Reading transportProperties\n" << endl;
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
@ -75,9 +67,9 @@ int main(int argc, char *argv[])
transportProperties.lookup("nu")
);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -39,25 +39,17 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< endl;
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "Reading transportProperties\n" << endl;
Info<< "\nEstimating error in the incompressible momentum equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
@ -76,9 +68,9 @@ int main(int argc, char *argv[])
transportProperties.lookup("nu")
);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -40,24 +40,17 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
Info<< "\nEstimating error in scalar transport equation\n" << endl;
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
Info<< "Reading transportProperties\n" << endl;
Info<< "\nEstimating error in scalar transport equation\n"
<< "Reading transportProperties\n" << endl;
IOdictionary transportProperties
(
@ -80,9 +73,9 @@ int main(int argc, char *argv[])
);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -182,6 +182,7 @@ int main(int argc, char *argv[])
if (overwrite)
{
mesh.setInstance(oldInstance);
meshCutter.setInstance(oldInstance);
}
Info<< "Writing mesh to " << runTime.timeName() << endl;

View File

@ -61,6 +61,7 @@ See Also
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "polyMesh.H"
#include "STARCDMeshWriter.H"
@ -73,20 +74,17 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
timeSelector::addOptions();
argList::validOptions.insert("scale", "scale");
argList::validOptions.insert("noBnd", "");
argList::validOptions.insert("tri", "");
argList::validOptions.insert("surface", "");
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
bool surfaceOnly = false;
if (args.options().found("surface") or args.options().found("tri"))
@ -118,17 +116,16 @@ int main(int argc, char *argv[])
# include "createPolyMesh.H"
// bool firstCheck = true;
for (label timeI = startTime; timeI < endTime; ++timeI)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[timeI], timeI);
runTime.setTime(timeDirs[timeI], timeI);
# include "getTimeIndex.H"
polyMesh::readUpdateState state = mesh.readUpdate();
if (timeI == startTime || state != polyMesh::UNCHANGED)
if (!timeI || state != polyMesh::UNCHANGED)
{
meshWriters::STARCD writer(mesh, scaleFactor);

View File

@ -1,4 +1,4 @@
meshDualiser.C
makePolyDualMesh.C
polyDualMeshApp.C
EXE = $(FOAM_APPBIN)/polyDualMesh

View File

@ -348,8 +348,10 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
@ -509,7 +511,7 @@ int main(int argc, char *argv[])
Info<< "Writing dual mesh to " << runTime.timeName() << endl;
mesh.write();
Info<< "End\n" << endl;
return 0;

View File

@ -37,6 +37,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "polyMesh.H"
#include "OFstream.H"
@ -336,6 +337,7 @@ void writePointCells
int main(int argc, char *argv[])
{
timeSelector::addOptions();
argList::validOptions.insert("patchFaces", "");
argList::validOptions.insert("cell", "cellI");
argList::validOptions.insert("face", "faceI");
@ -343,7 +345,6 @@ int main(int argc, char *argv[])
argList::validOptions.insert("cellSet", "setName");
argList::validOptions.insert("faceSet", "setName");
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
runTime.functionObjects().off();
@ -361,31 +362,23 @@ int main(int argc, char *argv[])
<< "(for points, faces, cells) is consistent with"
<< " Foam numbering (starting from 0)." << endl << endl;
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createPolyMesh.H"
bool firstCheck = true;
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
polyMesh::readUpdateState state = mesh.readUpdate();
if (firstCheck || state != polyMesh::UNCHANGED)
if (!timeI || state != polyMesh::UNCHANGED)
{
if (patchFaces)
{
writePatchFaces(mesh, runTime.timeName());
}
else if (doCell)
{
@ -487,9 +480,7 @@ int main(int argc, char *argv[])
Info << "No mesh." << endl;
}
firstCheck = false;
Info << endl << endl;
Info << nl << endl;
}

View File

@ -30,8 +30,7 @@ Description
#include "arcEdge.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -40,8 +39,7 @@ namespace Foam
defineTypeNameAndDebug(arcEdge, 0);
// Add the curvedEdge constructor functions to the hash tables
curvedEdge::addIstreamConstructorToTable<arcEdge>
addArcEdgeIstreamConstructorToTable_;
addToRunTimeSelectionTable(curvedEdge, arcEdge, Istream);
}

View File

@ -41,26 +41,7 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(curvedEdge, 0);
// Define the constructor function hash tables
HashTable<curvedEdge::IstreamConstructorPtr_>*
curvedEdge::IstreamConstructorTablePtr_;
// Hash table Constructor called from the table add functions.
void curvedEdge::constructTables()
{
static bool constructed = false;
if (!constructed)
{
curvedEdge::IstreamConstructorTablePtr_
= new HashTable<curvedEdge::IstreamConstructorPtr_>;
constructed = true;
}
}
defineRunTimeSelectionTable(curvedEdge, Istream);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -117,10 +98,11 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
word curvedEdgeType(is);
HashTable<IstreamConstructorPtr_>::iterator curvedEdgeConstructorIter =
IstreamConstructorTablePtr_->find(curvedEdgeType);
IstreamConstructorTable::iterator cstrIter =
IstreamConstructorTablePtr_
->find(curvedEdgeType);
if (curvedEdgeConstructorIter == IstreamConstructorTablePtr_->end())
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalErrorIn("curvedEdge::New(const pointField&, Istream&)")
<< "Unknown curvedEdge type " << curvedEdgeType << endl << endl
@ -129,7 +111,7 @@ autoPtr<curvedEdge> curvedEdge::New(const pointField& points, Istream& is)
<< abort(FatalError);
}
return autoPtr<curvedEdge>(curvedEdgeConstructorIter()(points, is));
return autoPtr<curvedEdge>(cstrIter()(points, is));
}
@ -177,7 +159,6 @@ Ostream& operator<<(Ostream& os, const curvedEdge& p)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -63,51 +63,23 @@ protected:
public:
// Constructor Hash tables
//- Construct from Istream function pointer type
typedef autoPtr<curvedEdge> (*IstreamConstructorPtr_)
(const pointField&, Istream&);
//- Construct from Istream function pointer table pointer
static HashTable<IstreamConstructorPtr_>*
IstreamConstructorTablePtr_;
//- Runtime type information
TypeName("curvedEdge");
// Hash table constructor classes and functions
// Declare run-time constructor selection tables
//- Hash table Constructor.
// Must be called from the table add functions below.
static void constructTables();
//- Class to add constructor from Istream to Hash table
template<class curvedEdgeType>
class addIstreamConstructorToTable
{
public:
static autoPtr<curvedEdge> New
declareRunTimeSelectionTable
(
autoPtr,
curvedEdge,
Istream,
(
const pointField& points,
Istream& is
)
{
return autoPtr<curvedEdge>(new curvedEdgeType(points, is));
}
addIstreamConstructorToTable()
{
curvedEdge::constructTables();
curvedEdge::IstreamConstructorTablePtr_
->insert(curvedEdgeType::typeName, New);
}
};
//- Runtime type information
TypeName("curvedEdge");
),
(points, is)
);
// Constructors

View File

@ -26,6 +26,7 @@ License
#include "polySplineEdge.H"
#include "BSpline.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -34,8 +35,7 @@ namespace Foam
defineTypeNameAndDebug(polySplineEdge, 0);
// Add the curvedEdge constructor functions to the hash tables
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
addPolySplineEdgeIstreamConstructorToTable_;
addToRunTimeSelectionTable(curvedEdge, polySplineEdge, Istream);
}

View File

@ -92,7 +92,7 @@ public:
);
//- Construct from Istream setting pointsList
polySplineEdge(const pointField& points,Istream& is);
polySplineEdge(const pointField& points, Istream& is);
// Destructor

View File

@ -27,9 +27,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "simpleSplineEdge.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -39,10 +38,8 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(simpleSplineEdge, 0);
addToRunTimeSelectionTable(curvedEdge, simpleSplineEdge, Istream);
// Add the curvedEdge constructor functions to the hash tables
curvedEdge::addIstreamConstructorToTable<simpleSplineEdge>
addSimpleSplineEdgeIstreamConstructorToTable_;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -52,19 +52,18 @@ using namespace Foam;
int main(int argc, char *argv[])
{
# include "setRoots.H"
# include "createTimeExtruded.H"
#include "setRoots.H"
#include "createTimeExtruded.H"
if (args.options().found("sourceRoot") == args.options().found("surface"))
if (args.options().found("sourceCase") == args.options().found("surface"))
{
FatalErrorIn(args.executable())
<< "Need to specify either -sourceRoot/Case/Patch or -surface"
<< " option to specify the source of the patch to extrude"
<< "Specify either -sourceCase and -sourcePatch"
" or -surface options\n"
" to specify the source of the patch to extrude"
<< exit(FatalError);
}
autoPtr<extrudedMesh> meshPtr(NULL);
autoPtr<extrudeModel> model
@ -84,23 +83,24 @@ int main(int argc, char *argv[])
)
);
if (args.options().found("sourceRoot"))
if (args.options().found("sourceCase"))
{
fileName rootDirSource(args.options()["sourceRoot"]);
fileName caseDirSource(args.options()["sourceCase"]);
fileName patchName(args.options()["sourcePatch"]);
fileName sourceCasePath(args.options()["sourceCase"]);
fileName sourceRootDir = sourceCasePath.path();
fileName sourceCaseDir = sourceCasePath.name();
word patchName(args.options()["sourcePatch"]);
Info<< "Extruding patch " << patchName
<< " on mesh " << rootDirSource << ' ' << caseDirSource << nl
<< " on mesh " << sourceCasePath << nl
<< endl;
Time runTime
(
Time::controlDictName,
rootDirSource,
caseDirSource
sourceRootDir,
sourceCaseDir
);
# include "createPolyMesh.H"
#include "createPolyMesh.H"
label patchID = mesh.boundaryMesh().findPatchID(patchName);
@ -171,7 +171,7 @@ int main(int argc, char *argv[])
fMesh,
model()
)
);
);
}
extrudedMesh& mesh = meshPtr();
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
const vector span = bb.span();
const scalar mergeDim = 1E-4 * bb.minDim();
Pout<< "Mesh bounding box:" << bb << nl
Info<< "Mesh bounding box:" << bb << nl
<< " with span:" << span << nl
<< "Merge distance :" << mergeDim << nl
<< endl;
@ -201,7 +201,7 @@ int main(int argc, char *argv[])
// ~~~~~~~~~~~~~~
{
Pout<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
Info<< "Collapsing edges < " << mergeDim << " ..." << nl << endl;
// Edge collapsing engine
edgeCollapser collapser(mesh);
@ -217,7 +217,7 @@ int main(int argc, char *argv[])
if (d < mergeDim)
{
Pout<< "Merging edge " << e << " since length " << d
Info<< "Merging edge " << e << " since length " << d
<< " << " << mergeDim << nl;
// Collapse edge to e[0]
@ -252,8 +252,8 @@ int main(int argc, char *argv[])
if (args.options().found("mergeFaces"))
{
Pout<< "Assuming full 360 degree axisymmetric case;"
<< " stitching faces on patches "
Info<< "Assuming full 360 degree axisymmetric case;"
<< " stitching faces on patches "
<< patches[origPatchID].name() << " and "
<< patches[otherPatchID].name() << " together ..." << nl << endl;

View File

@ -48,7 +48,7 @@ wedge::wedge(const dictionary& dict)
:
extrudeModel(typeName, dict),
axisPt_(coeffDict_.lookup("axisPt")),
axisNormal_(coeffDict_.lookup("axisNormal")),
axis_(coeffDict_.lookup("axis")),
angle_
(
readScalar(coeffDict_.lookup("angle"))
@ -96,7 +96,7 @@ point wedge::operator()
// of surface point and surface normal.
point d = surfacePoint - axisPt_;
d -= (axisNormal_ & d)*axisNormal_;
d -= (axis_ & d)*axis_;
scalar dMag = mag(d);
@ -107,7 +107,7 @@ point wedge::operator()
if (dMag > VSMALL)
{
vector n = (d/dMag) ^ axisNormal_;
vector n = (d/dMag) ^ axis_;
rotatedPoint +=
+ cos(sliceAngle)*d
@ -124,4 +124,3 @@ point wedge::operator()
} // End namespace Foam
// ************************************************************************* //

View File

@ -60,13 +60,13 @@ class wedge
{
// Private data
//- point on axis
//- Point on axis
const point axisPt_;
//- normalized direction of axis
const vector axisNormal_;
//- Normalized direction of axis
const vector axis_;
//- overall angle (radians)
//- Overall angle (radians)
const scalar angle_;
@ -80,6 +80,7 @@ public:
//- Construct from components
wedge(const dictionary& dict);
//- Destrcuctor
~wedge();

View File

@ -24,7 +24,7 @@ nLayers 1;
wedgeCoeffs
{
axisPt (0 0 0);
axisNormal (0 -1 0);
axis (0 -1 0);
angle 2.0;
}
@ -47,4 +47,3 @@ sigmaRadialCoeffs
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,7 +1,6 @@
argList::validArgs.clear();
argList::noParallel();
argList::validOptions.insert("sourceRoot", "source root");
argList::validOptions.insert("sourceCase", "source case");
argList::validOptions.insert("sourcePatch", "source patch");
@ -15,4 +14,3 @@
{
FatalError.exit();
}

View File

@ -1,6 +1,6 @@
EXE_INC = \
/* -g -DFULLDEBUG -O0 */ \
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
-I$(LIB_SRC)/autoMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
@ -9,7 +9,6 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod \
-lfiniteVolume \
-ldecompositionMethods \
-lmeshTools \

View File

@ -31,7 +31,9 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "polyMesh.H"
#include "globalMeshData.H"
@ -45,48 +47,34 @@ using namespace Foam;
int main(int argc, char *argv[])
{
timeSelector::addOptions(false); // no constant
# include "addRegionOption.H"
# include "addTimeOptionsNoConstant.H"
argList::validOptions.insert("noTopology", "");
argList::validOptions.insert("allGeometry", "");
argList::validOptions.insert("allTopology", "");
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createNamedPolyMesh.H"
const bool noTopology = args.options().found("noTopology");
const bool noTopology = args.options().found("noTopology");
const bool allGeometry = args.options().found("allGeometry");
const bool allTopology = args.options().found("allTopology");
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptionsNoConstant.H"
runTime.setTime(Times[startTime], startTime);
# include "createNamedPolyMesh.H"
bool firstCheck = true;
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
polyMesh::readUpdateState state = mesh.readUpdate();
if
(
firstCheck
!timeI
|| state == polyMesh::TOPO_CHANGE
|| state == polyMesh::TOPO_PATCH_CHANGE
)
{
firstCheck = false;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Clear mesh before checking
@ -110,32 +98,30 @@ int main(int argc, char *argv[])
if (noFailedChecks == 0)
{
Info<< "\nMesh OK."
<< nl << endl;
Info<< "\nMesh OK.\n" << endl;
}
else
{
Info<< "\nFailed " << noFailedChecks << " mesh checks."
<< nl << endl;
Info<< "\nFailed " << noFailedChecks << " mesh checks.\n"
<< endl;
}
}
else if (state == polyMesh::POINTS_MOVED)
{
Info<< "Time = " << runTime.timeName() << nl << endl;
label noFailedChecks = checkGeometry(mesh, allGeometry);
label nFailedChecks = checkGeometry(mesh, allGeometry);
reduce(noFailedChecks, sumOp<label>());
reduce(nFailedChecks, sumOp<label>());
if (noFailedChecks == 0)
if (nFailedChecks)
{
Info << "\nMesh OK."
<< nl << endl;
Info<< "\nFailed " << nFailedChecks << " mesh checks.\n"
<< endl;
}
else
{
Info<< "\nFailed " << noFailedChecks << " mesh checks."
<< nl << endl;
Info << "\nMesh OK.\n" << endl;
}
}
}

View File

@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude
EXE_LIBS = \
-lmeshTools \

View File

@ -31,6 +31,7 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "fvMesh.H"
#include "volFields.H"
@ -66,7 +67,8 @@ void RotateFields
int main(int argc, char *argv[])
{
# include "addTimeOptions.H"
timeSelector::addOptions();
argList::validArgs.append("n1");
argList::validArgs.append("n2");
@ -105,19 +107,15 @@ int main(int argc, char *argv[])
points.write();
}
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -48,8 +48,8 @@ Description
#if READLINE != 0
#include <readline/readline.h>
#include <readline/history.h>
# include <readline/readline.h>
# include <readline/history.h>
#endif
using namespace Foam;

View File

@ -48,6 +48,7 @@ Description
#include "OFstream.H"
#include "IFstream.H"
#include "IOobjectList.H"
#include "SortableList.H"
using namespace Foam;
@ -107,6 +108,7 @@ int main(int argc, char *argv[])
{
// Not in memory. Load it.
pointSet set(*iter());
SortableList<label> pointLabels(set.toc());
label zoneID = mesh.pointZones().findZoneID(set.name());
if (zoneID == -1)
@ -120,7 +122,7 @@ int main(int argc, char *argv[])
new pointZone
(
set.name(), //name
set.toc(), //addressing
pointLabels, //addressing
sz, //index
mesh.pointZones() //pointZoneMesh
)
@ -131,7 +133,7 @@ int main(int argc, char *argv[])
{
Info<< "Overwriting contents of existing pointZone " << zoneID
<< " with that of set " << set.name() << "." << endl;
mesh.pointZones()[zoneID] = set.toc();
mesh.pointZones()[zoneID] = pointLabels;
mesh.pointZones().writeOpt() = IOobject::AUTO_WRITE;
}
}
@ -150,6 +152,7 @@ int main(int argc, char *argv[])
{
// Not in memory. Load it.
cellSet set(*iter());
SortableList<label> cellLabels(set.toc());
label zoneID = mesh.cellZones().findZoneID(set.name());
if (zoneID == -1)
@ -163,7 +166,7 @@ int main(int argc, char *argv[])
new cellZone
(
set.name(), //name
set.toc(), //addressing
cellLabels, //addressing
sz, //index
mesh.cellZones() //pointZoneMesh
)
@ -174,7 +177,7 @@ int main(int argc, char *argv[])
{
Info<< "Overwriting contents of existing cellZone " << zoneID
<< " with that of set " << set.name() << "." << endl;
mesh.cellZones()[zoneID] = set.toc();
mesh.cellZones()[zoneID] = cellLabels;
mesh.cellZones().writeOpt() = IOobject::AUTO_WRITE;
}
}
@ -193,6 +196,7 @@ int main(int argc, char *argv[])
{
// Not in memory. Load it.
faceSet set(*iter());
SortableList<label> faceLabels(set.toc());
DynamicList<label> addressing(set.size());
DynamicList<bool> flipMap(set.size());
@ -214,9 +218,9 @@ int main(int argc, char *argv[])
// Load corresponding cells
cellSet cells(mesh, setName);
forAllConstIter(faceSet, set, iter)
forAll(faceLabels, i)
{
label faceI = iter.key();
label faceI = faceLabels[i];
bool flip = false;
@ -273,9 +277,10 @@ int main(int argc, char *argv[])
else
{
// No flip map.
forAllConstIter(faceSet, set, iter)
forAll(faceLabels, i)
{
addressing.append(iter.key());
label faceI = faceLabels[i];
addressing.append(faceI);
flipMap.append(false);
}
}

View File

@ -29,6 +29,9 @@ Description
#include "argList.H"
#include "dictionary.H"
#include "IFstream.H"
#include "IOobject.H"
#include "HashSet.H"
using namespace Foam;
@ -38,18 +41,108 @@ using namespace Foam;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("new", "");
argList::validOptions.insert("old", "");
wordList ds(debug::debugSwitches().toc());
sort(ds);
Info<< "debug switches: " << ds << endl;
Foam::argList args(argc, argv);
wordList currDebug(debug::debugSwitches().toc());
wordList currInfo(debug::infoSwitches().toc());
wordList currOpt(debug::optimisationSwitches().toc());
if (args.options().found("old") || args.options().found("new"))
{
dictionary controlDict(IFstream(findEtcFile("controlDict", true))());
wordHashSet oldDebug
(
controlDict.subDict("DebugSwitches").toc()
);
wordHashSet oldInfo
(
controlDict.subDict("InfoSwitches").toc()
);
wordHashSet oldOpt
(
controlDict.subDict("OptimisationSwitches").toc()
);
wordHashSet hashset;
wordList listing;
// list old switches - but this can't work since the (old) inserted
// switches are in both sets
// Workaround:
// 1. run without any options (get complete list)
// 2. comment out DebugSwitches, run again with -new to find new ones
// and do a diff
if (args.options().found("old"))
{
IOobject::writeDivider(Info);
hashset = oldDebug;
hashset -= currDebug;
listing = hashset.toc();
sort(listing);
Info<< "old DebugSwitches: " << listing << endl;
hashset = oldInfo;
hashset -= currInfo;
listing = hashset.toc();
sort(listing);
Info<< "old InfoSwitches: " << listing << endl;
hashset = oldOpt;
hashset -= currOpt;
listing = hashset.toc();
sort(listing);
Info<< "old OptimisationSwitches: " << listing << endl;
}
// list new switches
if (args.options().found("new"))
{
IOobject::writeDivider(Info);
hashset = currDebug;
hashset -= oldDebug;
listing = hashset.toc();
sort(listing);
Info<< "new DebugSwitches: " << listing << endl;
hashset = currInfo;
hashset -= oldInfo;
listing = hashset.toc();
sort(listing);
Info<< "new InfoSwitches: " << listing << endl;
hashset = currOpt;
hashset -= oldOpt;
listing = hashset.toc();
sort(listing);
Info<< "new OptimisationSwitches: " << listing << endl;
}
}
else
{
IOobject::writeDivider(Info);
sort(currDebug);
Info<< "DebugSwitches: " << currDebug << endl;
sort(currInfo);
Info<< "InfoSwitches: " << currInfo << endl;
sort(currOpt);
Info<< "OptimisationSwitches: " << currOpt << endl;
}
wordList is(debug::infoSwitches().toc());
sort(is);
Info<< "info switches: " << is << endl;
wordList os(debug::optimisationSwitches().toc());
sort(os);
Info<< "optimisation switches: " << os << endl;
Info<< "done" << endl;

View File

@ -40,25 +40,19 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "addRegionOption.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createNamedMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << nl << endl;

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude

View File

@ -312,7 +312,7 @@ int main(int argc, char *argv[])
fileNameList cloudDirs
(
readDir(runTime.timePath()/"lagrangian", fileName::DIRECTORY)
readDir(runTime.timePath()/cloud::prefix, fileName::DIRECTORY)
);
// Particles
@ -344,7 +344,7 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudDirs[i]
cloud::prefix/cloudDirs[i]
);
IOobject* positionsPtr = sprayObjs.lookup("positions");
@ -418,7 +418,7 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudDirs[cloudI]
cloud::prefix/cloudDirs[cloudI]
);
lagrangianFieldDecomposer::readFields

View File

@ -88,7 +88,7 @@ tmp<IOField<Type> > lagrangianFieldDecomposer::decomposeField
(
field.name(),
procMesh_.time().timeName(),
"lagrangian"/cloudName,
cloud::prefix/cloudName,
procMesh_,
IOobject::NO_READ,
IOobject::NO_WRITE

View File

@ -36,6 +36,7 @@ SourceFiles
#ifndef reconstructLagrangian_H
#define reconstructLagrangian_H
#include "cloud.H"
#include "polyMesh.H"
#include "IOobjectList.H"
#include "fvMesh.H"

View File

@ -47,7 +47,7 @@ Foam::tmp<Foam::IOField<Type> > Foam::reconstructLagrangianField
(
fieldName,
mesh.time().timeName(),
"lagrangian"/cloudName,
cloud::prefix/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::prefix/cloudName,
meshes[i],
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -51,6 +51,7 @@ int main(int argc, char *argv[])
argList::noParallel();
# include "addRegionOption.H"
argList::validOptions.insert("fields", "\"(list of fields)\"");
argList::validOptions.insert("noLagrangian", "");
# include "setRootCase.H"
# include "createTime.H"
@ -61,6 +62,8 @@ int main(int argc, char *argv[])
IStringStream(args.options()["fields"])() >> selectedFields;
}
bool noLagrangian = args.options().found("noLagrangian");
// determine the processor count directly
label nProcs = 0;
while (isDir(args.path()/(word("processor") + name(nProcs))))
@ -269,118 +272,121 @@ int main(int argc, char *argv[])
// the first processor that has them. They are in pass2 only used
// for name and type (scalar, vector etc).
HashTable<IOobjectList> cloudObjects;
forAll (databases, procI)
if (!noLagrangian)
{
fileNameList cloudDirs
(
readDir
(
databases[procI].timePath()/regionPrefix/"lagrangian",
fileName::DIRECTORY
)
);
HashTable<IOobjectList> cloudObjects;
forAll (cloudDirs, i)
forAll (databases, procI)
{
// Check if we already have cloud objects for this cloudname.
HashTable<IOobjectList>::const_iterator iter =
cloudObjects.find(cloudDirs[i]);
if (iter == cloudObjects.end())
{
// Do local scan for valid cloud objects.
IOobjectList sprayObjs
fileNameList cloudDirs
(
readDir
(
procMeshes.meshes()[procI],
databases[procI].timeName(),
"lagrangian"/cloudDirs[i]
);
databases[procI].timePath()/regionPrefix/cloud::prefix,
fileName::DIRECTORY
)
);
IOobject* positionsPtr = sprayObjs.lookup("positions");
forAll (cloudDirs, i)
{
// Check if we already have cloud objects for this cloudname
HashTable<IOobjectList>::const_iterator iter =
cloudObjects.find(cloudDirs[i]);
if (positionsPtr)
if (iter == cloudObjects.end())
{
cloudObjects.insert(cloudDirs[i], sprayObjs);
// Do local scan for valid cloud objects
IOobjectList sprayObjs
(
procMeshes.meshes()[procI],
databases[procI].timeName(),
cloud::prefix/cloudDirs[i]
);
IOobject* positionsPtr = sprayObjs.lookup("positions");
if (positionsPtr)
{
cloudObjects.insert(cloudDirs[i], sprayObjs);
}
}
}
}
}
if (cloudObjects.size())
{
// Pass2: reconstruct the cloud
forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)
if (cloudObjects.size())
{
const word cloudName = string::validate<word>(iter.key());
// Pass2: reconstruct the cloud
forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)
{
const word cloudName = string::validate<word>(iter.key());
// Objects (on arbitrary processor)
const IOobjectList& sprayObjs = iter();
// Objects (on arbitrary processor)
const IOobjectList& sprayObjs = iter();
Info<< "Reconstructing lagrangian fields for cloud "
<< cloudName << nl << endl;
Info<< "Reconstructing lagrangian fields for cloud "
<< cloudName << nl << endl;
reconstructLagrangianPositions
(
mesh,
cloudName,
procMeshes.meshes(),
procMeshes.faceProcAddressing(),
procMeshes.cellProcAddressing()
);
reconstructLagrangianFields<label>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<scalar>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<vector>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<sphericalTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<symmTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<tensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianPositions
(
mesh,
cloudName,
procMeshes.meshes(),
procMeshes.faceProcAddressing(),
procMeshes.cellProcAddressing()
);
reconstructLagrangianFields<label>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<scalar>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<vector>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<sphericalTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<symmTensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
reconstructLagrangianFields<tensor>
(
cloudName,
mesh,
procMeshes.meshes(),
sprayObjs
);
}
}
else
{
Info << "No lagrangian fields" << nl << endl;
}
}
else
{
Info << "No lagrangian fields" << nl << endl;
}
// If there are any "uniform" directories copy them from
// the master processor.
// the master processor
fileName uniformDir0 = databases[0].timePath()/"uniform";
if (isDir(uniformDir0))

View File

@ -1,5 +1,5 @@
EXE_INC = \
-I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \
-I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude

View File

@ -38,26 +38,22 @@ Description
int main(int argc, char *argv[])
{
argList::noParallel();
# include "addTimeOptions.H"
timeSelector::addOptions(false); // no constant
# include "setRootCase.H"
# include "createTime.H"
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptionsNoConstant.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
// make a directory called proInterface in the case
mkDir(runTime.rootPath()/runTime.caseName()/"fluentInterface");
for (label timeI = startTime; timeI < endTime; timeI++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[timeI], timeI);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
if (mesh.readUpdate())

View File

@ -35,6 +35,7 @@ SourceFiles
#ifndef ensightCloudField_H
#define ensightCloudField_H
#include "Cloud.H"
#include "IOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -211,7 +211,7 @@ int main(int argc, char *argv[])
fileNameList cloudDirs = readDir
(
runTime.timePath()/regionPrefix/"lagrangian",
runTime.timePath()/regionPrefix/cloud::prefix,
fileName::DIRECTORY
);
@ -221,7 +221,7 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudDirs[cloudI]
cloud::prefix/cloudDirs[cloudI]
);
IOobject* positionsPtr = cloudObjs.lookup("positions");
@ -266,7 +266,7 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudIter.key()
cloud::prefix/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::prefix,
fileName::DIRECTORY
);
@ -449,7 +449,7 @@ int main(int argc, char *argv[])
(
fieldName,
mesh.time().timeName(),
"lagrangian"/cloudName,
cloud::prefix/cloudName,
mesh,
IOobject::MUST_READ
);

View File

@ -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::prefix/cloudName/"positions").c_str()
<< nl;
}
caseFile
@ -122,7 +122,7 @@ forAllConstIter(HashTable<HashTable<word> >, cloudFields, cloudIter)
ensightType,
fieldName,
dataMask,
"lagrangian"/cloudName,
cloud::prefix/cloudName,
cloudNo,
2
);

View File

@ -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::prefix/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::prefix/cloudName;
fileName postFileName = cloudDir/fieldObject.name();
string title =

View File

@ -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"

View File

@ -36,7 +36,7 @@ if (timeDirs.size() > 1)
runTime.path()
/ timeDirs[timeDirs.size() - 1].name()
/ regionPrefix
/ "lagrangian",
/ cloud::prefix,
fileName::DIRECTORY
);
@ -55,7 +55,7 @@ if (timeDirs.size() > 1)
(
mesh,
timeDirs[timeDirs.size() - 1].name(),
"lagrangian"/cloudName
cloud::prefix/cloudName
);
bool hasPositions = false;

View File

@ -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::prefix/cloudName
)
)
{
continue;
}
@ -333,7 +340,7 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudName
cloud::prefix/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::prefix/cloudName
/ fieldName
<< endl;
continue;
}

View File

@ -21,7 +21,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
(
sprayScalarNames[fieldI],
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
@ -53,7 +53,7 @@ List<IOField<vector>* > sprayVectorFieldPtrs
(
sprayVectorNames[fieldI],
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -42,7 +42,7 @@ forAll(Times, timeI)
// Same for spray
IOobjectList sprayObjects(mesh, runTime.timeName(), "lagrangian");
IOobjectList sprayObjects(mesh, runTime.timeName(), cloud::prefix);
{
wordList fieldNames(sprayObjects.names(scalarIOField::typeName));
forAll(fieldNames, fieldI)

View File

@ -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::prefix
};
# 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"

View File

@ -1,14 +1,14 @@
for(label i=0; i < nTypes; i++)
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++)
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,43 +30,43 @@ for(label i=0; i < nTypes; i++)
}
gmvFile << nl;
}
if ( fieldTypes[i] == "volVectorField" )
if (fieldTypes[i] == "volVectorField")
{
if (fieldName == vComp)
{
volVectorField gmvVectorField(fieldObject, mesh);
gmvFile << "velocity 0" << nl;
for(label indx=0;indx<mesh.nCells();indx++)
for (label indx=0;indx<mesh.nCells();indx++)
{
gmvFile << gmvVectorField[indx].x() << " ";
}
for(label indx=0;indx<mesh.nCells();indx++)
for (label indx=0;indx<mesh.nCells();indx++)
{
gmvFile << gmvVectorField[indx].y() << " ";
}
for(label indx=0;indx<mesh.nCells();indx++)
for (label indx=0;indx<mesh.nCells();indx++)
{
gmvFile << gmvVectorField[indx].z() << " ";
}
gmvFile << nl;
}
}
if ( fieldTypes[i] == "surfaceScalarField" )
if (fieldTypes[i] == "surfaceScalarField")
{
// ...
}
}
if ( fieldTypes[i] == "lagrangian")
if (fieldTypes[i] == cloud::prefix)
{
IOobject lagrangianHeader
(
"positions",
runTime.timeName(),
"lagrangian",
cloud::prefix,
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::prefix);
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;
}

View File

@ -42,7 +42,7 @@ forAll(lagrangianScalarNames, i)
(
name,
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
@ -73,7 +73,7 @@ forAll(lagrangianVectorNames, i)
(
name,
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -40,7 +40,7 @@ forAll(lagrangianScalarNames, i)
(
name,
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -225,8 +225,10 @@ labelList getSelectedPatches
int main(int argc, char *argv[])
{
# include "addTimeOptions.H"
timeSelector::addOptions();
# include "addRegionOption.H"
argList::validOptions.insert("fields", "fields");
argList::validOptions.insert("cellSet", "cellSet name");
argList::validOptions.insert("faceSet", "faceSet name");
@ -244,7 +246,6 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
bool doWriteInternal = !args.options().found("noInternal");
bool doFaceZones = !args.options().found("noFaceZones");
bool doLinks = !args.options().found("noLinks");
@ -312,14 +313,8 @@ int main(int argc, char *argv[])
}
instantList Times = runTime.times();
instantList timeDirs = timeSelector::select0(runTime, args);
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
// Current mesh.
# include "createNamedMesh.H"
// VTK/ directory in the case
@ -359,11 +354,11 @@ int main(int argc, char *argv[])
// mesh wrapper; does subsetting and decomposition
vtkMesh vMesh(mesh, cellSetName);
for (label timeI = startTime; timeI < endTime; timeI++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[timeI], timeI);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time " << Times[timeI].name() << endl;
Info<< "Time: " << runTime.timeName() << endl;
// Check for new polyMesh/ and update mesh, fvMeshSubset and cell
// decomposition.
@ -914,7 +909,7 @@ int main(int argc, char *argv[])
(
readDir
(
runTime.timePath()/regionPrefix/"lagrangian",
runTime.timePath()/regionPrefix/cloud::prefix,
fileName::DIRECTORY
)
);
@ -925,18 +920,18 @@ int main(int argc, char *argv[])
(
mesh,
runTime.timeName(),
"lagrangian"/cloudDirs[i]
cloud::prefix/cloudDirs[i]
);
IOobject* positionsPtr = sprayObjs.lookup("positions");
if (positionsPtr)
{
mkDir(fvPath/"lagrangian"/cloudDirs[i]);
mkDir(fvPath/cloud::prefix/cloudDirs[i]);
fileName lagrFileName
(
fvPath/"lagrangian"/cloudDirs[i]/cloudDirs[i]
fvPath/cloud::prefix/cloudDirs[i]/cloudDirs[i]
+ "_" + name(timeI) + ".vtk"
);

View File

@ -39,6 +39,7 @@ SourceFiles
#include "globalPointPatch.H"
#include "OFstream.H"
#include "Cloud.H"
#include "volFields.H"
#include "pointFields.H"
#include "vtkMesh.H"

View File

@ -41,7 +41,7 @@ void Foam::lagrangianWriter::writeIOField(const wordList& objects)
(
object,
vMesh_.mesh().time().timeName(),
"lagrangian"/cloudName_,
cloud::prefix/cloudName_,
vMesh_.mesh(),
IOobject::MUST_READ,
IOobject::NO_WRITE,

View File

@ -50,14 +50,15 @@ vtkPV3FoamReader::vtkPV3FoamReader()
output0_ = NULL;
#ifdef VTKPV3FOAM_DUALPORT
// Add second output for the Lagrangian
this->SetNumberOfOutputPorts(2);
vtkMultiBlockDataSet *lagrangian;
lagrangian = vtkMultiBlockDataSet::New();
vtkMultiBlockDataSet *lagrangian = vtkMultiBlockDataSet::New();
lagrangian->ReleaseData();
this->GetExecutive()->SetOutputData(1, lagrangian);
lagrangian->Delete();
#endif
TimeStepRange[0] = 0;
TimeStepRange[1] = 0;
@ -204,9 +205,9 @@ int vtkPV3FoamReader::RequestInformation
);
}
double timeRange[2];
if (nTimeSteps)
{
double timeRange[2];
timeRange[0] = timeSteps[0];
timeRange[1] = timeSteps[nTimeSteps-1];
@ -273,46 +274,53 @@ int vtkPV3FoamReader::RequestData
}
}
// take port0 as the lead for other outputs
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// Get the requested time step.
// We only support requests for a single time step
int nRequestTime = 0;
double requestTime[nInfo];
// taking port0 as the lead for other outputs would be nice, but fails when
// a filter is added - we need to check everything
// but since PREVIOUS_UPDATE_TIME_STEPS() is protected, relay the logic
// to the vtkPV3Foam::setTime() method
for (int infoI = 0; infoI < nInfo; ++infoI)
{
vtkInformation *outInfo = outputVector->GetInformationObject(infoI);
if
(
outInfo->Has
(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
)
&& outInfo->Length
(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
) >= 1
)
{
requestTime[nRequestTime++] = outInfo->Get
(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
)[0];
}
}
if (nRequestTime)
{
foamData_->setTime(nRequestTime, requestTime);
}
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
(
outInfo->Get
outputVector->GetInformationObject(0)->Get
(
vtkMultiBlockDataSet::DATA_OBJECT()
)
);
vtkMultiBlockDataSet* lagrangianOutput = vtkMultiBlockDataSet::SafeDownCast
(
outputVector->GetInformationObject(1)->Get
(
vtkMultiBlockDataSet::DATA_OBJECT()
)
);
if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()))
{
// Get the requested time step.
// We only support requests for a single time step
int nRequestedTimeSteps = outInfo->Length
(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
);
if (nRequestedTimeSteps >= 1)
{
double *requestedTimeSteps = outInfo->Get
(
vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()
);
foamData_->setTime(requestedTimeSteps[0]);
}
}
if (Foam::vtkPV3Foam::debug)
{
cout<< "update output with "
@ -361,7 +369,21 @@ int vtkPV3FoamReader::RequestData
#else
foamData_->Update(output, lagrangianOutput);
#ifdef VTKPV3FOAM_DUALPORT
foamData_->Update
(
output,
vtkMultiBlockDataSet::SafeDownCast
(
outputVector->GetInformationObject(1)->Get
(
vtkMultiBlockDataSet::DATA_OBJECT()
)
);
);
#else
foamData_->Update(output, output);
#endif
if (ShowPatchNames)
{

View File

@ -90,12 +90,21 @@ void Foam::vtkPV3Foam::reduceMemory()
int Foam::vtkPV3Foam::setTime(const double& requestedTime)
int Foam::vtkPV3Foam::setTime(int nRequest, const double requestTimes[])
{
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::setTime(" << requestedTime << ")"
<< endl;
Info<< "<beg> Foam::vtkPV3Foam::setTime(";
for (int requestI = 0; requestI < nRequest; ++requestI)
{
if (requestI)
{
Info<< ", ";
}
Info<< requestTimes[requestI];
}
Info << ") - previousIndex = " << timeIndex_ << endl;
}
Time& runTime = dbPtr_();
@ -103,12 +112,26 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
// Get times list
instantList Times = runTime.times();
int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
int nearestIndex = timeIndex_;
for (int requestI = 0; requestI < nRequest; ++requestI)
{
int index = Time::findClosestTimeIndex(Times, requestTimes[requestI]);
if (index >= 0 && index != timeIndex_)
{
nearestIndex = index;
break;
}
}
if (nearestIndex < 0)
{
nearestIndex = 0;
}
// see what has changed
if (timeIndex_ != nearestIndex)
{
@ -138,10 +161,11 @@ int Foam::vtkPV3Foam::setTime(const double& requestedTime)
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time "
<< Times[nearestIndex].name() << " index=" << nearestIndex
<< " meshChanged=" << meshChanged_
<< " fieldsChanged=" << fieldsChanged_ << endl;
Info<< "<end> Foam::vtkPV3Foam::setTime() - selectedTime="
<< Times[nearestIndex].name() << " index=" << timeIndex_
<< "/" << Times.size()
<< " meshChanged=" << Switch(meshChanged_)
<< " fieldsChanged=" << Switch(fieldsChanged_) << endl;
}
return nearestIndex;
@ -441,7 +465,6 @@ void Foam::vtkPV3Foam::Update
cout<< "<beg> Foam::vtkPV3Foam::Update - output with "
<< output->GetNumberOfBlocks() << " and "
<< lagrangianOutput->GetNumberOfBlocks() << " blocks\n";
output->Print(cout);
lagrangianOutput->Print(cout);
printMemory();
@ -480,8 +503,10 @@ void Foam::vtkPV3Foam::Update
reader_->UpdateProgress(0.7);
}
#ifdef VTKPV3FOAM_DUALPORT
// restart port1 at block=0
blockNo = 0;
#endif
convertMeshLagrangian(lagrangianOutput, blockNo);
reader_->UpdateProgress(0.8);

View File

@ -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 "stringList.H"
@ -66,6 +71,8 @@ SourceFiles
#include "PrimitivePatchInterpolation.H"
#include "volPointInterpolation.H"
#undef VTKPV3FOAM_DUALPORT
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
class vtkDataArraySelection;
@ -128,6 +135,7 @@ class vtkPV3Foam
return block_;
}
//- Assign block number, return previous value
int block(int blockNo)
{
int prev = block_;
@ -713,9 +721,11 @@ public:
//- Remove patch names from the display
void removePatchNames(vtkRenderer* renderer);
//- set the runTime to the requested time, returns the timeIndex
// sets to "constant" on error and returns -1
int setTime(const double& requestedTime);
//- set the runTime to the first plausible request time,
// returns the timeIndex
// sets to "constant" on error
int setTime(int count, const double requestTimes[]);
//- The current time index
int timeIndex() const

View File

@ -266,7 +266,7 @@ void Foam::vtkPV3Foam::convertLagrangianFields
(
mesh,
dbPtr_().timeName(),
"lagrangian"/cloudName
cloud::prefix/cloudName
);
pruneObjectList(objects, selectedFields);

View File

@ -30,6 +30,8 @@ InClass
#ifndef vtkPV3FoamLagrangianFields_H
#define vtkPV3FoamLagrangianFields_H
#include "Cloud.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>

View File

@ -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::prefix/cloudName << endl;
printMemory();
}
@ -63,7 +63,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
(
mesh,
mesh.time().timeName(),
"lagrangian"/cloudName
cloud::prefix/cloudName
);
IOobject* positionsPtr = sprayObjs.lookup("positions");

View File

@ -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::prefix << 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::prefix);
if (meshRegion_ != polyMesh::defaultRegion)
{
lagrangianPrefix = meshRegion_/"lagrangian";
lagrangianPrefix = meshRegion_/cloud::prefix;
}
// 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::prefix);
if (meshRegion_ != polyMesh::defaultRegion)
{
lagrangianPrefix = meshRegion_/"lagrangian";
lagrangianPrefix = meshRegion_/cloud::prefix;
}
IOobjectList objects

View File

@ -40,7 +40,10 @@ void Foam::vtkPV3Foam::updateInfoFields
{
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields" << endl;
Info<< "<beg> Foam::vtkPV3Foam::updateInfoFields <"
<< meshType::Mesh::typeName
<< "> [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]"
<< endl;
}
stringList enabledEntries;

View File

@ -326,10 +326,10 @@ void Foam::vtkPV3Foam::convertVolField
const labelList& superCells = decompInfo.superCells();
vtkFloatArray* celldata = vtkFloatArray::New();
celldata->SetNumberOfTuples( superCells.size() );
celldata->SetNumberOfComponents( nComp );
celldata->Allocate( nComp*superCells.size() );
celldata->SetName( tf.name().c_str() );
celldata->SetNumberOfTuples(superCells.size());
celldata->SetNumberOfComponents(nComp);
celldata->Allocate(nComp*superCells.size());
celldata->SetName(tf.name().c_str());
if (debug)
{

View File

@ -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::prefix.c_str(),
Z_BUFL
);
number_of_elements[nPatches+1][Z_POINT] = sprayPtr->size();
number_of_nodes[nPatches+1] = sprayPtr->size();
}

View File

@ -164,7 +164,7 @@ int USERD_set_filenames
(
"positions",
runTime.timeName(),
"lagrangian",
cloud::prefix,
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::prefix);
lagrangianScalarNames =
(const wordList&)objects.names(sprayScalarFieldName);

View File

@ -12,7 +12,7 @@ if (nVar >= 0)
(
name,
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -14,7 +14,7 @@ if (nVar >= 0)
(
name,
runTime.timeName(),
"lagrangian",
cloud::prefix,
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE

View File

@ -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";

View File

@ -40,57 +40,50 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createEngineTime.H"
#include "createEngineMesh.H"
# include "setRootCase.H"
# include "createEngineTime.H"
# include "createEngineMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scalar eps = 1.0e-10;
scalar fullCycle = 360.0;
scalar ca0 = -180.0;
scalar ca1 = 0.0;
scalar ca = runTime.theta();
while (ca > ca0)
while (runTime.theta() > ca0)
{
ca0 += fullCycle;
ca1 += fullCycle;
}
if (mag(ca - ca0) > eps)
while (mag(runTime.theta() - ca0) > eps)
{
while(mag(ca - ca0) > eps)
{
ca = runTime.theta();
scalar t0 = runTime.userTimeToTime(ca0 - ca);
runTime.setDeltaT(t0);
runTime++;
Info << "CA = " << ca << endl;
mesh.move();
}
scalar t0 = runTime.userTimeToTime(ca0 - runTime.theta());
runTime.setDeltaT(t0);
runTime++;
Info<< "CA = " << runTime.theta() << endl;
mesh.move();
}
scalar Vmax = sum(mesh.V().field());
while(mag(ca-ca1) > eps)
while (mag(runTime.theta()-ca1) > eps)
{
ca = runTime.theta();
scalar t1 = runTime.userTimeToTime(ca1-ca);
scalar t1 = runTime.userTimeToTime(ca1-runTime.theta());
runTime.setDeltaT(t1);
runTime++;
Info << "CA = " << runTime.theta() << endl;
Info<< "CA = " << runTime.theta() << endl;
mesh.move();
}
scalar Vmin = sum(mesh.V().field());
Info << "\nVmax = " << Vmax;
Info << ", Vmin = " << Vmin << endl;
Info << "Vmax/Vmin = " << Vmax/Vmin << endl;
Info << "\n end\n";
Info<< "\nVmax = " << Vmax;
Info<< ", Vmin = " << Vmin << endl;
Info<< "Vmax/Vmin = " << Vmax/Vmin << endl;
Info<< "\nEnd" << endl;
return 0;
}

View File

@ -36,25 +36,18 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -37,25 +37,18 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
mesh.readUpdate();

View File

@ -29,6 +29,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "timeSelector.H"
#include "Time.H"
#include "fvMesh.H"
#include "vectorIOField.H"
#include "volFields.H"
@ -41,23 +43,18 @@ using namespace Foam;
int main(int argc, char *argv[])
{
# include "addTimeOptions.H"
timeSelector::addOptions();
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
@ -77,10 +74,10 @@ int main(int argc, char *argv[])
mesh.C()
);
//Info<< "Writing cellCentre positions to " << cc.name() << " in "
// << runTime.timeName() << endl;
// Info<< "Writing cellCentre positions to " << cc.name() << " in "
// << runTime.timeName() << endl;
//
//cc.write();
// cc.write();
Info<< "Writing components of cellCentre positions to volScalarFields"
<< " ccx, ccy, ccz in " << runTime.timeName() << endl;
@ -104,7 +101,7 @@ int main(int argc, char *argv[])
}
}
Info << nl << "End" << endl;
Info<< "\nEnd" << endl;
return 0;
}

View File

@ -39,10 +39,12 @@ using namespace Foam;
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addRegionOption.H"
# include "setRootCase.H"
# include "createTime.H"
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
# include "createNamedMesh.H"
IOprobes sniff
(

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
@ -9,5 +10,6 @@ EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lsurfMesh \
-ltriSurface \
-llagrangian

View File

@ -40,6 +40,7 @@ Description
- dx : DX scalar or vector format
- vtk : VTK ascii format
- raw : x y z value format for use with e.g. gnuplot 'splot'.
- obj : Wavefron stl. Does not contain values!
- stl : ascii stl. Does not contain values!
@param interpolationScheme : interpolation scheme, choice of \n

View File

@ -30,7 +30,10 @@ setFormat raw;
// dx : DX scalar or vector format
// vtk : VTK ascii format
// raw : x y z value format for use with e.g. gnuplot 'splot'.
// stl : ascii stl. Does not contain values!
//
// Note:
// other formats such as obj, stl, etc can also be written (by proxy)
// but without any values!
surfaceFormat vtk;
// interpolationScheme. choice of

View File

@ -38,23 +38,16 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
runTime.setTime(Times[endTime-1], endTime-1);
runTime.setTime(timeDirs[timeDirs.size()-1], timeDirs.size()-1);
volScalarField pMean
(
@ -68,9 +61,9 @@ int main(int argc, char *argv[])
mesh
);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -35,30 +35,22 @@ Description
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMesh.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -42,24 +42,19 @@ Source files:
int main(int argc, char *argv[])
{
#include "addTimeOptions.H"
timeSelector::addOptions();
#include "setRootCase.H"
#include "createTime.H"
// Get times list
instantList Times = runTime.times();
instantList timeDirs = timeSelector::select0(runTime, args);
// set startTime and endTime depending on -time and -latestTime options
#include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
#include "createMesh.H"
#include "createFields.H"
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;

View File

@ -26,7 +26,7 @@ Application
streamFunction
Description
Calculates and writes the stream function of velocity field U at each time
Calculates and writes the stream function of velocity field U at each time
\*---------------------------------------------------------------------------*/
@ -42,27 +42,20 @@ Description
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addTimeOptions.H"
# include "setRootCase.H"
# include "createTime.H"
// Get times list
instantList Times = runTime.times();
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
runTime.setTime(Times[startTime], startTime);
instantList timeDirs = timeSelector::select0(runTime, args);
# include "createMeshNoClear.H"
pointMesh pMesh(mesh);
for (label i=startTime; i<endTime; i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< nl << "Time: " << runTime.timeName() << endl;

View File

@ -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::prefix/cloudName,
meshTarget,
IOobject::NO_READ,
IOobject::NO_WRITE,

View File

@ -94,7 +94,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
(
readDir
(
meshSource.time().timePath()/"lagrangian",
meshSource.time().timePath()/cloud::prefix,
fileName::DIRECTORY
)
);
@ -106,7 +106,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
(
meshSource,
meshSource.time().timeName(),
"lagrangian"/cloudDirs[cloudI]
cloud::prefix/cloudDirs[cloudI]
);
IOobject* positionsPtr = objects.lookup("positions");
@ -223,6 +223,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
{
unmappedSource.erase(sourceParticleI);
addParticles.append(sourceParticleI);
iter().cell()=targetCell;
targetParcels.addParticle
(
sourceParcels.remove(&iter())

Some files were not shown because too many files have changed in this diff Show More