Merge branch 'master' into cvm

This commit is contained in:
graham
2010-10-22 12:45:30 +01:00
472 changed files with 8917 additions and 7259 deletions

View File

@ -29,13 +29,29 @@
=metis-5.0pre2=, =ParMetis-3.1= and =ParMGridGen-1.0=. =metis-5.0pre2=, =ParMetis-3.1= and =ParMGridGen-1.0=.
* Library developments * Library developments
There have been a number of developments to the libraries to support the There have been a number of developments to the libraries to support the
extension of functionality in solver and utility applications. extension of functionality in solver and utility applications.
*** Core library *** Core library
+ Large number of code refinements and consistency improvements to support + Large number of code refinements and consistency improvements to support
other developments. other developments.
*** Turbulence modelling *** Turbulence modelling
*** Thermo-physical Models *** *Updated* thermophysical libraries
+ Now use the more descriptive dictionary input format, e.g. for a single
component mixture:
thermoType hPsiThermo<pureMixture<sutherlandTransport<specieThermo<hConstThermo<perfectGas>>>>>;
mixture
{
nMoles 1;
molWeight 28.9;
Cp 1007;
Hf 0;
As 1.4792e-06;
Ts 116;
}
*** DSMC *** DSMC
*** Dynamic Mesh *** Dynamic Mesh
*** Numerics *** Numerics
@ -67,8 +83,10 @@
+ Additional wall functions for primary region momentum and temperature + Additional wall functions for primary region momentum and temperature
taking film into account taking film into account
+ Parallel aware + Parallel aware
*** *New* ptscotch decomposition method
*** *Updated* particle tracking algorithm *** *Updated* particle tracking algorithm
*** *Updated* split cyclics into two separate patches. See doc/changed/splitCyclics.txt
*** *New* compact binary I/O for faces and cells. This speeds up reading/writing meshes in binary.
* Solvers * Solvers
A number of new solvers have been developed for a range of engineering A number of new solvers have been developed for a range of engineering
applications. There has been a set of improvements to certain classes of applications. There has been a set of improvements to certain classes of
@ -108,10 +126,12 @@
+ extrudes into master direction (i.e. away from the owner cell + extrudes into master direction (i.e. away from the owner cell
if flipMap is false) if flipMap is false)
*** Updated utilities *** Updated utilities
+ ... + =setFields=: optionally use faceSets to set patch values (see e.g. hotRoom tutorial).
+ =blockMesh=: specify patches via dictionary instead of type only. This
makes rereading the boundary superfluous. see
e.g. pitzDailyDirectMapped tutorial.
* Post-processing * Post-processing
+ =foamToEnsight=: new =-nodeValues= option to generate and output nodal + =foamToEnsight=: parallel continuous data. new =-nodeValues= option to generate and output nodal
field data. field data.
+ Function objects: + Function objects:
+ =residualControl=: new function object to allow users to terminate steady + =residualControl=: new function object to allow users to terminate steady

View File

@ -55,6 +55,7 @@ Description
#include "edgeStats.H" #include "edgeStats.H"
#include "treeDataTriSurface.H" #include "treeDataTriSurface.H"
#include "indexedOctree.H" #include "indexedOctree.H"
#include "globalMeshData.H"
using namespace Foam; using namespace Foam;
@ -298,7 +299,7 @@ label selectOutsideCells
mesh, mesh,
outsideFaces.shrink(), outsideFaces.shrink(),
outsideFacesInfo.shrink(), outsideFacesInfo.shrink(),
mesh.nCells() // max iterations mesh.globalData().nTotalCells()+1 // max iterations
); );
// Now regionCalc should hold info on cells that are reachable from // Now regionCalc should hold info on cells that are reachable from

View File

@ -43,7 +43,7 @@ Description
#include "polyMeshZipUpCells.H" #include "polyMeshZipUpCells.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "cyclicPolyPatch.H" #include "oldCyclicPolyPatch.H"
#include "Swap.H" #include "Swap.H"
#include "IFstream.H" #include "IFstream.H"
#include "readHexLabel.H" #include "readHexLabel.H"
@ -900,7 +900,7 @@ int main(int argc, char *argv[])
fluentToFoamType.insert("interface", polyPatch::typeName); fluentToFoamType.insert("interface", polyPatch::typeName);
fluentToFoamType.insert("internal", polyPatch::typeName); fluentToFoamType.insert("internal", polyPatch::typeName);
fluentToFoamType.insert("solid", polyPatch::typeName); fluentToFoamType.insert("solid", polyPatch::typeName);
fluentToFoamType.insert("fan", cyclicPolyPatch::typeName); fluentToFoamType.insert("fan", oldCyclicPolyPatch::typeName);
fluentToFoamType.insert("radiator", polyPatch::typeName); fluentToFoamType.insert("radiator", polyPatch::typeName);
fluentToFoamType.insert("porous-jump", polyPatch::typeName); fluentToFoamType.insert("porous-jump", polyPatch::typeName);

View File

@ -41,7 +41,7 @@ Description
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
#include "cyclicPolyPatch.H" #include "oldCyclicPolyPatch.H"
#include "unitConversion.H" #include "unitConversion.H"
using namespace Foam; using namespace Foam;

View File

@ -196,7 +196,7 @@ const word* kivaPatchTypes[nBCs] =
&polyPatch::typeName, &polyPatch::typeName,
&polyPatch::typeName, &polyPatch::typeName,
&symmetryPolyPatch::typeName, &symmetryPolyPatch::typeName,
&cyclicPolyPatch::typeName &oldCyclicPolyPatch::typeName
}; };
enum patchTypeNames enum patchTypeNames

View File

