Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
Andrew Heather
2017-07-19 08:19:15 +01:00
801 changed files with 6834 additions and 7724 deletions

View File

@ -39,16 +39,16 @@ Foam::autoPtr<Foam::meshToMeshMethod> Foam::meshToMeshMethod::New
Info<< "Selecting AMIMethod " << methodName << endl;
}
componentsConstructorTable::iterator cstrIter =
componentsConstructorTablePtr_->find(methodName);
auto cstrIter = componentsConstructorTablePtr_->cfind(methodName);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown meshToMesh type "
<< methodName << nl << nl
<< "Valid meshToMesh types are:" << nl
<< componentsConstructorTablePtr_->sortedToc() << exit(FatalError);
<< "Valid meshToMesh types :" << nl
<< componentsConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return autoPtr<meshToMeshMethod>(cstrIter()(src, tgt));

View File

@ -33,25 +33,25 @@ License
namespace Foam
{
defineTypeNameAndDebug(meshToMesh, 0);
template<>
const char* Foam::NamedEnum
<
Foam::meshToMesh::interpolationMethod,
4
>::names[] =
{
"direct",
"mapNearest",
"cellVolumeWeight",
"correctedCellVolumeWeight"
};
const NamedEnum<meshToMesh::interpolationMethod, 4>
meshToMesh::interpolationMethodNames_;
}
const Foam::Enum
<
Foam::meshToMesh::interpolationMethod
>
Foam::meshToMesh::interpolationMethodNames_
{
{ interpolationMethod::imDirect, "direct" },
{ interpolationMethod::imMapNearest, "mapNearest" },
{ interpolationMethod::imCellVolumeWeight, "cellVolumeWeight" },
{
interpolationMethod::imCorrectedCellVolumeWeight,
"correctedCellVolumeWeight"
},
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<>

View File

@ -46,7 +46,7 @@ SourceFiles
#include "treeBoundBox.H"
#include "mapDistribute.H"
#include "volFieldsFwd.H"
#include "NamedEnum.H"
#include "Enum.H"
#include "AMIPatchToPatchInterpolation.H"
#include "pointList.H"
@ -74,8 +74,7 @@ public:
imCorrectedCellVolumeWeight
};
static const NamedEnum<interpolationMethod, 4>
interpolationMethodNames_;
static const Enum<interpolationMethod> interpolationMethodNames_;
private:

View File

@ -864,7 +864,7 @@ Foam::meshToMesh::mapTgtToSrc
PtrList<fvPatchField<Type>> srcPatchFields(srcBm.size());
// constuct src boundary patch types as copy of 'field' boundary types
// construct src boundary patch types as copy of 'field' boundary types
// note: this will provide place holders for fields with additional
// entries, but these values will need to be reset
forAll(srcPatchID_, i)

View File

@ -448,8 +448,7 @@ Foam::autoPtr<Foam::sampledSet> Foam::sampledSet::New
{
const word sampleType(dict.lookup("type"));
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(sampleType);
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
if (!cstrIter.found())
{

View File

@ -37,6 +37,7 @@ SourceFiles
#include "surfaceReader.H"
#include "ensightReadFile.H"
#include "StringStream.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -33,8 +33,7 @@ Foam::autoPtr<Foam::surfaceReader> Foam::surfaceReader::New
const fileName& fName
)
{
fileNameConstructorTable::iterator cstrIter =
fileNameConstructorTablePtr_->find(readerType);
auto cstrIter = fileNameConstructorTablePtr_->cfind(readerType);
if (!cstrIter.found())
{

View File

@ -61,15 +61,14 @@ Foam::autoPtr<Foam::sampledSurface> Foam::sampledSurface::New
Info<< "Selecting sampledType " << sampleType << endl;
}
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(sampleType);
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
if (!cstrIter.found())
{
FatalErrorInFunction
<< "Unknown sample type "
<< sampleType << nl << nl
<< "Valid sample types : " << endl
<< "Valid sample types :" << endl
<< wordConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -35,6 +35,18 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::sampledTriSurfaceMesh::samplingSource
>
Foam::sampledTriSurfaceMesh::samplingSourceNames_
{
{ samplingSource::cells, "cells" },
{ samplingSource::insideCells, "insideCells" },
{ samplingSource::boundaryFaces, "boundaryFaces" },
};
namespace Foam
{
defineTypeNameAndDebug(sampledTriSurfaceMesh, 0);
@ -45,18 +57,6 @@ namespace Foam
word
);
template<>
const char* NamedEnum<sampledTriSurfaceMesh::samplingSource, 3>::names[] =
{
"cells",
"insideCells",
"boundaryFaces"
};
const NamedEnum<sampledTriSurfaceMesh::samplingSource, 3>
sampledTriSurfaceMesh::samplingSourceNames_;
//- Private class for finding nearest
// Comprising:
// - global index
@ -685,7 +685,7 @@ Foam::sampledTriSurfaceMesh::sampledTriSurfaceMesh
false
)
),
sampleSource_(samplingSourceNames_[dict.lookup("source")]),
sampleSource_(samplingSourceNames_.lookup("source", dict)),
needsUpdate_(true),
keepIds_(dict.lookupOrDefault<Switch>("keepIds", false)),
originalIds_(),

View File

@ -108,7 +108,7 @@ private:
// Private data
static const NamedEnum<samplingSource, 3> samplingSourceNames_;
static const Enum<samplingSource> samplingSourceNames_;
//- Surface to sample on
const triSurfaceMesh surface_;

View File

@ -30,7 +30,7 @@ License
#include "ensightPartFaces.H"
#include "ensightSerialOutput.H"
#include "ensightPTraits.H"
#include "OStringStream.H"
#include "StringStream.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //

View File

@ -38,31 +38,32 @@ namespace Foam
// Create write methods
defineSurfaceWriterWriteFields(nastranSurfaceWriter);
template<>
const char* NamedEnum<nastranSurfaceWriter::writeFormat, 3>::names[] =
{
"short",
"long",
"free"
};
const NamedEnum<nastranSurfaceWriter::writeFormat, 3>
nastranSurfaceWriter::writeFormatNames_;
template<>
const char* NamedEnum<nastranSurfaceWriter::dataFormat, 2>::names[] =
{
"PLOAD2",
"PLOAD4"
};
const NamedEnum<nastranSurfaceWriter::dataFormat, 2>
nastranSurfaceWriter::dataFormatNames_;
}
const Foam::Enum
<
Foam::nastranSurfaceWriter::writeFormat
>
Foam::nastranSurfaceWriter::writeFormatNames_
{
{ writeFormat::wfShort, "short" },
{ writeFormat::wfLong, "long" },
{ writeFormat::wfFree, "free" },
};
const Foam::Enum
<
Foam::nastranSurfaceWriter::dataFormat
>
Foam::nastranSurfaceWriter::dataFormatNames_
{
{ dataFormat::dfPLOAD2, "PLOAD2" },
{ dataFormat::dfPLOAD4, "PLOAD4" },
};
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::nastranSurfaceWriter::formatOS(Ostream& os) const
@ -405,18 +406,17 @@ Foam::nastranSurfaceWriter::nastranSurfaceWriter()
Foam::nastranSurfaceWriter::nastranSurfaceWriter(const dictionary& options)
:
surfaceWriter(),
writeFormat_(wfLong),
writeFormat_(writeFormat::wfLong),
fieldMap_(),
scale_(options.lookupOrDefault("scale", 1.0)),
separator_("")
{
if (options.found("format"))
{
writeFormat_ = writeFormatNames_.read
(
options.lookup("format")
);
}
writeFormat_ = writeFormatNames_.lookupOrDefault
(
"format",
options,
writeFormat::wfLong
);
if (writeFormat_ == wfFree)
{

View File

@ -56,7 +56,7 @@ SourceFiles
#define nastranSurfaceWriter_H
#include "surfaceWriter.H"
#include "NamedEnum.H"
#include "Enum.H"
#include "OFstream.H"
#include "HashTable.H"
@ -93,8 +93,8 @@ private:
// Private data
static const NamedEnum<writeFormat, 3> writeFormatNames_;
static const NamedEnum<dataFormat, 2> dataFormatNames_;
static const Enum<writeFormat> writeFormatNames_;
static const Enum<dataFormat> dataFormatNames_;
//- Write option
writeFormat writeFormat_;

View File

@ -54,8 +54,7 @@ namespace Foam
Foam::autoPtr<Foam::surfaceWriter>
Foam::surfaceWriter::New(const word& writeType)
{
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(writeType);
auto cstrIter = wordConstructorTablePtr_->cfind(writeType);
if (!cstrIter.found())
{
@ -86,8 +85,7 @@ Foam::autoPtr<Foam::surfaceWriter>
Foam::surfaceWriter::New(const word& writeType, const dictionary& optDict)
{
// find constructors with dictionary options
wordDictConstructorTable::iterator cstrIter =
wordDictConstructorTablePtr_->find(writeType);
auto cstrIter = wordDictConstructorTablePtr_->cfind(writeType);
if (!cstrIter.found())
{

View File

@ -78,8 +78,7 @@ Foam::surfMeshSampler::New
{
const word sampleType(dict.lookup("type"));
wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_->find(sampleType);
auto cstrIter = wordConstructorTablePtr_->cfind(sampleType);
if (!cstrIter.found())
{

View File

@ -35,22 +35,22 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::discreteSurface::samplingSource
>
Foam::discreteSurface::samplingSourceNames_
{
{ samplingSource::cells, "cells" },
{ samplingSource::insideCells, "insideCells" },
{ samplingSource::boundaryFaces, "boundaryFaces" },
};
namespace Foam
{
defineTypeNameAndDebug(discreteSurface, 0);
template<>
const char* NamedEnum<discreteSurface::samplingSource, 3>::names[] =
{
"cells",
"insideCells",
"boundaryFaces"
};
const NamedEnum<discreteSurface::samplingSource, 3>
discreteSurface::samplingSourceNames_;
//- Private class for finding nearest
// Comprising:
// - global index
@ -686,7 +686,7 @@ Foam::discreteSurface::discreteSurface
false
)
),
sampleSource_(samplingSourceNames_[dict.lookup("source")]),
sampleSource_(samplingSourceNames_.lookup("source", dict)),
needsUpdate_(true),
keepIds_(dict.lookupOrDefault<Switch>("keepIds", false)),
originalIds_(),

View File

@ -107,7 +107,7 @@ private:
// Private data
static const NamedEnum<samplingSource, 3> samplingSourceNames_;
static const Enum<samplingSource> samplingSourceNames_;
//- Reference to mesh
const polyMesh& mesh_;