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

Conflicts:
	src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H
This commit is contained in:
sergio
2016-12-05 15:32:26 -08:00
219 changed files with 2413 additions and 1432 deletions

View File

@ -51,7 +51,7 @@ int main(int argc, char *argv[])
{
argList::addOption
(
"cloudName",
"cloud",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);

View File

@ -11,7 +11,7 @@ word continuousPhaseName
mesh,
IOobject::MUST_READ
)
).lookup("continuousPhaseName")
).lookup("continuousPhase")
);
Info<< "Reading field U\n" << endl;
@ -123,7 +123,7 @@ volScalarField alphac
);
word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloudName", kinematicCloudName);
args.optionReadIfPresent("cloud", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicTypeCloud kinematicCloud

View File

@ -58,7 +58,7 @@ volScalarField mu
);
word kinematicCloudName("kinematicCloud");
args.optionReadIfPresent("cloudName", kinematicCloudName);
args.optionReadIfPresent("cloud", kinematicCloudName);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
basicKinematicCollidingCloud kinematicCloud

View File

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
{
argList::addOption
(
"cloudName",
"cloud",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);

View File

@ -46,7 +46,7 @@ int main(int argc, char *argv[])
{
argList::addOption
(
"cloudName",
"cloud",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);

View File

@ -51,7 +51,7 @@ autoPtr<compressible::turbulenceModel> turbulence
const word kinematicCloudName
(
args.optionLookupOrDefault<word>("cloudName", "kinematicCloud")
args.optionLookupOrDefault<word>("cloud", "kinematicCloud")
);
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;

View File

@ -45,7 +45,7 @@ int main(int argc, char *argv[])
{
argList::addOption
(
"cloudName",
"cloud",
"name",
"specify alternative cloud name. default is 'kinematicCloud'"
);

View File

@ -49,7 +49,7 @@ Foam::copiedFixedValueFvPatchScalarField::copiedFixedValueFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF, dict),
sourceFieldName_(dict.lookup("sourceFieldName"))
sourceFieldName_(dict.lookup("sourceField"))
{}
@ -109,7 +109,7 @@ void Foam::copiedFixedValueFvPatchScalarField::updateCoeffs()
void Foam::copiedFixedValueFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
os.writeKeyword("sourceFieldName")
os.writeKeyword("sourceField")
<< sourceFieldName_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}

View File

@ -81,6 +81,10 @@ int main(int argc, char *argv[])
}
Pout<< "zero scalar (time): " << dimensionedScalar(dimTime) << endl;
Pout<< "zero vector: " << dimensionedVector(dimLength) << endl;
Pout<< "zero tensor: " << dimensionedTensor(dimLength) << endl;
Info<< "End\n" << endl;
return 0;

View File

@ -0,0 +1,3 @@
Test-objectRegistry.C
EXE = $(FOAM_USER_APPBIN)/Test-objectRegistry

View File

@ -0,0 +1,2 @@
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
/* EXE_LIBS = -lfiniteVolume */

View File

@ -0,0 +1,278 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-objectRegistry
Description
Simple test of objectRegistry functionality.
Particular focus on the behaviour of subRegistry.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "IOstreams.H"
#include "objectRegistry.H"
#include "hashedWordList.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// file variable, needed for switching the default in lookupObject etc.
bool recursive = false;
template<class Type>
Foam::Ostream& printList(Foam::Ostream& os, const UList<Type>& list)
{
// list with out any linebreaks
os << '(';
forAll(list, i)
{
if (i) os << ' ';
os << list[i];
}
os << ')';
return os;
}
void printRegistry
(
Foam::Ostream& os,
const Foam::objectRegistry& obr,
Foam::label indent = 4
);
void printRegistry
(
Foam::Ostream& os,
const Foam::objectRegistry& obr,
Foam::label indent
)
{
hashedWordList regs = obr.names<objectRegistry>();
regs.sort();
wordList names = obr.sortedNames();
std::string prefix;
for (label i=indent; i; --i)
{
prefix += ' ';
}
os << '#' << prefix.c_str() << obr.name()
<< " parent:" << obr.parent().name() << nl;
// all names
{
os << ' ' << prefix.c_str() << "objects: ";
printList(os, names) << nl;
}
// sub-registry names
{
os << ' ' << prefix.c_str() << "registries: ";
printList(os, regs) << nl;
}
// Print, but skip expansion of sub-registries for now
forAll(names, i)
{
const word& name = names[i];
os << (regs.found(name) ? '-' : ' ')
<< prefix.c_str() << name << " => " << obr[name]->type() << nl;
}
for (label i=indent; i; --i)
{
os << '-'; // divider
}
os << '\n';
// Now descend into the sub-registries
forAll(regs, i)
{
const word& name = regs[i];
const objectRegistry& next = obr.lookupObject<objectRegistry>
(
name
);
os << prefix.c_str()
<< "current:" << obr.name() << " next:"
<< next.name() << " next-parent:" << next.parent().name() << nl;
os << prefix.c_str() << name << " => " << obr[name]->type();
if ("dictionary" == obr[name]->type())
{
os << " (skip dictionary)" << nl;
}
else
{
os << nl;
printRegistry(os, next, indent + 4);
}
}
}
// Main program:
int main(int argc, char *argv[])
{
argList::noBanner();
argList::noParallel();
argList::addBoolOption
(
"mesh",
"test with polyMesh objectRegistry instead of runTime"
);
argList::addBoolOption
(
"skip",
"skip some parts"
);
// argList::validArgs.append("recursive (true|false)");
#include "setRootCase.H"
#include "createTime.H"
#include "createPolyMesh.H"
// recursive = Switch(args[1]);
const bool optMesh = args.optionFound("mesh");
const bool optSkip = args.optionFound("skip");
const objectRegistry& db = (optMesh ? mesh.thisDb() : runTime);
Info<<"## start ##" << nl;
printRegistry(Info, db);
Info<< nl;
const label nRegs = 3;
// Add some items
for (label j = 0; j < 3; ++j)
{
word entryName = "entry" + name(j);
db.subRegistry
(
entryName,
true
);
}
Info<<"## initally populated ##" << nl;
printRegistry(Info, db);
Info<< nl;
// create a few sub-registries
for (label i = 0; i < nRegs; ++i)
{
word regName = "subreg" + name(i);
const objectRegistry& subreg = db.subRegistry
(
regName,
true
);
for (label j = 0; j < 3; ++j)
{
word entryName = "entry" + name(j);
subreg.subRegistry
(
entryName,
true
);
subreg.subRegistry
(
"$" + entryName, // qualified to avoid collisions
true
);
}
}
Info<<"## after adding sub-registries" << nl;
printRegistry(Info, db);
Info<< nl;
// Add further items into top-level
for (label j = 0; j < 6; ++j)
{
word entryName = "entry" + name(j);
db.subRegistry
(
entryName,
true
);
}
Info<< "after adding some entries, top-level now contains: ";
printList(Info, db.names()) << endl;
Info<<"## Now attempt to add a few more entries ##" << nl;
// Try adding the same items into sub registry
// create a few sub-registries
for (label i = 0; i < nRegs; ++i)
{
word regName = "subreg" + name(i);
const objectRegistry& subreg = db.subRegistry
(
regName,
false
);
if (!optSkip)
{
for (label j = 0; j < 6; ++j)
{
word entryName = "entry" + name(j);
subreg.subRegistry
(
entryName,
true
);
}
}
}
Info<<"## Complete picture ##" << nl;
printRegistry(Info, db);
Info<< nl;
return 0;
}
// ************************************************************************* //

View File

@ -36,7 +36,7 @@ Description
int main(int argc, char *argv[])
{
argList::validArgs.append("cloudName");
argList::validArgs.append("cloud");
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"

View File

@ -602,8 +602,8 @@ int main(int argc, char *argv[])
const word& key = iter().keyword();
const dictionary& dict = iter().dict();
const word cyclicName = dict.lookup("cyclicMasterPatchName");
const word wallName = dict.lookup("wallPatchName");
const word cyclicName = dict.lookup("cyclicMasterPatch");
const word wallName = dict.lookup("wallPatch");
FixedList<word, 3> nameAndType;
nameAndType[0] = key;
nameAndType[1] = wallName;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -148,6 +148,15 @@ int main(int argc, char *argv[])
dictPath =
runTime.constant()
/regionPath/polyMesh::meshSubDir/dictName;
// Warn that constant/polyMesh/blockMesh was selected instead of
// system/blockMesh
WarningIn(args[0])
<< "Using the old blockMeshDict location: "
<< dictPath << nl
<< " instead of the default location: "
<< runTime.system()/regionPath/dictName << nl
<< endl;
}
// Otherwise assume the dictionary is present in the system directory
else

View File

@ -901,33 +901,42 @@ int main(int argc, char *argv[])
// Read decomposePar dictionary
dictionary decomposeDict;
if (Pstream::parRun())
{
if (Pstream::parRun())
{
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
decomposeDict = IOdictionary
// A demand-driven decompositionMethod can have issues finding
// an alternative decomposeParDict location.
IOdictionary* dictPtr = new IOdictionary
(
decompositionModel::selectIO
(
decompositionModel::selectIO
IOobject
(
IOobject
(
"decomposeParDict",
runTime.system(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
),
decompDictFile
)
);
}
else
{
decomposeDict.add("method", "none");
decomposeDict.add("numberOfSubdomains", 1);
}
"decomposeParDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
decompDictFile
)
);
// Store it on the object registry, but to be found it must also
// have the expected "decomposeParDict" name.
dictPtr->rename("decomposeParDict");
runTime.store(dictPtr);
decomposeDict = *dictPtr;
}
else
{
decomposeDict.add("method", "none");
decomposeDict.add("numberOfSubdomains", 1);
}

View File

