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 argList::addOption
( (
"cloudName", "cloud",
"name", "name",
"specify alternative cloud name. default is 'kinematicCloud'" "specify alternative cloud name. default is 'kinematicCloud'"
); );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -62,6 +62,7 @@ protected:
word sourceFieldName_; word sourceFieldName_;
public: public:
//- Runtime type information //- Runtime type information

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; Info<< "End\n" << endl;
return 0; 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[]) int main(int argc, char *argv[])
{ {
argList::validArgs.append("cloudName"); argList::validArgs.append("cloud");
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"

View File

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

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -148,6 +148,15 @@ int main(int argc, char *argv[])
dictPath = dictPath =
runTime.constant() runTime.constant()
/regionPath/polyMesh::meshSubDir/dictName; /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 // Otherwise assume the dictionary is present in the system directory
else else

View File

@ -901,13 +901,15 @@ int main(int argc, char *argv[])
// Read decomposePar dictionary // Read decomposePar dictionary
dictionary decomposeDict; dictionary decomposeDict;
{
if (Pstream::parRun()) if (Pstream::parRun())
{ {
fileName decompDictFile; fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", 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
( (
@ -915,20 +917,27 @@ int main(int argc, char *argv[])
( (
"decomposeParDict", "decomposeParDict",
runTime.system(), runTime.system(),
mesh, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
decompDictFile 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 else
{ {
decomposeDict.add("method", "none"); decomposeDict.add("method", "none");
decomposeDict.add("numberOfSubdomains", 1); decomposeDict.add("numberOfSubdomains", 1);
} }
}
// Debug // Debug

View File

@ -431,7 +431,11 @@ snapControls
// (wip) Optional for explicit feature snapping: // (wip) Optional for explicit feature snapping:
//- Detect baffle edges. Default is true. //- Detect baffle edges. Default is true.
//detectBaffles false; //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; //releasePoints true;
//- Walk along feature edges, adding missing ones. Default is true. //- Walk along feature edges, adding missing ones. Default is true.
//stringFeatures false; //stringFeatures false;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -28,15 +28,31 @@ Group
grpMeshManipulationUtilities grpMeshManipulationUtilities
Description 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. 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 - can only handle pairwise boundary faces. So three faces using
the same points is not handled (is illegal mesh anyway) 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 - surfaces consisting of duplicate faces can be topologically split
if the points on the interior of the surface cannot walk to all the if the points on the interior of the surface cannot walk to all the
cells that use them in one go. cells that use them in one go.
@ -71,6 +87,7 @@ using namespace Foam;
void insertDuplicateMerge void insertDuplicateMerge
( (
const polyMesh& mesh, const polyMesh& mesh,
const labelList& boundaryFaces,
const labelList& duplicates, const labelList& duplicates,
polyTopoChange& meshMod polyTopoChange& meshMod
) )
@ -87,8 +104,8 @@ void insertDuplicateMerge
{ {
// Two duplicate faces. Merge. // Two duplicate faces. Merge.
label face0 = mesh.nInternalFaces() + bFacei; label face0 = boundaryFaces[bFacei];
label face1 = mesh.nInternalFaces() + otherFacei; label face1 = boundaryFaces[otherFacei];
label own0 = faceOwner[face0]; label own0 = faceOwner[face0];
label own1 = faceOwner[face1]; 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) labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
{ {
// Get all duplicate face labels (in boundaryFaces indices!). // Get all duplicate face labels (in boundaryFaces indices!).
@ -173,7 +229,7 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
{ {
if (duplicates[bFacei] != -1) if (duplicates[bFacei] != -1)
{ {
label facei = mesh.nInternalFaces() + bFacei; label facei = boundaryFaces[bFacei];
label patchi = patches.whichPatch(facei); label patchi = patches.whichPatch(facei);
if (isA<processorPolyPatch>(patches[patchi])) if (isA<processorPolyPatch>(patches[patchi]))
@ -205,12 +261,12 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
if (otherFacei != -1 && otherFacei > bFacei) if (otherFacei != -1 && otherFacei > bFacei)
{ {
duplicateSet.insert(mesh.nInternalFaces() + bFacei); duplicateSet.insert(boundaryFaces[bFacei]);
duplicateSet.insert(mesh.nInternalFaces() + otherFacei); duplicateSet.insert(boundaryFaces[otherFacei]);
} }
} }
Pout<< "Writing " << duplicateSet.size() Info<< "Writing " << returnReduce(duplicateSet.size(), sumOp<label>())
<< " duplicate faces to faceSet " << duplicateSet.objectPath() << " duplicate faces to faceSet " << duplicateSet.objectPath()
<< nl << endl; << nl << endl;
duplicateSet.write(); duplicateSet.write();
@ -220,8 +276,6 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
argList::addNote argList::addNote
@ -232,6 +286,7 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H" #include "addOverwriteOption.H"
#include "addRegionOption.H" #include "addRegionOption.H"
#include "addDictOption.H"
argList::addBoolOption argList::addBoolOption
( (
"detectOnly", "detectOnly",
@ -249,25 +304,89 @@ int main(int argc, char *argv[])
#include "createNamedMesh.H" #include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance(); const word oldInstance = mesh.pointsInstance();
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const bool readDict = args.optionFound("dict");
const bool split = args.optionFound("split"); const bool split = args.optionFound("split");
const bool overwrite = args.optionFound("overwrite"); const bool overwrite = args.optionFound("overwrite");
const bool detectOnly = args.optionFound("detectOnly"); const bool detectOnly = args.optionFound("detectOnly");
// Collect all boundary faces if (readDict && (split || detectOnly))
labelList boundaryFaces(mesh.nFaces() - mesh.nInternalFaces());
forAll(boundaryFaces, i)
{ {
boundaryFaces[i] = i+mesh.nInternalFaces(); FatalErrorInFunction
<< "Use of dictionary for settings not compatible with"
<< " using command line arguments for \"split\""
<< " or \"detectOnly\"" << exit(FatalError);
} }
labelList detectPatchIDs;
labelList splitPatchIDs;
labelList mergePatchIDs;
if (readDict)
{
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) if (detectOnly)
{ {
findBaffles(mesh, boundaryFaces);
return 0; return 0;
} }
}
// Read objects in time directory // Read objects in time directory
@ -308,36 +427,21 @@ int main(int argc, char *argv[])
ReadFields(mesh, objects, stFlds); ReadFields(mesh, objects, stFlds);
if (mergePatchIDs.size())
{
Info<< "Merging duplicate faces" << nl << endl;
// Mesh change engine // Mesh change engine
polyTopoChange meshMod(mesh); polyTopoChange meshMod(mesh);
const labelList boundaryFaces(patchFaces(mesh, mergePatchIDs));
if (split) // Get all duplicate face pairs (in boundaryFaces indices!).
{
Pout<< "Topologically splitting duplicate surfaces"
<< ", i.e. duplicating points internal to duplicate surfaces."
<< nl << endl;
// Analyse which points need to be duplicated
localPointRegion regionSide(mesh);
// Point duplication engine
duplicatePoints pointDuplicator(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)); labelList duplicates(findBaffles(mesh, boundaryFaces));
// Merge into internal faces. // Merge into internal faces.
insertDuplicateMerge(mesh, duplicates, meshMod); insertDuplicateMerge(mesh, boundaryFaces, duplicates, meshMod);
}
if (!overwrite) if (!overwrite)
{ {
@ -360,12 +464,81 @@ int main(int argc, char *argv[])
{ {
mesh.setInstance(oldInstance); mesh.setInstance(oldInstance);
} }
Pout<< "Writing mesh to time " << runTime.timeName() << endl; 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, candidates);
// Point duplication engine
duplicatePoints pointDuplicator(mesh);
// Mesh change engine
polyTopoChange meshMod(mesh);
// Insert topo changes
pointDuplicator.setRefinement(regionSide, 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(); mesh.write();
// Dump duplicated points (if any) // Dump duplicated points (if any)
if (split)
{
const labelList& pointMap = map().pointMap(); const labelList& pointMap = map().pointMap();
labelList nDupPerPoint(map().nOldPoints(), 0); 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 " << " duplicated points to pointSet "
<< dupPoints.objectPath() << nl << endl; << 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 \ -lchemistryModel \
-lcoalCombustion \ -lcoalCombustion \
-lcombustionModels \ -lcombustionModels \
-lcompressibleTransportModels \ -lcompressibleEulerianInterfacialModels \
-lcompressibleMultiphaseEulerianInterfacialModels \
-lcompressibleTurbulenceModels \ -lcompressibleTurbulenceModels \
-lconversion \ -lCompressibleTwoPhaseMixtureTurbulenceModels \
-ldecompose \ -lcompressibleTwoPhaseSystem \
-lconformalVoronoiMesh \
-ldecompositionMethods \ -ldecompositionMethods \
-ldistributed \ -ldistributed \
-ldistributionModels \ -ldistributionModels \
@ -35,29 +37,32 @@ EXE_LIBS = \
-lfileFormats \ -lfileFormats \
-lfiniteVolume \ -lfiniteVolume \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lfoamToVTK \
-lforces \ -lforces \
-lfvMotionSolvers \ -lfvMotionSolvers \
-lfvOptions \ -lfvOptions \
-lgenericPatchFields \ -lgenericPatchFields \
-limmiscibleIncompressibleTwoPhaseMixture \ -lhelpTypes \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lincompressibleTurbulenceModels \ -lincompressibleTurbulenceModels \
-linterfaceProperties \ -linterfaceProperties \
-llagrangianFunctionObjects \ -llagrangianFunctionObjects \
-llagrangianIntermediate \ -llagrangianIntermediate \
-llagrangian \
-llagrangianSpray \ -llagrangianSpray \
-llagrangianTurbulence \ -llagrangianTurbulence \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lliquidMixtureProperties \ -lliquidPropertiesFvPatchFields \
-lliquidProperties \ -lliquidProperties \
-lmeshTools \ -lmeshTools \
-lmolecularMeasurements \ -lmultiphaseInterFoam \
-lmolecule \ -lmultiphaseMixtureThermo \
-lmultiphaseReactingTurbulenceModels \
-lmultiphaseSystem \
-lODE \ -lODE \
-lOpenFOAM \ -lOpenFOAM \
-lpairPatchAgglomeration \
-lphaseChangeTwoPhaseMixtures \ -lphaseChangeTwoPhaseMixtures \
-lphaseCompressibleTurbulenceModels \
-lphaseTemperatureChangeTwoPhaseMixtures \
-lpotential \ -lpotential \
-lpyrolysisModels \ -lpyrolysisModels \
-lradiationModels \ -lradiationModels \
@ -68,7 +73,6 @@ EXE_LIBS = \
-lreactingPhaseSystem \ -lreactingPhaseSystem \
-lreactingTwoPhaseSystem \ -lreactingTwoPhaseSystem \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lreconstruct \
-lregionCoupled \ -lregionCoupled \
-lregionCoupling \ -lregionCoupling \
-lregionModels \ -lregionModels \
@ -79,11 +83,9 @@ EXE_LIBS = \
-lsampling \ -lsampling \
-lscotchDecomp \ -lscotchDecomp \
-lsixDoFRigidBodyMotion \ -lsixDoFRigidBodyMotion \
-lSLGThermo \ -lSloanRenumber \
-lsnappyHexMesh \ -lsnappyHexMesh \
-lsolidChemistryModel \ -lsolidChemistryModel \
-lsolidMixtureProperties \
-lsolidParticle \
-lsolidProperties \ -lsolidProperties \
-lsolidSpecie \ -lsolidSpecie \
-lsolidThermo \ -lsolidThermo \
@ -92,13 +94,12 @@ EXE_LIBS = \
-lsurfaceFilmDerivedFvPatchFields \ -lsurfaceFilmDerivedFvPatchFields \
-lsurfaceFilmModels \ -lsurfaceFilmModels \
-lsurfMesh \ -lsurfMesh \
-ltabulatedWallFunctions \
-lthermalBaffleModels \ -lthermalBaffleModels \
-lthermophysicalFunctions \ -lthermophysicalFunctions \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \
-ltriSurface \ -lturbulenceModelSchemes \
-lturbulenceModels \ -lturbulenceModels \
-ltwoPhaseMixture \
-ltwoPhaseMixtureThermo \
-ltwoPhaseProperties \ -ltwoPhaseProperties \
-ltwoPhaseReactingTurbulenceModels \ -ltwoPhaseReactingTurbulenceModels \
-lutilityFunctionObjects -lutilityFunctionObjects

View File

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

View File

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

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions # Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions . $WM_DIR/scripts/wmakeFunctions
set -x #set -x
# deal with client/server vs combined plugins # deal with client/server vs combined plugins
rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null 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 # Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions . $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_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX" [ -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 then
wmake $targetType vtkPVFoam wmake $targetType vtkPVFoam
if [ "$targetType" != "objects" ] if [ "$targetType" != objects ]
then then
sourceDir=$PWD/PVFoamReader doCmake $PWD/PVFoamReader || {
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo echo
echo " WARNING: incomplete build of ParaView OpenFOAM plugin" echo " WARNING: incomplete build of ParaView OpenFOAM plugin"
echo
} }
fi fi
fi fi

View File

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

View File

@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions # Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions . $WM_DIR/scripts/wmakeFunctions
set -x #set -x
# deal with client/server vs combined plugins # deal with client/server vs combined plugins
rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null 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_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX" [ -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 then
wmake $targetType vtkPVblockMesh wmake $targetType vtkPVblockMesh
if [ "$targetType" != "objects" ] if [ "$targetType" != objects ]
then then
sourceDir=$PWD/PVblockMeshReader doCmake $PWD/PVblockMeshReader || {
# Where are any generated files stored?
findObjectDir $sourceDir
(
mkdir -p $objectsDir \
&& cd $objectsDir \
&& cmake $sourceDir \
&& make
) || {
echo echo
echo " WARNING: incomplete build of ParaView BlockMesh plugin" echo " WARNING: incomplete build of ParaView BlockMesh plugin"
echo
} }
fi fi
fi fi

View File

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

View File

@ -1,4 +1,5 @@
EXE_INC = \ EXE_INC = \
${c++LESSWARN} \
-I$(ParaView_INCLUDE_DIR) \ -I$(ParaView_INCLUDE_DIR) \
-I$(ParaView_INCLUDE_DIR)/vtkkwiml -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"))); label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")));

View File

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

View File

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

View File

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

View File

@ -55,6 +55,7 @@ Usage
#include "triangle.H" #include "triangle.H"
#include "triSurface.H" #include "triSurface.H"
#include "triSurfaceSearch.H" #include "triSurfaceSearch.H"
#include "triSurfaceTools.H"
#include "argList.H" #include "argList.H"
#include "OFstream.H" #include "OFstream.H"
#include "OBJstream.H" #include "OBJstream.H"
@ -64,79 +65,6 @@ Usage
using namespace Foam; 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 labelList countBins
( (
const scalar min, const scalar min,
@ -377,14 +305,12 @@ int main(int argc, char *argv[])
const fileName surfFileName = args[1]; const fileName surfFileName = args[1];
const bool checkSelfIntersect = args.optionFound("checkSelfIntersection"); const bool checkSelfIntersect = args.optionFound("checkSelfIntersection");
const bool verbose = args.optionFound("verbose");
const bool splitNonManifold = args.optionFound("splitNonManifold"); const bool splitNonManifold = args.optionFound("splitNonManifold");
label outputThreshold = 10; label outputThreshold = 10;
args.optionReadIfPresent("outputThreshold", outputThreshold); args.optionReadIfPresent("outputThreshold", outputThreshold);
Info<< "Reading surface from " << surfFileName << " ..." << nl << endl; Info<< "Reading surface from " << surfFileName << " ..." << nl << endl;
// Read // Read
// ~~~~ // ~~~~
@ -479,7 +405,7 @@ int main(int argc, char *argv[])
forAll(surf, facei) forAll(surf, facei)
{ {
if (!validTri(verbose, surf, facei)) if (!triSurfaceTools::validTri(surf, facei))
{ {
illegalFaces.append(facei); illegalFaces.append(facei);
} }

View File

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

View File

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

View File

@ -161,7 +161,10 @@ int main(int argc, char *argv[])
fileName decompDictFile; fileName decompDictFile;
args.optionReadIfPresent("decomposeParDict", 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 decompositionModel::selectIO
( (
@ -170,18 +173,18 @@ int main(int argc, char *argv[])
"decomposeParDict", "decomposeParDict",
runTime.system(), runTime.system(),
runTime, runTime,
IOobject::MUST_READ_IF_MODIFIED, IOobject::MUST_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
decompDictFile decompDictFile
) )
); );
// The object must have the expected "decomposeParDict" name. // Store it on the object registry, but to be found it must also
// This also implies that it cannot be changed during the run. // have the expected "decomposeParDict" name.
dict->rename("decomposeParDict");
runTime.store(dict); dictPtr->rename("decomposeParDict");
runTime.store(dictPtr);
} }
// Determine mesh bounding boxes: // Determine mesh bounding boxes:

View File

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

View File

@ -50,8 +50,8 @@
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
set boost_version=boost_1_61_0 set boost_version=boost_1_62_0
set cgal_version=CGAL-4.8 set cgal_version=CGAL-4.9
setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version 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 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/>. # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
# #
# File # File
# etc/config.sh/FFTW # etc/config.csh/FFTW
# #
# Description # Description
# Setup file for FFTW include/libraries. # 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 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` set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config.csh/paraview`

View File

@ -51,7 +51,7 @@ case SYSTEMOPENMPI:
breaksw breaksw
case OPENMPI: case OPENMPI:
setenv FOAM_MPI openmpi-1.10.2 setenv FOAM_MPI openmpi-1.10.4
# Optional configuration tweaks: # Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/openmpi` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/openmpi`
@ -60,6 +60,12 @@ case OPENMPI:
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
setenv OPAL_PREFIX $MPI_ARCH_PATH 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 _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH _foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddMan $MPI_ARCH_PATH/share/man _foamAddMan $MPI_ARCH_PATH/share/man
@ -111,8 +117,8 @@ case SYSTEMMPI:
case MPICH: case MPICH:
setenv FOAM_MPI mpich2-1.1.1p1 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_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
setenv MPI_HOME $MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin

View File

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

View File

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

View File

@ -49,8 +49,8 @@
# - the LD_LIBRARY_PATH is not adjusted. # - the LD_LIBRARY_PATH is not adjusted.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
boost_version=boost_1_61_0 boost_version=boost_1_62_0
cgal_version=CGAL-4.8 cgal_version=CGAL-4.9
export BOOST_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version 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 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. # - 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 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 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
@ -25,17 +25,54 @@
# etc/config.sh/gperftools # etc/config.sh/gperftools
# #
# Description # 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_version=gperftools-2.5
gperftools_install=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER
GPERFTOOLS_VERSION=gperftools-$version GPERFTOOLS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$gperftools_version
GPERFTOOLS_ARCH_PATH=$gperftools_install/$GPERFTOOLS_VERSION
#------------------------------------------------------------------------------
export PATH=$GPERFTOOLS_ARCH_PATH/bin:$PATH if [ "$FOAM_VERBOSE" -a "$PS1" ]
export LD_LIBRARY_PATH=$GPERFTOOLS_ARCH_PATH/lib:$LD_LIBRARY_PATH 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) OPENMPI)
export FOAM_MPI=openmpi-1.10.2 export FOAM_MPI=openmpi-1.10.4
# Optional configuration tweaks: # Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi` _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/openmpi`
@ -63,6 +63,13 @@ OPENMPI)
# Tell OpenMPI where to find its install directory # Tell OpenMPI where to find its install directory
export OPAL_PREFIX=$MPI_ARCH_PATH 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 _foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH _foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddMan $MPI_ARCH_PATH/share/man _foamAddMan $MPI_ARCH_PATH/share/man
@ -118,8 +125,8 @@ SYSTEMMPI)
MPICH) MPICH)
export FOAM_MPI=mpich2-1.1.1p1 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_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
export MPI_HOME=$MPI_ARCH_PATH
_foamAddPath $MPI_ARCH_PATH/bin _foamAddPath $MPI_ARCH_PATH/bin

View File

@ -41,17 +41,20 @@
# If using a central installation not located under ThirdParty, you will # If using a central installation not located under ThirdParty, you will
# need to set some environment values directly. For example, # need to set some environment values directly. For example,
# #
# export ParaView_DIR=/opt/paraview/paraview-5.2.0 # export ParaView_DIR=/opt/paraview/paraview-5.0.1
# export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-5.2 # export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-5.0
# export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.2 # export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.0
# #
# export PATH=$ParaView_DIR/bin:$PATH # 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 # 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 ParaView_MAJOR=detect # Automatically determine major version
cmake_version=cmake-system cmake_version=cmake-system
@ -66,14 +69,12 @@ cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
) \ ) \
&& PATH="$cleaned" && PATH="$cleaned"
# Environment for ThirdParty cmake # ThirdParty cmake
unset CMAKE_HOME
cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
if [ -r $cmake ] if [ -r $cmake/bin/cmake ]
then then
export CMAKE_HOME=$cmake # _foamAddPath not available when foamPV function is used
export CMAKE_ROOT=$cmake PATH=$cmake/bin:$PATH
export PATH=$CMAKE_HOME/bin:$PATH
fi fi
# Evaluate command-line parameters for ParaView # Evaluate command-line parameters for ParaView
@ -115,19 +116,18 @@ then
pvName=ParaView-$ParaView_VERSION pvName=ParaView-$ParaView_VERSION
pvMajor=paraview-$ParaView_MAJOR pvMajor=paraview-$ParaView_MAJOR
pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
# Set paths if binaries or source are present # Set paths if binaries or source are present
if [ -r $ParaView_DIR -o -r $pvSrcDir ] if [ -r $ParaView_DIR ]
then then
pvLibDir=$ParaView_DIR/lib/$pvMajor pvLibDir=$ParaView_DIR/lib/$pvMajor
pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
export PATH=$ParaView_DIR/bin:$PATH
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/$pvMajor export ParaView_INCLUDE_DIR=$ParaView_DIR/include/$pvMajor
export PV_PLUGIN_PATH=$FOAM_LIBBIN/$pvMajor export PV_PLUGIN_PATH=$FOAM_LIBBIN/$pvMajor
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH
# Add in python libraries if required # Add in python libraries if required
@ -150,13 +150,24 @@ then
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH" echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
fi fi
else 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 unset ParaView_DIR ParaView_INCLUDE_DIR PV_PLUGIN_PATH
fi fi
fi fi
unset -f _foamParaviewEval unset -f _foamParaviewEval
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython unset cleaned cmake cmake_version pvName pvMajor pvLibDir pvPython
unset ParaView_VERSION ParaView_MAJOR 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 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM. # This file is part of OpenFOAM.
@ -115,7 +115,6 @@ fi
# Unset Ensight/ParaView-related environment variables # Unset Ensight/ParaView-related environment variables
unset ENSIGHT9_READER unset ENSIGHT9_READER
unset CMAKE_HOME
unset ParaView_DIR unset ParaView_DIR
unset ParaView_INCLUDE_DIR unset ParaView_INCLUDE_DIR
unset ParaView_MAJOR unset ParaView_MAJOR
@ -125,12 +124,15 @@ unset PV_PLUGIN_PATH
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# unset other ThirdParty environment variables # unset other ThirdParty environment variables
unset ADIOS_ARCH_PATH
unset BOOST_ARCH_PATH unset BOOST_ARCH_PATH
unset CCMIO_ARCH_PATH unset CCMIO_ARCH_PATH
unset CGAL_ARCH_PATH unset CGAL_ARCH_PATH
unset FFTW_ARCH_PATH unset FFTW_ARCH_PATH
unset GPERFTOOLS_ARCH_PATH
unset GMP_ARCH_PATH unset GMP_ARCH_PATH
unset MPFR_ARCH_PATH unset MPFR_ARCH_PATH
unset METIS_ARCH_PATH
unset SCOTCH_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 UIndirectList;
template<class T> class BiIndirectList; template<class T> class BiIndirectList;
typedef UList<label> unallocLabelList;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class List Declaration Class List Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

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

View File

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

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. 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 * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
template<class Type> template<class Type>

View File

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

View File

@ -202,7 +202,7 @@ void Foam::LduMatrix<Type, DType, LUType>::sumA
{ {
if (interfaces_.set(patchi)) if (interfaces_.set(patchi))
{ {
const unallocLabelList& pa = lduAddr().patchAddr(patchi); const labelUList& pa = lduAddr().patchAddr(patchi);
const Field<LUType>& pCoeffs = interfacesUpper_[patchi]; const Field<LUType>& pCoeffs = interfacesUpper_[patchi];
forAll(pa, face) 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(); const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
Field<DType>& Diag = diag(); Field<DType>& Diag = diag();
const unallocLabelList& l = lduAddr().lowerAddr(); const labelUList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr(); const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<l.size(); face++) 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(); const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
Field<DType>& Diag = diag(); Field<DType>& Diag = diag();
const unallocLabelList& l = lduAddr().lowerAddr(); const labelUList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr(); const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<l.size(); face++) 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>& Lower = const_cast<const LduMatrix&>(*this).lower();
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper(); const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
const unallocLabelList& l = lduAddr().lowerAddr(); const labelUList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr(); const labelUList& u = lduAddr().upperAddr();
for (label face = 0; face < l.size(); face++) 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>& Lower = const_cast<const LduMatrix&>(*this).lower();
const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper(); const Field<LUType>& Upper = const_cast<const LduMatrix&>(*this).upper();
// Take refereces to addressing // Take references to addressing
const unallocLabelList& l = lduAddr().lowerAddr(); const labelUList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr(); const labelUList& u = lduAddr().upperAddr();
tmp<Field<Type>> tfaceHpsi(new Field<Type> (Lower.size())); tmp<Field<Type>> tfaceHpsi(new Field<Type> (Lower.size()));
Field<Type> & faceHpsi = tfaceHpsi(); Field<Type> & faceHpsi = tfaceHpsi();
@ -413,8 +413,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator*=
Field<LUType>& upper = this->upper(); Field<LUType>& upper = this->upper();
Field<LUType>& lower = this->lower(); Field<LUType>& lower = this->lower();
const unallocLabelList& l = lduAddr().lowerAddr(); const labelUList& l = lduAddr().lowerAddr();
const unallocLabelList& u = lduAddr().upperAddr(); const labelUList& u = lduAddr().upperAddr();
for (label face=0; face<upper.size(); face++) 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_(), name_(),
index_(index), index_(index),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,8 +15,13 @@ if [ "$WM_LABEL_SIZE" = 64 ]
then then
# The libccmio uses int32_t. # The libccmio uses int32_t.
# The OpenFOAM adapter thus requires additional work for 64-bit labels. # 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" 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 \ elif [ -e $CCMIO_ARCH_PATH/include/libccmio/ccmio.h \
-a -e $CCMIO_ARCH_PATH/lib/libccmio.a ] -a -e $CCMIO_ARCH_PATH/lib/libccmio.a ]
then then

View File

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

View File

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

View File

@ -41,11 +41,11 @@ License
// * * * * * * * * * * Static Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * Static Private Member Functions * * * * * * * * * * * //
template<class Type> template<template<typename> class FieldContainer, class Type>
void Foam::ensightOutput::writeField void Foam::ensightOutput::writeFieldContent
( (
const char* key, const char* key,
const Field<Type>& fld, const FieldContainer<Type>& fld,
ensightFile& os ensightFile& os
) )
{ {
@ -85,7 +85,7 @@ void Foam::ensightOutput::writeField
template<class Type> template<class Type>
bool Foam::ensightOutput::writePatchField bool Foam::ensightOutput::writeFaceField
( (
const Field<Type>& pf, const Field<Type>& pf,
const ensightFaces& ensFaces, const ensightFaces& ensFaces,
@ -99,14 +99,11 @@ bool Foam::ensightOutput::writePatchField
os.beginPart(ensFaces.index()); os.beginPart(ensFaces.index());
} }
const List<ensightFaces::elemType> enums = for (label typei=0; typei < ensightFaces::nTypes; ++typei)
ensightFaces::elemEnum.enums();
forAllConstIter(List<ensightFaces::elemType>, enums, iter)
{ {
const ensightFaces::elemType& what = *iter; const ensightFaces::elemType what = ensightFaces::elemType(typei);
writeField writeFieldContent
( (
ensightFaces::key(what), ensightFaces::key(what),
Field<Type>(pf, ensFaces.faceIds(what)), Field<Type>(pf, ensFaces.faceIds(what)),
@ -124,7 +121,47 @@ bool Foam::ensightOutput::writePatchField
template<class Type> 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 Field<Type>& vf,
const ensightCells& ensCells, const ensightCells& ensCells,
@ -151,35 +188,31 @@ bool Foam::ensightOutput::writeVolField
ensightCells::NFACED 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), ensightCells::key(what),
Field<Type>(vf, ensCells.cellIds(what)), Field<Type>(vf, ensCells.cellIds(what)),
os os
); );
} }
return true;
} }
else
{
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), ensightCells::key(what),
Field<Type>(vf, ensCells.cellIds(what)), Field<Type>(vf, ensCells.cellIds(what)),
os os
); );
} }
}
return true; return true;
} }
@ -209,7 +242,7 @@ bool Foam::ensightOutput::writeField
// //
if (ensMesh.useInternalMesh()) 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 word& patchName = patchLookup[listi];
const ensightFaces& ensFaces = patchFaces[patchName]; const ensightFaces& ensFaces = patchFaces[patchName];
writePatchField writeFaceField
( (
vf.boundaryField()[patchId], vf.boundaryField()[patchId],
ensFaces, 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 os.beginPart(0); // 0 = internalMesh
} }
writeField writeFieldContent
( (
"coordinates", "coordinates",
Field<Type>(pf.internalField(), ensMesh.uniquePointMap()), Field<Type>(pf.internalField(), ensMesh.uniquePointMap()),
@ -373,7 +408,7 @@ bool Foam::ensightOutput::ensightPointField
os.beginPart(ensFaces.index()); os.beginPart(ensFaces.index());
} }
writeField writeFieldContent
( (
"coordinates", "coordinates",
Field<Type>(pf.internalField(), uniqueMeshPointLabels), Field<Type>(pf.internalField(), uniqueMeshPointLabels),
@ -417,7 +452,7 @@ bool Foam::ensightOutput::ensightPointField
os.beginPart(ensFaces.index()); os.beginPart(ensFaces.index());
} }
writeField writeFieldContent
( (
"coordinates", "coordinates",
Field<Type>(pf.internalField(), uniqueMeshPointLabels), Field<Type>(pf.internalField(), uniqueMeshPointLabels),

View File

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

View File

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

View File

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

View File

@ -175,7 +175,6 @@ public:
//- Print various types of debugging information //- Print various types of debugging information
virtual void dumpInfo(Ostream&) const; virtual void dumpInfo(Ostream&) const;
}; };

View File

@ -190,13 +190,10 @@ void Foam::ensightCells::reduce()
void Foam::ensightCells::sort() void Foam::ensightCells::sort()
{ {
forAll(lists_, typeI) forAll(lists_, typeI)
{
if (lists_[typeI])
{ {
Foam::sort(*(lists_[typeI])); Foam::sort(*(lists_[typeI]));
} }
} }
}
void Foam::ensightCells::classify void Foam::ensightCells::classify

View File

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

View File

@ -208,7 +208,6 @@ public:
//- Return element from linear-list. //- Return element from linear-list.
inline label operator[](const label i) const; inline label operator[](const label i) const;
}; };

View File

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

View File

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

View File

@ -70,6 +70,16 @@ class foamVtkFormatter
mutable bool inTag_; mutable bool inTag_;
//- Write XML attribute
template<class Type>
foamVtkFormatter& xmlAttribute
(
const word&,
const Type&,
const char quote
);
protected: protected:
// Protected Member Functions // Protected Member Functions
@ -136,7 +146,7 @@ public:
//- Close XML tag, optional as an empty container. //- Close XML tag, optional as an empty container.
// Always adds a trailing newline. // Always adds a trailing newline.
foamVtkFormatter& closeTag(bool isEmpty = false); foamVtkFormatter& closeTag(const bool isEmpty = false);
//- End XML tag, optional with sanity check //- End XML tag, optional with sanity check
// Always adds a trailing newline. // Always adds a trailing newline.
@ -164,7 +174,6 @@ public:
} }
//- Write XML attribute //- Write XML attribute
foamVtkFormatter& xmlAttr foamVtkFormatter& xmlAttr
( (
@ -177,7 +186,15 @@ public:
foamVtkFormatter& xmlAttr foamVtkFormatter& xmlAttr
( (
const word&, const word&,
const label, const int32_t,
const char quote = '\''
);
//- Write XML attribute
foamVtkFormatter& xmlAttr
(
const word&,
const int64_t,
const char quote = '\'' const char quote = '\''
); );
@ -205,7 +222,10 @@ public:
foamVtkFormatter& operator()(const word&, const std::string&); foamVtkFormatter& operator()(const word&, const std::string&);
//- Write XML attribute //- 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 //- Write XML attribute
foamVtkFormatter& operator()(const word&, const uint64_t); 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> template<class Type, int nComp>
Foam::foamVtkFormatter& Foam::foamVtkFormatter::openDataArray 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) void Foam::foamVtkLegacyFormatter::write(const uint8_t val)
{ {
// Can only handle integers // Legacy can only handle 32-bit integers.
int copy(val); // Nonetheless promote to 'label' (32 or 64 bit) and deal with it later
label copy(val);
write(copy); write(copy);
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,38 +4,59 @@ cd ${0%/*} || exit 1 # Run from this directory
# Source the wmake functions # Source the wmake functions
. $WM_DIR/scripts/wmakeFunctions . $WM_DIR/scripts/wmakeFunctions
# The source directory # Ensure CMake gets the correct C/C++ compilers
sourceDir=$PWD [ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
# Where are any generated files stored?
findObjectDir $sourceDir
depDir="$objectsDir"
echo echo
echo "======================================================================" echo "======================================================================"
echo "${PWD##*/} : $PWD" echo "${PWD##*/} : $PWD"
echo 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" ] if [ -d "$VTK_DIR" -o -d "$ParaView_DIR" ]
then then
# ensure CMake gets the correct C/C++ compilers if [ "$targetType" != objects ]
[ -n "$WM_CC" ] && export CC="$WM_CC" then
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
if type cmake > /dev/null 2>&1 if type cmake > /dev/null 2>&1
then then
( doCmake $PWD || {
mkdir -p $depDir \
&& cd $depDir \
&& cmake $sourceDir \
&& make
) || {
echo echo
echo " WARNING: incomplete build of VTK-based post-processing" echo " WARNING: incomplete build of VTK-based post-processing"
echo
} }
else else
echo "WARNING: skipped - needs cmake" echo "WARNING: skipped - needs cmake"
fi fi
fi
else else
echo "WARNING: skipped - needs a VTK or a ParaView installation" echo "WARNING: skipped - needs a VTK or a ParaView installation"
echo " - For ParaView : export the 'ParaView_DIR' variable" echo " - For ParaView : export the 'ParaView_DIR' variable"
@ -45,4 +66,4 @@ fi
echo "======================================================================" echo "======================================================================"
echo echo
# ----------------------------------------------------------------- end-of-file # -----------------------------------------------------------------------------

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -207,10 +207,10 @@ Foam::fv::tabulatedNTUHeatTransfer::tabulatedNTUHeatTransfer
) )
: :
interRegionHeatTransferModel(name, modelType, dict, mesh), interRegionHeatTransferModel(name, modelType, dict, mesh),
UName_(coeffs_.lookupOrDefault<word>("UName", "U")), UName_(coeffs_.lookupOrDefault<word>("U", "U")),
UNbrName_(coeffs_.lookupOrDefault<word>("UNbrName", "U")), UNbrName_(coeffs_.lookupOrDefault<word>("UNbr", "U")),
rhoName_(coeffs_.lookupOrDefault<word>("rhoName", "rho")), rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")),
rhoNbrName_(coeffs_.lookupOrDefault<word>("rhoNbrName", "rho")), rhoNbrName_(coeffs_.lookupOrDefault<word>("rhoNbr", "rho")),
ntuTable_(), ntuTable_(),
geometryMode_(gmCalculated), geometryMode_(gmCalculated),
Ain_(-1), Ain_(-1),
@ -275,10 +275,10 @@ bool Foam::fv::tabulatedNTUHeatTransfer::read(const dictionary& dict)
{ {
if (option::read(dict)) if (option::read(dict))
{ {
coeffs_.readIfPresent("UName", UName_); coeffs_.readIfPresent("U", UName_);
coeffs_.readIfPresent("UNbrName", UNbrName_); coeffs_.readIfPresent("UNbr", UNbrName_);
coeffs_.readIfPresent("rhoName", rhoName_); coeffs_.readIfPresent("rho", rhoName_);
coeffs_.readIfPresent("rhoNbrName", rhoNbrName_); coeffs_.readIfPresent("rhoNbr", rhoNbrName_);
// Force geometry re-initialisation // Force geometry re-initialisation
Ain_ = -1; Ain_ = -1;

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