Merge branch 'master' into cvm

This commit is contained in:
graham
2008-07-31 16:36:28 +01:00
66 changed files with 1130 additions and 1633 deletions

View File

@ -418,19 +418,55 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const
return times[times.size() - 1];
}
label nearestIndex = -1;
scalar deltaT = GREAT;
label closesti = 0;
for (label i=1; i<times.size(); i++)
{
if (mag(times[i].value() - t) < deltaT)
scalar diff = mag(times[i].value() - t);
if (diff < deltaT)
{
deltaT = mag(times[i].value() - t);
closesti = i;
deltaT = diff;
nearestIndex = i;
}
}
return times[closesti];
return times[nearestIndex];
}
//
// This should work too,
// if we don't worry about checking "constant" explicitly
//
// Foam::instant Foam::Time::findClosestTime(const scalar t) const
// {
// instantList times = Time::findTimes(path());
// label timeIndex = min(findClosestTimeIndex(times, t), 0);
// return times[timeIndex];
// }
Foam::label Foam::Time::findClosestTimeIndex
(
const instantList& times,
const scalar t
)
{
label nearestIndex = -1;
scalar deltaT = GREAT;
forAll (times, i)
{
if (times[i].name() == "constant") continue;
scalar diff = fabs(times[i].value() - t);
if (diff < deltaT)
{
deltaT = diff;
nearestIndex = i;
}
}
return nearestIndex;
}

View File