@ -431,7 +431,11 @@ snapControls
// (wip) Optional for explicit feature snapping:
//- Detect baffle edges. Default is true.
//detectBaffles false;
//- Erase attraction close to feature point. Default is false.
//- On any faces where points are on multiple regions (see
// multiRegionFeatureSnap) have the other points follow these points
// instead of having their own independent movement, i.e. have snapping
// to multi-region edges/points take priority. This might aid snapping
// to sharp edges that are also region edges. The default is false.
//releasePoints true;
//- Walk along feature edges, adding missing ones. Default is true.
//stringFeatures false;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,15 +28,31 @@ Group
grpMeshManipulationUtilities
Description
Detects faces that share points (baffles). Either merge them or
Detects boundary faces that share points (baffles). Either merges them or
duplicate the points.
Notes:
Usage
\b mergeOrSplitBaffles [OPTION]
Options:
- \par -detect
Detect baffles and write to faceSet duplicateFaces.
- \par -merge
Detect baffles and convert to internal faces.
- \par -split
Detect baffles and duplicate the points (used so the two sides
can move independently)
- \par -dict \<dictionary\>
Specify a dictionary to read actions from.
Note
- can only handle pairwise boundary faces. So three faces using
the same points is not handled (is illegal mesh anyway)
- there is no option to only split/merge some baffles.
- surfaces consisting of duplicate faces can be topologically split
if the points on the interior of the surface cannot walk to all the
cells that use them in one go.
@ -71,6 +87,7 @@ using namespace Foam;
void insertDuplicateMerge
(
const polyMesh& mesh,
const labelList& boundaryFaces,
const labelList& duplicates,
polyTopoChange& meshMod
)
@ -87,8 +104,8 @@ void insertDuplicateMerge
{
// Two duplicate faces. Merge.
label face0 = mesh.nInternalFaces() + bFacei;
label face1 = mesh.nInternalFaces() + otherFacei;
label face0 = boundaryFaces[bFacei];
label face1 = boundaryFaces[otherFacei];
label own0 = faceOwner[face0];
label own1 = faceOwner[face1];
@ -156,6 +173,45 @@ void insertDuplicateMerge
}
label patchSize(const polyMesh& mesh, const labelList& patchIDs)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
label sz = 0;
forAll(patchIDs, i)
{
const polyPatch& pp = patches[patchIDs[i]];
sz += pp.size();
}
return sz;
}
labelList patchFaces(const polyMesh& mesh, const labelList& patchIDs)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
labelList faceIDs(patchSize(mesh, patchIDs));
label sz = 0;
forAll(patchIDs, i)
{
const polyPatch& pp = patches[patchIDs[i]];
forAll(pp, ppi)
{
faceIDs[sz++] = pp.start()+ppi;
}
}
if (faceIDs.size() != sz)
{
FatalErrorInFunction << exit(FatalError);
}
return faceIDs;
}
labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
{
// Get all duplicate face labels (in boundaryFaces indices!).
@ -173,7 +229,7 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
{
if (duplicates[bFacei] != -1)
{
label facei = mesh.nInternalFaces() + bFacei;
label facei = boundaryFaces[bFacei];
label patchi = patches.whichPatch(facei);
if (isA<processorPolyPatch>(patches[patchi]))
@ -205,12 +261,12 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
if (otherFacei != -1 && otherFacei > bFacei)
{
duplicateSet.insert(mesh.nInternalFaces() + bFacei);
duplicateSet.insert(mesh.nInternalFaces() + otherFacei);
duplicateSet.insert(boundaryFaces[bFacei]);
duplicateSet.insert(boundaryFaces[otherFacei]);
}
}
Pout<< "Writing " << duplicateSet.size()
Info<< "Writing " << returnReduce(duplicateSet.size(), sumOp<label>())
<< " duplicate faces to faceSet " << duplicateSet.objectPath()
<< nl << endl;
duplicateSet.write();
@ -220,8 +276,6 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
}
int main(int argc, char *argv[])
{
argList::addNote
@ -232,6 +286,7 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
#include "addRegionOption.H"
#include "addDictOption.H"
argList::addBoolOption
(
"detectOnly",
@ -249,25 +304,89 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const bool readDict = args.optionFound("dict");
const bool split = args.optionFound("split");
const bool overwrite = args.optionFound("overwrite");
const bool detectOnly = args.optionFound("detectOnly");
// Collect all boundary faces
labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces());
forAll(boundaryFaces, i)
if (readDict && (split || detectOnly))
{
boundaryFaces[i] = i+mesh.nInternalFaces();
FatalErrorInFunction
<< "Use of dictionary for settings not compatible with"
<< " using command line arguments for \"split\""
<< " or \"detectOnly\"" << exit(FatalError);
}
if (detectOnly)
labelList detectPatchIDs;
labelList splitPatchIDs;
labelList mergePatchIDs;
if (readDict)
{
findBaffles(mesh, boundaryFaces);
return 0;
const word dictName;
#include "setSystemMeshDictionaryIO.H"
Info<< "Reading " << dictName << "\n" << endl;
IOdictionary dict(dictIO);
if (dict.found("detect"))
{
wordReList patchNames(dict.subDict("detect").lookup("patches"));
detectPatchIDs = patches.patchSet(patchNames).sortedToc();
Info<< "Detecting baffles on " << detectPatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, detectPatchIDs), sumOp<label>())
<< " faces" << endl;
}
if (dict.found("merge"))
{
wordReList patchNames(dict.subDict("merge").lookup("patches"));
mergePatchIDs = patches.patchSet(patchNames).sortedToc();
Info<< "Detecting baffles on " << mergePatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, mergePatchIDs), sumOp<label>())
<< " faces" << endl;
}
if (dict.found("split"))
{
wordReList patchNames(dict.subDict("split").lookup("patches"));
splitPatchIDs = patches.patchSet(patchNames).sortedToc();
Info<< "Detecting baffles on " << splitPatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, splitPatchIDs), sumOp<label>())
<< " faces" << endl;
}
}
else
{
if (detectOnly)
{
detectPatchIDs = identity(patches.size());
}
else if (split)
{
splitPatchIDs = identity(patches.size());
}
else
{
mergePatchIDs = identity(patches.size());
}
}
if (detectPatchIDs.size())
{
findBaffles(mesh, patchFaces(mesh, detectPatchIDs));
if (detectOnly)
{
return 0;
}
}
// Read objects in time directory
@ -308,64 +427,118 @@ int main(int argc, char *argv[])
ReadFields(mesh, objects, stFlds);
// Mesh change engine
polyTopoChange meshMod(mesh);
if (split)
if (mergePatchIDs.size())
{
Pout<< "Topologically splitting duplicate surfaces"
<< ", i.e. duplicating points internal to duplicate surfaces."
Info<< "Merging duplicate faces" << nl << endl;
// Mesh change engine
polyTopoChange meshMod(mesh);
const labelList boundaryFaces(patchFaces(mesh, mergePatchIDs));
// Get all duplicate face pairs (in boundaryFaces indices!).
labelList duplicates(findBaffles(mesh, boundaryFaces));
// Merge into internal faces.
insertDuplicateMerge(mesh, boundaryFaces, duplicates, meshMod);
if (!overwrite)
{
runTime++;
}
// Change the mesh. No inflation.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
if (overwrite)
{
mesh.setInstance(oldInstance);
}
Info<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write();
}
if (splitPatchIDs.size())
{
Info<< "Topologically splitting duplicate surfaces"
<< ", i.e. duplicating points internal to duplicate surfaces"
<< nl << endl;
// Determine points on split patches
DynamicList<label> candidates;
{
label sz = 0;
forAll(splitPatchIDs, i)
{
sz += patches[splitPatchIDs[i]].nPoints();
}
candidates.setCapacity(sz);
PackedBoolList isCandidate(mesh.nPoints());
forAll(splitPatchIDs, i)
{
const labelList& mp = patches[splitPatchIDs[i]].meshPoints();
forAll(mp, mpi)
{
label pointi = mp[mpi];
if (isCandidate.set(pointi))
{
candidates.append(pointi);
}
}
}
}
// Analyse which points need to be duplicated
localPointRegion regionSide(mesh);
localPointRegion regionSide(mesh, candidates);
// Point duplication engine
duplicatePoints pointDuplicator(mesh);
// Mesh change engine
polyTopoChange meshMod(mesh);
// Insert topo changes
pointDuplicator.setRefinement(regionSide, meshMod);
}
else
{
Pout<< "Merging duplicate faces."
<< nl << endl;
// Get all duplicate face labels (in boundaryFaces indices!).
labelList duplicates(findBaffles(mesh, boundaryFaces));
if (!overwrite)
{
runTime++;
}
// Merge into internal faces.
insertDuplicateMerge(mesh, duplicates, meshMod);
}
// Change the mesh. No inflation.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
if (!overwrite)
{
runTime++;
}
// Update fields
mesh.updateMesh(map);
// Change the mesh. No inflation.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
// Update fields
mesh.updateMesh(map);
if (overwrite)
{
mesh.setInstance(oldInstance);
}
Info<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write();
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
if (overwrite)
{
mesh.setInstance(oldInstance);
}
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write();
// Dump duplicated points (if any)
if (split)
{
// Dump duplicated points (if any)
const labelList& pointMap = map().pointMap();
labelList nDupPerPoint(map().nOldPoints(), 0);
@ -385,7 +558,7 @@ int main(int argc, char *argv[])
}
}
Pout<< "Writing " << dupPoints.size()
Info<< "Writing " << returnReduce(dupPoints.size(), sumOp<label>())
<< " duplicated points to pointSet "
<< dupPoints.objectPath() << nl << endl;

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object mergeOrSplitBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Detect baffles (boundary faces sharing points) on selected set of patches
// and write to a faceSet.
detect
{
patches (".*Wall");
}
// Detect baffles (on selected patches) and merge these into internal faces.
merge
{
patches ("mergePatch");
}
// Detect baffles (on selected patches) and duplicate the points. This is
// used if e.g. the two sides need to move separately. Note that since the
// points are duplicated the two faces are no longer baffles.
split
{
patches ("split.*Patches");
}
// ************************************************************************* //

View File

@ -15,10 +15,12 @@ EXE_LIBS = \
-lchemistryModel \
-lcoalCombustion \
-lcombustionModels \
-lcompressibleTransportModels \
-lcompressibleEulerianInterfacialModels \
-lcompressibleMultiphaseEulerianInterfacialModels \
-lcompressibleTurbulenceModels \
-lconversion \
-ldecompose \
-lCompressibleTwoPhaseMixtureTurbulenceModels \
-lcompressibleTwoPhaseSystem \
-lconformalVoronoiMesh \
-ldecompositionMethods \
-ldistributed \
-ldistributionModels \
@ -35,29 +37,32 @@ EXE_LIBS = \
-lfileFormats \
-lfiniteVolume \
-lfluidThermophysicalModels \
-lfoamToVTK \
-lforces \
-lfvMotionSolvers \
-lfvOptions \
-lgenericPatchFields \
-limmiscibleIncompressibleTwoPhaseMixture \
-lhelpTypes \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModels \
-linterfaceProperties \
-llagrangianFunctionObjects \
-llagrangianIntermediate \
-llagrangian \
-llagrangianSpray \
-llagrangianTurbulence \
-llaminarFlameSpeedModels \
-lliquidMixtureProperties \
-lliquidPropertiesFvPatchFields \
-lliquidProperties \
-lmeshTools \
-lmolecularMeasurements \
-lmolecule \
-lmultiphaseInterFoam \
-lmultiphaseMixtureThermo \
-lmultiphaseReactingTurbulenceModels \
-lmultiphaseSystem \
-lODE \
-lOpenFOAM \
-lpairPatchAgglomeration \
-lphaseChangeTwoPhaseMixtures \
-lphaseCompressibleTurbulenceModels \
-lphaseTemperatureChangeTwoPhaseMixtures \
-lpotential \
-lpyrolysisModels \
-lradiationModels \
@ -68,7 +73,6 @@ EXE_LIBS = \
-lreactingPhaseSystem \
-lreactingTwoPhaseSystem \
-lreactionThermophysicalModels \
-lreconstruct \
-lregionCoupled \
-lregionCoupling \
-lregionModels \
@ -79,11 +83,9 @@ EXE_LIBS = \
-lsampling \
-lscotchDecomp \
-lsixDoFRigidBodyMotion \
-lSLGThermo \
-lSloanRenumber \
-lsnappyHexMesh \
-lsolidChemistryModel \
-lsolidMixtureProperties \
-lsolidParticle \
-lsolidProperties \
-lsolidSpecie \
-lsolidThermo \
@ -92,13 +94,12 @@ EXE_LIBS = \
-lsurfaceFilmDerivedFvPatchFields \
-lsurfaceFilmModels \
-lsurfMesh \
-ltabulatedWallFunctions \
-lthermalBaffleModels \
-lthermophysicalFunctions \
-ltopoChangerFvMesh \
-ltriSurface \
-lturbulenceModelSchemes \
-lturbulenceModels \
-ltwoPhaseMixture \
-ltwoPhaseMixtureThermo \
-ltwoPhaseProperties \
-ltwoPhaseReactingTurbulenceModels \
-lutilityFunctionObjects

View File

@ -347,7 +347,7 @@ int main(int argc, char *argv[])
runTime.time().system(),
regionDir, // use region if non-standard
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),

View File

@ -1,6 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
set -x
#set -x
wclean libso vtkPVReaders
PVblockMeshReader/Allwclean

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
set -x
#set -x
# deal with client/server vs combined plugins
rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null

View File

@ -7,29 +7,49 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
# ensure CMake gets the correct C/C++ compilers
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
# CMake into objectsDir,
# with an additional attempt if (possibly incorrect) CMakeCache.txt existed
doCmake()
{
local sourceDir="$1"
findObjectDir $sourceDir # Where are generated files stored?
test -f "$objectsDir/CMakeCache.txt"
retry=$? # CMakeCache.txt exists, but sources may have moved
mkdir -p $objectsDir && \
(
cd $objectsDir || exit 1
cmake $sourceDir || {
if [ $retry -eq 0 ]
then
echo "Removing CMakeCache.txt and attempt again"
rm -f CMakeCache.txt
cmake $sourceDir
else
exit 1
fi
} && make
)
}
if [ -d "$ParaView_DIR" ]
then
wmake $targetType vtkPVFoam
if [ "$targetType" != "objects" ]
if [ "$targetType" != objects ]
then
sourceDir=$PWD/PVFoamReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
doCmake $PWD/PVFoamReader || {
echo
echo " WARNING: incomplete build of ParaView OpenFOAM plugin"
echo
echo "WARNING: incomplete build of ParaView OpenFOAM plugin"
}
fi
fi

View File

@ -1,4 +1,5 @@
EXE_INC = \
${c++LESSWARN} \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
set -x
#set -x
# deal with client/server vs combined plugins
rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null

View File

@ -11,25 +11,45 @@ cd ${0%/*} || exit 1 # Run from this directory
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
set -x
if [ -d "$ParaView_DIR" -a -r "$ParaView_DIR" ]
# CMake into objectsDir,
# with an additional attempt if (possibly incorrect) CMakeCache.txt existed
doCmake()
{
local sourceDir="$1"
findObjectDir $sourceDir # Where are generated files stored?
test -f "$objectsDir/CMakeCache.txt"
retry=$? # CMakeCache.txt exists, but sources may have moved
mkdir -p $objectsDir && \
(
cd $objectsDir || exit 1
cmake $sourceDir || {
if [ $retry -eq 0 ]
then
echo "Removing CMakeCache.txt and attempt again"
rm -f CMakeCache.txt
cmake $sourceDir
else
exit 1
fi
} && make
)
}
if [ -d "$ParaView_DIR" ]
then
wmake $targetType vtkPVblockMesh
if [ "$targetType" != "objects" ]
if [ "$targetType" != objects ]
then
sourceDir=$PWD/PVblockMeshReader
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
doCmake $PWD/PVblockMeshReader || {
echo
echo " WARNING: incomplete build of ParaView BlockMesh plugin"
echo
echo "WARNING: incomplete build of ParaView BlockMesh plugin"
}
fi
fi

View File

@ -1,4 +1,5 @@
EXE_INC = \
${c++LESSWARN} \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude \

View File

@ -1,4 +1,5 @@
EXE_INC = \
${c++LESSWARN} \
-I$(ParaView_INCLUDE_DIR) \
-I$(ParaView_INCLUDE_DIR)/vtkkwiml

View File

@ -9,7 +9,7 @@ IOdictionary propsDict
)
);
const word cloudName(propsDict.lookup("cloudName"));
const word cloudName(propsDict.lookup("cloud"));
label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")));

View File

@ -4,6 +4,6 @@ const word dictName("particleTrackDict");
IOdictionary propsDict(dictIO);
word cloudName(propsDict.lookup("cloudName"));
word cloudName(propsDict.lookup("cloud"));
List<word> userFields(propsDict.lookup("fields"));

View File

@ -69,7 +69,7 @@ int readNumProcs
dictName,
runTime.system(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
),

View File

@ -20,5 +20,6 @@ EXE_INC = \
-I/usr/include/Qt
LIB_LIBS = \
-L$(CGAL_ARCH_PATH)/lib \
-L$(CGAL_ARCH_PATH)/lib$(WM_COMPILER_LIB_ARCH) \
-ltriSurface

View File

@ -55,6 +55,7 @@ Usage
#include "triangle.H"
#include "triSurface.H"
#include "triSurfaceSearch.H"
#include "triSurfaceTools.H"
#include "argList.H"
#include "OFstream.H"
#include "OBJstream.H"
@ -64,79 +65,6 @@ Usage
using namespace Foam;
// Does face use valid vertices?
bool validTri
(
const bool verbose,
const triSurface& surf,
const label facei
)
{
// Simple check on indices ok.
const labelledTri& f = surf[facei];
forAll(f, fp)
{
if (f[fp] < 0 || f[fp] >= surf.points().size())
{
WarningInFunction
<< "triangle " << facei << " vertices " << f
<< " uses point indices outside point range 0.."
<< surf.points().size()-1 << endl;
return false;
}
}
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
{
WarningInFunction
<< "triangle " << facei
<< " uses non-unique vertices " << f
<< " coords:" << f.points(surf.points())
<< endl;
return false;
}
// duplicate triangle check
const labelList& fFaces = surf.faceFaces()[facei];
// Check if faceNeighbours use same points as this face.
// Note: discards normal information - sides of baffle are merged.
forAll(fFaces, i)
{
label nbrFacei = fFaces[i];
if (nbrFacei <= facei)
{
// lower numbered faces already checked
continue;
}
const labelledTri& nbrF = surf[nbrFacei];
if
(
((f[0] == nbrF[0]) || (f[0] == nbrF[1]) || (f[0] == nbrF[2]))
&& ((f[1] == nbrF[0]) || (f[1] == nbrF[1]) || (f[1] == nbrF[2]))
&& ((f[2] == nbrF[0]) || (f[2] == nbrF[1]) || (f[2] == nbrF[2]))
)
{
WarningInFunction
<< "triangle " << facei << " vertices " << f
<< " has the same vertices as triangle " << nbrFacei
<< " vertices " << nbrF
<< " coords:" << f.points(surf.points())
<< endl;
return false;
}
}
return true;
}
labelList countBins
(
const scalar min,
@ -377,14 +305,12 @@ int main(int argc, char *argv[])
const fileName surfFileName = args[1];
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
const bool verbose = args.optionFound("verbose");
const bool splitNonManifold = args.optionFound("splitNonManifold");
label outputThreshold = 10;
args.optionReadIfPresent("outputThreshold", outputThreshold);
Info<< "Reading surface from " << surfFileName << " ..." << nl << endl;
// Read
// ~~~~
@ -479,7 +405,7 @@ int main(int argc, char *argv[])
forAll(surf, facei)
{
if (!validTri(verbose, surf, facei))
if (!triSurfaceTools::validTri(surf, facei))
{
illegalFaces.append(facei);
}

View File

@ -60,7 +60,7 @@ int main(int argc, char *argv[])
argList::addBoolOption
(
"noClean",
"perform some surface checking/cleanup on the input surface"
"suppress surface checking/cleanup on the input surface"
);
argList args(argc, argv);

View File

@ -91,7 +91,11 @@ int main(int argc, char *argv[])
argList::validArgs.append("inputFile");
argList::validArgs.append("outputFile");
argList::addBoolOption("clean");
argList::addBoolOption
(
"clean",
"perform some surface checking/cleanup on the input surface"
);
argList::addBoolOption
(
"orient",

View File

@ -161,7 +161,10 @@ int main(int argc, char *argv[])
fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", decompDictFile);
IOdictionary* dict = new IOdictionary
// A demand-driven decompositionMethod can have issues finding
// an alternative decomposeParDict location.
IOdictionary* dictPtr = new IOdictionary
(
decompositionModel::selectIO
(
@ -170,18 +173,18 @@ int main(int argc, char *argv[])
"decomposeParDict",
runTime.system(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
decompDictFile
)
);
// The object must have the expected "decomposeParDict" name.
// This also implies that it cannot be changed during the run.
dict->rename("decomposeParDict");
// Store it on the object registry, but to be found it must also
// have the expected "decomposeParDict" name.
runTime.store(dict);
dictPtr->rename("decomposeParDict");
runTime.store(dictPtr);
}
// Determine mesh bounding boxes:

View File

@ -56,15 +56,17 @@ isTest()
#
getNumberOfProcessors()
{
local dict="${1:-system/decomposeParDict}"
# Re-use positional parameters for automatic whitespace elimination
set -- $(foamDictionary -entry numberOfSubdomains -value "${1:-system/decomposeParDict}")
set -- $(foamDictionary -entry numberOfSubdomains -value "$dict" 2>/dev/null)
if [ "$#" -eq 1 ]
then
echo "$1"
else
echo "Error retrieving 'numberOfSubdomains' from decomposeParDict" 1>&2
echo 1
echo "Warning no 'numberOfSubdomains' in '$dict'" 1>&2
echo 1 # serial as fallback
return 1
fi
}

View File

@ -50,8 +50,8 @@
#
#------------------------------------------------------------------------------
set boost_version=boost_1_61_0
set cgal_version=CGAL-4.8
set boost_version=boost_1_62_0
set cgal_version=CGAL-4.9
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
setenv CGAL_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version

View File

@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config.sh/FFTW
# etc/config.csh/FFTW
#
# Description
# Setup file for FFTW include/libraries.
@ -48,7 +48,7 @@
#
#------------------------------------------------------------------------------
set fftw_version=fftw-3.3.4
set fftw_version=fftw-3.3.5
setenv FFTW_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version

View File

@ -35,7 +35,7 @@
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview.csh with a different ParaView_VERSION
# Use other (shipped) paraview with a different ParaView_VERSION
#
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config.csh/paraview`

View File

@ -51,7 +51,7 @@ case SYSTEMOPENMPI:
breaksw
case OPENMPI:
setenv FOAM_MPI openmpi-1.10.2
setenv FOAM_MPI openmpi-1.10.4
# Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/openmpi`
@ -60,6 +60,12 @@ case OPENMPI:
# Tell OpenMPI where to find its install directory
setenv OPAL_PREFIX $MPI_ARCH_PATH
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using OPENMPI:"
echo " OPAL_PREFIX : $OPAL_PREFIX"
echo " FOAM_MPI : $FOAM_MPI"
endif
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddMan $MPI_ARCH_PATH/share/man
@ -111,8 +117,8 @@ case SYSTEMMPI:
case MPICH:
setenv FOAM_MPI mpich2-1.1.1p1
setenv MPI_HOME $WM_THIRD_PARTY_DIR/$FOAM_MPI
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
setenv MPI_HOME $MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin

View File

@ -41,17 +41,17 @@
# If using a central installation not located under ThirdParty, you will
# need to set some environment values directly. For example,
#
# setenv ParaView_DIR /opt/paraview/paraview-5.2.0
# setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-5.2
# setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-5.2
# setenv ParaView_DIR /opt/paraview/paraview-5.0.1
# setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-5.0
# setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-5.0
#
# setenv PATH ${ParaView_DIR}/bin:${PATH}
# setenv LD_LIBRARY_PATH ${ParaView_DIR}/lib/paraview-5.2:${LD_LIBRARY_PATH}
# setenv LD_LIBRARY_PATH ${ParaView_DIR}/lib/paraview-5.0:${LD_LIBRARY_PATH}
# unsetenv ParaView_VERSION # avoid using ThirdParty settings
#
#------------------------------------------------------------------------------
setenv ParaView_VERSION 5.1.2
setenv ParaView_VERSION 5.0.1
setenv ParaView_MAJOR detect # Automatically determine major version
set cmake_version=cmake-system
@ -63,12 +63,11 @@ if ( ! $?ParaView_DIR ) setenv ParaView_DIR
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) setenv PATH $cleaned
# Environment for ThirdParty cmake
unsetenv CMAKE_HOME
# ThirdParty cmake
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
if ( -r $cmake ) then
setenv CMAKE_HOME $cmake
setenv PATH ${CMAKE_HOME}/bin:${PATH}
if ( -r $cmake/bin/cmake ) then
# _foamAddPath not available when foamPV alias is used
setenv PATH $cmake/bin:${PATH}
endif
# Evaluate command-line parameters for ParaView
@ -103,18 +102,17 @@ if ( $?ParaView_VERSION ) then
set pvName=ParaView-$ParaView_VERSION
set pvMajor=paraview-$ParaView_MAJOR
set pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
# Set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $pvSrcDir ) then
# Set paths if binaries are present
if ( -r $ParaView_DIR ) then
set pvLibDir=${ParaView_DIR}/lib/$pvMajor
set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/$pvMajor
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/$pvMajor
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${pvLibDir}:${LD_LIBRARY_PATH}"
# Add in python libraries if required
@ -134,13 +132,18 @@ if ( $?ParaView_VERSION ) then
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
endif
else
if ($?FOAM_VERBOSE && $?prompt) then
echo "No paraview found"
echo " ParaView_DIR : $ParaView_DIR"
endif
unsetenv ParaView_INCLUDE_DIR PV_PLUGIN_PATH
setenv ParaView_DIR # Defined but empty (used by foamPV alias)
endif
endif
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
unsetenv ParaView_VERSION ParaView_MAJOR
unset cleaned cmake cmake_version pvName pvMajor pvLibDir pvPython
unsetenv ParaView_MAJOR ParaView_VERSION
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -119,7 +119,6 @@ unsetenv OPAL_PREFIX
# Unset Ensight/ParaView-related environment variables
unsetenv ENSIGHT9_READER
unsetenv CMAKE_HOME
unsetenv ParaView_DIR
unsetenv ParaView_INCLUDE_DIR
unsetenv ParaView_MAJOR
@ -129,12 +128,15 @@ unsetenv PV_PLUGIN_PATH
#------------------------------------------------------------------------------
# unset other ThirdParty environment variables
unsetenv ADIOS_ARCH_PATH
unsetenv BOOST_ARCH_PATH
unsetenv CCMIO_ARCH_PATH
unsetenv CGAL_ARCH_PATH
unsetenv FFTW_ARCH_PATH
unsetenv GPERFTOOLS_ARCH_PATH
unsetenv GMP_ARCH_PATH
unsetenv MPFR_ARCH_PATH
unsetenv METIS_ARCH_PATH
unsetenv SCOTCH_ARCH_PATH
#------------------------------------------------------------------------------
@ -174,7 +176,6 @@ unalias wm32
unalias wmSP
unalias wmDP
unalias wmRefresh
unalias wmUnset
unalias wmSchedOn
@ -191,6 +192,7 @@ unalias util
unalias tut
unalias run
unalias wmRefresh
unalias foamVersion
unalias foamPV

View File

@ -49,8 +49,8 @@
# - the LD_LIBRARY_PATH is not adjusted.
#------------------------------------------------------------------------------
boost_version=boost_1_61_0
cgal_version=CGAL-4.8
boost_version=boost_1_62_0
cgal_version=CGAL-4.9
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
export CGAL_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version

View File

@ -47,7 +47,7 @@
# - the LD_LIBRARY_PATH is not adjusted.
#------------------------------------------------------------------------------
fftw_version=fftw-3.3.4
fftw_version=fftw-3.3.5
export FFTW_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$fftw_version

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -25,17 +25,54 @@
# etc/config.sh/gperftools
#
# Description
# Setup file for gperftools binaries libraries.
# Setup file for gperftools binaries and libraries.
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#
# If using system-wide installations, use the following settings:
#
# gperftools_version=gperftools-system
#
# If the system gperftools is unusable (eg, too old) and you don't
# have or want a ThirdParty installation:
#
# gperftools_version=gperftools-none
#
# If using a central installation, but not located under ThirdParty:
# - specify gperftools-system
# - provide full paths for GPERFTOOLS_ARCH_PATH
#
# Note
# When _foamAddLib is unset (eg, called from makeGperftools):
# - gperftools_version variable are retained.
# - the LD_LIBRARY_PATH and PATH are not adjusted.
#------------------------------------------------------------------------------
version=svn
gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
gperftools_version=gperftools-2.5
GPERFTOOLS_VERSION=gperftools-$version
GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH
export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH
GPERFTOOLS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$gperftools_version
#------------------------------------------------------------------------------
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using gperftools ($gperftools_version) -> $GPERFTOOLS_ARCH_PATH" 1>&2
fi
if type _foamAddLib > /dev/null 2>&1 # normal sourcing
then
# If GPERFTOOLS_ARCH_PATH does not end with '-system' or '-none',
# it is located within ThirdParty, or a central installation
# outside of ThirdParty and must be added to the lib-path.
ending="${GPERFTOOLS_ARCH_PATH##*-}"
if [ "$ending" != none -a "$ending" != system ]
then
_foamAddLib $GPERFTOOLS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddPath $GPERFTOOLS_ARCH_PATH/bin
fi
unset gperftools_version ending
fi
#------------------------------------------------------------------------------

View File

@ -54,7 +54,7 @@ SYSTEMOPENMPI)
;;
OPENMPI)
export FOAM_MPI=openmpi-1.10.2
export FOAM_MPI=openmpi-1.10.4
# Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
@ -63,6 +63,13 @@ OPENMPI)
# Tell OpenMPI where to find its install directory
export OPAL_PREFIX=$MPI_ARCH_PATH
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using OPENMPI:" 1>&2
echo " OPAL_PREFIX : $OPAL_PREFIX" 1>&2
echo " FOAM_MPI : $FOAM_MPI" 1>&2
fi
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddMan $MPI_ARCH_PATH/share/man
@ -118,8 +125,8 @@ SYSTEMMPI)
MPICH)
export FOAM_MPI=mpich2-1.1.1p1
export MPI_HOME=$WM_THIRD_PARTY_DIR/$FOAM_MPI
export MPI_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
export MPI_HOME=$MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin

View File

@ -41,17 +41,20 @@
# If using a central installation not located under ThirdParty, you will
# need to set some environment values directly. For example,
#
# export ParaView_DIR=/opt/paraview/paraview-5.2.0
# export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-5.2
# export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.2
# export ParaView_DIR=/opt/paraview/paraview-5.0.1
# export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-5.0
# export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.0
#
# export PATH=$ParaView_DIR/bin:$PATH
# export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-5.2:$LD_LIBRARY_PATH
# export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-5.0:$LD_LIBRARY_PATH
# unset ParaView_VERSION # avoid using ThirdParty settings
#
# Note
# When _foamAddLib is unset (eg, called from makeParaView or from foamPV):
# - the ParaView_VERSION variable is retained.
#------------------------------------------------------------------------------
ParaView_VERSION=5.1.2
ParaView_VERSION=5.0.1
ParaView_MAJOR=detect # Automatically determine major version
cmake_version=cmake-system
@ -66,14 +69,12 @@ cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
) \
&& PATH="$cleaned"
# Environment for ThirdParty cmake
unset CMAKE_HOME
# ThirdParty cmake
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
if [ -r $cmake ]
if [ -r $cmake/bin/cmake ]
then
export CMAKE_HOME=$cmake
export CMAKE_ROOT=$cmake
export PATH=$CMAKE_HOME/bin:$PATH
# _foamAddPath not available when foamPV function is used
PATH=$cmake/bin:$PATH
fi
# Evaluate command-line parameters for ParaView
@ -115,19 +116,18 @@ then
pvName=ParaView-$ParaView_VERSION
pvMajor=paraview-$ParaView_MAJOR
pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
# Set paths if binaries or source are present
if [ -r $ParaView_DIR -o -r $pvSrcDir ]
if [ -r $ParaView_DIR ]
then
pvLibDir=$ParaView_DIR/lib/$pvMajor
pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
export PATH=$ParaView_DIR/bin:$PATH
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/$pvMajor
export PV_PLUGIN_PATH=$FOAM_LIBBIN/$pvMajor
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH
# Add in python libraries if required
@ -150,13 +150,24 @@ then
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
fi
else
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "No paraview found"
echo " ParaView_DIR : $ParaView_DIR"
fi
unset ParaView_DIR ParaView_INCLUDE_DIR PV_PLUGIN_PATH
fi
fi
unset -f _foamParaviewEval
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
unset ParaView_VERSION ParaView_MAJOR
unset cleaned cmake cmake_version pvName pvMajor pvLibDir pvPython
unset ParaView_MAJOR
if type _foamAddLib > /dev/null 2>&1 # normal sourcing
then
unset ParaView_VERSION
fi
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -115,7 +115,6 @@ fi
# Unset Ensight/ParaView-related environment variables
unset ENSIGHT9_READER
unset CMAKE_HOME
unset ParaView_DIR
unset ParaView_INCLUDE_DIR
unset ParaView_MAJOR
@ -125,12 +124,15 @@ unset PV_PLUGIN_PATH
#------------------------------------------------------------------------------
# unset other ThirdParty environment variables
unset ADIOS_ARCH_PATH
unset BOOST_ARCH_PATH
unset CCMIO_ARCH_PATH
unset CGAL_ARCH_PATH
unset FFTW_ARCH_PATH
unset GPERFTOOLS_ARCH_PATH
unset GMP_ARCH_PATH
unset MPFR_ARCH_PATH
unset METIS_ARCH_PATH
unset SCOTCH_ARCH_PATH
#------------------------------------------------------------------------------

View File

@ -76,8 +76,6 @@ template<class T> class IndirectList;
template<class T> class UIndirectList;
template<class T> class BiIndirectList;
typedef UList<label> unallocLabelList;
/*---------------------------------------------------------------------------*\
Class List Declaration
\*---------------------------------------------------------------------------*/

View File

@ -77,7 +77,8 @@ Foam::functionObjects::timeControl::timeControl
),
executeControl_(t, dict, "execute"),
writeControl_(t, dict, "write"),
foPtr_(functionObject::New(name, t, dict_))
foPtr_(functionObject::New(name, t, dict_)),
executeTimeIndex_(-1)
{
readControls();
}
@ -89,6 +90,7 @@ bool Foam::functionObjects::timeControl::execute()
{
if (active() && (postProcess || executeControl_.execute()))
{
executeTimeIndex_ = time_.timeIndex();
foPtr_->execute();
}
@ -100,6 +102,13 @@ bool Foam::functionObjects::timeControl::write()
{
if (active() && (postProcess || writeControl_.execute()))
{
// Ensure written results reflect the current state
if (executeTimeIndex_ != time_.timeIndex())
{
executeTimeIndex_ = time_.timeIndex();
foPtr_->execute();
}
foPtr_->write();
}

View File

@ -99,6 +99,9 @@ class timeControl
//- The functionObject to execute
autoPtr<functionObject> foPtr_;
//- Time index of the last execute call
label executeTimeIndex_;
// Private Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -169,6 +169,18 @@ Foam::dimensioned<Type>::dimensioned
{}
template<class Type>
Foam::dimensioned<Type>::dimensioned
(
const dimensionSet& dimSet
)
:
name_("0"),
dimensions_(dimSet),
value_(Zero)
{}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
template<class Type>

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -117,9 +117,12 @@ public:
//- Construct from dictionary lookup with a given name and dimensions
dimensioned(const word&, const dimensionSet&, const dictionary&);
//- Null constructor
//- Null constructor - a dimensionless Zero, named "undefined"
dimensioned();
//- A dimensioned Zero, named "0"
explicit dimensioned(const dimensionSet&);
// Static member functions

View File

@ -202,7 +202,7 @@ void Foam::LduMatrix<Type, DType, LUType>::sumA
{
if (interfaces_.set(patchi))
{
const unallocLabelList& pa = lduAddr().patchAddr(patchi);
const labelUList& pa = lduAddr().patchAddr(patchi);
const Field<LUType>& pCoeffs = interfacesUpper_[patchi];
forAll(pa, face)

View File

@ -34,8 +34,8 @@ void Foam::LduMatrix<Type, DType, LUType>::sumDiag()
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
Field<DType>& Diag = diag();
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
const labelUList& l = lduAddr().lowerAddr();
const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<l.size(); face++)
{
@ -52,8 +52,8 @@ void Foam::LduMatrix<Type, DType, LUType>::negSumDiag()
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
Field<DType>& Diag = diag();
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
const labelUList& l = lduAddr().lowerAddr();
const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<l.size(); face++)
{
@ -72,8 +72,8 @@ void Foam::LduMatrix<Type, DType, LUType>::sumMagOffDiag
const Field<LUType>& Lower = const_cast<const LduMatrix&>(*this).lower();
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
const labelUList& l = lduAddr().lowerAddr();
const labelUList& u = lduAddr().upperAddr();
for (label face = 0; face < l.size(); face++)
{
@ -135,9 +135,9 @@ Foam::LduMatrix<Type, DType, LUType>::faceH(const Field<Type>& psi) const
const Field<LUType>& Lower = const_cast<const LduMatrix&>(*this).lower();
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
// Take refereces to addressing
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
// Take references to addressing
const labelUList& l = lduAddr().lowerAddr();
const labelUList& u = lduAddr().upperAddr();
tmp<Field<Type>> tfaceHpsi(new Field<Type> (Lower.size()));
Field<Type> & faceHpsi = tfaceHpsi();
@ -413,8 +413,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator*=
Field<LUType>& upper = this->upper();
Field<LUType>& lower = this->lower();
const unallocLabelList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr();
const labelUList& l = lduAddr().lowerAddr();
const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<upper.size(); face++)
{

View File

@ -41,7 +41,7 @@ Foam::surfZoneIdentifier::surfZoneIdentifier()
{}
Foam::surfZoneIdentifier::surfZoneIdentifier(label index)
Foam::surfZoneIdentifier::surfZoneIdentifier(const label index)
:
name_(),
index_(index),

View File

@ -86,10 +86,7 @@ public:
surfZoneIdentifier();
//- Construct null with specified index
explicit surfZoneIdentifier
(
const label index
);
explicit surfZoneIdentifier(const label index);
//- Construct from components
surfZoneIdentifier

View File

@ -113,9 +113,6 @@ protected:
//- Build primitive patch
void calcFaceZonePatch() const;
//- Return map of local face indices
const Map<label>& faceLookupMap() const;
//- Calculate master and slave face layer
void calcCellLayers() const;

View File

@ -204,7 +204,8 @@ Foam::Function1Types::CSV<Type>::CSV
(
const word& entryName,
const dictionary& dict,
const word& ext
const word& ext,
const fileName& fName
)
:
TableBase<Type>(entryName, dict.subDict(entryName + ext)),
@ -214,7 +215,7 @@ Foam::Function1Types::CSV<Type>::CSV
componentColumns_(coeffs_.lookup("componentColumns")),
separator_(coeffs_.lookupOrDefault<string>("separator", string(","))[0]),
mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))),
fName_(coeffs_.lookup("fileName"))
fName_(fName != fileName::null ? fName : coeffs_.lookup("fileName"))
{
if (componentColumns_.size() != pTraits<Type>::nComponents)
{

View File

@ -122,7 +122,8 @@ public:
(
const word& entryName,
const dictionary& dict,
const word& ext = "Coeffs"
const word& ext = "Coeffs",
const fileName& fName = fileName::null
);
//- Copy constructor

View File

@ -74,7 +74,7 @@ outletMappedUniformInletHeatAdditionFvPatchField
)
:
fixedValueFvPatchScalarField(p, iF, dict),
outletPatchName_(dict.lookup("outletPatchName")),
outletPatchName_(dict.lookup("outletPatch")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
Q_(readScalar(dict.lookup("Q"))),
minTempLimit_(dict.lookupOrDefault<scalar>("minTempLimit", 0)),
@ -167,8 +167,7 @@ void Foam::outletMappedUniformInletHeatAdditionFvPatchField::updateCoeffs()
scalar averageOutletField =
gSum(outletPatchPhi*outletPatchField)/sumOutletPatchPhi;
const scalarField Cpf =
thermo.Cp()().boundaryField()[outletPatchID];
const scalarField Cpf(thermo.Cp()().boundaryField()[outletPatchID]);
scalar totalPhiCp = gSum(outletPatchPhi)*gAverage(Cpf);
@ -198,11 +197,13 @@ void Foam::outletMappedUniformInletHeatAdditionFvPatchField::updateCoeffs()
}
void Foam::outletMappedUniformInletHeatAdditionFvPatchField::
write(Ostream& os) const
void Foam::outletMappedUniformInletHeatAdditionFvPatchField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
os.writeKeyword("outletPatchName")
os.writeKeyword("outletPatch")
<< outletPatchName_ << token::END_STATEMENT << nl;
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
@ -216,6 +217,7 @@ write(Ostream& os) const
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam

View File

@ -28,6 +28,7 @@ Group
grpInletBoundaryConditions
Description
This temperature boundary condition averages the temperature over the
"outlet" patch specified by name "outletPatchName" and applies an extra
heat source. This is set as a uniform temperature value on this patch.
@ -37,7 +38,7 @@ Description
\table
Property | Description | Required | Default value
outletPatchName | name of outlet patch | yes |
outletPatch | name of outlet patch | yes |
Q | Heat addition | yes
phi | flux field name | no | phi
minTempLimit | min temperature limit | no | 0.0
@ -49,7 +50,7 @@ Description
myPatch
{
type outletMappedUniformInletHeatAddition;
outletPatchName aPatch;
outletPatch aPatch;
Q 10; // Heat addition in W
phi phi;
value uniform 0;
@ -100,6 +101,7 @@ class outletMappedUniformInletHeatAdditionFvPatchField
//- Maxmum Temperature Limit
scalar maxTempLimit_;
public:
//- Runtime type information

View File

@ -15,8 +15,13 @@ if [ "$WM_LABEL_SIZE" = 64 ]
then
# The libccmio uses int32_t.
# The OpenFOAM adapter thus requires additional work for 64-bit labels.
echo "Skipping optional component libccm"
echo "Skipping optional 'libccm' adapter component"
echo " does not support 64-bit labels"
elif [ "$WM_PRECISION_OPTION" = SP ]
then
# The OpenFOAM adapter was originally only designed for 'double'
echo "Skipping optional 'libccm' adapter component"
echo " was not originally designed for 'single precision' values"
elif [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
then

View File

@ -258,9 +258,9 @@ void Foam::ensightMesh::correct()
Foam::sort(selectZones);
// Count face types in each selected faceZone
forAll(selectZones, zoneI)
forAll(selectZones, zonei)
{
const word& zoneName = selectZones[zoneI];
const word& zoneName = selectZones[zonei];
const label zoneID = mesh_.faceZones().findZoneID(zoneName);
const faceZone& fz = mesh_.faceZones()[zoneID];
@ -342,12 +342,12 @@ void Foam::ensightMesh::write(ensightGeoFile& os) const
(
pp.meshPoints(),
pp.meshPointMap(),
pointToGlobal,
uniqueMeshPointLabels
pointToGlobal, // local patch point to unique global index
uniqueMeshPointLabels // unique global points
);
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
// Renumber the patch faces
// Renumber the patch faces,
// from local patch indexing to unique global index
faceList patchFaces(pp.localFaces());
forAll(patchFaces, i)
{
@ -359,7 +359,7 @@ void Foam::ensightMesh::write(ensightGeoFile& os) const
ensFaces.index(),
patchName,
globalPointsPtr().size(),
uniquePoints,
pointField(mesh_.points(), uniqueMeshPointLabels),
os
);
@ -391,30 +391,28 @@ void Foam::ensightMesh::write(ensightGeoFile& os) const
uniqueMeshPointLabels
);
pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
primitiveFacePatch facePatch
// Make a copy in the proper order
primitiveFacePatch pp
(
faceList(mesh_.faces(), ensFaces.faceIds()),
mesh_.points()
);
const boolList& flip = ensFaces.flipMap();
forAll(facePatch[faceI], faceI)
forAll(pp, facei)
{
if (flip[faceI])
if (flip[facei])
{
facePatch[faceI].flip();
pp[facei].flip();
}
}
// Faces belonging to the faceZone, in local numbering
faceList localFaces(facePatch.localFaces());
// Renumber the faceZone master faces
forAll(localFaces, i)
// Renumber the faces belonging to the faceZone,
// from local numbering to unique global index
faceList patchFaces(pp.localFaces());
forAll(patchFaces, i)
{
inplaceRenumber(pointToGlobal, localFaces[i]);
inplaceRenumber(pointToGlobal, patchFaces[i]);
}
writeAllPoints
@ -422,11 +420,11 @@ void Foam::ensightMesh::write(ensightGeoFile& os) const
ensFaces.index(),
zoneName,
globalPointsPtr().size(),
uniquePoints,
pointField(mesh_.points(), uniqueMeshPointLabels),
os
);
writeFaceConnectivity(ensFaces, localFaces, os, true);
writeFaceConnectivity(ensFaces, patchFaces, os, true);
}
}

View File

@ -55,27 +55,42 @@ class ensightOutput
{
// Private Methods
template<class Type>
static void writeField
//- Write field content (component-wise) for the given ensight element type
template<template<typename> class FieldContainer, class Type>
static void writeFieldContent
(
const char* key,
const FieldContainer<Type>& fld,
ensightFile& os
);
//- Write a field of faces values as an indirect list,
// using the face ids from ensightFaces
template<class Type>
static bool writeFaceField
(
const Field<Type>& fld,
const ensightFaces&,
ensightFile& os
);
//- Write a field of faces values as a sublist,
// using the sublist sizes ensightFaces
template<class Type>
static bool writePatchField
static bool writeFaceSubField
(
const Field<Type>& pf,
const ensightFaces& ensFaces,
const Field<Type>& fld,
const ensightFaces&,
ensightFile& os
);
//- Write a field of cell values as an indirect list,
// using the cell ids from ensightCells
template<class Type>
static bool writeVolField
static bool writeCellField
(
const Field<Type>& vf,
const ensightCells& ensCells,
const Field<Type>& fld,
const ensightCells&,
ensightFile& os,
const bool deprecatedOrder = false
);

View File

@ -41,11 +41,11 @@ License
// * * * * * * * * * * Static Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::ensightOutput::writeField
template<template<typename> class FieldContainer, class Type>
void Foam::ensightOutput::writeFieldContent
(
const char* key,
const Field<Type>& fld,
const FieldContainer<Type>& fld,
ensightFile& os
)
{
@ -85,7 +85,7 @@ void Foam::ensightOutput::writeField
template<class Type>
bool Foam::ensightOutput::writePatchField
bool Foam::ensightOutput::writeFaceField
(
const Field<Type>& pf,
const ensightFaces& ensFaces,
@ -99,14 +99,11 @@ bool Foam::ensightOutput::writePatchField
os.beginPart(ensFaces.index());
}
const List<ensightFaces::elemType> enums =
ensightFaces::elemEnum.enums();
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType& what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeField
writeFieldContent
(
ensightFaces::key(what),
Field<Type>(pf, ensFaces.faceIds(what)),
@ -124,7 +121,47 @@ bool Foam::ensightOutput::writePatchField
template<class Type>
bool Foam::ensightOutput::writeVolField
bool Foam::ensightOutput::writeFaceSubField
(
const Field<Type>& pf,
const ensightFaces& ensFaces,
Foam::ensightFile& os
)
{
if (ensFaces.total())
{
if (Pstream::master())
{
os.beginPart(ensFaces.index());
}
label start = 0; // start of sublist
for (label typei = 0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = ensightFaces::elemType(typei);
const label size = ensFaces.faceIds(what).size();
writeFieldContent
(
ensightFaces::key(what),
SubField<Type>(pf, size, start),
os
);
start += size; // start of next sublist
}
return true;
}
else
{
return false;
}
}
template<class Type>
bool Foam::ensightOutput::writeCellField
(
const Field<Type>& vf,
const ensightCells& ensCells,
@ -151,34 +188,30 @@ bool Foam::ensightOutput::writeVolField
ensightCells::NFACED
};
for (int i=0; i < 5; ++i)
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const ensightCells::elemType& what = oldOrder[i];
const ensightCells::elemType& what = oldOrder[typei];
writeField
writeFieldContent
(
ensightCells::key(what),
Field<Type>(vf, ensCells.cellIds(what)),
os
);
}
return true;
}
else
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const List<ensightCells::elemType> enums =
ensightCells::elemEnum.enums();
const ensightCells::elemType what = ensightCells::elemType(typei);
forAllConstIter(List<ensightCells::elemType>, enums, iter)
{
const ensightCells::elemType& what = *iter;
writeField
(
ensightCells::key(what),
Field<Type>(vf, ensCells.cellIds(what)),
os
);
}
writeFieldContent
(
ensightCells::key(what),
Field<Type>(vf, ensCells.cellIds(what)),
os
);
}
return true;
@ -209,7 +242,7 @@ bool Foam::ensightOutput::writeField
//
if (ensMesh.useInternalMesh())
{
writeVolField(vf, meshCells, os, ensMesh.deprecatedOrder());
writeCellField(vf, meshCells, os, ensMesh.deprecatedOrder());
}
//
@ -223,7 +256,7 @@ bool Foam::ensightOutput::writeField
const word& patchName = patchLookup[listi];
const ensightFaces& ensFaces = patchFaces[patchName];
writePatchField
writeFaceField
(
vf.boundaryField()[patchId],
ensFaces,
@ -303,7 +336,9 @@ bool Foam::ensightOutput::writeField
);
}
writePatchField(values, ensFaces, os);
// The field is already copied in the proper order
// - just need its corresponding sub-fields
writeFaceSubField(values, ensFaces, os);
}
}
@ -335,7 +370,7 @@ bool Foam::ensightOutput::ensightPointField
os.beginPart(0); // 0 = internalMesh
}
writeField
writeFieldContent
(
"coordinates",
Field<Type>(pf.internalField(), ensMesh.uniquePointMap()),
@ -373,7 +408,7 @@ bool Foam::ensightOutput::ensightPointField
os.beginPart(ensFaces.index());
}
writeField
writeFieldContent
(
"coordinates",
Field<Type>(pf.internalField(), uniqueMeshPointLabels),
@ -417,7 +452,7 @@ bool Foam::ensightOutput::ensightPointField
os.beginPart(ensFaces.index());
}
writeField
writeFieldContent
(
"coordinates",
Field<Type>(pf.internalField(), uniqueMeshPointLabels),

View File

@ -55,12 +55,12 @@ class ensightSerialOutput
{
// Private Methods
//- Write field component-wise
template<class Type>
static void writeField
//- Write field content (component-wise) for the given ensight element type
template<template<typename> class FieldContainer, class Type>
static void writeFieldContent
(
const word& key,
const Field<Type>& field,
const FieldContainer<Type>& fld,
ensightFile& os
);

View File

@ -31,11 +31,11 @@ License
// * * * * * * * * * * Static Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::ensightSerialOutput::writeField
template<template<typename> class FieldContainer, class Type>
void Foam::ensightSerialOutput::writeFieldContent
(
const word& key,
const Field<Type>& fld,
const FieldContainer<Type>& fld,
ensightFile& os
)
{
@ -82,14 +82,11 @@ bool Foam::ensightSerialOutput::writeField
{
os.beginPart(part.index());
const List<ensightFaces::elemType> enums =
ensightFaces::elemEnum.enums();
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
for (label typei=0; typei < ensightFaces::nTypes; ++typei)
{
const ensightFaces::elemType what = *iter;
const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeField
writeFieldContent
(
ensightFaces::key(what),
Field<Type>(fld, part.faceIds(what)),
@ -115,14 +112,11 @@ bool Foam::ensightSerialOutput::writeField
{
os.beginPart(part.index());
const List<ensightCells::elemType> enums =
ensightCells::elemEnum.enums();
forAllConstIter(List<ensightCells::elemType>, enums, iter)
for (label typei=0; typei < ensightCells::nTypes; ++typei)
{
const ensightCells::elemType what = *iter;
const ensightCells::elemType what = ensightCells::elemType(typei);
writeField
writeFieldContent
(
ensightCells::key(what),
Field<Type>(fld, part.cellIds(what)),

View File

@ -48,10 +48,10 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
labelList& usedPoints = ptList.list;
label nPoints = 0;
// add all points from faces
// Add all points from faces
const labelUList& idList = this->faceIds();
// add all points from faces
// Add all points from faces
forAll(idList, i)
{
const label id = idList[i] + start_;
@ -67,7 +67,7 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
}
// this is not absolutely necessary, but renumber anyhow
// This is not absolutely necessary, but renumber anyhow
nPoints = 0;
forAll(usedPoints, ptI)
{
@ -101,7 +101,7 @@ Foam::ensightPartFaces::ensightPartFaces
points_(points),
contiguousPoints_(contiguousPoints)
{
// classify the face shapes
// Classify the face shapes
classify(faces);
}
@ -121,7 +121,7 @@ Foam::ensightPartFaces::ensightPartFaces
points_(mesh.points()),
contiguousPoints_(false)
{
// classify the face shapes
// Classify the face shapes
classify(patch);
}
@ -149,10 +149,10 @@ void Foam::ensightPartFaces::writeConnectivity
os.write(idList.size());
os.newline();
// write (polygon) face sizes
// Write (polygon) face sizes
if (key == "nsided")
{
// write the number of points per face
// Write the number of points per face
forAll(idList, i)
{
const label id = idList[i] + start_;
@ -163,13 +163,13 @@ void Foam::ensightPartFaces::writeConnectivity
}
}
// write the points describing the face
// Write the points describing the face
forAll(idList, i)
{
const label id = idList[i] + start_;
const face& f = faces[id];
// convert global -> local index
// Convert global -> local index
// (note: Ensight indices start with 1)
forAll(f, fp)
{
@ -205,7 +205,7 @@ void Foam::ensightPartFaces::write
const pointField& points
) const
{
if (ensightPart::size())
if (size())
{
const localPoints ptList = calcLocalPoints();
const labelUList& pointMap = ptList.list;

View File

@ -138,44 +138,43 @@ public:
// Member Functions
// Access
// Access
//- Part index (0-based)
virtual label index() const
{
return ensightFaces::index();
}
//- Part index (0-based)
virtual label index() const
{
return ensightFaces::index();
}
//- Number of elements in this part
virtual label size() const
{
return ensightFaces::size();
}
//- Number of elements in this part
virtual label size() const
{
return ensightFaces::size();
}
//- Return the patch index, -1 when not in use.
inline label patchIndex() const
{
return patchIndex_;
}
//- Return the patch index, -1 when not in use.
inline label patchIndex() const
{
return patchIndex_;
}
// Output
// Output
//- Write summary information about the object
virtual void writeSummary(Ostream&) const;
//- Write summary information about the object
virtual void writeSummary(Ostream&) const;
//- Write geometry
virtual void write(ensightGeoFile&) const;
//- Write geometry
virtual void write(ensightGeoFile&) const;
//- Helper: write geometry given the pointField
virtual void write(ensightGeoFile&, const pointField&) const;
//- Helper: write geometry given the pointField
virtual void write(ensightGeoFile&, const pointField&) const;
//- Print various types of debugging information
virtual void dumpInfo(Ostream&) const;
//- Print various types of debugging information
virtual void dumpInfo(Ostream&) const;
};

View File

@ -191,10 +191,7 @@ void Foam::ensightCells::sort()
{
forAll(lists_, typeI)
{
if (lists_[typeI])
{
Foam::sort(*(lists_[typeI]));
}
Foam::sort(*(lists_[typeI]));
}
}

View File

@ -233,28 +233,25 @@ void Foam::ensightFaces::sort()
{
if (flipMap_.size() == address_.size())
{
// sort flip too
// sort flip map too
labelList order;
label start = 0;
forAll(lists_, typeI)
{
if (lists_[typeI])
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
if (sz)
{
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
SubList<bool> flip(flipMap_, sz, start);
start += sz; // for next sub-list
if (sz)
{
SubList<bool> flip(flipMap_, sz, start);
start += sz; // for next sub-list
Foam::sortedOrder(idLst, order);
sortedOrder(idLst, order);
idLst = reorder<labelList>(order, idLst);
flip = reorder<boolList>(order, flip);
}
idLst = reorder<labelList>(order, idLst);
flip = reorder<boolList>(order, flip);
}
}
}
@ -263,16 +260,9 @@ void Foam::ensightFaces::sort()
// no flip-maps, simpler to sort
forAll(lists_, typeI)
{
if (lists_[typeI])
{
SubList<label>& idLst = *(lists_[typeI]);
const label sz = idLst.size();
if (sz)
{
Foam::sort(idLst);
}
}
Foam::sort(*(lists_[typeI]));
}
flipMap_.clear(); // for safety
}
}

View File

@ -132,83 +132,82 @@ public:
// Member Functions
// Access
// Access
//- The index in a list.
inline label index() const;
//- The index in a list.
inline label index() const;
//- The index in a list, non-const access.
inline label& index();
//- The index in a list, non-const access.
inline label& index();
//- The processor local size of all elements.
inline label size() const;
//- The processor local size of all elements.
inline label size() const;
//- The global number of the specified element type.
// This value is only meaningful after a reduce operation.
inline label total(const enum elemType) const;
//- The global number of the specified element type.
// This value is only meaningful after a reduce operation.
inline label total(const enum elemType) const;
//- The global number of all element types.
// This value is only meaningful after a reduce operation.
label total() const;
//- The global number of all element types.
// This value is only meaningful after a reduce operation.
label total() const;
//- The processor local sizes per element type.
FixedList<label, 3> sizes() const;
//- The processor local sizes per element type.
FixedList<label, 3> sizes() const;
//- The global numbers per element type.
// This value is only meaningful after a reduce operation.
const FixedList<label, 3>& totals() const;
//- The global numbers per element type.
// This value is only meaningful after a reduce operation.
const FixedList<label, 3>& totals() const;
//- Return the (local) face ids of the specified element type
inline const labelUList& faceIds(const enum elemType) const;
//- Return the (local) face ids of the specified element type
inline const labelUList& faceIds(const enum elemType) const;
//- Return the face ids of all elements
inline const labelUList& faceIds() const;
//- Return the face ids of all elements
inline const labelUList& faceIds() const;
//- Return the flip-map of all elements
inline const boolList& flipMap() const;
//- Return the flip-map of all elements
inline const boolList& flipMap() const;
//- Starting offset of element type.
label offset(const enum elemType what) const;
//- Starting offset of element type.
label offset(const enum elemType what) const;
// Edit
// Edit
//- Classify the face types, set element list.
void classify(const faceList& faces);
//- Classify the face types, set element list.
void classify(const faceList& faces);
//- Classify the face types, set element list.
// The indirect addressing can be used when classifying groups of
// face (eg, from a faceZone etc) with an optional flipMap.
// The optional exclude marker can be used to skip faces on particular
// boundary types or regions.
void classify
(
const faceList& faces,
const labelUList& addressing,
const boolList& flipMap = boolList(),
const PackedBoolList& exclude = PackedBoolList()
);
//- Classify the face types, set element list.
// The indirect addressing can be used when classifying groups of
// face (eg, from a faceZone etc) with an optional flipMap.
// The optional exclude marker can be used to skip faces on particular
// boundary types or regions.
void classify
(
const faceList& faces,
const labelUList& addressing,
const boolList& flipMap = boolList(),
const PackedBoolList& exclude = PackedBoolList()
);
//- Set addressable sizes to zero, free up addressing memory.
void clear();
//- Set addressable sizes to zero, free up addressing memory.
void clear();
//- Sum element counts across all processes.
void reduce();
//- Sum element counts across all processes.
void reduce();
//- Sort element lists numerically.
void sort();
//- Sort element lists numerically.
void sort();
// Member operators
//- Return element from linear-list.
inline label operator[](const label i) const;
};

View File

@ -230,7 +230,7 @@ void Foam::fileFormats::STARCDCore::writePoints
(
Ostream& os,
const pointField& points,
const double scaleFactor
const scalar scaleFactor
)
{
writeHeader(os, HEADER_VRT);

View File

@ -116,7 +116,7 @@ Foam::foamVtkFormatter::openTag(const word& tag)
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::closeTag(bool isEmpty)
Foam::foamVtkFormatter::closeTag(const bool isEmpty)
{
if (!inTag_)
{
@ -207,20 +207,23 @@ Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttr
(
const word& k,
const label v,
const int32_t v,
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
return xmlAttribute(k, v, quote);
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttr
(
const word& k,
const int64_t v,
const char quote
)
{
return xmlAttribute(k, v, quote);
}
@ -232,16 +235,7 @@ Foam::foamVtkFormatter::xmlAttr
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
return xmlAttribute(k, v, quote);
}
@ -253,16 +247,7 @@ Foam::foamVtkFormatter::xmlAttr
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
return xmlAttribute(k, v, quote);
}
@ -283,7 +268,18 @@ Foam::foamVtkFormatter&
Foam::foamVtkFormatter::operator()
(
const word& k,
const label v
const int32_t v
)
{
return xmlAttr(k, v);
}
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::operator()
(
const word& k,
const int64_t v
)
{
return xmlAttr(k, v);

View File

@ -70,6 +70,16 @@ class foamVtkFormatter
mutable bool inTag_;
//- Write XML attribute
template<class Type>
foamVtkFormatter& xmlAttribute
(
const word&,
const Type&,
const char quote
);
protected:
// Protected Member Functions
@ -113,9 +123,9 @@ public:
virtual void writeSize(const uint64_t) = 0;
virtual void write(const uint8_t) = 0;
virtual void write(const label) = 0;
virtual void write(const float) = 0;
virtual void write(const double) = 0;
virtual void write(const label) = 0;
virtual void write(const float) = 0;
virtual void write(const double) = 0;
virtual void flush() = 0;
@ -136,7 +146,7 @@ public:
//- Close XML tag, optional as an empty container.
// Always adds a trailing newline.
foamVtkFormatter& closeTag(bool isEmpty = false);
foamVtkFormatter& closeTag(const bool isEmpty = false);
//- End XML tag, optional with sanity check
// Always adds a trailing newline.
@ -164,21 +174,28 @@ public:
}
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const std::string&,
const char quote='\''
const char quote = '\''
);
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const label,
const char quote='\''
const int32_t,
const char quote = '\''
);
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const int64_t,
const char quote = '\''
);
//- Write XML attribute
@ -186,7 +203,7 @@ public:
(
const word&,
const uint64_t,
const char quote='\''
const char quote = '\''
);
//- Write XML attribute
@ -194,7 +211,7 @@ public:
(
const word&,
const scalar,
const char quote='\''
const char quote = '\''
);
@ -205,7 +222,10 @@ public:
foamVtkFormatter& operator()(const word&, const std::string&);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const label);
foamVtkFormatter& operator()(const word&, const int32_t);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const int64_t);
//- Write XML attribute
foamVtkFormatter& operator()(const word&, const uint64_t);

View File

@ -26,6 +26,28 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::foamVtkFormatter&
Foam::foamVtkFormatter::xmlAttribute
(
const word& k,
const Type& v,
const char quote
)
{
if (!inTag_)
{
WarningInFunction
<< "xml attribute '" << k << "' but not within a tag!"
<< endl;
}
os_ << ' ' << k << '=' << quote << v << quote;
return *this;
}
template<class Type, int nComp>
Foam::foamVtkFormatter& Foam::foamVtkFormatter::openDataArray
(

View File

@ -77,8 +77,9 @@ void Foam::foamVtkLegacyFormatter::writeSize(const uint64_t)
void Foam::foamVtkLegacyFormatter::write(const uint8_t val)
{
// Can only handle integers
int copy(val);
// Legacy can only handle 32-bit integers.
// Nonetheless promote to 'label' (32 or 64 bit) and deal with it later
label copy(val);
write(copy);
}

View File

@ -29,13 +29,13 @@ Group
Description
This boundary conditon averages the field over the "outlet" patch specified
by name "outletPatchName" and applies this as the uniform value of the
by name "outletPatch" and applies this as the uniform value of the
field over this patch.
Usage
\table
Property | Description | Required | Default value
outletPatchName | name of outlet patch | yes |
outletPatch | name of outlet patch | yes |
phi | flux field name | no | phi
\endtable
@ -44,7 +44,7 @@ Usage
<patchName>
{
type outletMappedUniformInlet;
outletPatchName aPatch;
outletPatch aPatch;
phi phi;
value uniform 0;
}

View File

@ -67,18 +67,13 @@ surfaceNormalFixedValueFvPatchVectorField
)
:
fixedValueFvPatchVectorField(p, iF),
refValue_(ptf.refValue_, mapper)
refValue_(ptf.refValue_, mapper, 0.0)
{
// Note: calculate product only on ptf to avoid multiplication on
// unset values in reconstructPar.
fvPatchVectorField::operator=
(
vectorField
(
ptf.refValue_*ptf.patch().nf(),
mapper
)
);
// Note: refValue_ will have default value 0.0 for unmapped faces. This
// can temporarily happen during e.g. redistributePar. We should not
// access ptf.patch() instead since redistributePar has destroyed this
// at the time of mapping.
fvPatchVectorField::operator=(refValue_*patch().nf());
}

View File

@ -1104,9 +1104,9 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::write(Ostream& os) const
fvPatchField<vector>::write(os);
writeEntry("value", os);
os.writeKeyword("delta") << delta_ << token::END_STATEMENT << nl;
writeEntryIfDifferent(os, "d", 1.0, d_);
writeEntryIfDifferent(os, "kappa", 0.41, kappa_);
writeEntryIfDifferent(os, "perturb", 1e-5, perturb_);
writeEntryIfDifferent<scalar>(os, "d", 1.0, d_);
writeEntryIfDifferent<scalar>(os, "kappa", 0.41, kappa_);
writeEntryIfDifferent<scalar>(os, "perturb", 1e-5, perturb_);
writeEntryIfDifferent<label>(os, "nCellPerEddy", 5, nCellPerEddy_);
writeEntryIfDifferent(os, "writeEddies", false, writeEddies_);

View File

@ -113,7 +113,7 @@ bool Foam::functionObjects::DESModelRegions::read(const dictionary& dict)
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
dict.readIfPresent("resultName", resultName_);
dict.readIfPresent("result", resultName_);
return true;
}

View File

@ -112,7 +112,6 @@ Foam::functionObjects::ddt2::ddt2
)
:
fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(),
resultName_(word::null),
blacklist_(),
@ -218,20 +217,12 @@ bool Foam::functionObjects::ddt2::execute()
<< "Unprocessed field " << ignored << endl;
}
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true;
}
bool Foam::functionObjects::ddt2::write()
{
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size())
{
Log << type() << ' ' << name() << " write:" << endl;

View File

@ -101,9 +101,6 @@ class ddt2
{
// Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process
wordReList selectFields_;

View File

@ -623,7 +623,7 @@ bool Foam::functionObjects::fluxSummary::read(const dictionary& dict)
writeFile::read(dict);
mode_ = modeTypeNames_.read(dict.lookup("mode"));
phiName_= dict.lookupOrDefault<word>("phiName", "phi");
phiName_= dict.lookupOrDefault<word>("phi", "phi");
dict.readIfPresent("scaleFactor", scaleFactor_);
dict.readIfPresent("tolerance", tolerance_);

View File

@ -558,7 +558,7 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
//Info<< " using interpolation " << interpolationScheme_ << endl;
cloudName_ = dict.lookupOrDefault<word>("cloudName", type());
cloudName_ = dict.lookupOrDefault<word>("cloud", type());
dict.lookup("seedSampleSet") >> seedSet_;
const dictionary& coeffsDict = dict.subDict(seedSet_ + "Coeffs");

View File

@ -70,7 +70,7 @@ Foam::functionObjects::valueAverage::valueAverage
:
regionFunctionObject(name, runTime, dict),
writeFile(obr_, name, typeName, dict),
functionObjectName_("unknown-functionObjectName"),
functionObjectName_("unknown-functionObject"),
fieldNames_(),
window_(-1),
totalTime_(),
@ -109,7 +109,7 @@ bool Foam::functionObjects::valueAverage::read(const dictionary& dict)
regionFunctionObject::read(dict);
writeFile::read(dict);
dict.lookup("functionObjectName") >> functionObjectName_;
dict.lookup("functionObject") >> functionObjectName_;
dict.lookup("fields") >> fieldNames_;
window_ = dict.lookupOrDefault<scalar>("window", -1);

View File

@ -100,7 +100,6 @@ Foam::functionObjects::zeroGradient::zeroGradient
)
:
fvMeshFunctionObject(name, runTime, dict),
prevTimeIndex_(-1),
selectFields_(),
resultName_(string::null),
results_()
@ -175,20 +174,12 @@ bool Foam::functionObjects::zeroGradient::execute()
<< "Unprocessed field " << ignored << endl;
}
// Update time index
prevTimeIndex_ = obr_.time().timeIndex();
return true;
}
bool Foam::functionObjects::zeroGradient::write()
{
if (prevTimeIndex_ < obr_.time().timeIndex())
{
// Ensure written results reflect the current state
execute();
}
if (results_.size())
{
Log << type() << ' ' << name() << " write:" << endl;

View File

@ -95,9 +95,6 @@ class zeroGradient
{
// Private data
//- Time at last execute, ensures write uses up-to-date values
label prevTimeIndex_;
//- Name of fields to process
wordReList selectFields_;

View File

@ -4,37 +4,58 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions
# The source directory
sourceDir=$PWD
# Where are any generated files stored?
findObjectDir $sourceDir
depDir="$objectsDir"
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
echo
echo "======================================================================"
echo "${PWD##*/} : $PWD"
echo
# CMake into objectsDir,
# with an additional attempt if (possibly incorrect) CMakeCache.txt existed
doCmake()
{
local sourceDir="$1"
findObjectDir $sourceDir # Where are generated files stored?
test -f "$objectsDir/CMakeCache.txt"
retry=$? # CMakeCache.txt exists, but sources may have moved
mkdir -p $objectsDir && \
(
cd $objectsDir || exit 1
cmake $sourceDir || {
if [ $retry -eq 0 ]
then
echo "Removing CMakeCache.txt and attempt again"
rm -f CMakeCache.txt
cmake $sourceDir
else
exit 1
fi
} && make
)
}
if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ]
then
# ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
if type cmake > /dev/null 2>&1
if [ "$targetType" != objects ]
then
(
mkdir -p $depDir \
&& cd $depDir \
&& cmake $sourceDir \
&& make
) || {
echo
echo "WARNING: incomplete build of VTK-based post-processing"
}
else
echo "WARNING: skipped - needs cmake"
if type cmake > /dev/null 2>&1
then
doCmake $PWD || {
echo
echo " WARNING: incomplete build of VTK-based post-processing"
echo
}
else
echo "WARNING: skipped - needs cmake"
fi
fi
else
echo "WARNING: skipped - needs a VTK or a ParaView installation"
@ -45,4 +66,4 @@ fi
echo "======================================================================"
echo
# ----------------------------------------------------------------- end-of-file
# -----------------------------------------------------------------------------

View File

@ -514,7 +514,7 @@ Foam::functionObjects::fieldVisualisationBase::fieldVisualisationBase
:
parent_(parent),
colours_(colours),
fieldName_(dict.lookup("fieldName")),
fieldName_(dict.lookup("field")),
colourBy_(cbColour),
colourMap_(cmRainbow),
range_()

View File

@ -63,9 +63,9 @@ Foam::functionObjects::runTimePostPro::functionObjectCloud::functionObjectCloud
:
pointData(parent, dict, colours),
fieldVisualisationBase(parent, dict, colours),
cloudName_(dict.lookup("cloudName")),
cloudName_(dict.lookup("cloud")),
functionObject_(dict.lookup("functionObject")),
colourFieldName_(dict.lookup("colourFieldName")),
colourFieldName_(dict.lookup("colourField")),
actor_()
{
actor_ = vtkSmartPointer<vtkActor>::New();

View File

@ -296,7 +296,7 @@ bool Foam::functionObjects::scalarTransport::execute()
mesh_.lookupObject<surfaceScalarField>(phiName_)
);
}
else if(UPhiName_ != "none")
else if (UPhiName_ != "none")
{
const volVectorField& Uphi =
mesh_.lookupObject<volVectorField>(UPhiName_);

View File

@ -53,7 +53,7 @@ Foam::functionObjects::runTimeControls::averageCondition::averageCondition
)
:
runTimeCondition(name, obr, dict, state),
functionObjectName_(dict.lookup("functionObjectName")),
functionObjectName_(dict.lookup("functionObject")),
fieldNames_(dict.lookup("fields")),
tolerance_(readScalar(dict.lookup("tolerance"))),
window_(dict.lookupOrDefault<scalar>("window", -1)),

View File

@ -102,7 +102,7 @@ Foam::fv::interRegionOption::interRegionOption
mesh
),
master_(coeffs_.lookupOrDefault<bool>("master", true)),
nbrRegionName_(coeffs_.lookup("nbrRegionName")),
nbrRegionName_(coeffs_.lookup("nbrRegion")),
meshInterpPtr_()
{
if (active())

View File

@ -106,7 +106,7 @@ Foam::fv::acousticDampingSource::acousticDampingSource
zeroGradientFvPatchField<vector>::typeName
)
),
URefName_("unknown-URefName"),
URefName_("unknown-URef"),
x0_(Zero),
r1_(0),
r2_(0),

View File

@ -304,9 +304,9 @@ bool Foam::fv::effectivenessHeatExchangerSource::read(const dictionary& dict)
{
if (cellSetOption::read(dict))
{
UName_ = coeffs_.lookupOrDefault<word>("UName", "U");
TName_ = coeffs_.lookupOrDefault<word>("TName", "T");
phiName_ = coeffs_.lookupOrDefault<word>("phiName", "phi");
UName_ = coeffs_.lookupOrDefault<word>("U", "U");
TName_ = coeffs_.lookupOrDefault<word>("T", "T");
phiName_ = coeffs_.lookupOrDefault<word>("phi", "phi");
coeffs_.lookup("faceZone") >> faceZoneName_;
coeffs_.lookup("secondaryMassFlowRate") >> secondaryMassFlowRate_;

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