diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files b/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files index f98171fc93..a63fc64fa7 100644 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files +++ b/applications/solvers/Lagrangian/kinematicParcelFoam/Make/files @@ -1,3 +1,3 @@ kinematicParcelFoam.C -EXE = $(FOAM_USER_APPBIN)/kinematicParcelFoam +EXE = $(FOAM_APPBIN)/kinematicParcelFoam diff --git a/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C b/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C index 290480583c..57b3dc5d13 100644 --- a/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C +++ b/applications/solvers/Lagrangian/kinematicParcelFoam/kinematicParcelFoam.C @@ -26,7 +26,8 @@ Application kinematicParcelFoam Description - Transient solver a single kinematicCloud. + Transient solver for a single kinematicCloud. Uses precalculated velocity + field to evolve a cloud. \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index f0c8e0a6c4..a8cb5dbb98 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -697,7 +697,7 @@ endOfSection {space}")"{space} /* ------ Ignore remaining space and \n s. ------ */ -<*>{some_space}|\n { +<*>{some_space}|\n|\r { } diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/writeSurfFields.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/writeSurfFields.C index 5e40ed5871..58107bc776 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/writeSurfFields.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/writeSurfFields.C @@ -28,7 +28,7 @@ License #include "OFstream.H" #include "floatScalar.H" #include "writeFuns.H" -#include "emptyFvPatchFields.H" +#include "emptyFvsPatchFields.H" #include "fvsPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -100,7 +100,7 @@ void writeSurfFields const fvPatch& pp = mesh.boundary()[patchI]; - if (isA(pf)) + if (isA(pf)) { // Note: loop over polypatch size, not fvpatch size. forAll(pp.patch(), i) diff --git a/applications/utilities/surface/surfaceSubset/surfaceSubset.C b/applications/utilities/surface/surfaceSubset/surfaceSubset.C index cf0771d260..aa30790b5c 100644 --- a/applications/utilities/surface/surfaceSubset/surfaceSubset.C +++ b/applications/utilities/surface/surfaceSubset/surfaceSubset.C @@ -248,7 +248,7 @@ int main(int argc, char *argv[]) indexedOctree selectTree ( treeDataTriSurface(selectSurf), - bb.extend(rndGen, 1E-3), // slightly randomize bb + bb.extend(rndGen, 1E-4), // slightly randomize bb 8, // maxLevel 10, // leafsize 3.0 // duplicity diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 56cdd8aacf..b8da8ba698 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -45,9 +45,9 @@ export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER if [ "$PYTHONPATH" ]; then - export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping + export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 else - export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping + export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 fi diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index c9fd98f4a2..636b10eb75 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -45,9 +45,9 @@ setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER if ($?PYTHONPATH) then - setenv PYTHONPATH ${PYTHONPATH}:$ParaView_DIR/bin:$ParaView_DIR/Utilities/VTKPythonWrapping + setenv PYTHONPATH ${PYTHONPATH}:$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 else - setenv PYTHONPATH $ParaView_DIR/bin:$ParaView_DIR/Utilities/VTKPythonWrapping + setenv PYTHONPATH $ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 endif if ( -r $ParaView_INST_DIR ) then diff --git a/src/OpenFOAM/db/Time/TimeIO.C b/src/OpenFOAM/db/Time/TimeIO.C index c74b674389..4299d05b5e 100644 --- a/src/OpenFOAM/db/Time/TimeIO.C +++ b/src/OpenFOAM/db/Time/TimeIO.C @@ -86,13 +86,6 @@ void Foam::Time::readDict() purgeWrite_ = 0; } - - if (writeControl_ != wcTimeStep && purgeWrite_ > 0) - { - FatalIOErrorIn("Time::readDict()", controlDict_) - << "writeControl must be set to timeStep for purgeWrite " - << exit(FatalIOError); - } } if (controlDict_.found("timeFormat")) diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.C b/src/OpenFOAM/meshes/boundBox/boundBox.C index c368e1a662..c87e552c85 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.C +++ b/src/OpenFOAM/meshes/boundBox/boundBox.C @@ -87,9 +87,47 @@ boundBox::boundBox(Istream& is) // * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // -Ostream& operator<<(Ostream& os, const boundBox& b) +Ostream& operator<<(Ostream& os, const boundBox& bb) { - return os << b.min() << token::SPACE << b.max(); + if (os.format() == IOstream::ASCII) + { + os << bb.min_ << token::SPACE << bb.max_; + } + else + { + os.write + ( + reinterpret_cast(&bb.min_), + sizeof(boundBox) + ); + } + + // Check state of Ostream + os.check("Ostream& operator<<(Ostream&, const boundBox&)"); + + return os; +} + + +Istream& operator>>(Istream& is, boundBox& bb) +{ + if (is.format() == IOstream::ASCII) + { + return is >> bb.min_ >> bb.max_; + } + else + { + is.read + ( + reinterpret_cast(&bb.min_), + sizeof(boundBox) + ); + } + + // Check state of Istream + is.check("Istream& operator>>(Istream&, boundBox&)"); + + return is; } diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.H b/src/OpenFOAM/meshes/boundBox/boundBox.H index 40287e53eb..1493c0fe2f 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.H +++ b/src/OpenFOAM/meshes/boundBox/boundBox.H @@ -153,12 +153,31 @@ public: } - // Ostream operator + // Friend Operators - friend Ostream& operator<<(Ostream& os, const boundBox& b); + friend bool operator==(const boundBox& a, const boundBox& b) + { + return (a.min_ == b.min_) && (a.max_ == b.max_); + } + + friend bool operator!=(const boundBox& a, const boundBox& b) + { + return !(a == b); + } + + + // IOstream operator + + friend Istream& operator>>(Istream& is, boundBox&); + friend Ostream& operator<<(Ostream& os, const boundBox&); }; +//- Specify data associated with boundBox type is contiguous +template<> +inline bool contiguous() {return contiguous();} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C b/src/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C index fe64ea81c3..1a577acecb 100644 --- a/src/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C +++ b/src/autoMesh/autoHexMesh/shellSurfaces/shellSurfaces.C @@ -30,6 +30,7 @@ License #include "triSurfaceMesh.H" #include "refinementSurfaces.H" #include "searchableSurfaces.H" +#include "orientedSurface.H" #include "pointIndexHit.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -211,7 +212,27 @@ void Foam::shellSurfaces::orient() refCast(s) ); - refinementSurfaces::orientSurface(outsidePt, shell); + // Flip surface so outsidePt is outside. + bool anyFlipped = orientedSurface::orient + ( + shell, + outsidePt, + true + ); + + if (anyFlipped) + { + // orientedSurface will have done a clearOut of the surface. + // we could do a clearout of the triSurfaceMeshes::trees() + // but these aren't affected by orientation + // (except for cached + // sideness which should not be set at this point. + // !!Should check!) + + Info<< "shellSurfaces : Flipped orientation of surface " + << s.name() + << " so point " << outsidePt << " is outside." << endl; + } } } } diff --git a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C index 6d97285d73..f3918578cd 100644 --- a/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C +++ b/src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C @@ -29,8 +29,8 @@ License #include "matchPoints.H" #include "indirectPrimitivePatch.H" #include "meshTools.H" -#include "octreeDataFace.H" -#include "octree.H" +#include "treeDataFace.H" +#include "indexedOctree.H" #include "OFstream.H" #include "IndirectList.H" @@ -1011,19 +1011,29 @@ void Foam::faceCoupleInfo::findSlavesCoveringMaster ) { // Construct octree from all mesh0 boundary faces - octreeDataFace shapes(mesh0); + labelList bndFaces(mesh0.nFaces()-mesh0.nInternalFaces()); + forAll(bndFaces, i) + { + bndFaces[i] = mesh0.nInternalFaces() + i; + } treeBoundBox overallBb(mesh0.points()); - octree tree - ( - overallBb, // overall search domain - shapes, // all information needed to do checks on cells - 1, // min levels - 20.0, // maximum ratio of cubes v.s. cells - 10.0 - ); + Random rndGen(123456); + indexedOctree tree + ( + treeDataFace // all information needed to search faces + ( + false, // do not cache bb + mesh0, + bndFaces // boundary faces only + ), + overallBb.extend(rndGen, 1E-4), // overall search domain + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ); if (debug) { @@ -1048,17 +1058,11 @@ void Foam::faceCoupleInfo::findSlavesCoveringMaster // Generate face centre (prevent cellCentres() reconstruction) point fc(f1.centre(mesh1.points())); - // Search in bounding box of face only. - treeBoundBox tightest(static_cast(f1.points(mesh1.points()))); + pointIndexHit nearInfo = tree.findNearest(fc, Foam::sqr(absTol)); - scalar tightestDist = GREAT; - - label index = tree.findNearest(fc, tightest, tightestDist); - - - if (index != -1) + if (nearInfo.hit()) { - label mesh0FaceI = shapes.meshFaces()[index]; + label mesh0FaceI = tree.shapes().faceLabels()[nearInfo.index()]; // Check if points of f1 actually lie on top of mesh0 face // This is the bit that might fail since if f0 is severely warped diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C index 1b3bf6e19b..0c567ee312 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.C @@ -62,6 +62,7 @@ namespace Foam }; } + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::hexRef8::reorder @@ -80,7 +81,7 @@ void Foam::hexRef8::reorder if (newI >= len) { - FatalErrorIn("hexRef8::reorder") << abort(FatalError); + FatalErrorIn("hexRef8::reorder(..)") << abort(FatalError); } if (newI >= 0) @@ -557,22 +558,11 @@ Foam::label Foam::hexRef8::getAnchorCell } // Problem. - - // Pick up points of the cell - const labelList cPoints(cellPoints(cellI)); - - Perr<< "cell:" << cellI << " points:" << endl; - forAll(cPoints, i) - { - label pointI = cPoints[i]; - - Perr<< " " << pointI << " coord:" << mesh_.points()[pointI] - << nl; - } + dumpCell(cellI); Perr<< "cell:" << cellI << " anchorPoints:" << cellAnchorPoints[cellI] << endl; - FatalErrorIn("hexRef8::getAnchorCell") + FatalErrorIn("hexRef8::getAnchorCell(..)") << "Could not find point " << pointI << " in the anchorPoints for cell " << cellI << endl << "Does your original mesh obey the 2:1 constraint and" @@ -690,9 +680,50 @@ Foam::label Foam::hexRef8::countAnchors } +void Foam::hexRef8::dumpCell(const label cellI) const +{ + OFstream str(mesh_.time().path()/"cell_" + Foam::name(cellI) + ".obj"); + Pout<< "hexRef8 : Dumping cell as obj to " << str.name() << endl; + + const cell& cFaces = mesh_.cells()[cellI]; + + Map