@ -29,7 +29,7 @@ Description
#include "sammMesh.H" #include "sammMesh.H"
#include "Time.H" #include "Time.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "cyclicPolyPatch.H" #include "oldCyclicPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "preservePatchTypes.H" #include "preservePatchTypes.H"
#include "IFstream.H" #include "IFstream.H"
@ -208,7 +208,7 @@ void sammMesh::readBoundary()
{ {
// incorrect. should be cyclicPatch but this // incorrect. should be cyclicPatch but this
// requires info on connected faces. // requires info on connected faces.
patchTypes_[patchLabel] = cyclicPolyPatch::typeName; patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
} }
else else
{ {

View File

@ -29,7 +29,7 @@ Description
#include "starMesh.H" #include "starMesh.H"
#include "Time.H" #include "Time.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "cyclicPolyPatch.H" #include "oldCyclicPolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "preservePatchTypes.H" #include "preservePatchTypes.H"
#include "IFstream.H" #include "IFstream.H"
@ -206,7 +206,7 @@ void starMesh::readBoundary()
{ {
// incorrect. should be cyclicPatch but this // incorrect. should be cyclicPatch but this
// requires info on connected faces. // requires info on connected faces.
patchTypes_[patchLabel] = cyclicPolyPatch::typeName; patchTypes_[patchLabel] = oldCyclicPolyPatch::typeName;
} }
else else
{ {

View File

@ -11,7 +11,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh \ -ldynamicMesh \
-lautoMesh -lautoMesh

View File

@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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/>.
\*---------------------------------------------------------------------------*/
#include "SetPatchFields.H"
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class GeoField>
void Foam::SetPatchFields
(
PtrList<GeoField>& fields,
const label patchI,
const typename GeoField::value_type& initVal
)
{
forAll(fields, i)
{
typename GeoField::PatchFieldType& pfld =
fields[i].boundaryField()[patchI];
pfld == initVal;
}
}
// ************************************************************************* //

View File

@ -21,73 +21,46 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Global
setHotRoom Foam::SetPatchFields
Description Description
Set the initial field of T for the hot room problem. Helper routine to initialise a patch field to a constant value
SourceFiles
SetPatchFields.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #ifndef SetPatchFields_H
#include "OSspecific.H" #define SetPatchFields_H
#include "fixedValueFvPatchFields.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[]) namespace Foam
{ {
# include "setRootCase.H" //- Helper routine to read fields
template<class GeoField>
void SetPatchFields
(
PtrList<GeoField>& fields,
const label patchI,
const typename GeoField::value_type& initVal
);
# include "createTime.H" } // End namespace Foam
# include "createMesh.H"
# include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
volScalarField::GeometricBoundaryField& Tpatches = T.boundaryField(); #ifdef NoRepository
# include "SetPatchFields.C"
#endif
forAll(Tpatches, patchI) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
{
if
(
isA<fixedValueFvPatchScalarField>(Tpatches[patchI])
&& mesh.boundaryMesh()[patchI].name() == "floor"
)
{
fixedValueFvPatchScalarField& Tpatch =
refCast<fixedValueFvPatchScalarField>(Tpatches[patchI]);
const vectorField& faceCentres = #endif
mesh.Cf().boundaryField()[patchI];
forAll(faceCentres, facei)
{
if
(
(faceCentres[facei].x() > 4.5) &&
(faceCentres[facei].x() < 5.5) &&
(faceCentres[facei].z() > 4.5) &&
(faceCentres[facei].z() < 5.5)
)
{
Tpatch[facei] = 600;
}
else
{
Tpatch[facei] = 300;
}
}
};
Info<< "Writing modified field T\n" << endl;
T.write();
Info<< "End\n" << endl;
return 0;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -43,6 +43,8 @@ Description
#include "volFields.H" #include "volFields.H"
#include "surfaceFields.H" #include "surfaceFields.H"
#include "ZoneIDs.H" #include "ZoneIDs.H"
#include "fvMeshMapper.H"
#include "SetPatchFields.H"
using namespace Foam; using namespace Foam;
@ -241,8 +243,6 @@ int main(int argc, char *argv[])
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());
// Read vol fields. // Read vol fields.
if (args.optionFound("updateFields"))
{
Info<< "Reading geometric fields" << nl << endl; Info<< "Reading geometric fields" << nl << endl;
PtrList<volScalarField> vsFlds; PtrList<volScalarField> vsFlds;
ReadFields(mesh, objects, vsFlds); ReadFields(mesh, objects, vsFlds);
@ -275,11 +275,7 @@ int main(int argc, char *argv[])
PtrList<surfaceTensorField> stFlds; PtrList<surfaceTensorField> stFlds;
ReadFields(mesh, objects, stFlds); ReadFields(mesh, objects, stFlds);
}
else
{
Info<< "Not updating geometric fields" << nl << endl;
}
// Mesh change container // Mesh change container
polyTopoChange meshMod(mesh); polyTopoChange meshMod(mesh);
@ -484,6 +480,58 @@ int main(int argc, char *argv[])
// Update fields // Update fields
mesh.updateMesh(map); mesh.updateMesh(map);
// Correct boundary faces mapped-out-of-nothing.
{
fvMeshMapper mapper(mesh, map);
bool hasWarned = false;
forAll(newMasterPatches, i)
{
label patchI = newMasterPatches[i];
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
if (pm.sizeBeforeMapping() == 0)
{
if (!hasWarned)
{
hasWarned = true;
WarningIn(args.executable())
<< "Setting field on boundary faces to zero." << endl
<< "You might have to edit these fields." << endl;
}
SetPatchFields(vsFlds, patchI, pTraits<scalar>::zero);
SetPatchFields(vvFlds, patchI, pTraits<vector>::zero);
SetPatchFields(vstFlds, patchI, pTraits<sphericalTensor>::zero);
SetPatchFields(vsymtFlds, patchI, pTraits<symmTensor>::zero);
SetPatchFields(vtFlds, patchI, pTraits<tensor>::zero);
SetPatchFields(ssFlds, patchI, pTraits<scalar>::zero);
SetPatchFields(svFlds, patchI, pTraits<vector>::zero);
SetPatchFields(sstFlds, patchI, pTraits<sphericalTensor>::zero);
SetPatchFields(ssymtFlds, patchI, pTraits<symmTensor>::zero);
SetPatchFields(stFlds, patchI, pTraits<tensor>::zero);
}
}
forAll(newSlavePatches, i)
{
label patchI = newSlavePatches[i];
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
if (pm.sizeBeforeMapping() == 0)
{
SetPatchFields(vsFlds, patchI, pTraits<scalar>::zero);
SetPatchFields(vvFlds, patchI, pTraits<vector>::zero);
SetPatchFields(vstFlds, patchI, pTraits<sphericalTensor>::zero);
SetPatchFields(vsymtFlds, patchI, pTraits<symmTensor>::zero);
SetPatchFields(vtFlds, patchI, pTraits<tensor>::zero);
SetPatchFields(ssFlds, patchI, pTraits<scalar>::zero);
SetPatchFields(svFlds, patchI, pTraits<vector>::zero);
SetPatchFields(sstFlds, patchI, pTraits<sphericalTensor>::zero);
SetPatchFields(ssymtFlds, patchI, pTraits<symmTensor>::zero);
SetPatchFields(stFlds, patchI, pTraits<tensor>::zero);
}
}
}
// Move mesh (since morphing might not do this) // Move mesh (since morphing might not do this)
if (map().hasMotionPoints()) if (map().hasMotionPoints())
{ {

View File

@ -4,4 +4,5 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-lgenericPatchFields

View File

@ -7,6 +7,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-ldecompositionMethods -lmetisDecomp -lscotchDecomp \ -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
-llagrangian \ -llagrangian \
-lmeshTools -lmeshTools

View File

@ -7,6 +7,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ldecompositionMethods \ -ldecompositionMethods \
-L$(FOAM_MPI_LIBBIN) -lptscotchDecomp \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
-lmeshTools \ -lmeshTools \
-ldynamicMesh -ldynamicMesh

View File

@ -57,7 +57,6 @@ public:
labelList prisms; labelList prisms;
labelList wedges; labelList wedges;
labelList hexes; labelList hexes;
labelList hexesWedges;
labelList polys; labelList polys;
@ -77,7 +76,6 @@ public:
prisms(nCells), prisms(nCells),
wedges(nCells), wedges(nCells),
hexes(nCells), hexes(nCells),
hexesWedges(nCells),
polys(nCells) polys(nCells)
{} {}
}; };

View File

@ -38,6 +38,32 @@ using namespace Foam;
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template<class Type>
Field<Type> map
(
const Field<Type>& vf,
const labelList& map1,
const labelList& map2
)
{
Field<Type> mf(map1.size() + map2.size());
forAll(map1, i)
{
mf[i] = vf[map1[i]];
}
label offset = map1.size();
forAll(map2, i)
{
mf[i + offset] = vf[map2[i]];
}
return mf;
}
template<class Type> template<class Type>
void writeField void writeField
( (
@ -274,7 +300,8 @@ void ensightField
const labelList& tets = meshCellSets.tets; const labelList& tets = meshCellSets.tets;
const labelList& pyrs = meshCellSets.pyrs; const labelList& pyrs = meshCellSets.pyrs;
const labelList& prisms = meshCellSets.prisms; const labelList& prisms = meshCellSets.prisms;
const labelList& hexesWedges = meshCellSets.hexesWedges; const labelList& wedges = meshCellSets.wedges;
const labelList& hexes = meshCellSets.hexes;
const labelList& polys = meshCellSets.polys; const labelList& polys = meshCellSets.polys;
ensightStream* ensightFilePtr = NULL; ensightStream* ensightFilePtr = NULL;
@ -328,7 +355,7 @@ void ensightField
writeField writeField
( (
"hexa8", "hexa8",
Field<Type>(vf, hexesWedges), map(vf, hexes, wedges),
ensightFile ensightFile
); );

View File

@ -70,12 +70,15 @@ void Foam::ensightMesh::correct()
// Patches are output. Check that they're synced. // Patches are output. Check that they're synced.
mesh_.boundaryMesh().checkParallelSync(true); mesh_.boundaryMesh().checkParallelSync(true);
allPatchNames_ = wordList::subList allPatchNames_ = mesh_.boundaryMesh().names();
if (Pstream::parRun())
{
allPatchNames_.setSize
( (
mesh_.boundaryMesh().names(),
mesh_.boundary().size() mesh_.boundary().size()
- mesh_.globalData().processorPatches().size() - mesh_.globalData().processorPatches().size()
); );
}
if (patches_) if (patches_)
{ {
@ -114,7 +117,6 @@ void Foam::ensightMesh::correct()
labelList& prisms = meshCellSets_.prisms; labelList& prisms = meshCellSets_.prisms;
labelList& wedges = meshCellSets_.wedges; labelList& wedges = meshCellSets_.wedges;
labelList& hexes = meshCellSets_.hexes; labelList& hexes = meshCellSets_.hexes;
labelList& hexesWedges = meshCellSets_.hexesWedges;
labelList& polys = meshCellSets_.polys; labelList& polys = meshCellSets_.polys;
label nTets = 0; label nTets = 0;
@ -122,7 +124,6 @@ void Foam::ensightMesh::correct()
label nPrisms = 0; label nPrisms = 0;
label nWedges = 0; label nWedges = 0;
label nHexes = 0; label nHexes = 0;
label nHexesWedges = 0;
label nPolys = 0; label nPolys = 0;
forAll(cellShapes, cellI) forAll(cellShapes, cellI)
@ -145,12 +146,10 @@ void Foam::ensightMesh::correct()
else if (cellModel == wedge) else if (cellModel == wedge)
{ {
wedges[nWedges++] = cellI; wedges[nWedges++] = cellI;
hexesWedges[nHexesWedges++] = cellI;
} }
else if (cellModel == hex) else if (cellModel == hex)
{ {
hexes[nHexes++] = cellI; hexes[nHexes++] = cellI;
hexesWedges[nHexesWedges++] = cellI;
} }
else else
{ {
@ -163,7 +162,6 @@ void Foam::ensightMesh::correct()
prisms.setSize(nPrisms); prisms.setSize(nPrisms);
wedges.setSize(nWedges); wedges.setSize(nWedges);
hexes.setSize(nHexes); hexes.setSize(nHexes);
hexesWedges.setSize(nHexesWedges);
polys.setSize(nPolys); polys.setSize(nPolys);
meshCellSets_.nTets = nTets; meshCellSets_.nTets = nTets;
@ -175,7 +173,7 @@ void Foam::ensightMesh::correct()
meshCellSets_.nPrisms = nPrisms; meshCellSets_.nPrisms = nPrisms;
reduce(meshCellSets_.nPrisms, sumOp<label>()); reduce(meshCellSets_.nPrisms, sumOp<label>());
meshCellSets_.nHexesWedges = nHexesWedges; meshCellSets_.nHexesWedges = nWedges+nHexes;
reduce(meshCellSets_.nHexesWedges, sumOp<label>()); reduce(meshCellSets_.nHexesWedges, sumOp<label>());
meshCellSets_.nPolys = nPolys; meshCellSets_.nPolys = nPolys;

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Selects a cell set through a dictionary. Set values on a selected set of cells/patchfaces through a dictionary.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -32,12 +32,13 @@ Description
#include "fvMesh.H" #include "fvMesh.H"
#include "topoSetSource.H" #include "topoSetSource.H"
#include "cellSet.H" #include "cellSet.H"
#include "faceSet.H"
#include "volFields.H" #include "volFields.H"
using namespace Foam; using namespace Foam;
template<class Type> template<class Type>
bool setFieldType bool setCellFieldType
( (
const word& fieldTypeDesc, const word& fieldTypeDesc,
const fvMesh& mesh, const fvMesh& mesh,
@ -65,7 +66,8 @@ bool setFieldType
// Check field exists // Check field exists
if (fieldHeader.headerOk()) if (fieldHeader.headerOk())
{ {
Info<< " Setting " << fieldHeader.headerClassName() Info<< " Setting internal values of "
<< fieldHeader.headerClassName()
<< " " << fieldName << endl; << " " << fieldName << endl;
fieldType field(fieldHeader, mesh); fieldType field(fieldHeader, mesh);
@ -96,7 +98,7 @@ bool setFieldType
{ {
WarningIn WarningIn
( (
"void setFieldType" "void setCellFieldType"
"(const fvMesh& mesh, const labelList& selectedCells," "(const fvMesh& mesh, const labelList& selectedCells,"
"Istream& fieldValueStream)" "Istream& fieldValueStream)"
) << "Field " << fieldName << " not found" << endl; ) << "Field " << fieldName << " not found" << endl;
@ -106,17 +108,17 @@ bool setFieldType
} }
class setField class setCellField
{ {
public: public:
setField() setCellField()
{} {}
autoPtr<setField> clone() const autoPtr<setCellField> clone() const
{ {
return autoPtr<setField>(new setField()); return autoPtr<setCellField>(new setCellField());
} }
class iNew class iNew
@ -132,37 +134,200 @@ public:
selectedCells_(selectedCells) selectedCells_(selectedCells)
{} {}
autoPtr<setField> operator()(Istream& fieldValues) const autoPtr<setCellField> operator()(Istream& fieldValues) const
{ {
word fieldType(fieldValues); word fieldType(fieldValues);
if if
( (
!( !(
setFieldType<scalar> setCellFieldType<scalar>
(fieldType, mesh_, selectedCells_, fieldValues) (fieldType, mesh_, selectedCells_, fieldValues)
|| setFieldType<vector> || setCellFieldType<vector>
(fieldType, mesh_, selectedCells_, fieldValues) (fieldType, mesh_, selectedCells_, fieldValues)
|| setFieldType<sphericalTensor> || setCellFieldType<sphericalTensor>
(fieldType, mesh_, selectedCells_, fieldValues) (fieldType, mesh_, selectedCells_, fieldValues)
|| setFieldType<symmTensor> || setCellFieldType<symmTensor>
(fieldType, mesh_, selectedCells_, fieldValues) (fieldType, mesh_, selectedCells_, fieldValues)
|| setFieldType<tensor> || setCellFieldType<tensor>
(fieldType, mesh_, selectedCells_, fieldValues) (fieldType, mesh_, selectedCells_, fieldValues)
) )
) )
{ {
WarningIn("setField::iNew::operator()(Istream& is)") WarningIn("setCellField::iNew::operator()(Istream& is)")
<< "field type " << fieldType << " not currently supported" << "field type " << fieldType << " not currently supported"
<< endl; << endl;
} }
return autoPtr<setField>(new setField()); return autoPtr<setCellField>(new setCellField());
} }
}; };
}; };
template<class Type>
bool setFaceFieldType
(
const word& fieldTypeDesc,
const fvMesh& mesh,
const labelList& selectedFaces,
Istream& fieldValueStream
)
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
if (fieldTypeDesc != fieldType::typeName + "Value")
{
return false;
}
word fieldName(fieldValueStream);
IOobject fieldHeader
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ
);
// Check field exists
if (fieldHeader.headerOk())
{
Info<< " Setting patchField values of "
<< fieldHeader.headerClassName()
<< " " << fieldName << endl;
fieldType field(fieldHeader, mesh);
const Type& value = pTraits<Type>(fieldValueStream);
// Create flat list of selected faces and their value.
Field<Type> allBoundaryValues(mesh.nFaces()-mesh.nInternalFaces());
forAll(field.boundaryField(), patchi)
{
SubField<Type>
(
allBoundaryValues,
field.boundaryField()[patchi].size(),
field.boundaryField()[patchi].patch().start()
- mesh.nInternalFaces()
).assign(field.boundaryField()[patchi]);
}
// Override
labelList nChanged(field.boundaryField().size(), 0);
forAll(selectedFaces, i)
{
label facei = selectedFaces[i];
if (mesh.isInternalFace(facei))
{
WarningIn("setFaceFieldType(..)")
<< "Ignoring internal face " << facei << endl;
}
else
{
label bFaceI = facei-mesh.nInternalFaces();
allBoundaryValues[bFaceI] = value;
nChanged[mesh.boundaryMesh().patchID()[bFaceI]]++;
}
}
Pstream::listCombineGather(nChanged, plusEqOp<label>());
Pstream::listCombineScatter(nChanged);
// Reassign.
forAll(field.boundaryField(), patchi)
{
if (nChanged[patchi] > 0)
{
Info<< " On patch "
<< field.boundaryField()[patchi].patch().name()
<< " set " << nChanged[patchi] << " values" << endl;
field.boundaryField()[patchi] == SubField<Type>
(
allBoundaryValues,
field.boundaryField()[patchi].size(),
field.boundaryField()[patchi].patch().start()
- mesh.nInternalFaces()
);
}
}
field.write();
}
else
{
WarningIn
(
"void setFaceFieldType"
"(const fvMesh& mesh, const labelList& selectedFaces,"
"Istream& fieldValueStream)"
) << "Field " << fieldName << " not found" << endl;
}
return true;
}
class setFaceField
{
public:
setFaceField()
{}
autoPtr<setFaceField> clone() const
{
return autoPtr<setFaceField>(new setFaceField());
}
class iNew
{
const fvMesh& mesh_;
const labelList& selectedFaces_;
public:
iNew(const fvMesh& mesh, const labelList& selectedFaces)
:
mesh_(mesh),
selectedFaces_(selectedFaces)
{}
autoPtr<setFaceField> operator()(Istream& fieldValues) const
{
word fieldType(fieldValues);
if
(
!(
setFaceFieldType<scalar>
(fieldType, mesh_, selectedFaces_, fieldValues)
|| setFaceFieldType<vector>
(fieldType, mesh_, selectedFaces_, fieldValues)
|| setFaceFieldType<sphericalTensor>
(fieldType, mesh_, selectedFaces_, fieldValues)
|| setFaceFieldType<symmTensor>
(fieldType, mesh_, selectedFaces_, fieldValues)
|| setFaceFieldType<tensor>
(fieldType, mesh_, selectedFaces_, fieldValues)
)
)
{
WarningIn("setFaceField::iNew::operator()(Istream& is)")
<< "field type " << fieldType << " not currently supported"
<< endl;
}
return autoPtr<setFaceField>(new setFaceField());
}
};
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[]) int main(int argc, char *argv[])
@ -194,10 +359,10 @@ int main(int argc, char *argv[])
if (setFieldsDict.found("defaultFieldValues")) if (setFieldsDict.found("defaultFieldValues"))
{ {
Info<< "Setting field default values" << endl; Info<< "Setting field default values" << endl;
PtrList<setField> defaultFieldValues PtrList<setCellField> defaultFieldValues
( (
setFieldsDict.lookup("defaultFieldValues"), setFieldsDict.lookup("defaultFieldValues"),
setField::iNew(mesh, labelList(mesh.nCells())) setCellField::iNew(mesh, labelList(mesh.nCells()))
); );
Info<< endl; Info<< endl;
} }
@ -211,9 +376,11 @@ int main(int argc, char *argv[])
{ {
const entry& region = regions[regionI]; const entry& region = regions[regionI];
autoPtr<topoSetSource> cellSelector = autoPtr<topoSetSource> source =
topoSetSource::New(region.keyword(), mesh, region.dict()); topoSetSource::New(region.keyword(), mesh, region.dict());
if (source().setType() == topoSetSource::CELLSETSOURCE)
{
cellSet selectedCellSet cellSet selectedCellSet
( (
mesh, mesh,
@ -221,18 +388,41 @@ int main(int argc, char *argv[])
mesh.nCells()/10+1 // Reasonable size estimate. mesh.nCells()/10+1 // Reasonable size estimate.
); );
cellSelector->applyToSet source->applyToSet
( (
topoSetSource::NEW, topoSetSource::NEW,
selectedCellSet selectedCellSet
); );
PtrList<setField> fieldValues PtrList<setCellField> fieldValues
( (
region.dict().lookup("fieldValues"), region.dict().lookup("fieldValues"),
setField::iNew(mesh, selectedCellSet.toc()) setCellField::iNew(mesh, selectedCellSet.toc())
); );
} }
else if (source().setType() == topoSetSource::FACESETSOURCE)
{
faceSet selectedFaceSet
(
mesh,
"faceSet",
(mesh.nFaces()-mesh.nInternalFaces())/10+1
);
source->applyToSet
(
topoSetSource::NEW,
selectedFaceSet
);
PtrList<setFaceField> fieldValues
(
region.dict().lookup("fieldValues"),
setFaceField::iNew(mesh, selectedFaceSet.toc())
);
}
}
Info<< "\nEnd\n" << endl; Info<< "\nEnd\n" << endl;

View File

@ -23,6 +23,8 @@ defaultFieldValues
regions regions
( (
// Set cell values
// (does zerogradient on boundaries)
boxToCell boxToCell
{ {
box (0 0 -1) (0.1461 0.292 1); box (0 0 -1) (0.1461 0.292 1);
@ -32,6 +34,17 @@ regions
volScalarFieldValue gamma 1 volScalarFieldValue gamma 1
); );
} }
// Set patch values (using ==)
boxToFace
{
box (0 0 -1) (0.1461 0.292 1);
fieldValues
(
volScalarFieldValue gamma 1
);
}
); );
// ************************************************************************* // // ************************************************************************* //

View File

@ -48,11 +48,13 @@ int main(int argc, char *argv[])
OFstream reactionsFile(args[3]); OFstream reactionsFile(args[3]);
reactionsFile reactionsFile
<< "species" << cr.species() << token::END_STATEMENT << nl << nl << "species" << cr.species() << token::END_STATEMENT << nl << nl;
<< "reactions" << cr.reactions() << token::END_STATEMENT << endl;
cr.reactions().write(reactionsFile);
OFstream thermoFile(args[4]); OFstream thermoFile(args[4]);
thermoFile<< cr.speciesThermo() << endl; cr.speciesThermo().write(thermoFile);
Info<< "End\n" << endl; Info<< "End\n" << endl;

View File

@ -56,7 +56,7 @@ cleanTimeDirectories()
zeros=`printf %0${nZeros}d 0` zeros=`printf %0${nZeros}d 0`
nZeros=$(($nZeros + 1)) nZeros=$(($nZeros + 1))
done done
rm -rf ./{[1-9]*,-[1-9]*,log,log.*,log-*,logSummary.*,.fxLock,*.xml,ParaView*,paraFoam*,*.OpenFOAM} > /dev/null 2>&1 rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1
} }
cleanCase() cleanCase()
@ -65,16 +65,20 @@ cleanCase()
rm -rf processor* > /dev/null 2>&1 rm -rf processor* > /dev/null 2>&1
rm -rf probes* > /dev/null 2>&1 rm -rf probes* > /dev/null 2>&1
rm -rf forces* > /dev/null 2>&1 rm -rf forces* > /dev/null 2>&1
rm -rf system/machines > /dev/null 2>&1
rm -rf system/machines \ (cd constant/polyMesh && \
constant/polyMesh/{allOwner*,cell*,face*,meshModifiers*} \ rm -rf \
constant/polyMesh/{owner*,neighbour*,point*,edge*} \ allOwner* cell* face* meshModifiers* \
constant/polyMesh/{cellLevel*,pointLevel*,refinementHistory*,surfaceIndex*} \ owner* neighbour* point* edge* \
constant/{cellToRegion,cellLevel*,pointLevel*} \ cellLevel* pointLevel* refinementHistory* surfaceIndex* sets \
constant/polyMesh/sets/ \ > /dev/null 2>&1 \
VTK \ )
sets/streamLines \ (cd constant && \
> /dev/null 2>&1 rm -rf \
cellToRegion cellLevel* pointLevel* \
> /dev/null 2>&1 \
)
rm -rf VTK > /dev/null 2>&1
if [ -e constant/polyMesh/blockMeshDict.m4 ] if [ -e constant/polyMesh/blockMeshDict.m4 ]
then then
@ -96,12 +100,12 @@ removeCase()
cleanSamples() cleanSamples()
{ {
rm -rf {sets,samples,sampleSurfaces} > /dev/null 2>&1 rm -rf ./sets ./samples ./sampleSurfaces > /dev/null 2>&1
} }
cleanUcomponents() cleanUcomponents()
{ {
rm -rf 0/{Ux,Uy,Uz} > /dev/null 2>&1 rm -rf 0/Ux 0/Uy 0/Uz > /dev/null 2>&1
} }
cleanApplication() cleanApplication()

50
bin/tools/foamConfigurePaths Executable file → Normal file
View File

@ -46,6 +46,17 @@ USAGE
} }
# Function to do replacement on file. Checks if any replacement has been done.
# inlineSed <file> <sedCommand> <description>
_inlineSed()
{
backup=`tempfile`
cp $1 $backup
sed -i -e "$2" $1
cmp $1 $backup || usage "Failed : $3"
}
[ -f etc/bashrc -a -f etc/settings.sh ] || usage "Please run from top-level directory of installation" [ -f etc/bashrc -a -f etc/settings.sh ] || usage "Please run from top-level directory of installation"
unset foamInstall projectName archOption paraviewInstall unset foamInstall projectName archOption paraviewInstall
@ -60,29 +71,39 @@ do
--foamInstall) --foamInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
foamInstall="$2" foamInstall="$2"
echo "Replacing foamInstall setting by $foamInstall" echo "** foamInstall:$foamInstall"
sed -i -e '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" etc/bashrc
_inlineSed \
etc/bashrc \
'/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
"Replacing foamInstall setting by $foamInstall"
shift 2 shift 2
;; ;;
--projectName) --projectName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
projectName="$2" projectName="$2"
echo "Replacing WM_PROJECT_DIR setting by $projectName" _inlineSed \
sed -i -e '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" etc/bashrc etc/bashrc \
'/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
"Replacing WM_PROJECT_DIR setting by $projectName"
shift 2 shift 2
;; ;;
--archOption) --archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2" archOption="$2"
echo "Replacing WM_ARCH_OPTION setting by $archOption" _inlineSed \
sed -i -e '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" etc/bashrc etc/bashrc \
'/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
"Replacing WM_ARCH_OPTION setting by $archOption"
shift 2 shift 2
;; ;;
--paraviewInstall) --paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument" [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2" paraviewInstall="$2"
echo "Replacing ParaView_DIR setting by $paraviewInstall" _inlineSed \
sed -i -e '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" etc/apps/paraview3/bashrc etc/apps/paraview3/bashrc \
'/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
"Replacing ParaView_DIR setting by $paraviewInstall"
shift 2 shift 2
;; ;;
*) *)
@ -97,11 +118,14 @@ done
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc #sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
# Replace the WM_MPLIB always # Replace the WM_MPLIB always
echo "Replacing WM_MPLIB setting by SYSTEMOPENMPI" _inlineSed \
sed -i -e '/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' etc/bashrc etc/bashrc \
'/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' \
"Replacing WM_MPLIB setting by SYSTEMOPENMPI"
# Replace the compilerInstall always # Replace the compilerInstall always
echo "Replacing compilerInstall setting by system" _inlineSed \
sed -i -e '/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' etc/settings.sh etc/settings.sh \
'/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' \
"Replacing compilerInstall setting by system"
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------