@ -300,6 +300,9 @@ public:
//- Search the case for the time closest to the given time
instant findClosestTime(const scalar) const;
//- Search instantList for the time index closest to the given time
static label findClosestTimeIndex(const instantList&, const scalar);
//- Write using given format, version and compression
virtual bool writeObject
(

View File

@ -33,10 +33,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
word Time::findInstance
Foam::word Foam::Time::findInstance
(
const fileName& dir,
const word& name,
@ -110,7 +107,7 @@ word Time::findInstance
// constant function of the time, because the latter points to
// the case constant directory in parallel cases
if
if
(
file(path()/constant()/dir/name)
&& IOobject(name, constant(), dir, *this).headerOk()
@ -139,9 +136,4 @@ word Time::findInstance
return constant();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -35,12 +35,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
instantList Time::findTimes(const fileName& directory)
Foam::instantList Foam::Time::findTimes(const fileName& directory)
{
if (debug)
{
@ -101,9 +96,4 @@ instantList Time::findTimes(const fileName& directory)
return Times;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -337,23 +337,21 @@ Foam::argList::argList
Switch distributed(false);
if (decompositionDict.found("distributed"))
if
(
decompositionDict.readIfPresent("distributed", distributed)
&& distributed
)
{
decompositionDict.lookup("distributed") >> distributed;
decompositionDict.lookup("roots") >> roots;
if (distributed)
if (roots.size() != Pstream::nProcs()-1)
{
decompositionDict.lookup("roots") >> roots;
if (roots.size() != Pstream::nProcs())
{
FatalError
<< "number of entries in "
<< "decompositionDict::roots"
<< " is not equal to the number of processors "
<< Pstream::nProcs()
<< exit(FatalError);
}
FatalError
<< "number of entries in decompositionDict::roots"
<< " is not equal to the number of slaves "
<< Pstream::nProcs()-1
<< exit(FatalError);
}
}

View File

@ -1,22 +1,7 @@
if (args.options().found("time"))
{
scalar time(readScalar(IStringStream(args.options()["time"])()));
scalar timeValue(readScalar(IStringStream(args.options()["time"])()));
int nearestIndex = -1;
scalar nearestDiff = Foam::GREAT;
forAll(Times, timeIndex)
{
if (Times[timeIndex].name() == "constant") continue;
scalar diff = fabs(Times[timeIndex].value() - time);
if (diff < nearestDiff)
{
nearestDiff = diff;
nearestIndex = timeIndex;
}
}
startTime = nearestIndex;
endTime = nearestIndex + 1;
startTime = Time::findClosestTimeIndex(Times, timeValue);
endTime = startTime + 1;
}

View File

@ -1072,7 +1072,7 @@ const Foam::globalMeshData& Foam::polyMesh::globalData() const
// Remove all files and some subdirs (eg, sets)
void Foam::polyMesh::removeFiles(const fileName& instanceDir) const
{
fileName meshFilesPath = db().path()/instanceDir/meshSubDir;
fileName meshFilesPath = db().path()/instanceDir/meshDir();
rm(meshFilesPath/"points");
rm(meshFilesPath/"faces");

View File

@ -102,7 +102,7 @@ Foam::scalar Foam::layerAdditionRemoval::readOldThickness
const dictionary& dict
)
{
dict.lookupOrDefault("oldLayerThickness", -1.0);
return dict.lookupOrDefault("oldLayerThickness", -1.0);
}

View File

@ -1,126 +0,0 @@
cellClassification/cellClassification.C
cellClassification/cellInfo.C
cellQuality/cellQuality.C
cellDist/cellDistFuncs.C
cellDist/patchWave/patchWave.C
cellDist/wallPoint/wallPoint.C
cellFeatures/cellFeatures.C
coordinateSystems/parabolicCylindricalCS.C
coordinateSystems/coordinateSystem.C
coordinateSystems/toroidalCS.C
coordinateSystems/cartesianCS.C
coordinateSystems/newCoordinateSystem.C
coordinateSystems/cylindricalCS.C
coordinateSystems/sphericalCS.C
coordinateSystems/coordinateRotation/coordinateRotation.C
coordinateSystems/coordinateRotation/EulerCoordinateRotation.C
coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C
polyMeshZipUpCells/polyMeshZipUpCells.C
primitiveMeshGeometry/primitiveMeshGeometry.C
meshSearch/meshSearch.C
meshTools/meshTools.C
PointEdgeWave/PointEdgeWaveName.C
PointEdgeWave/pointEdgePoint.C
regionSplit/regionSplit.C
octree/octreeName.C
octree/octreeDataPoint.C
octree/octreeDataPointTreeLeaf.C
octree/octreeDataEdges.C
octree/octreeDataCell.C
octree/octreeDataFace.C
octree/treeBoundBox.C
octree/treeNodeName.C
octree/treeLeafName.C
octree/pointIndexHitIOList.C
indexedOctree/indexedOctreeName.C
indexedOctree/treeDataTriSurface.C
topoSets = sets/topoSets
$(topoSets)/cellSet.C
$(topoSets)/topoSet.C
$(topoSets)/faceSet.C
$(topoSets)/pointSet.C
sets/topoSetSource/topoSetSource.C
cellSources = sets/cellSources
$(cellSources)/faceToCell/faceToCell.C
$(cellSources)/fieldToCell/fieldToCell.C
$(cellSources)/pointToCell/pointToCell.C
$(cellSources)/shapeToCell/shapeToCell.C
$(cellSources)/boxToCell/boxToCell.C
$(cellSources)/rotatedBoxToCell/rotatedBoxToCell.C
$(cellSources)/labelToCell/labelToCell.C
$(cellSources)/surfaceToCell/surfaceToCell.C
$(cellSources)/cellToCell/cellToCell.C
$(cellSources)/nearestToCell/nearestToCell.C
$(cellSources)/nbrToCell/nbrToCell.C
$(cellSources)/zoneToCell/zoneToCell.C
faceSources = sets/faceSources
$(faceSources)/faceToFace/faceToFace.C
$(faceSources)/labelToFace/labelToFace.C
$(faceSources)/cellToFace/cellToFace.C
$(faceSources)/normalToFace/normalToFace.C
$(faceSources)/pointToFace/pointToFace.C
$(faceSources)/patchToFace/patchToFace.C
$(faceSources)/boundaryToFace/boundaryToFace.C
$(faceSources)/zoneToFace/zoneToFace.C
$(faceSources)/boxToFace/boxToFace.C
pointSources = sets/pointSources
$(pointSources)/labelToPoint/labelToPoint.C
$(pointSources)/pointToPoint/pointToPoint.C
$(pointSources)/cellToPoint/cellToPoint.C
$(pointSources)/faceToPoint/faceToPoint.C
$(pointSources)/boxToPoint/boxToPoint.C
$(pointSources)/surfaceToPoint/surfaceToPoint.C
$(pointSources)/zoneToPoint/zoneToPoint.C
surfaceSets/surfaceSets.C
triSurface/orientedSurface/orientedSurface.C
booleanOps = triSurface/booleanOps
surfaceIntersection = $(booleanOps)/surfaceIntersection
$(surfaceIntersection)/surfaceIntersection.C
$(surfaceIntersection)/surfaceIntersectionFuncs.C
$(surfaceIntersection)/edgeIntersections.C
booleanSurface = $(booleanOps)/booleanSurface
$(booleanSurface)/booleanSurface.C
intersectedSurface = $(booleanOps)/intersectedSurface
$(intersectedSurface)/intersectedSurface.C
$(intersectedSurface)/edgeSurface.C
triSurface/triSurfaceSearch/triSurfaceSearch.C
triSurface/octreeData/octreeDataTriSurface.C
triSurface/octreeData/octreeDataTriSurfaceTreeLeaf.C
triSurface/triangleFuncs/triangleFuncs.C
triSurface/surfaceFeatures/surfaceFeatures.C
triSurface/triSurfaceMeshes/triSurfaceMeshes.C
twoDPointCorrector/twoDPointCorrector.C
directMapped/directMappedPolyPatch/directMappedPolyPatch.C
directMapped/directMappedPointPatch/directMappedPointPatch.C
LIB = $(FOAM_LIBBIN)/libmeshTools

View File

@ -13,10 +13,10 @@ sampledSet/sampledSets/sampledSets.C
sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C
sampledSet/writers/writer/writers.C
sampledSet/writers/raw/rawWriters.C
sampledSet/writers/xmgr/xmgrWriters.C
sampledSet/writers/gnuplot/gnuplotWriters.C
sampledSet/writers/jplot/jplotWriters.C
sampledSet/writers/raw/rawWriters.C
cuttingPlane/cuttingPlane.C

View File

@ -29,6 +29,15 @@ License
#include "linePointRef.H"
#include "meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// set values for what is close to zero and what is considered to
// be positive (and not just rounding noise)
//! @cond localScope
const Foam::scalar zeroish = Foam::SMALL;
const Foam::scalar positive = Foam::SMALL * 1E3;
//! @endcond localScope
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Find cut cells
@ -71,8 +80,8 @@ void Foam::cuttingPlane::calcCutCells
if
(
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0)
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0)
(dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|| (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
)
{
nCutEdges++;
@ -116,8 +125,8 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
if
(
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0)
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0)
(dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|| (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
)
{
// Edge is cut.
@ -126,7 +135,19 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
scalar alpha = lineIntersect(linePointRef(p0, p1));
dynCuttingPoints.append((1-alpha)*p0 + alpha*p1);
if (alpha < zeroish)
{
dynCuttingPoints.append(p0);
}
else if (alpha > 1.0)
{
dynCuttingPoints.append(p1);
}
else
{
dynCuttingPoints.append((1-alpha)*p0 + alpha*p1);
}
edgePoint[edgeI] = dynCuttingPoints.size() - 1;
}
}

View File

@ -30,6 +30,10 @@ Description
No attempt at resolving degenerate cases.
Note
When the cutting plane coincides with a mesh face, the cell edge on the
positive side of the plane is taken.
SourceFiles
cuttingPlane.C

View File

@ -63,28 +63,26 @@ public:
//- Construct null
gnuplot();
// Destructor
virtual ~gnuplot();
//- Destructor
virtual ~gnuplot();
// Member Functions
// Write
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
};

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "gnuplotWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeWriters(gnuplot);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWriters(gnuplot)
}
// ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass
Foam::gnuplotWriters
Description
SourceFiles
gnuplotWriters.C
\*---------------------------------------------------------------------------*/
#ifndef gnuplotWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef gnuplot<scalar> gnuplotScalarWriter;
typedef gnuplot<vector> gnuplotVectorWriter;
typedef gnuplot<tensor> gnuplotTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWritersTypedefs(gnuplot)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,8 +25,6 @@ License
Class
Foam::jplot
Description
SourceFiles
jplot.C
@ -43,8 +41,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
/*---------------------------------------------------------------------------*\
Class jplot Declaration
\*---------------------------------------------------------------------------*/
@ -71,30 +67,26 @@ public:
//- Construct null
jplot();
// Destructor
virtual ~jplot();
//- Destructor
virtual ~jplot();
// Member Functions
// Access
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
// Write
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
};

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "jplotWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeWriters(jplot);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWriters(jplot)
}
// ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass
Foam::jplotWriters
Description
SourceFiles
jplotWriters.C
\*---------------------------------------------------------------------------*/
#ifndef jplotWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef jplot<scalar> jplotScalarWriter;
typedef jplot<vector> jplotVectorWriter;
typedef jplot<tensor> jplotTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWritersTypedefs(jplot)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -64,28 +64,25 @@ public:
raw();
// Destructor
virtual ~raw();
//- Destructor
virtual ~raw();
// Member Functions
// Write
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
};

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "rawWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeWriters(raw);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWriters(raw)
}
// ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass
Foam::rawWriters
Description
SourceFiles
rawWriters.C
\*---------------------------------------------------------------------------*/
#ifndef rawWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef raw<scalar> rawScalarWriter;
typedef raw<vector> rawVectorWriter;
typedef raw<tensor> rawTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWritersTypedefs(raw)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -31,11 +31,11 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
autoPtr<writer<Type> > writer<Type>::New(const word& writeType)
Foam::autoPtr<Foam::writer<Type> > Foam::writer<Type>::New
(
const word& writeType
)
{
typename wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_
@ -60,7 +60,7 @@ autoPtr<writer<Type> > writer<Type>::New(const word& writeType)
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
fileName writer<Type>::getBaseName
Foam::fileName Foam::writer<Type>::getBaseName
(
const coordSet& points,
const wordList& valueSets
@ -78,7 +78,7 @@ fileName writer<Type>::getBaseName
template<class Type>
void writer<Type>::writeCoord
void Foam::writer<Type>::writeCoord
(
const coordSet& points,
const label pointI,
@ -97,7 +97,7 @@ void writer<Type>::writeCoord
template<class Type>
void writer<Type>::writeTable
void Foam::writer<Type>::writeTable
(
const coordSet& points,
const List<Type>& values,
@ -109,16 +109,14 @@ void writer<Type>::writeTable
writeCoord(points, pointI, os);
os << token::SPACE;
write(values[pointI], os);
os << endl;
}
}
template<class Type>
void writer<Type>::writeTable
void Foam::writer<Type>::writeTable
(
const coordSet& points,
const List<const List<Type>*>& valuesPtrList,
@ -132,9 +130,7 @@ void writer<Type>::writeTable
forAll(valuesPtrList, i)
{
os << token::SPACE;
const List<Type>& values = *valuesPtrList[i];
write(values[pointI], os);
}
os << endl;
@ -144,36 +140,44 @@ void writer<Type>::writeTable
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template<class Type>
writer<Type>::writer()
Foam::writer<Type>::writer()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
writer<Type>::~writer()
Foam::writer<Type>::~writer()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const scalar value, Ostream& os) const
Foam::Ostream& Foam::writer<Type>::write
(
const scalar value,
Ostream& os
) const
{
return os << value;
}
template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const
template<class VSType>
Foam::Ostream& Foam::writer<Type>::writeVS
(
const VSType& value,
Ostream& os
) const
{
for (direction d=0; d<vector::nComponents; d++)
for (direction d=0; d<VSType::nComponents; d++)
{
os << value.component(d);
if (d <= vector::nComponents-1)
if (d <= VSType::nComponents-1)
{
os << token::TAB;
}
@ -183,23 +187,47 @@ Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const
template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const tensor& value, Ostream& os) const
Foam::Ostream& Foam::writer<Type>::write
(
const vector& value,
Ostream& os
) const
{
for (direction d=0; d<tensor::nComponents; d++)
{
os << value.component(d);
if (d <= tensor::nComponents-1)
{
os << token::TAB;
}
}
return os;
return writeVS(value, os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const sphericalTensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const symmTensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const tensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
} // End namespace Foam
// ************************************************************************* //

View File

@ -29,8 +29,8 @@ Description
Base class for graphics format writing. Entry points are
- write(..). \n
Write to an Ostream a table of points with corresponding values.
- write(scalar/vector/tensor). \n
Write single scalar/vector/tensor.
- write(scalar/vector/sphericalTensor/symmTensor/tensor). \n
Write single scalar/vector/sphericalTensor/symmTensor/tensor.
Default is to write space separated components.
Example:
@ -151,43 +151,47 @@ public:
writer();
// Destructor
virtual ~writer() = 0;
//- Destructor
virtual ~writer() = 0;
// Member Functions
// Access
//- Generate file name with correct extension
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const = 0;
// Write
//- General entry point for writing.
// The data is organized in a set of point with one or
// more values per point
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream&
) const = 0;
//- Generate file name with correct extension
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const = 0;
//- Write scalar as ascii
virtual Ostream& write(const scalar, Ostream&) const;
//- General entry point for writing.
// The data is organized in a set of point with one or
// more values per point
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream&
) const = 0;
template<class VSType>
Ostream& writeVS(const VSType& value, Ostream& os) const;
//- Write scalar as ascii
virtual Ostream& write(const scalar, Ostream&) const;
//- Write vector. Tab separated ascii
virtual Ostream& write(const vector&, Ostream&) const;
//- Write vector. Tab separated ascii
virtual Ostream& write(const vector&, Ostream&) const;
//- Write sphericalTensor. Tab separated ascii
virtual Ostream& write(const sphericalTensor&, Ostream&) const;
//- Write tensor. Tab separated ascii
virtual Ostream& write(const tensor&, Ostream&) const;
//- Write symmTensor. Tab separated ascii
virtual Ostream& write(const symmTensor&, Ostream&) const;
//- Write tensor. Tab separated ascii
virtual Ostream& write(const tensor&, Ostream&) const;
};
@ -202,34 +206,47 @@ public:
#endif
// Only used internally
#define makeTypeWritersTypeName(type) \
\
#define makeTypeWritersTypeName(type) \
\
defineNamedTemplateTypeNameAndDebug(type, 0);
// Used externally sometimes
#define makeWritersTypeName(typeWriter) \
\
makeTypeWritersTypeName(typeWriter##ScalarWriter); \
makeTypeWritersTypeName(typeWriter##VectorWriter); \
#define makeWritersTypeName(typeWriter) \
\
makeTypeWritersTypeName(typeWriter##ScalarWriter); \
makeTypeWritersTypeName(typeWriter##VectorWriter); \
makeTypeWritersTypeName(typeWriter##SphericalTensorWriter); \
makeTypeWritersTypeName(typeWriter##SymmTensorWriter); \
makeTypeWritersTypeName(typeWriter##TensorWriter);
// Define type info for single template instantiation (e.g. vector)
#define makeWriterTypes(WriterType, type) \
\
defineNamedTemplateTypeNameAndDebug(type, 0); \
\
addToRunTimeSelectionTable \
( \
WriterType, type, word \
#define makeWriterTypes(WriterType, type) \
\
defineNamedTemplateTypeNameAndDebug(type, 0); \
\
addToRunTimeSelectionTable \
( \
WriterType, type, word \
);
// Define type info info for scalar, vector etc. instantiations
#define makeWriters(typeWriter) \
\
makeWriterTypes(scalarWriter, typeWriter##ScalarWriter); \
makeWriterTypes(vectorWriter, typeWriter##VectorWriter); \
makeWriterTypes(tensorWriter, typeWriter##TensorWriter);
#define makeWriters(typeWriter) \
\
makeWriterTypes(writerScalarWriter, typeWriter##ScalarWriter); \
makeWriterTypes(writerVectorWriter, typeWriter##VectorWriter); \
makeWriterTypes(writerSphericalTensorWriter, typeWriter##SphericalTensorWriter);\
makeWriterTypes(writerSymmTensorWriter, typeWriter##SymmTensorWriter); \
makeWriterTypes(writerTensorWriter, typeWriter##TensorWriter);
#define makeWritersTypedefs(typeWriter) \
\
typedef typeWriter<scalar> typeWriter##ScalarWriter; \
typedef typeWriter<vector> typeWriter##VectorWriter; \
typedef typeWriter<sphericalTensor> typeWriter##SphericalTensorWriter; \
typedef typeWriter<symmTensor> typeWriter##SymmTensorWriter; \
typedef typeWriter<tensor> typeWriter##TensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "writers.H"
@ -35,20 +33,20 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineNamedTemplateTypeNameAndDebug(scalarWriter, 0);
defineTemplateRunTimeSelectionTable(scalarWriter, word);
defineNamedTemplateTypeNameAndDebug(writerScalarWriter, 0);
defineTemplateRunTimeSelectionTable(writerScalarWriter, word);
defineNamedTemplateTypeNameAndDebug(vectorWriter, 0);
defineTemplateRunTimeSelectionTable(vectorWriter, word);
defineNamedTemplateTypeNameAndDebug(writerVectorWriter, 0);
defineTemplateRunTimeSelectionTable(writerVectorWriter, word);
defineNamedTemplateTypeNameAndDebug(sphericalTensorWriter, 0);
defineTemplateRunTimeSelectionTable(sphericalTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(writerSphericalTensorWriter, 0);
defineTemplateRunTimeSelectionTable(writerSphericalTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(symmTensorWriter, 0);
defineTemplateRunTimeSelectionTable(symmTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(writerSymmTensorWriter, 0);
defineTemplateRunTimeSelectionTable(writerSymmTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(tensorWriter, 0);
defineTemplateRunTimeSelectionTable(tensorWriter, word);
defineNamedTemplateTypeNameAndDebug(writerTensorWriter, 0);
defineTemplateRunTimeSelectionTable(writerTensorWriter, word);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InClass
Foam::writer
Foam::rawWriters
Description
SourceFiles
writers.C
\*---------------------------------------------------------------------------*/
@ -39,18 +40,8 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef writer<scalar> scalarWriter;
typedef writer<vector> vectorWriter;
typedef writer<sphericalTensor> sphericalTensorWriter;
typedef writer<symmTensor> symmTensorWriter;
typedef writer<tensor> tensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWritersTypedefs(writer)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -63,28 +63,26 @@ public:
//- Construct null
xmgr();
// Destructor
virtual ~xmgr();
//- Destructor
virtual ~xmgr();
// Member Functions
// Write
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
};

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "xmgrWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeWriters(xmgr);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWriters(xmgr)
}
// ************************************************************************* //

View File

@ -44,16 +44,8 @@ SourceFiles
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef xmgr<scalar> xmgrScalarWriter;
typedef xmgr<vector> xmgrVectorWriter;
typedef xmgr<tensor> xmgrTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
makeWritersTypedefs(xmgr)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //