GIT: Resolved merge conflict

This commit is contained in:
Andrew Heather
2016-12-12 12:23:45 +00:00
18 changed files with 253 additions and 133 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -40,19 +40,46 @@ namespace functionObjects
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
const Foam::objectRegistry&
Foam::functionObjects::regionFunctionObject::whichSubRegistry
(
const objectRegistry& obr,
const dictionary& dict
)
{
word subName;
if (dict.readIfPresent("subRegion", subName))
{
return obr.lookupObject<objectRegistry>(subName);
}
else
{
return obr;
}
}
const Foam::objectRegistry&
Foam::functionObjects::regionFunctionObject::obr() const
{
return subObr_;
}
bool Foam::functionObjects::regionFunctionObject::writeObject
(
const word& fieldName
)
{
if (obr_.foundObject<regIOobject>(fieldName))
const regIOobject* objPtr =
this->lookupObjectPtr<regIOobject>(fieldName);
if (objPtr)
{
const regIOobject& field = obr_.lookupObject<regIOobject>(fieldName);
Log << " functionObjects::" << type() << " " << name()
<< " writing field: " << field.name() << endl;
<< " writing field: " << objPtr->name() << endl;
field.write();
objPtr->write();
return true;
}
@ -68,13 +95,12 @@ bool Foam::functionObjects::regionFunctionObject::clearObject
const word& fieldName
)
{
if (foundObject<regIOobject>(fieldName))
regIOobject* objPtr = lookupObjectRefPtr<regIOobject>(fieldName);
if (objPtr)
{
const regIOobject& resultObject = lookupObject<regIOobject>(fieldName);
if (resultObject.ownedByRegistry())
if (objPtr->ownedByRegistry())
{
return const_cast<regIOobject&>(resultObject).checkOut();
return objPtr->checkOut();
}
else
{
@ -104,7 +130,8 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
(
dict.lookupOrDefault("region", polyMesh::defaultRegion)
)
)
),
subObr_(whichSubRegistry(obr_, dict))
{}
@ -116,7 +143,8 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
)
:
stateFunctionObject(name, obr.time()),
obr_(obr)
obr_(obr),
subObr_(whichSubRegistry(obr_, dict))
{}

View File

@ -27,6 +27,8 @@ Class
Description
Specialization of Foam::functionObject for a region and providing a
reference to the region Foam::objectRegistry.
Also provides support for referencing a sub-region, which is typically
needed when dealing with surfMesh and their fields.
See also
Foam::functionObjects::stateFunctionObject
@ -68,18 +70,51 @@ protected:
//- Reference to the region objectRegistry
const objectRegistry& obr_;
//- Optional reference to the sub-region objectRegistry.
// If a sub-region is not in effect, this reference is identical
// to the usual region objectRegistry.
const objectRegistry& subObr_;
// Protected member functions
//- Find field in the objectRegistry
//- Selector for alternative sub-registry,
// when the keyword %subRegion is present in the dictionary
static const objectRegistry& whichSubRegistry
(
const objectRegistry& obr,
const dictionary& dict
);
//- The region or sub-region registry being used
const objectRegistry& obr() const;
//- Find object (eg, a field) in the (sub) objectRegistry
template<class ObjectType>
bool foundObject(const word& fieldName) const;
//- Lookup field from the objectRegistry
//- Lookup and return object (eg, a field) from the (sub) objectRegistry
template<class ObjectType>
const ObjectType& lookupObject(const word& fieldName) const;
//- Store the given field in the objectRegistry under the given name
//- Lookup and return object (eg, a field) from the (sub) objectRegistry
template<class ObjectType>
ObjectType& lookupObjectRef(const word& fieldName) const;
//- Lookup and return pointer to the object,
// otherwise nullptr if the object was not found,
// or had the incorrect type.
template<class ObjectType>
const ObjectType* lookupObjectPtr(const word& fieldName) const;
//- Lookup and return non-const pointer to the object,
// otherwise nullptr if the object was not found,
// or had the incorrect type.
template<class ObjectType>
ObjectType* lookupObjectRefPtr(const word& fieldName) const;
//- Store the given field in the (sub) objectRegistry under the given name
// Note: sets the fieldName to tfield().name() if not already set
template<class ObjectType>
bool store
@ -89,10 +124,10 @@ protected:
bool cacheable = false
);
//- Write field if present in objectRegistry
//- Write field if present in the (sub) objectRegistry
bool writeObject(const word& fieldName);
//- Clear field from the objectRegistry if present
//- Clear field from the (sub) objectRegistry if present
bool clearObject(const word& fieldName);
@ -101,10 +136,10 @@ private:
// Private Member Functions
//- Disallow default bitwise copy construct
regionFunctionObject(const regionFunctionObject&);
regionFunctionObject(const regionFunctionObject&) = delete;
//- Disallow default bitwise assignment
void operator=(const regionFunctionObject&);
void operator=(const regionFunctionObject&) = delete;
public:

View File

@ -34,7 +34,7 @@ bool Foam::functionObjects::regionFunctionObject::foundObject
const word& fieldName
) const
{
return obr_.foundObject<ObjectType>(fieldName);
return obr().foundObject<ObjectType>(fieldName);
}
@ -44,7 +44,37 @@ const ObjectType& Foam::functionObjects::regionFunctionObject::lookupObject
const word& fieldName
) const
{
return obr_.lookupObject<ObjectType>(fieldName);
return obr().lookupObject<ObjectType>(fieldName);
}
template<class ObjectType>
ObjectType& Foam::functionObjects::regionFunctionObject::lookupObjectRef
(
const word& fieldName
) const
{
return obr().lookupObjectRef<ObjectType>(fieldName);
}
template<class ObjectType>
const ObjectType* Foam::functionObjects::regionFunctionObject::lookupObjectPtr
(
const word& fieldName
) const
{
return obr().lookupObjectPtr<ObjectType>(fieldName);
}
template<class ObjectType>
ObjectType* Foam::functionObjects::regionFunctionObject::lookupObjectRefPtr
(
const word& fieldName
) const
{
return obr().lookupObjectRefPtr<ObjectType>(fieldName);
}
@ -72,8 +102,8 @@ bool Foam::functionObjects::regionFunctionObject::store
{
const ObjectType& field = lookupObject<ObjectType>(fieldName);
// If there is a result field already registered assign to the new
// result field otherwise transfer ownership of the new result field to
// If there is a result field already registered, assign to the new
// result field. Otherwise transfer ownership of the new result field to
// the object registry
if (&field != &tfield())
{
@ -81,7 +111,7 @@ bool Foam::functionObjects::regionFunctionObject::store
}
else
{
obr_.objectRegistry::store(tfield.ptr());
obr().objectRegistry::store(tfield.ptr());
}
}
else
@ -95,7 +125,7 @@ bool Foam::functionObjects::regionFunctionObject::store
fieldName = tfield().name();
}
obr_.objectRegistry::store(tfield.ptr());
obr().objectRegistry::store(tfield.ptr());
}
return true;

View File

@ -157,7 +157,7 @@ Foam::functionObjects::PecletNo::~PecletNo()
bool Foam::functionObjects::PecletNo::read(const dictionary& dict)
{
dict.readIfPresent("rho", rhoName_);
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
return true;
}

View File

@ -117,8 +117,13 @@ bool Foam::functionObjects::blendingFactor::read(const dictionary& dict)
writeFile::read(dict);
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
dict.readIfPresent("tolerance", tolerance_);
if ((tolerance_ < 0) || (tolerance_ > 1))
tolerance_ = 0.001;
if
(
dict.readIfPresent("tolerance", tolerance_)
&& (tolerance_ < 0 || tolerance_ > 1)
)
{
FatalErrorInFunction
<< "tolerance must be in the range 0 to 1. Supplied value: "

View File

@ -302,17 +302,39 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
dict.readIfPresent("periodicRestart", periodicRestart_);
dict.lookup("fields") >> faItems_;
const scalar currentTime = obr().time().value();
if (periodicRestart_)
{
dict.lookup("restartPeriod") >> restartPeriod_;
if (restartPeriod_ > 0)
{
// Determine the appropriate interval for the next restart
periodIndex_ = 1;
while (currentTime > restartPeriod_*periodIndex_)
{
++periodIndex_;
}
Info<< " Restart period " << restartPeriod_
<< " - next restart at " << (restartPeriod_*periodIndex_)
<< nl << endl;
}
else
{
periodicRestart_ = false;
Info<< " Restart period " << restartPeriod_
<< " - ignored"
<< nl << endl;
}
}
restartTime_ = GREAT;
if (dict.readIfPresent("restartTime", restartTime_))
{
if (restartTime_ < obr_.time().value())
if (currentTime > restartTime_)
{
// The restart time is already in the past - ignore
restartTime_ = GREAT;

View File

@ -97,7 +97,7 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict)
dict.lookup("fields") >> fields_;
dict.lookup("writeFields") >> writeFields_;
dict.readIfPresent("scaleFactor", scaleFactor_);
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
return true;
}

View File

@ -70,7 +70,7 @@ protected:
// Protected data
//- Optional scale value
//- Optional scaling factor
scalar scaleFactor_;
//- Construction dictionary

View File

@ -79,21 +79,19 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
DynamicList<List<scalar>>& faceSign
) const
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
label zonei = mesh.faceZones().findZoneID(faceZoneName);
label zonei = mesh_.faceZones().findZoneID(faceZoneName);
if (zonei == -1)
{
FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName
<< ". Valid faceZones are: " << mesh.faceZones().names()
<< ". Valid faceZones are: " << mesh_.faceZones().names()
<< exit(FatalError);
}
faceZoneNames.append(faceZoneName);
const faceZone& fZone = mesh.faceZones()[zonei];
const faceZone& fZone = mesh_.faceZones()[zonei];
DynamicList<label> faceIDs(fZone.size());
DynamicList<label> facePatchIDs(fZone.size());
@ -105,15 +103,15 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZone
label faceID = -1;
label facePatchID = -1;
if (mesh.isInternalFace(facei))
if (mesh_.isInternalFace(facei))
{
faceID = facei;
facePatchID = -1;
}
else
{
facePatchID = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[facePatchID];
facePatchID = mesh_.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh_.boundaryMesh()[facePatchID];
if (isA<coupledPolyPatch>(pp))
{
if (refCast<const coupledPolyPatch>(pp).owner())
@ -170,31 +168,29 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
DynamicList<List<scalar>>& faceSign
) const
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
vector refDir = dir/(mag(dir) + ROOTVSMALL);
label zonei = mesh.faceZones().findZoneID(faceZoneName);
label zonei = mesh_.faceZones().findZoneID(faceZoneName);
if (zonei == -1)
{
FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName
<< ". Valid faceZones are: " << mesh.faceZones().names()
<< ". Valid faceZones are: " << mesh_.faceZones().names()
<< exit(FatalError);
}
faceZoneNames.append(faceZoneName);
zoneRefDir.append(refDir);
const faceZone& fZone = mesh.faceZones()[zonei];
const faceZone& fZone = mesh_.faceZones()[zonei];
DynamicList<label> faceIDs(fZone.size());
DynamicList<label> facePatchIDs(fZone.size());
DynamicList<scalar> faceSigns(fZone.size());
const surfaceVectorField& Sf = mesh.Sf();
const surfaceScalarField& magSf = mesh.magSf();
const surfaceVectorField& Sf = mesh_.Sf();
const surfaceScalarField& magSf = mesh_.magSf();
vector n(Zero);
@ -204,15 +200,15 @@ void Foam::functionObjects::fluxSummary::initialiseFaceZoneAndDirection
label faceID = -1;
label facePatchID = -1;
if (mesh.isInternalFace(facei))
if (mesh_.isInternalFace(facei))
{
faceID = facei;
facePatchID = -1;
}
else
{
facePatchID = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[facePatchID];
facePatchID = mesh_.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh_.boundaryMesh()[facePatchID];
if (isA<coupledPolyPatch>(pp))
{
if (refCast<const coupledPolyPatch>(pp).owner())
@ -279,27 +275,25 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
DynamicList<List<scalar>>& faceSign
) const
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
vector refDir = dir/(mag(dir) + ROOTVSMALL);
const label cellZonei = mesh.cellZones().findZoneID(cellZoneName);
const label cellZonei = mesh_.cellZones().findZoneID(cellZoneName);
if (cellZonei == -1)
{
FatalErrorInFunction
<< "Unable to find cellZone " << cellZoneName
<< ". Valid zones are: " << mesh.cellZones().names()
<< ". Valid zones are: " << mesh_.cellZones().names()
<< exit(FatalError);
}
const label nInternalFaces = mesh.nInternalFaces();
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
const label nInternalFaces = mesh_.nInternalFaces();
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
labelList cellAddr(mesh.nCells(), -1);
const labelList& cellIDs = mesh.cellZones()[cellZonei];
labelList cellAddr(mesh_.nCells(), -1);
const labelList& cellIDs = mesh_.cellZones()[cellZonei];
UIndirectList<label>(cellAddr, cellIDs) = identity(cellIDs.size());
labelList nbrFaceCellAddr(mesh.nFaces() - nInternalFaces, -1);
labelList nbrFaceCellAddr(mesh_.nFaces() - nInternalFaces, -1);
forAll(pbm, patchi)
{
@ -311,17 +305,17 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
{
label facei = pp.start() + i;
label nbrFacei = facei - nInternalFaces;
label own = mesh.faceOwner()[facei];
label own = mesh_.faceOwner()[facei];
nbrFaceCellAddr[nbrFacei] = cellAddr[own];
}
}
}
// Correct boundary values for parallel running
syncTools::swapBoundaryFaceList(mesh, nbrFaceCellAddr);
syncTools::swapBoundaryFaceList(mesh_, nbrFaceCellAddr);
// Collect faces
DynamicList<label> faceIDs(floor(0.1*mesh.nFaces()));
DynamicList<label> faceIDs(floor(0.1*mesh_.nFaces()));
DynamicList<label> facePatchIDs(faceIDs.size());
DynamicList<label> faceLocalPatchIDs(faceIDs.size());
DynamicList<scalar> faceSigns(faceIDs.size());
@ -329,12 +323,12 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
// Internal faces
for (label facei = 0; facei < nInternalFaces; facei++)
{
const label own = cellAddr[mesh.faceOwner()[facei]];
const label nbr = cellAddr[mesh.faceNeighbour()[facei]];
const label own = cellAddr[mesh_.faceOwner()[facei]];
const label nbr = cellAddr[mesh_.faceNeighbour()[facei]];
if (((own != -1) && (nbr == -1)) || ((own == -1) && (nbr != -1)))
{
vector n = mesh.faces()[facei].normal(mesh.points());
vector n = mesh_.faces()[facei].normal(mesh_.points());
n /= mag(n) + ROOTVSMALL;
if ((n & refDir) > tolerance_)
@ -362,12 +356,12 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
forAll(pp, localFacei)
{
const label facei = pp.start() + localFacei;
const label own = cellAddr[mesh.faceOwner()[facei]];
const label own = cellAddr[mesh_.faceOwner()[facei]];
const label nbr = nbrFaceCellAddr[facei - nInternalFaces];
if ((own != -1) && (nbr == -1))
{
vector n = mesh.faces()[facei].normal(mesh.points());
vector n = mesh_.faces()[facei].normal(mesh_.points());
n /= mag(n) + ROOTVSMALL;
if ((n & refDir) > tolerance_)
@ -391,15 +385,15 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
// Convert into primitivePatch for convenience
indirectPrimitivePatch patch
(
IndirectList<face>(mesh.faces(), faceIDs),
mesh.points()
IndirectList<face>(mesh_.faces(), faceIDs),
mesh_.points()
);
if (debug)
{
OBJstream os(mesh.time().path()/"patch.obj");
OBJstream os(mesh_.time().path()/"patch.obj");
faceList faces(patch);
os.write(faces, mesh.points(), false);
os.write(faces, mesh_.points(), false);
}
@ -467,7 +461,7 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
patchEdgeFaceRegion
> calc
(
mesh,
mesh_,
patch,
changedEdges,
changedInfo,
@ -524,9 +518,9 @@ void Foam::functionObjects::fluxSummary::initialiseCellZoneAndDirection
// Write OBj of faces to file
if (debug)
{
OBJstream os(mesh.time().path()/zoneName + ".obj");
faceList faces(mesh.faces(), regionFaceIDs[regioni]);
os.write(faces, mesh.points(), false);
OBJstream os(mesh_.time().path()/zoneName + ".obj");
faceList faces(mesh_.faces(), regionFaceIDs[regioni]);
os.write(faces, mesh_.points(), false);
}
}
@ -552,8 +546,7 @@ void Foam::functionObjects::fluxSummary::initialiseFaceArea()
{
faceArea_.setSize(faceID_.size(), 0);
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const surfaceScalarField& magSf = mesh.magSf();
const surfaceScalarField& magSf = mesh_.magSf();
forAll(faceID_, zonei)
{
@ -623,9 +616,9 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
writeFile::read(dict);
mode_ = modeTypeNames_.read(dict.lookup("mode"));
phiName_= dict.lookupOrDefault<word>("phi", "phi");
dict.readIfPresent("scaleFactor", scaleFactor_);
dict.readIfPresent("tolerance", tolerance_);
phiName_ = dict.lookupOrDefault<word>("phi", "phi");
scaleFactor_ = dict.lookupOrDefault<scalar>("scaleFactor", 1.0);
tolerance_ = dict.lookupOrDefault<scalar>("tolerance", 0.8);
// Initialise with capacity of 10 faceZones
DynamicList<vector> refDir(10);
@ -788,7 +781,7 @@ bool Foam::functionObjects::fluxSummary::write()
{
const surfaceScalarField& phi = lookupObject<surfaceScalarField>(phiName_);
word flowType = "";
word flowType;
if (phi.dimensions() == dimVolume/dimTime)
{
flowType = "volumetric";
@ -801,7 +794,7 @@ bool Foam::functionObjects::fluxSummary::write()
{
FatalErrorInFunction
<< "Unsupported flux field " << phi.name() << " with dimensions "
<< phi.dimensions() << ". Expected eithe mass flow or volumetric "
<< phi.dimensions() << ". Expected either mass flow or volumetric "
<< "flow rate" << abort(FatalError);
}

View File

@ -50,7 +50,7 @@ Usage
\table
Property | Description | Required | Default value
type | Type name: mapFields | yes |
mapRgion | Name of region to map to | yes |
mapRegion | Name of region to map to | yes |
mapMethod | Mapping method | yes |
patchMapMethod | Patch mapping method | no | <auto>
consistent | Mapping meshes have consistent boundaries | yes |
@ -61,7 +61,6 @@ Usage
SourceFiles
mapFields.C
IOmapFields.H
\*---------------------------------------------------------------------------*/

View File

@ -232,8 +232,8 @@ bool Foam::functionObjects::pressure::read(const dictionary& dict)
{
fieldExpression::read(dict);
dict.readIfPresent("U", UName_);
dict.readIfPresent("rho", rhoName_);
UName_ = dict.lookupOrDefault<word>("U", "U");
rhoName_ = dict.lookupOrDefault<word>("rho", "rho");
if (rhoName_ == "rhoInf")
{

View File

@ -95,7 +95,7 @@ protected:
// Protected data
//- Name of function object to retrueve data from
//- Name of function object to retrieve data from
word functionObjectName_;
//- List of fields on which to operate

View File

@ -256,8 +256,6 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
if (writeFields_)
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
volVectorField* forceCoeffPtr
(
new volVectorField
@ -265,12 +263,12 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
IOobject
(
fieldName("forceCoeff"),
mesh.time().timeName(),
mesh,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
mesh_,
dimensionedVector("0", dimless, Zero)
)
);
@ -284,12 +282,12 @@ bool Foam::functionObjects::forceCoeffs::read(const dictionary& dict)
IOobject
(
fieldName("momentCoeff"),
mesh.time().timeName(),
mesh,
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
mesh_,
dimensionedVector("0", dimless, Zero)
)
);

View File

@ -212,14 +212,14 @@ void Foam::ensightSurfaceReader::readCase(IFstream& is)
}
// Start reading time information
readLine(is, buffer); // time set: 1
readLine(is, buffer); // time set: <int>
readLine(is, buffer);
readFromLine(3, buffer, nTimeSteps_);
readFromLine(3, buffer, nTimeSteps_); // number of steps: <int>
readLine(is, buffer);
readFromLine(3, buffer, timeStartIndex_);
readFromLine(3, buffer, timeStartIndex_); // filename start number: <int>
readLine(is, buffer);
readFromLine(2, buffer, timeIncrement_);
readFromLine(2, buffer, timeIncrement_); // filename increment: <int>
if (debug)
{
@ -369,7 +369,7 @@ const Foam::meshedSurface& Foam::ensightSurfaceReader::geometry()
// Read faces - may be a mix of tris, quads and polys
DynamicList<face> faces(ceil(nPoints/3));
DynamicList<Tuple2<string, label> > schema(faces.size());
DynamicList<Tuple2<string, label>> schema(faces.size());
string faceType = "";
label nFace = 0;
while (is.good()) // (is.peek() != EOF)
@ -494,7 +494,7 @@ Foam::wordList Foam::ensightSurfaceReader::fieldNames
}
Foam::tmp<Foam::Field<Foam::scalar> > Foam::ensightSurfaceReader::field
Foam::tmp<Foam::Field<Foam::scalar>> Foam::ensightSurfaceReader::field
(
const label timeIndex,
const label fieldIndex,
@ -505,7 +505,7 @@ Foam::tmp<Foam::Field<Foam::scalar> > Foam::ensightSurfaceReader::field
}
Foam::tmp<Foam::Field<Foam::vector> > Foam::ensightSurfaceReader::field
Foam::tmp<Foam::Field<Foam::vector>> Foam::ensightSurfaceReader::field
(
const label timeIndex,
const label fieldIndex,
@ -516,7 +516,7 @@ Foam::tmp<Foam::Field<Foam::vector> > Foam::ensightSurfaceReader::field
}
Foam::tmp<Foam::Field<Foam::sphericalTensor> >
Foam::tmp<Foam::Field<Foam::sphericalTensor>>
Foam::ensightSurfaceReader::field
(
const label timeIndex,
@ -528,7 +528,7 @@ Foam::ensightSurfaceReader::field
}
Foam::tmp<Foam::Field<Foam::symmTensor> > Foam::ensightSurfaceReader::field
Foam::tmp<Foam::Field<Foam::symmTensor>> Foam::ensightSurfaceReader::field
(
const label timeIndex,
const label fieldIndex,
@ -539,7 +539,7 @@ Foam::tmp<Foam::Field<Foam::symmTensor> > Foam::ensightSurfaceReader::field
}
Foam::tmp<Foam::Field<Foam::tensor> > Foam::ensightSurfaceReader::field
Foam::tmp<Foam::Field<Foam::tensor>> Foam::ensightSurfaceReader::field
(
const label timeIndex,
const label fieldIndex,

View File

@ -86,7 +86,7 @@ protected:
//- Pointer to the surface
autoPtr<meshedSurface> surfPtr_;
List<Tuple2<string, label> > schema_;
List<Tuple2<string, label>> schema_;
// Protected Member Functions
@ -126,7 +126,7 @@ protected:
//- Helper function to return a field
template<class Type>
tmp<Field<Type> > readField
tmp<Field<Type>> readField
(
const label timeIndex,
const label fieldIndex
@ -160,7 +160,7 @@ public:
virtual wordList fieldNames(const label timeIndex) const;
//- Return a scalar field at a given time
virtual tmp<Field<scalar> > field
virtual tmp<Field<scalar>> field
(
const label timeIndex,
const label fieldIndex,
@ -168,7 +168,7 @@ public:
) const;
//- Return a scalar field at a given time
virtual tmp<Field<vector> > field
virtual tmp<Field<vector>> field
(
const label timeIndex,
const label fieldIndex,
@ -176,7 +176,7 @@ public:
) const;
//- Return a sphericalTensor field at a given time
virtual tmp<Field<sphericalTensor> > field
virtual tmp<Field<sphericalTensor>> field
(
const label timeIndex,
const label fieldIndex,
@ -184,7 +184,7 @@ public:
) const;
//- Return a symmTensor field at a given time
virtual tmp<Field<symmTensor> > field
virtual tmp<Field<symmTensor>> field
(
const label timeIndex,
const label fieldIndex,
@ -192,7 +192,7 @@ public:
) const;
//- Return a tensor field at a given time
virtual tmp<Field<tensor> > field
virtual tmp<Field<tensor>> field
(
const label timeIndex,
const label fieldIndex,

View File

@ -57,7 +57,7 @@ void Foam::ensightSurfaceReader::readFromLine
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::ensightSurfaceReader::readField
Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
(
const label timeIndex,
const label fieldIndex
@ -126,7 +126,7 @@ Foam::tmp<Foam::Field<Type> > Foam::ensightSurfaceReader::readField
is.read(iValue);
// Allocate storage for data as a list per component
List<DynamicList<scalar> > values(pTraits<Type>::nComponents);
List<DynamicList<scalar>> values(pTraits<Type>::nComponents);
label n = surfPtr_->size();
forAll(values, cmptI)
{
@ -164,7 +164,7 @@ Foam::tmp<Foam::Field<Type> > Foam::ensightSurfaceReader::readField
}
}
tmp<Field<Type> > tField(new Field<Type>(n, pTraits<Type>::zero));
tmp<Field<Type>> tField(new Field<Type>(n, pTraits<Type>::zero));
Field<Type>& field = tField.ref();
for

View File

@ -12,4 +12,5 @@ CGAL_LIBS = \
-L$(BOOST_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-L$(CGAL_ARCH_PATH)/lib \
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-lCGAL
-lCGAL \
-lmpfr

View File

@ -46,6 +46,10 @@ Usage: $Script [OPTIONS]
Executing $Script is equivalent to
wmake -all [OPTIONS]
With these additional options:
-l | -log
USAGE
wmake -help
@ -57,8 +61,7 @@ USAGE
# Parse the arguments and options
#------------------------------------------------------------------------------
fromWmake=
qOpt=
unset fromWmake optLog optQueue
for arg in "$@"
do
@ -70,17 +73,20 @@ do
usage
exit 0
;;
# Check if called from wmake to avoid recusion
-fromWmake)
fromWmake="fromWmake"
# If called from wmake (to avoid recursion)
fromWmake=true
;;
-q)
qOpt="-q"
# Permanently remove arg
continue
-l | -log)
optLog=true
continue # Permanently remove arg
;;
-q | -queue)
optQueue="-q"
continue # Permanently remove arg
;;
# Target type
lib | libo | libso | dep | objects)
# Target type
targetType=$arg
;;
esac
@ -96,11 +102,13 @@ done
if [ -z "$fromWmake" ]
then
exec wmake -all $qOpt $*
else
# Print command
[ -z "$targetType" ] || targetSpace=" "
echo "$Script $targetType$targetSpace$(echo $PWD | sed s%$WM_PROJECT_DIR/%% )"
if [ -z "$optLog" ]
then
exec wmake -all $optQueue $*
else
echo "logging wmake -all output to 'log.Allwmake'" 1>&2
exec wmake -all $optQueue $* 2>&1 | tee log.Allwmake
fi
fi
@ -118,7 +126,8 @@ fi
# Cleanup local variables and functions
#------------------------------------------------------------------------------
unset Script usage fromWmake
unset Script fromWmake optLog optQueue
unset -f usage
#------------------------------------------------------------------------------