View File

@ -574,12 +574,14 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
# INPUT = $(WM_PROJECT_DIR)/src \ #INPUT = $(WM_PROJECT_DIR)/src \
# $(WM_PROJECT_DIR)/applications/utilities \ # $(WM_PROJECT_DIR)/applications/utilities \
# $(WM_PROJECT_DIR)/applications/solvers # $(WM_PROJECT_DIR)/applications/solvers
# limit input for testing purposes # limit input for testing purposes
INPUT = $(WM_PROJECT_DIR)/src/OpenFOAM/global INPUT = $(WM_PROJECT_DIR)/src/OpenFOAM/global \
$(WM_PROJECT_DIR)/src/OpenFOAM/containers \
$(WM_PROJECT_DIR)/src/OpenFOAM/primitives
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is

View File

@ -108,6 +108,12 @@ case OpenFOAM:
set gmp_version=gmp-4.2.4 set gmp_version=gmp-4.2.4
set mpfr_version=mpfr-2.4.1 set mpfr_version=mpfr-2.4.1
breaksw breaksw
case Clang:
# using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-2.8
breaksw
default: default:
echo echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
@ -159,6 +165,25 @@ case OpenFOAM:
endif endif
unset gcc_version gccDir unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
if ( $?clang_version ) then
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
# Check that the compiler directory can be found
if ( ! -d "$clangDir" ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
echo " Cannot find $clangDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo
endif
_foamAddMan $clangDir/man
_foamAddPath $clangDir/bin
endif
unset clang_version clangDir
breaksw breaksw
endsw endsw

View File

@ -131,6 +131,12 @@ OpenFOAM)
gmp_version=gmp-4.2.4 gmp_version=gmp-4.2.4
mpfr_version=mpfr-2.4.1 mpfr_version=mpfr-2.4.1
;; ;;
Clang)
# using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
clang_version=llvm-2.8
;;
*) *)
echo echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
@ -183,6 +189,25 @@ OpenFOAM)
fi fi
unset gcc_version gccDir unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
if [ -n "$clang_version" ]
then
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
# Check that the compiler directory can be found
[ -d "$clangDir" ] || {
echo
echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
echo " Cannot find $clangDir installation."
echo " Please install this compiler version or if you wish to use the system compiler,"
echo " change the 'compilerInstall' setting to 'system' in this file"
echo
}
_foamAddMan $clangDir/share/man
_foamAddPath $clangDir/bin
fi
unset clang_version clangDir
;; ;;
esac esac

View File

@ -39,7 +39,7 @@ Class
#else #else
# include <sys/inotify.h> # include <sys/inotify.h>
# include <sys/ioctl.h> # include <sys/ioctl.h>
# include <errno.h>
# define EVENT_SIZE ( sizeof (struct inotify_event) ) # define EVENT_SIZE ( sizeof (struct inotify_event) )
# define EVENT_LEN (EVENT_SIZE + 16) # define EVENT_LEN (EVENT_SIZE + 16)
# define EVENT_BUF_LEN ( 1024 * EVENT_LEN ) # define EVENT_BUF_LEN ( 1024 * EVENT_LEN )
@ -49,19 +49,19 @@ Class
defineTypeNameAndDebug(Foam::fileMonitor, 0); defineTypeNameAndDebug(Foam::fileMonitor, 0);
template<>
const char* Foam::NamedEnum<Foam::fileMonitor::fileState, 3>::names[] =
{
"unmodified",
"modified",
"deleted"
};
const Foam::NamedEnum<Foam::fileMonitor::fileState, 3> const Foam::NamedEnum<Foam::fileMonitor::fileState, 3>
Foam::fileMonitor::fileStateNames_; Foam::fileMonitor::fileStateNames_;
namespace Foam namespace Foam
{ {
template<>
const char* Foam::NamedEnum<Foam::fileMonitor::fileState, 3>::names[] =
{
"unmodified",
"modified",
"deleted"
};
//- Reduction operator for PackedList of fileState //- Reduction operator for PackedList of fileState
class reduceFileStates class reduceFileStates
{ {
@ -144,7 +144,7 @@ namespace Foam
#else #else
//- File descriptor for the inotify instance //- File descriptor for the inotify instance
int fd; int inotifyFd_;
//- Current watchIDs and corresponding directory id //- Current watchIDs and corresponding directory id
DynamicList<label> dirWatches_; DynamicList<label> dirWatches_;
@ -153,19 +153,40 @@ namespace Foam
//- initialise inotify //- initialise inotify
inline fileMonitorWatcher(const label sz = 20) inline fileMonitorWatcher(const label sz = 20)
: :
fd(inotify_init()), inotifyFd_(inotify_init()),
dirWatches_(sz), dirWatches_(sz),
dirFiles_(sz) dirFiles_(sz)
{} {
if (inotifyFd_ < 0)
{
static bool hasWarned = false;
if (!hasWarned)
{
hasWarned = true;
WarningIn("fileMonitorWatcher(const label)")
<< "Failed allocating an inotify descriptor : "
<< string(strerror(errno)) << endl
<< " Please increase the number of allowable "
<< "inotify instances" << endl
<< " (/proc/sys/fs/inotify/max_user_instances"
<< " on Linux)" << endl
<< " or switch off runTimeModifiable." << endl
<< " Continuing without additional file monitoring."
<< endl;
}
}
}
//- remove all watches //- remove all watches
inline ~fileMonitorWatcher() inline ~fileMonitorWatcher()
{
if (inotifyFd_ >= 0)
{ {
forAll(dirWatches_, i) forAll(dirWatches_, i)
{ {
if (dirWatches_[i] >= 0) if (dirWatches_[i] >= 0)
{ {
if (inotify_rm_watch(fd, int(dirWatches_[i]))) if (inotify_rm_watch(inotifyFd_, int(dirWatches_[i])))
{ {
WarningIn("fileMonitor::~fileMonitor()") WarningIn("fileMonitor::~fileMonitor()")
<< "Failed deleting directory watch " << "Failed deleting directory watch "
@ -174,13 +195,19 @@ namespace Foam
} }
} }
} }
}
inline bool addWatch(const label watchFd, const fileName& fName) inline bool addWatch(const label watchFd, const fileName& fName)
{ {
if (inotifyFd_ < 0)
{
return false;
}
// Add/retrieve watch on directory containing file // Add/retrieve watch on directory containing file
label dirWatchID = inotify_add_watch label dirWatchID = inotify_add_watch
( (
fd, inotifyFd_,
fName.path().c_str(), fName.path().c_str(),
IN_CLOSE_WRITE IN_CLOSE_WRITE
); );
@ -189,7 +216,8 @@ namespace Foam
{ {
FatalErrorIn("addWatch(const label, const fileName&)") FatalErrorIn("addWatch(const label, const fileName&)")
<< "Failed adding watch " << watchFd << "Failed adding watch " << watchFd
<< " to directory " << fName << " to directory " << fName << " due to "
<< string(strerror(errno))
<< exit(FatalError); << exit(FatalError);
} }
@ -209,6 +237,11 @@ namespace Foam
inline bool removeWatch(const label watchFd) inline bool removeWatch(const label watchFd)
{ {
if (inotifyFd_ < 0)
{
return false;
}
dirWatches_[watchFd] = -1; dirWatches_[watchFd] = -1;
return true; return true;
} }
@ -263,11 +296,11 @@ void Foam::fileMonitor::checkFiles() const
fd_set fdSet; fd_set fdSet;
// Add notify descriptor to select fd_set // Add notify descriptor to select fd_set
FD_ZERO(&fdSet); FD_ZERO(&fdSet);
FD_SET(watcher_->fd, &fdSet); FD_SET(watcher_->inotifyFd_, &fdSet);
int ready = select int ready = select
( (
watcher_->fd+1, // num filedescriptors in fdSet watcher_->inotifyFd_+1, // num filedescriptors in fdSet
&fdSet, // fdSet with only inotifyFd &fdSet, // fdSet with only inotifyFd
NULL, // No writefds NULL, // No writefds
NULL, // No errorfds NULL, // No errorfds
@ -280,15 +313,15 @@ void Foam::fileMonitor::checkFiles() const
<< "Problem in issuing select." << "Problem in issuing select."
<< abort(FatalError); << abort(FatalError);
} }
else if (FD_ISSET(watcher_->fd, &fdSet)) else if (FD_ISSET(watcher_->inotifyFd_, &fdSet))
{ {
// Read events // Read events
ssize_t nBytes = read(watcher_->fd, buffer, EVENT_BUF_LEN); ssize_t nBytes = read(watcher_->inotifyFd_, buffer, EVENT_BUF_LEN);
if (nBytes < 0) if (nBytes < 0)
{ {
FatalErrorIn("fileMonitor::updateStates(const fileName&)") FatalErrorIn("fileMonitor::updateStates(const fileName&)")
<< "read of " << watcher_->fd << "read of " << watcher_->inotifyFd_
<< " failed with " << label(nBytes) << " failed with " << label(nBytes)
<< abort(FatalError); << abort(FatalError);
} }
@ -364,6 +397,7 @@ Foam::label Foam::fileMonitor::addWatch(const fileName& fName)
label watchFd; label watchFd;
label sz = freeWatchFds_.size(); label sz = freeWatchFds_.size();
if (sz) if (sz)
{ {
watchFd = freeWatchFds_[sz-1]; watchFd = freeWatchFds_[sz-1];

View File

@ -346,6 +346,7 @@ $(basicPolyPatches)/generic/genericPolyPatch.C
constraintPolyPatches = $(polyPatches)/constraint constraintPolyPatches = $(polyPatches)/constraint
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C $(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C $(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/oldCyclic/oldCyclicPolyPatch.C
$(constraintPolyPatches)/empty/emptyPolyPatch.C $(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C $(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C $(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C

View File

@ -72,6 +72,11 @@ class HashPtrTable
template<class INew> template<class INew>
void read(Istream&, const INew& inewt); void read(Istream&, const INew& inewt);
//- Read from dictionary using given dictionary constructor class
template<class INew>
void read(const dictionary& dict, const INew& inewt);
public: public:
@ -91,6 +96,10 @@ public:
//- Construct from Istream using default Istream constructor class //- Construct from Istream using default Istream constructor class
HashPtrTable(Istream&); HashPtrTable(Istream&);
//- Construct from dictionary using default dictionary constructor
// class
HashPtrTable(const dictionary& dict);
//- Construct as copy //- Construct as copy
HashPtrTable(const HashPtrTable<T, Key, Hash>&); HashPtrTable(const HashPtrTable<T, Key, Hash>&);
@ -112,6 +121,9 @@ public:
//- Clear all entries from table //- Clear all entries from table
void clear(); void clear();
//- Write
void write(Ostream& os) const;
// Member Operators // Member Operators

View File

@ -27,6 +27,7 @@ License
#include "Istream.H" #include "Istream.H"
#include "Ostream.H" #include "Ostream.H"
#include "INew.H" #include "INew.H"
#include "dictionary.H"
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
@ -137,6 +138,39 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
} }
template<class T, class Key, class Hash>
template<class INew>
void Foam::HashPtrTable<T, Key, Hash>::read
(
const dictionary& dict,
const INew& inewt
)
{
forAllConstIter(dictionary, dict, iter)
{
insert(iter().keyword(), inewt(dict.subDict(iter().keyword())).ptr());
}
}
template<class T, class Key, class Hash>
void Foam::HashPtrTable<T, Key, Hash>::write(Ostream& os) const
{
for
(
typename HashPtrTable<T, Key, Hash>::const_iterator
iter = this->begin();
iter != this->end();
++iter
)
{
const T* ptr = iter();
ptr->write(os);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class T, class Key, class Hash> template<class T, class Key, class Hash>
@ -154,6 +188,13 @@ Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(Istream& is)
} }
template<class T, class Key, class Hash>
Foam::HashPtrTable<T, Key, Hash>::HashPtrTable(const dictionary& dict)
{
read(dict, INew<T>());
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class T, class Key, class Hash> template<class T, class Key, class Hash>

View File

@ -51,6 +51,12 @@ SeeAlso
namespace Foam namespace Foam
{ {
// Forward declaration
class PackedBoolList;
//- @typedef A List of PackedBoolList
typedef List<PackedBoolList> PackedBoolListList;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class PackedBoolList Declaration Class PackedBoolList Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -59,6 +59,7 @@ template<class T> class SubList;
template<class T> class UList; template<class T> class UList;
template<class T> Ostream& operator<<(Ostream&, const UList<T>&); template<class T> Ostream& operator<<(Ostream&, const UList<T>&);
typedef UList<label> labelUList;
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class UList Declaration Class UList Declaration

View File

@ -25,7 +25,7 @@ Class
Foam::INew Foam::INew
Description Description
A helper class when constructing from an Istream A helper class when constructing from an Istream or dictionary
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -52,18 +52,33 @@ class INew
public: public:
//- Construct null
INew() INew()
{} {}
//- Construct from Istream
autoPtr<T> operator()(Istream& is) const autoPtr<T> operator()(Istream& is) const
{ {
return T::New(is); return T::New(is);
} }
//- Construct from word and Istream
autoPtr<T> operator()(const word&, Istream& is) const autoPtr<T> operator()(const word&, Istream& is) const
{ {
return T::New(is); return T::New(is);
} }
//- Construct from dictionary
autoPtr<T> operator()(const dictionary& dict) const
{
return T::New(dict);
}
//- Construct from word and dictionary
autoPtr<T> operator()(const word&, const dictionary& dict) const
{
return T::New(dict);
}
}; };

View File

@ -32,13 +32,17 @@ License
defineTypeNameAndDebug(Foam::UPstream, 0); defineTypeNameAndDebug(Foam::UPstream, 0);
template<> namespace Foam
const char* Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names[] =
{ {
template<>
const char* Foam::NamedEnum<Foam::UPstream::commsTypes, 3>::names[] =
{
"blocking", "blocking",
"scheduled", "scheduled",
"nonBlocking" "nonBlocking"
}; };
}
const Foam::NamedEnum<Foam::UPstream::commsTypes, 3> const Foam::NamedEnum<Foam::UPstream::commsTypes, 3>
Foam::UPstream::commsTypeNames; Foam::UPstream::commsTypeNames;

View File

@ -32,27 +32,30 @@ License
defineTypeNameAndDebug(Foam::Time, 0); defineTypeNameAndDebug(Foam::Time, 0);
template<> namespace Foam
const char* Foam::NamedEnum<Foam::Time::stopAtControls, 4>::names[] =
{ {
template<>
const char* Foam::NamedEnum<Foam::Time::stopAtControls, 4>::names[] =
{
"endTime", "endTime",
"noWriteNow", "noWriteNow",
"writeNow", "writeNow",
"nextWrite" "nextWrite"
}; };
const Foam::NamedEnum<Foam::Time::stopAtControls, 4> template<>
Foam::Time::stopAtControlNames_; const char* Foam::NamedEnum<Foam::Time::writeControls, 5>::names[] =
{
template<>
const char* Foam::NamedEnum<Foam::Time::writeControls, 5>::names[] =
{
"timeStep", "timeStep",
"runTime", "runTime",
"adjustableRunTime", "adjustableRunTime",
"clockTime", "clockTime",
"cpuTime" "cpuTime"
}; };
}
const Foam::NamedEnum<Foam::Time::stopAtControls, 4>
Foam::Time::stopAtControlNames_;
const Foam::NamedEnum<Foam::Time::writeControls, 5> const Foam::NamedEnum<Foam::Time::writeControls, 5>
Foam::Time::writeControlNames_; Foam::Time::writeControlNames_;
@ -242,13 +245,14 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"), readLibs_(controlDict_, "libs"),
functionObjects_(*this) functionObjects_(*this)
{ {
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves. // Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_) if (runTimeModifiable_)
{ {
monitorPtr_.reset(new fileMonitor());
controlDict_.watchIndex() = addWatch(controlDict_.filePath()); controlDict_.watchIndex() = addWatch(controlDict_.filePath());
} }
setControls();
} }
@ -304,14 +308,20 @@ Foam::Time::Time
readLibs_(controlDict_, "libs"), readLibs_(controlDict_, "libs"),
functionObjects_(*this) functionObjects_(*this)
{ {
setControls();
// Time objects not registered so do like objectRegistry::checkIn ourselves. // Time objects not registered so do like objectRegistry::checkIn ourselves.
if (runTimeModifiable_) if (runTimeModifiable_)
{ {
controlDict_.watchIndex() = addWatch(controlDict_.filePath()); monitorPtr_.reset(new fileMonitor());
}
setControls(); // File might not exist yet.
fileName f(controlDict_.filePath());
if (f != fileName::null)
{
controlDict_.watchIndex() = addWatch(f);
}
}
} }
@ -385,18 +395,18 @@ Foam::Time::~Time()
Foam::label Foam::Time::addWatch(const fileName& fName) const Foam::label Foam::Time::addWatch(const fileName& fName) const
{ {
return monitor_.addWatch(fName); return monitorPtr_().addWatch(fName);
} }
bool Foam::Time::removeWatch(const label watchIndex) const bool Foam::Time::removeWatch(const label watchIndex) const
{ {
return monitor_.removeWatch(watchIndex); return monitorPtr_().removeWatch(watchIndex);
} }
const Foam::fileName& Foam::Time::getFile(const label watchIndex) const const Foam::fileName& Foam::Time::getFile(const label watchIndex) const
{ {
return monitor_.getFile(watchIndex); return monitorPtr_().getFile(watchIndex);
} }
@ -405,13 +415,13 @@ Foam::fileMonitor::fileState Foam::Time::getState
const label watchFd const label watchFd
) const ) const
{ {
return monitor_.getState(watchFd); return monitorPtr_().getState(watchFd);
} }
void Foam::Time::setUnmodified(const label watchFd) const void Foam::Time::setUnmodified(const label watchFd) const
{ {
monitor_.setUnmodified(watchFd); monitorPtr_().setUnmodified(watchFd);
} }

View File

@ -73,7 +73,7 @@ class Time
// Private data // Private data
//- file-change monitor for all registered files //- file-change monitor for all registered files
mutable fileMonitor monitor_; mutable autoPtr<fileMonitor> monitorPtr_;
//- The controlDict //- The controlDict
IOdictionary controlDict_; IOdictionary controlDict_;

View File

@ -211,10 +211,7 @@ void Foam::Time::readModifiedObjects()
// valid filePath). // valid filePath).
// Note: requires same ordering in objectRegistries on different // Note: requires same ordering in objectRegistries on different
// processors! // processors!
monitor_.updateStates(Pstream::parRun()); monitorPtr_().updateStates(Pstream::parRun());
//Pout<< "Time : runTimeModifiable_ and watchIndex:"
// << controlDict_.watchIndex() << endl;
// Time handling is special since controlDict_ is the one dictionary // Time handling is special since controlDict_ is the one dictionary
// that is not registered to any database. // that is not registered to any database.

View File

@ -111,6 +111,23 @@ public:
{ {
return name_; return name_;
} }
//- Return the local dictionary name (final part of scoped name)
const word dictName() const
{
const word scopedName = name_.name();
string::size_type i = scopedName.rfind(':');
if (i == scopedName.npos)
{
return scopedName;
}
else
{
return scopedName.substr(i + 1, scopedName.npos);
}
}
}; };

View File

@ -106,13 +106,19 @@ public:
// Member functions // Member functions
//- Return the dictionary name //- Return the local dictionary name (final part of scoped name)
const word dictName() const
{
return dictionary::dictName();
}
//- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
const fileName& name() const const fileName& name() const
{ {
return dictionary::name(); return dictionary::name();
} }
//- Return the dictionary name //- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
fileName& name() fileName& name()
{ {
return dictionary::name(); return dictionary::name();

View File

@ -27,16 +27,19 @@ License
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * // // * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
template<> namespace Foam
const char* Foam::NamedEnum {
< template<>
const char* Foam::NamedEnum
<
Foam::outputFilterOutputControl::outputControls, Foam::outputFilterOutputControl::outputControls,
2 2
>::names[] = >::names[] =
{ {
"timeStep", "timeStep",
"outputTime" "outputTime"
}; };
}
const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 2> const Foam::NamedEnum<Foam::outputFilterOutputControl::outputControls, 2>
Foam::outputFilterOutputControl::outputControlNames_; Foam::outputFilterOutputControl::outputControlNames_;

View File

@ -42,7 +42,7 @@ namespace Foam
// Forward declaration of friend functions and operators // Forward declaration of friend functions and operators
class lduScheduleEntry; struct lduScheduleEntry;
Ostream& operator<<(Ostream& os, const lduScheduleEntry& lb); Ostream& operator<<(Ostream& os, const lduScheduleEntry& lb);

View File

@ -44,16 +44,20 @@ namespace Foam
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word); addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary); addToRunTimeSelectionTable(polyPatch, cyclicPolyPatch, dictionary);
}
template<> template<>
const char* Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4>::names[] = const char* Foam::NamedEnum
{ <
Foam::cyclicPolyPatch::transformType,
4
>::names[] =
{
"unknown", "unknown",
"rotational", "rotational",
"translational", "translational",
"noOrdering" "noOrdering"
}; };
}
const Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4> const Foam::NamedEnum<Foam::cyclicPolyPatch::transformType, 4>
Foam::cyclicPolyPatch::transformTypeNames; Foam::cyclicPolyPatch::transformTypeNames;
@ -91,44 +95,58 @@ void Foam::cyclicPolyPatch::calcTransforms()
// Half0 // Half0
const cyclicPolyPatch& half0 = *this; const cyclicPolyPatch& half0 = *this;
const pointField& half0Ctrs = half0.faceCentres();
if (debug)
{
fileName casePath(boundaryMesh().mesh().time().path());
fileName nm0(casePath/name()+"_faces.obj");
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
<< " faces to OBJ file " << nm0 << endl;
writeOBJ(nm0, half0, half0.points());
}
vectorField half0Areas(half0.size()); vectorField half0Areas(half0.size());
forAll(half0, facei) forAll(half0, facei)
{ {
half0Areas[facei] = half0[facei].normal(half0.points()); half0Areas[facei] = half0[facei].normal(half0.points());
} }
// Half1 // Half1
const cyclicPolyPatch& half1 = neighbPatch(); const cyclicPolyPatch& half1 = neighbPatch();
vectorField half1Areas(half1.size());
forAll(half1, facei)
{
half1Areas[facei] = half1[facei].normal(half1.points());
}
const pointField& half1Ctrs = half1.faceCentres(); calcTransforms
(
half0,
half0.faceCentres(),
half0Areas,
half1.faceCentres(),
half1Areas
);
}
}
// Dump halves
if (debug) void Foam::cyclicPolyPatch::calcTransforms
(
const primitivePatch& half0,
const UList<point>& half0Ctrs,
const UList<point>& half0Areas,
const UList<point>& half1Ctrs,
const UList<point>& half1Areas
)
{
if (debug && owner())
{ {
fileName casePath(boundaryMesh().mesh().time().path()); fileName casePath(boundaryMesh().mesh().time().path());
{
fileName nm0(casePath/name()+"_faces.obj");
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << name()
<< " faces to OBJ file " << nm0 << endl;
writeOBJ(nm0, half0, half0.points());
}
const cyclicPolyPatch& half1 = neighbPatch();
{
fileName nm1(casePath/half1.name()+"_faces.obj"); fileName nm1(casePath/half1.name()+"_faces.obj");
Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name() Pout<< "cyclicPolyPatch::calcTransforms : Writing " << half1.name()
<< " faces to OBJ file " << nm1 << endl; << " faces to OBJ file " << nm1 << endl;
writeOBJ(nm1, half1, half1.points()); writeOBJ(nm1, half1, half1.points());
}
{
OFstream str(casePath/name()+"_to_" + half1.name() + ".obj"); OFstream str(casePath/name()+"_to_" + half1.name() + ".obj");
label vertI = 0; label vertI = 0;
Pout<< "cyclicPolyPatch::calcTransforms :" Pout<< "cyclicPolyPatch::calcTransforms :"
@ -145,35 +163,10 @@ void Foam::cyclicPolyPatch::calcTransforms()
str << "l " << vertI-1 << ' ' << vertI << nl; str << "l " << vertI-1 << ' ' << vertI << nl;
} }
} }
vectorField half1Areas(half1.size());
forAll(half1, facei)
{
half1Areas[facei] = half1[facei].normal(half1.points());
} }
calcTransforms
(
half0,
half0Ctrs,
half0Areas,
half1Ctrs,
half1Areas
);
}
}
void Foam::cyclicPolyPatch::calcTransforms
(
const primitivePatch& half0,
const UList<point>& half0Ctrs,
const UList<point>& half0Areas,
const UList<point>& half1Ctrs,
const UList<point>& half1Areas
)
{
if (half0Ctrs.size() != half1Ctrs.size()) if (half0Ctrs.size() != half1Ctrs.size())
{ {
FatalErrorIn FatalErrorIn

View File

@ -0,0 +1,318 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 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/>.
Class
Foam::oldCyclicPolyPatch
Description
'old' style cyclic polyPatch with all faces in single patch. Does ordering
but cannot be used to run. Writes 'type cyclic' so foamUpgradeCyclics
can be run afterwards.
Used to get cyclics from mesh converters that assume cyclics in single
patch (e.g. fluent3DMeshToFoam)
SourceFiles
oldCyclicPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef oldCyclicPolyPatch_H
#define oldCyclicPolyPatch_H
#include "coupledPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class oldCyclicPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class oldCyclicPolyPatch
:
public coupledPolyPatch
{
public:
enum transformType
{
UNKNOWN,
ROTATIONAL,
TRANSLATIONAL
};
static const NamedEnum<transformType, 3> transformTypeNames;
private:
// Private data
//- Morph:angle between normals of neighbouring faces.
// Used to split cyclic into halves.
scalar featureCos_;
//- Type of transformation - rotational or translational
transformType transform_;
// For rotation
//- Axis of rotation for rotational cyclics
vector rotationAxis_;
//- point on axis of rotation for rotational cyclics
point rotationCentre_;
// For translation
//- Translation vector
vector separationVector_;
// Private member functions
//- Find amongst selected faces the one with the largest area
static label findMaxArea(const pointField&, const faceList&);
void calcTransforms();
//- Calculate face centres
static pointField calcFaceCentres
(
const UList<face>&,
const pointField&
);
//- Get f[0] for all faces
static pointField getAnchorPoints
(
const UList<face>&,
const pointField&
);
// Face ordering
//- Find the two parts of the faces of pp using feature edges.
// Returns true if successfull.
bool getGeometricHalves
(
const primitivePatch&,
labelList&,
labelList&
) const;
//- Calculate geometric factors of the two halves.
void getCentresAndAnchors
(
const primitivePatch&,
const faceList& half0Faces,
const faceList& half1Faces,
pointField& ppPoints,
pointField& half0Ctrs,
pointField& half1Ctrs,
pointField& anchors0,
scalarField& tols
) const;
//- Given matched faces matches the anchor point. Sets faceMap,
// rotation. Returns true if all matched.
bool matchAnchors
(
const bool report,
const primitivePatch&,
const labelList&,
const pointField&,
const labelList&,
const faceList&,
const labelList&,
const scalarField&,
labelList& faceMap,
labelList& rotation
) const;
//- For rotational cases, try to find a unique face on each side
// of the cyclic.
label getConsistentRotationFace
(
const pointField& faceCentres
) const;
protected:
// Protected Member functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry(PstreamBuffers&);
//- Calculate the patch geometry
virtual void calcGeometry(PstreamBuffers&);
//- Initialise the patches for moving points
virtual void initMovePoints(PstreamBuffers&, const pointField&);
//- Correct patches after moving points
virtual void movePoints(PstreamBuffers&, const pointField&);
//- Initialise the update of the patch topology
virtual void initUpdateMesh(PstreamBuffers&);
//- Update of the patch topology
virtual void updateMesh(PstreamBuffers&);
public:
//- Runtime type information
TypeName("oldCyclic");
// Constructors
//- Construct from components
oldCyclicPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
);
//- Construct from dictionary
oldCyclicPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm
);
//- Construct as copy, resetting the boundary mesh
oldCyclicPolyPatch(const oldCyclicPolyPatch&, const polyBoundaryMesh&);
//- Construct given the original patch and resetting the
// face list and boundary mesh information
oldCyclicPolyPatch
(
const oldCyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new oldCyclicPolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new oldCyclicPolyPatch(*this, bm, index, newSize, newStart)
);
}
// Destructor
virtual ~oldCyclicPolyPatch();
// Member Functions
// Access
//- Does this side own the patch ?
virtual bool owner() const
{
notImplemented("oldCyclicPolyPatch::owner()");
return true;
}
//- Transform a patch-based position from other side to this side
virtual void transformPosition(pointField& l) const
{
notImplemented("transformPosition(pointField&)");
}
//- Calculate the patch geometry
virtual void calcGeometry
(
const primitivePatch& referPatch,
const UList<point>& thisCtrs,
const UList<point>& thisAreas,
const UList<point>& thisCc,
const UList<point>& nbrCtrs,
const UList<point>& nbrAreas,
const UList<point>& nbrCc
);
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual void initOrder
(
PstreamBuffers&,
const primitivePatch&
) const;
//- Return new ordering for primitivePatch.
// Ordering is -faceMap: for every face
// index of the new face -rotation:for every new face the clockwise
// shift of the original face. Return false if nothing changes
// (faceMap is identity, rotation is 0), true otherwise.
virtual bool order
(
PstreamBuffers&,
const primitivePatch&,
labelList& faceMap,
labelList& rotation
) const;
//- Write the polyPatch data as a dictionary
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -49,7 +49,7 @@ Foam::PatchTools::sortedEdgeFaces
const Field<PointType>& localPoints = p.localPoints(); const Field<PointType>& localPoints = p.localPoints();
// create the lists for the various results. (resized on completion) // create the lists for the various results. (resized on completion)
labelListList& sortedEdgeFaces = labelListList(edgeFaces.size()); labelListList sortedEdgeFaces(edgeFaces.size());
forAll(edgeFaces, edgeI) forAll(edgeFaces, edgeI)
{ {

View File

@ -29,27 +29,29 @@ License
Foam::scalar Foam::intersection::planarTol_ = 0.2; Foam::scalar Foam::intersection::planarTol_ = 0.2;
template<> namespace Foam
const char* Foam::NamedEnum<Foam::intersection::direction, 2>::names[] =
{ {
template<>
const char* Foam::NamedEnum<Foam::intersection::direction, 2>::names[] =
{
"vector", "vector",
"contactSphere" "contactSphere"
}; };
const Foam::NamedEnum<Foam::intersection::direction, 2> template<>
Foam::intersection::directionNames_; const char* Foam::NamedEnum<Foam::intersection::algorithm, 3>::names[] =
{
template<>
const char* Foam::NamedEnum<Foam::intersection::algorithm, 3>::names[] =
{
"fullRay", "fullRay",
"halfRay", "halfRay",
"visible" "visible"
}; };
}
const Foam::NamedEnum<Foam::intersection::direction, 2>
Foam::intersection::directionNames_;
const Foam::NamedEnum<Foam::intersection::algorithm, 3> const Foam::NamedEnum<Foam::intersection::algorithm, 3>
Foam::intersection::algorithmNames_; Foam::intersection::algorithmNames_;
// ************************************************************************* // // ************************************************************************* //

View File

@ -21,6 +21,12 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::boolUList
Description
A UList of bool
Typedef Typedef
Foam::boolList Foam::boolList
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<bool> boolUList;
typedef List<bool> boolList; typedef List<bool> boolList;
typedef List<List<bool> > boolListList; typedef List<List<bool> > boolListList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::fileNameUList
Description
A UList of fileNames.
Typedef Typedef
Foam::fileNameList Foam::fileNameList
Description Description
List of fileNames. A List of fileNames.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<fileName> fileNameUList;
typedef List<fileName> fileNameList; typedef List<fileName> fileNameList;
} }

View File

@ -25,7 +25,19 @@ Typedef
Foam::labelList Foam::labelList
Description Description
Label container classes A List of labels
Typedef
Foam::labelListList
Description
A List of labelList
Typedef
Foam::labelListListList
Description
A List of labelListList
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,11 +51,11 @@ Description
namespace Foam namespace Foam
{ {
// Note: frequently used UList version is located in container itself
typedef List<label> labelList; typedef List<label> labelList;
typedef List<labelList> labelListList; typedef List<labelList> labelListList;
typedef List<labelListList> labelListListList; typedef List<labelListList> labelListListList;
typedef UList<label> unallocLabelList;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::scalarUList
Description
A UList of scalars.
Typedef Typedef
Foam::scalarList Foam::scalarList
Description Description
List of scalars. A List of scalars.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<scalar> scalarUList;
typedef List<scalar> scalarList; typedef List<scalar> scalarList;
typedef List<scalarList> scalarListList; typedef List<scalarList> scalarListList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::sphericalTensorUList
Description
A UList of sphericalTensors.
Typedef Typedef
Foam::sphericalTensorList Foam::sphericalTensorList
Description Description
List of sphericalTensors. A List of sphericalTensors.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<sphericalTensor> sphericalTensorUList;
typedef List<sphericalTensor> sphericalTensorList; typedef List<sphericalTensor> sphericalTensorList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::stringUList
Description
A UList of strings.
Typedef Typedef
Foam::stringList Foam::stringList
Description Description
List of strings. A List of strings.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<string> stringUList;
typedef List<string> stringList; typedef List<string> stringList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::symmTensorUList
Description
A UList of symmTensors.
Typedef Typedef
Foam::symmTensorList Foam::symmTensorList
Description Description
List of symmTensors. A List of symmTensors.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<symmTensor> symmTensorUList;
typedef List<symmTensor> symmTensorList; typedef List<symmTensor> symmTensorList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::tensorUList
Description
A UList of tensors.
Typedef Typedef
Foam::tensorList Foam::tensorList
Description Description
List of tensors. A List of tensors.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<tensor> tensorUList;
typedef List<tensor> tensorList; typedef List<tensor> tensorList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::vectorUList
Description
A UList of vectors.
Typedef Typedef
Foam::vectorList Foam::vectorList
Description Description
List of vectors. A List of vectors.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<vector> vectorUList;
typedef List<vector> vectorList; typedef List<vector> vectorList;
} }

View File

@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::wordUList
Description
A UList of words.
Typedef Typedef
Foam::wordList Foam::wordList
Description Description
List of words. A List of words.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<word> wordUList;
typedef List<word> wordList; typedef List<word> wordList;
} }

View File

@ -2,7 +2,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) 1991-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -21,11 +21,17 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::wordReUList
Description
A UList of wordRe (word or regular expression)
Typedef Typedef
Foam::wordReList Foam::wordReList
Description Description
List of wordRe (word or regular expression) A List of wordRe (word or regular expression)
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,6 +45,8 @@ Description
namespace Foam namespace Foam
{ {
typedef UList<wordRe> wordReUList;
typedef List<wordRe> wordReList; typedef List<wordRe> wordReList;
} }

View File

@ -28,32 +28,35 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> namespace Foam
const char* const Foam::labelTensor::typeName = "labelTensor";
template<>
const char* Foam::labelTensor::componentNames[] =
{ {
template<>
const char* const Foam::labelTensor::typeName = "labelTensor";
template<>
const char* Foam::labelTensor::componentNames[] =
{
"xx", "xy", "xz", "xx", "xy", "xz",
"yx", "yy", "yz", "yx", "yy", "yz",
"zx", "zy", "zz" "zx", "zy", "zz"
}; };
template<> template<>
const Foam::labelTensor Foam::labelTensor::zero const Foam::labelTensor Foam::labelTensor::zero
( (
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0 0, 0, 0
); );
template<> template<>
const Foam::labelTensor Foam::labelTensor::one const Foam::labelTensor Foam::labelTensor::one
( (
1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,
1, 1, 1 1, 1, 1
); );
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -27,17 +27,19 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> namespace Foam
const char* const Foam::labelVector::typeName = "labelVector"; {
template<>
const char* const Foam::labelVector::typeName = "labelVector";
template<> template<>
const char* Foam::labelVector::componentNames[] = {"x", "y", "z"}; const char* Foam::labelVector::componentNames[] = {"x", "y", "z"};
template<> template<>
const Foam::labelVector Foam::labelVector::zero(0, 0, 0); const Foam::labelVector Foam::labelVector::zero(0, 0, 0);
template<>
const Foam::labelVector Foam::labelVector::one(1, 1, 1);
template<>
const Foam::labelVector Foam::labelVector::one(1, 1, 1);
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -111,6 +111,15 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is)
} }
template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial(Istream& is)
:
VectorSpace<Polynomial<PolySize>, scalar, PolySize>(is),
logActive_(false),
logCoeff_(0.0)
{}
template<int PolySize> template<int PolySize>
Foam::Polynomial<PolySize>::Polynomial Foam::Polynomial<PolySize>::Polynomial
( (

View File

@ -110,6 +110,9 @@ public:
//- Construct from a list of coefficients //- Construct from a list of coefficients
explicit Polynomial(const UList<scalar>& coeffs); explicit Polynomial(const UList<scalar>& coeffs);
//- Construct from Istream
Polynomial(Istream& is);
//- Construct from name and Istream //- Construct from name and Istream
Polynomial(const word& name, Istream& is); Polynomial(const word& name, Istream& is);

View File

@ -2,7 +2,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) 1991-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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) 1991-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,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) 1991-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -32,22 +32,25 @@ License
#include "meshTools.H" #include "meshTools.H"
#include "hexMatcher.H" #include "hexMatcher.H"
#include "Switch.H" #include "Switch.H"
#include "globalMeshData.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> namespace Foam
const char* Foam::NamedEnum<Foam::directions::directionType, 3>::names[] =
{ {
template<>
const char* Foam::NamedEnum<Foam::directions::directionType, 3>::names[] =
{
"tan1", "tan1",
"tan2", "tan2",
"normal" "normal"
}; };
}
const Foam::NamedEnum<Foam::directions::directionType, 3> const Foam::NamedEnum<Foam::directions::directionType, 3>
Foam::directions::directionTypeNames_; Foam::directions::directionTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// For debugging // For debugging
@ -204,7 +207,7 @@ Foam::vectorField Foam::directions::propagateDirection
mesh, mesh,
changedFaces, changedFaces,
changedFacesInfo, changedFacesInfo,
mesh.nCells() mesh.globalData().nTotalCells()+1
); );
const List<directionInfo>& cellInfo = directionCalc.allCellInfo(); const List<directionInfo>& cellInfo = directionCalc.allCellInfo();

View File

@ -2332,7 +2332,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
seedFacesInfo.clear(); seedFacesInfo.clear();
// Iterate until no change. Now 2:1 face difference should be satisfied // Iterate until no change. Now 2:1 face difference should be satisfied
levelCalc.iterate(mesh_.globalData().nTotalFaces()); levelCalc.iterate(mesh_.globalData().nTotalFaces()+1);
// Now check point-connected cells (face-connected cells already ok): // Now check point-connected cells (face-connected cells already ok):
@ -2836,7 +2836,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
seedFacesInfo, seedFacesInfo,
allFaceInfo, allFaceInfo,
allCellInfo, allCellInfo,
mesh_.globalData().nTotalCells() mesh_.globalData().nTotalCells()+1
); );

View File

@ -45,15 +45,18 @@ namespace Foam
slidingInterface, slidingInterface,
dictionary dictionary
); );
}
template<>
template<> const char* Foam::NamedEnum
const char* Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2>::names[] = <
{ Foam::slidingInterface::typeOfMatch,
2
>::names[] =
{
"integral", "integral",
"partial" "partial"
}; };
}
const Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2> const Foam::NamedEnum<Foam::slidingInterface::typeOfMatch, 2>

View File

@ -21,6 +21,12 @@ License
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Namespace
Foam::porousMedia
Description
Namespace for models related to porous media
Class Class
Foam::porousZone Foam::porousZone

View File

@ -171,6 +171,23 @@ tmp<Field<Type> > cyclicFvPatchField<Type>::patchNeighbourField() const
} }
template<class Type>
const cyclicFvPatchField<Type>& cyclicFvPatchField<Type>::neighbourPatchField()
const
{
const GeometricField<Type, fvPatchField, volMesh>& fld =
static_cast<const GeometricField<Type, fvPatchField, volMesh>&>
(
this->internalField()
);
return refCast<const cyclicFvPatchField<Type> >
(
fld.boundaryField()[this->cyclicPatch().neighbPatchID()]
);
}
template<class Type> template<class Type>
void cyclicFvPatchField<Type>::updateInterfaceMatrix void cyclicFvPatchField<Type>::updateInterfaceMatrix
( (

View File

@ -150,9 +150,12 @@ public:
// Evaluation functions // Evaluation functions
//- Return neighbour coupled given internal cell data //- Return neighbour coupled internal cell data
tmp<Field<Type> > patchNeighbourField() const; tmp<Field<Type> > patchNeighbourField() const;
//- Return reference to neighbour patchField
const cyclicFvPatchField<Type>& neighbourPatchField() const;
//- Update result field based on interface functionality //- Update result field based on interface functionality
virtual void updateInterfaceMatrix virtual void updateInterfaceMatrix
( (

View File

@ -260,7 +260,7 @@ void directMappedFixedValueFvPatchField<Type>::updateCoeffs()
allValues allValues
); );
newValues = this->patch().patchSlice(allValues); newValues.transfer(allValues);
break; break;
} }

View File

@ -25,7 +25,13 @@ Class
Foam::directMappedFixedValueFvPatchField Foam::directMappedFixedValueFvPatchField
Description Description
Recycles the value at a set of internal faces back to *this. Recycles the value at a set of cells or patch faces back to *this. Can not
sample internal faces (since volField not defined on faces).
mode = NEARESTCELL : sample nearest cell
mode = NEARESTPATCHFACE : sample nearest face on selected patch
mode = NEARESTFACE : sample nearest face on any patch. Note: does not
warn if nearest actually is on internal face!
SourceFiles SourceFiles
directMappedFixedValueFvPatchField.C directMappedFixedValueFvPatchField.C

View File

@ -198,7 +198,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
distMap.constructMap(), distMap.constructMap(),
allUValues allUValues
); );
newUValues = patch().patchSlice(allUValues); newUValues.transfer(allUValues);
mapDistribute::distribute mapDistribute::distribute
( (
@ -209,7 +209,7 @@ void directMappedVelocityFluxFixedValueFvPatchField::updateCoeffs()
distMap.constructMap(), distMap.constructMap(),
allPhiValues allPhiValues
); );
newPhiValues = patch().patchSlice(allPhiValues); newPhiValues.transfer(allPhiValues);
break; break;
} }

View File

@ -27,6 +27,11 @@ Class
Description Description
Recycles the velocity and flux at a patch to this patch Recycles the velocity and flux at a patch to this patch
mode = NEARESTCELL : sample nearest cell
mode = NEARESTPATCHFACE : sample nearest face on selected patch
mode = NEARESTFACE : sample nearest face on any patch. Note: does not
warn if nearest actually is on internal face!
SourceFiles SourceFiles
directMappedVelocityFluxFixedValueFvPatchField.C directMappedVelocityFluxFixedValueFvPatchField.C

View File

@ -139,9 +139,19 @@ public:
//- Return the "jump" across the patch. //- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const virtual tmp<Field<Type> > jump() const
{
if (this->cyclicPatch().owner())
{ {
return jump_; return jump_;
} }
else
{
return refCast<const fanFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
// Mapping functions // Mapping functions

View File

@ -108,7 +108,7 @@ public:
} }
//- Return processor number //- Return processor number
virtual const cyclicLduInterface& neighbPatch() const virtual const cyclicFvPatch& neighbPatch() const
{ {
return refCast<const cyclicFvPatch> return refCast<const cyclicFvPatch>
( (

View File

@ -115,7 +115,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
mesh, mesh,
changedFaces, changedFaces,
faceDist, faceDist,
mesh.globalData().nTotalCells() // max iterations mesh.globalData().nTotalCells()+1 // max iterations
); );
const List<wallPoint>& faceInfo = waveInfo.allFaceInfo(); const List<wallPoint>& faceInfo = waveInfo.allFaceInfo();

View File

@ -27,15 +27,17 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> namespace Foam
const char* Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>::names[] =
{ {
template<>
const char* Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>::names[] =
{
"gas", "gas",
"liquid", "liquid",
"solid", "solid",
"unknown" "unknown"
}; };
}
const Foam::NamedEnum<Foam::phaseProperties::phaseType, 4> const Foam::NamedEnum<Foam::phaseProperties::phaseType, 4>
Foam::phaseProperties::phaseTypeNames_; Foam::phaseProperties::phaseTypeNames_;

View File

@ -34,15 +34,19 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<> namespace Foam
const char*
Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] =
{ {
template<>
const char*
Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>::names[] =
{
"inside", "inside",
"outside", "outside",
"insidePoint", "insidePoint",
"none" "none"
}; };
}
const Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4> const Foam::NamedEnum<Foam::refinementSurfaces::areaSelectionAlgo, 4>
Foam::refinementSurfaces::areaSelectionAlgoNames; Foam::refinementSurfaces::areaSelectionAlgoNames;

View File

@ -322,7 +322,7 @@ void Foam::cellClassification::markCells
changedFaces, // Labels of changed faces changedFaces, // Labels of changed faces
changedFacesInfo, // Information on changed faces changedFacesInfo, // Information on changed faces
cellInfoList, // Information on all cells cellInfoList, // Information on all cells
mesh_.globalData().nTotalCells() // max iterations mesh_.globalData().nTotalCells()+1 // max iterations
); );
// Get information out of cellInfoList // Get information out of cellInfoList

View File

@ -225,7 +225,7 @@ void Foam::patchDataWave<TransferType>::correct()
mesh(), mesh(),
changedFaces, changedFaces,
faceDist, faceDist,
mesh().globalData().nTotalCells() // max iterations mesh().globalData().nTotalCells()+1 // max iterations
); );

View File

@ -186,7 +186,7 @@ void Foam::patchWave::correct()
mesh(), mesh(),
changedFaces, changedFaces,
faceDist, faceDist,
mesh().globalData().nTotalCells() // max iterations mesh().globalData().nTotalCells()+1 // max iterations
); );

View File

@ -66,9 +66,9 @@ public:
//- Mesh items to sample //- Mesh items to sample
enum sampleMode enum sampleMode
{ {
NEARESTCELL, NEARESTCELL, // nearest cell
NEARESTPATCHFACE, NEARESTPATCHFACE, // faces on selected patch
NEARESTFACE NEARESTFACE // nearest face
}; };
private: private:
@ -201,7 +201,7 @@ public:
return sampleRegion_; return sampleRegion_;
} }
//- Patch (only if NEARESTBOUNDARY) //- Patch (only if NEARESTPATCHFACE)
const word& samplePatch() const const word& samplePatch() const
{ {
return samplePatch_; return samplePatch_;

View File

@ -102,6 +102,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -93,6 +93,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -109,6 +109,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -33,13 +33,18 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(faceToCell, 0);
addToRunTimeSelectionTable(topoSetSource, faceToCell, word);
addToRunTimeSelectionTable(topoSetSource, faceToCell, istream);
defineTypeNameAndDebug(faceToCell, 0); template<>
const char* Foam::NamedEnum<Foam::faceToCell::faceAction, 4>::names[] =
addToRunTimeSelectionTable(topoSetSource, faceToCell, word); {
"neighbour",
addToRunTimeSelectionTable(topoSetSource, faceToCell, istream); "owner",
"any",
"all"
};
} }
@ -51,15 +56,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceToCell::usage_
" of the faces in the faceSet or where all faces are in the faceSet\n\n" " of the faces in the faceSet or where all faces are in the faceSet\n\n"
); );
template<>
const char* Foam::NamedEnum<Foam::faceToCell::faceAction, 4>::names[] =
{
"neighbour",
"owner",
"any",
"all"
};
const Foam::NamedEnum<Foam::faceToCell::faceAction, 4> const Foam::NamedEnum<Foam::faceToCell::faceAction, 4>
Foam::faceToCell::faceActionNames_; Foam::faceToCell::faceActionNames_;

View File

@ -119,6 +119,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -32,13 +32,16 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(faceZoneToCell, 0);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word);
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream);
defineTypeNameAndDebug(faceZoneToCell, 0); template<>
const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] =
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, word); {
"master",
addToRunTimeSelectionTable(topoSetSource, faceZoneToCell, istream); "slave"
};
} }
@ -51,14 +54,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToCell::usage_
); );
template<>
const char* Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>::names[] =
{
"master",
"slave"
};
const Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2> const Foam::NamedEnum<Foam::faceZoneToCell::faceAction, 2>
Foam::faceZoneToCell::faceActionNames_; Foam::faceZoneToCell::faceActionNames_;

View File

@ -116,6 +116,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -115,6 +115,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -100,6 +100,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -101,6 +101,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -100,6 +100,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -33,13 +33,15 @@ License
namespace Foam namespace Foam
{ {
defineTypeNameAndDebug(pointToCell, 0);
addToRunTimeSelectionTable(topoSetSource, pointToCell, word);
addToRunTimeSelectionTable(topoSetSource, pointToCell, istream);
defineTypeNameAndDebug(pointToCell, 0); template<>
const char* Foam::NamedEnum<Foam::pointToCell::pointAction, 1>::names[] =
addToRunTimeSelectionTable(topoSetSource, pointToCell, word); {
"any"
addToRunTimeSelectionTable(topoSetSource, pointToCell, istream); };
} }
@ -50,13 +52,6 @@ Foam::topoSetSource::addToUsageTable Foam::pointToCell::usage_
" Select all cells with any point in the pointSet\n\n" " Select all cells with any point in the pointSet\n\n"
); );
template<>
const char* Foam::NamedEnum<Foam::pointToCell::pointAction, 1>::names[] =
{
"any"
};
const Foam::NamedEnum<Foam::pointToCell::pointAction, 1> const Foam::NamedEnum<Foam::pointToCell::pointAction, 1>
Foam::pointToCell::pointActionNames_; Foam::pointToCell::pointActionNames_;

View File

@ -115,6 +115,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -105,6 +105,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet(const topoSetSource::setAction action, topoSet&) virtual void applyToSet(const topoSetSource::setAction action, topoSet&)
const; const;

View File

@ -111,6 +111,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -109,6 +109,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -105,6 +105,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

View File

@ -195,6 +195,11 @@ public:
// Member Functions // Member Functions
virtual sourceType setType() const
{
return CELLSETSOURCE;
}
virtual void applyToSet virtual void applyToSet
( (
const topoSetSource::setAction action, const topoSetSource::setAction action,

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