diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 3c257d249dad22088cf3323801740e6d7adbd258..8d97ad9048a5a6e145d9fa0184629534df3a61e3 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -59,7 +59,8 @@ rho = thermo->rho(); rho.relax(); - Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; + Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() + << endl; pd == p - (rho*gh + pRef); } diff --git a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C index 364aed2e16c4196938e76e0bd9839f67899f470f..c18e0af978a147ca1b9b2dc522f6d8773f85b947 100644 --- a/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C +++ b/applications/utilities/mesh/advanced/refineHexMesh/refineHexMesh.C @@ -182,6 +182,7 @@ int main(int argc, char *argv[]) if (overwrite) { mesh.setInstance(oldInstance); + meshCutter.setInstance(oldInstance); } Info<< "Writing mesh to " << runTime.timeName() << endl; diff --git a/applications/utilities/mesh/generation/snappyHexMesh/Make/options b/applications/utilities/mesh/generation/snappyHexMesh/Make/options index d9eb36aa340d1aa8389aa2759d17871b99f25680..1c74c3aff57aa36a4bcd788e0aed2d3048c70946 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/snappyHexMesh/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ /* -g -DFULLDEBUG -O0 */ \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/autoMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ @@ -9,7 +9,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod \ -lfiniteVolume \ -ldecompositionMethods \ -lmeshTools \ diff --git a/applications/utilities/mesh/manipulation/renumberMesh/Make/options b/applications/utilities/mesh/manipulation/renumberMesh/Make/options index 2dcae6b386b7c6ed90b433312a589f9e507e64b2..8a7e5d167449b3092f4e01ba390c5e8cb6d5d184 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/Make/options +++ b/applications/utilities/mesh/manipulation/renumberMesh/Make/options @@ -2,7 +2,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude EXE_LIBS = \ -lmeshTools \ diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/options b/applications/utilities/parallelProcessing/decomposePar/Make/options index 706b6dc58f50935004ba605982795103c7ceb3c7..4b1adfd7ba270dc7af91f2c664e8a661796e3e48 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/options +++ b/applications/utilities/parallelProcessing/decomposePar/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options index 7836a4fbf7ac3fbb5650018740cef5cd1739fdc0..c0f7a0877670d32235f3e117f3e4141ab34c6ee7 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude diff --git a/applications/utilities/preProcessing/mapFields/mapLagrangian.C b/applications/utilities/preProcessing/mapFields/mapLagrangian.C index 9d04dcfbecc82c6c39f71ea501575aacff67304f..d3f35d02a359b001df855540ee87d6b5a3c923a1 100644 --- a/applications/utilities/preProcessing/mapFields/mapLagrangian.C +++ b/applications/utilities/preProcessing/mapFields/mapLagrangian.C @@ -223,6 +223,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp) { unmappedSource.erase(sourceParticleI); addParticles.append(sourceParticleI); + iter().cell()=targetCell; targetParcels.addParticle ( sourceParcels.remove(&iter()) diff --git a/bin/foamCleanPath b/bin/foamCleanPath index 5eb203f55359cb01c2da29665901fdfb3cb1b7db..dca96f490edd8bef78e9a97c1f23b98ea6e1679b 100755 --- a/bin/foamCleanPath +++ b/bin/foamCleanPath @@ -27,12 +27,12 @@ # foamCleanPath # # Description -# Usage: foamCleanPath path [wildcard] .. [wildcard] +# Usage: foamCleanPath [-strip] path [wildcard] .. [wildcard] # # Prints its argument (which should be a ':' separated path) # without all # - duplicate elements -# - non-accessible directories +# - (if '-strip') non-accessible directories # - elements whose start matches a wildcard # # Note: @@ -42,16 +42,25 @@ if [ "$#" -lt 1 -o "$1" = "-h" -o "$1" = "-help" ] then cat <<USAGE 1>&2 -Usage: ${0##*/} path [wildcard] .. [wildcard] +Usage: ${0##*/} [-strip] path [wildcard] .. [wildcard] Prints its argument (which should be a ':' separated list) cleansed from - duplicate elements - - non-accessible directories - elements whose start matches one of the wildcard(s) + - (if '-strip') non-accessible directories USAGE exit 1 fi + +strip='' +if [ "$1" = "-strip" ] +then + strip=true + shift +fi + + dirList="$1" shift @@ -94,6 +103,10 @@ do then dirList="$dirList $dir" fi + elif [ "$strip" != "true" ] + then + # Print non-existing directories if not in 'strip' mode. + dirList="$dirList $dir" fi done diff --git a/etc/bashrc b/etc/bashrc index 3b001711bc0649acee98e87b9fe78e763ec6d13d..26dc8c2dfc806109f539bdc8f4e6ae8f5a1b1188 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -152,10 +152,12 @@ Linux) ;; esac ;; + ia64) WM_ARCH=linuxIA64 export WM_COMPILER=I64 ;; + mips64) WM_ARCH=SiCortex64 export WM_COMPILER_LIB_ARCH=64 @@ -166,6 +168,17 @@ Linux) export WM_LDFLAGS='-mabi=64 -G0' export WM_MPLIB=MPI ;; + + ppc64) + WM_ARCH=linuxPPC64 + export WM_COMPILER_LIB_ARCH=64 + export WM_CC='gcc' + export WM_CXX='g++' + export WM_CFLAGS='-m64 -fPIC' + export WM_CXXFLAGS='-m64 -fPIC' + export WM_LDFLAGS='-m64' + ;; + *) echo Unknown processor type `uname -m` for Linux ;; diff --git a/etc/cshrc b/etc/cshrc index 034a5bfbfa25ce4571d0191b73e9e338f2f8b0d1..f4147422f99595d06db46d35e228a4591146663f 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -120,6 +120,7 @@ case Linux: switch (`uname -m`) case i686: breaksw + case x86_64: switch ($WM_ARCH_OPTION) case 32: @@ -131,6 +132,7 @@ case Linux: setenv WM_CXXFLAGS '-m32 -fPIC' setenv WM_LDFLAGS '-m32' breaksw + case 64: setenv WM_ARCH linux64 setenv WM_COMPILER_LIB_ARCH 64 @@ -140,15 +142,19 @@ case Linux: setenv WM_CXXFLAGS '-m64 -fPIC' setenv WM_LDFLAGS '-m64' breaksw + default: echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64 breaksw + endsw breaksw + case ia64: setenv WM_ARCH linuxIA64 setenv WM_COMPILER I64 breaksw + case mips64: setenv WM_ARCH SiCortex64 setenv WM_COMPILER_LIB_ARCH 64 @@ -159,9 +165,21 @@ case Linux: setenv WM_LDFLAGS '-mabi=64 -G0' setenv WM_MPLIB MPI breaksw + + case ppc64: + setenv WM_ARCH linuxPPC64 + setenv WM_COMPILER_LIB_ARCH 64 + setenv WM_CC 'gcc' + setenv WM_CXX 'g++' + setenv WM_CFLAGS '-m64 -fPIC' + setenv WM_CXXFLAGS '-m64 -fPIC' + setenv WM_LDFLAGS '-m64' + breaksw + default: echo Unknown processor type `uname -m` for Linux breaksw + endsw breaksw diff --git a/etc/settings.csh b/etc/settings.csh index d36a91ad5b0391a9f112a5145d26c258910fff6c..d0a1e9966506b0567b9e71935aa373c7aa007a80 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -35,8 +35,6 @@ alias _foamAddPath 'set path=(\!* $path)' # prefix to LD_LIBRARY_PATH alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}' -# make directory if it doesn't already exist -alias _foamMkDir 'if ( ! -d \!* ) mkdir -p \!*' # location of the jobControl directory setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl @@ -71,12 +69,6 @@ _foamAddPath $FOAM_USER_APPBIN _foamAddLib $FOAM_LIBBIN _foamAddLib $FOAM_USER_LIBBIN -# create these directories if necessary: -_foamMkDir $FOAM_LIBBIN -_foamMkDir $FOAM_APPBIN -_foamMkDir $FOAM_USER_LIBBIN -_foamMkDir $FOAM_USER_APPBIN - # Select compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -130,9 +122,6 @@ case OPENMPI: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin - _foamMkDir $MPI_ARCH_PATH/lib setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version @@ -147,9 +136,6 @@ case LAM: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin - _foamMkDir $MPI_ARCH_PATH/lib setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version @@ -163,9 +149,6 @@ case MPICH: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin - _foamMkDir $MPI_ARCH_PATH/lib setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version @@ -180,9 +163,6 @@ case MPICH-GM: _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $GM_LIB_PATH - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin - _foamMkDir $MPI_ARCH_PATH/lib setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm breaksw @@ -246,8 +226,6 @@ default: endsw _foamAddLib $FOAM_MPI_LIBBIN -# before compiling, this directory may not exist: -_foamMkDir $FOAM_MPI_LIBBIN # Set the minimum MPI buffer size (used by all platforms except SGI MPI) @@ -281,7 +259,6 @@ endif # ~~~~~~~~~~~~~~~~~~~~ unalias _foamAddPath unalias _foamAddLib -unalias _foamMkDir unset minBufferSize # ----------------------------------------------------------------------------- diff --git a/etc/settings.sh b/etc/settings.sh index 046f624cdefbfb2848bd9e59a843a84863047412..14258eac6778a0754623b195813c5ae1220d1bb5 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -52,17 +52,6 @@ _foamAddLib() } -# make directories if they don't already exist -_foamMkDir() -{ - while [ $# -ge 1 ] - do - [ -d $1 ] || mkdir -p $1 - shift - done -} - - # location of the jobControl directory export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl @@ -94,9 +83,6 @@ export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH _foamAddPath $FOAM_APPBIN $FOAM_USER_APPBIN _foamAddLib $FOAM_LIBBIN $FOAM_USER_LIBBIN -# create these directories if necessary: -_foamMkDir $FOAM_LIBBIN $FOAM_USER_LIBBIN $FOAM_APPBIN $FOAM_USER_APPBIN - # Compiler settings # ~~~~~~~~~~~~~~~~~ @@ -160,8 +146,6 @@ OPENMPI) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin $MPI_ARCH_PATH/lib export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version unset mpi_version @@ -176,8 +160,6 @@ LAM) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin $MPI_ARCH_PATH/lib export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version unset mpi_version @@ -191,8 +173,6 @@ MPICH) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin $MPI_ARCH_PATH/lib export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version unset mpi_version @@ -207,8 +187,6 @@ MPICH-GM) _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib _foamAddLib $GM_LIB_PATH - # before compiling, these directories may not exist: - _foamMkDir $MPI_ARCH_PATH/bin $MPI_ARCH_PATH/lib export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm ;; @@ -274,8 +252,6 @@ QSMPI) esac _foamAddLib $FOAM_MPI_LIBBIN -# before compiling, this directory may not exist: -_foamMkDir $FOAM_MPI_LIBBIN # Set the minimum MPI buffer size (used by all platforms except SGI MPI) @@ -304,6 +280,6 @@ export MPI_BUFFER_SIZE # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ -unset _foamAddPath _foamAddLib _foamMkDir minBufferSize +unset _foamAddPath _foamAddLib minBufferSize # ----------------------------------------------------------------------------- diff --git a/src/Allwmake b/src/Allwmake index f22e0729dbe8e50694ee43a373205494b0a2a536..3168208c49f2dd8e10c591071fabcb5753e2115a 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -18,7 +18,8 @@ wmake libso triSurface wmake libso edgeMesh wmake libso surfMesh -decompositionAgglomeration/Allwmake +# Decomposition methods needed by meshTools +decompositionMethods/Allwmake wmake libso meshTools wmake libso finiteVolume @@ -44,4 +45,6 @@ conversion/Allwmake wmake libso autoMesh wmake libso errorEstimation +fvAgglomerationMethods/Allwmake + # ----------------------------------------------------------------- end-of-file diff --git a/src/ODE/ODESolvers/SIBS/SIBS.C b/src/ODE/ODESolvers/SIBS/SIBS.C index 99b03346b5b3a0c9447a9671d1adb85f3c7cdea2..ec5c196ff028d8c95db3c245beb0dbfa5840e0e3 100644 --- a/src/ODE/ODESolvers/SIBS/SIBS.C +++ b/src/ODE/ODESolvers/SIBS/SIBS.C @@ -71,8 +71,8 @@ void Foam::SIBS::solve const ODE& ode, scalar& x, scalarField& y, - scalarField& dydx, - const scalar eps, + scalarField& dydx, + const scalar eps, const scalarField& yScale, const scalar hTry, scalar& hDid, @@ -96,7 +96,7 @@ void Foam::SIBS::solve { for (register label k=0; k<iq; k++) { - alpha_[k][iq] = + alpha_[k][iq] = pow(eps1, (a_[k + 1] - a_[iq + 1]) /((a_[iq + 1] - a_[0] + 1.0)*(2*k + 3))); } diff --git a/src/ODE/ODESolvers/SIBS/SIBS.H b/src/ODE/ODESolvers/SIBS/SIBS.H index 03e3535bdf408207fa0a2e19acc4137b7c58a8fa..ff08b81ac9a309cfa1ba8d685541479ea29a4b86 100644 --- a/src/ODE/ODESolvers/SIBS/SIBS.H +++ b/src/ODE/ODESolvers/SIBS/SIBS.H @@ -29,8 +29,8 @@ Description Foam::SIBS SourceFiles - SIBSCK.C - SIBSQS.C + SIMPR.C + polyExtrapolate.C \*---------------------------------------------------------------------------*/ @@ -61,7 +61,7 @@ class SIBS mutable scalarField a_; mutable scalarSquareMatrix alpha_; - mutable scalarSquareMatrix d_p_; + mutable scalarRectangularMatrix d_p_; mutable scalarField x_p_; mutable scalarField err_; @@ -75,30 +75,31 @@ class SIBS mutable scalar epsOld_, xNew_; -void SIMPR -( - const ODE& ode, - const scalar xStart, - const scalarField& y, - const scalarField& dydx, - const scalarField& dfdx, - const scalarSquareMatrix& dfdy, - const scalar deltaX, - const label nSteps, - scalarField& yEnd -) const; - - -void polyExtrapolate -( - const label iest, - const scalar xest, - const scalarField& yest, - scalarField& yz, - scalarField& dy, - scalarField& x_p, - scalarSquareMatrix& d_p -) const; + // Private member functions + + void SIMPR + ( + const ODE& ode, + const scalar xStart, + const scalarField& y, + const scalarField& dydx, + const scalarField& dfdx, + const scalarSquareMatrix& dfdy, + const scalar deltaX, + const label nSteps, + scalarField& yEnd + ) const; + + void polyExtrapolate + ( + const label iest, + const scalar xest, + const scalarField& yest, + scalarField& yz, + scalarField& dy, + scalarField& x_p, + scalarRectangularMatrix& d_p + ) const; public: diff --git a/src/ODE/ODESolvers/SIBS/polyExtrapolate.C b/src/ODE/ODESolvers/SIBS/polyExtrapolate.C index a9c93329d648236eec271851e2317e8729acd1d1..6a05e1600ae9b6659a8ef6af31eebfad3d2633da 100644 --- a/src/ODE/ODESolvers/SIBS/polyExtrapolate.C +++ b/src/ODE/ODESolvers/SIBS/polyExtrapolate.C @@ -36,7 +36,7 @@ void Foam::SIBS::polyExtrapolate scalarField& yz, scalarField& dy, scalarField& x, - scalarSquareMatrix& d + scalarRectangularMatrix& d ) const { label n = yz.size(); diff --git a/src/autoMesh/Make/options b/src/autoMesh/Make/options index 4589b7ac3f62cff056724d19138fb70a47390c59..f1687b7eb1ecf3b19e60d8363cc3703b17a80e72 100644 --- a/src/autoMesh/Make/options +++ b/src/autoMesh/Make/options @@ -1,5 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index c5941aeadc641be07af9019384fba9c22c587d10..e154576ad947a3368df3adbeb7945a43d76b08d4 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1212,6 +1212,17 @@ void Foam::meshRefinement::findCellZoneTopo // by changing cell zone every time we cross a surface. while (true) { + // Synchronise regionToCellZone. + // Note: + // - region numbers are identical on all processors + // - keepRegion is identical ,, + // - cellZones are identical ,, + // This done at top of loop to account for geometric matching + // not being synchronised. + Pstream::listCombineGather(regionToCellZone, maxEqOp<label>()); + Pstream::listCombineScatter(regionToCellZone); + + bool changed = false; // Internal faces @@ -1292,14 +1303,6 @@ void Foam::meshRefinement::findCellZoneTopo { break; } - - // Synchronise regionToCellZone. - // Note: - // - region numbers are identical on all processors - // - keepRegion is identical ,, - // - cellZones are identical ,, - Pstream::listCombineGather(regionToCellZone, maxEqOp<label>()); - Pstream::listCombineScatter(regionToCellZone); } diff --git a/src/decompositionAgglomeration/Allwmake b/src/decompositionMethods/Allwmake similarity index 88% rename from src/decompositionAgglomeration/Allwmake rename to src/decompositionMethods/Allwmake index 3294fe48c349607d3862d65dffa0d74af840a46d..f71ea71b867935edc49b4529681def9fe7cfde95 100755 --- a/src/decompositionAgglomeration/Allwmake +++ b/src/decompositionMethods/Allwmake @@ -9,6 +9,4 @@ then (WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB; wmake libso parMetisDecomp) fi -wmake libso MGridGenGamgAgglomeration - # ----------------------------------------------------------------- end-of-file diff --git a/src/decompositionAgglomeration/decompositionMethods/Make/files b/src/decompositionMethods/decompositionMethods/Make/files similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/Make/files rename to src/decompositionMethods/decompositionMethods/Make/files diff --git a/src/decompositionAgglomeration/decompositionMethods/Make/options b/src/decompositionMethods/decompositionMethods/Make/options similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/Make/options rename to src/decompositionMethods/decompositionMethods/Make/options diff --git a/src/decompositionAgglomeration/decompositionMethods/decompositionMethod/decompositionMethod.C b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/decompositionMethod/decompositionMethod.C rename to src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.C diff --git a/src/decompositionAgglomeration/decompositionMethods/decompositionMethod/decompositionMethod.H b/src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/decompositionMethod/decompositionMethod.H rename to src/decompositionMethods/decompositionMethods/decompositionMethod/decompositionMethod.H diff --git a/src/decompositionAgglomeration/decompositionMethods/geomDecomp/geomDecomp.C b/src/decompositionMethods/decompositionMethods/geomDecomp/geomDecomp.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/geomDecomp/geomDecomp.C rename to src/decompositionMethods/decompositionMethods/geomDecomp/geomDecomp.C diff --git a/src/decompositionAgglomeration/decompositionMethods/geomDecomp/geomDecomp.H b/src/decompositionMethods/decompositionMethods/geomDecomp/geomDecomp.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/geomDecomp/geomDecomp.H rename to src/decompositionMethods/decompositionMethods/geomDecomp/geomDecomp.H diff --git a/src/decompositionAgglomeration/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C rename to src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C diff --git a/src/decompositionAgglomeration/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.H b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.H rename to src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.H diff --git a/src/decompositionAgglomeration/decompositionMethods/manualDecomp/manualDecomp.C b/src/decompositionMethods/decompositionMethods/manualDecomp/manualDecomp.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/manualDecomp/manualDecomp.C rename to src/decompositionMethods/decompositionMethods/manualDecomp/manualDecomp.C diff --git a/src/decompositionAgglomeration/decompositionMethods/manualDecomp/manualDecomp.H b/src/decompositionMethods/decompositionMethods/manualDecomp/manualDecomp.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/manualDecomp/manualDecomp.H rename to src/decompositionMethods/decompositionMethods/manualDecomp/manualDecomp.H diff --git a/src/decompositionAgglomeration/decompositionMethods/metisDecomp/metisDecomp.C b/src/decompositionMethods/decompositionMethods/metisDecomp/metisDecomp.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/metisDecomp/metisDecomp.C rename to src/decompositionMethods/decompositionMethods/metisDecomp/metisDecomp.C diff --git a/src/decompositionAgglomeration/decompositionMethods/metisDecomp/metisDecomp.H b/src/decompositionMethods/decompositionMethods/metisDecomp/metisDecomp.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/metisDecomp/metisDecomp.H rename to src/decompositionMethods/decompositionMethods/metisDecomp/metisDecomp.H diff --git a/src/decompositionAgglomeration/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C b/src/decompositionMethods/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C rename to src/decompositionMethods/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.C diff --git a/src/decompositionAgglomeration/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.H b/src/decompositionMethods/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.H similarity index 100% rename from src/decompositionAgglomeration/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.H rename to src/decompositionMethods/decompositionMethods/simpleGeomDecomp/simpleGeomDecomp.H diff --git a/src/decompositionAgglomeration/parMetisDecomp/Make/files b/src/decompositionMethods/parMetisDecomp/Make/files similarity index 100% rename from src/decompositionAgglomeration/parMetisDecomp/Make/files rename to src/decompositionMethods/parMetisDecomp/Make/files diff --git a/src/decompositionAgglomeration/parMetisDecomp/Make/options b/src/decompositionMethods/parMetisDecomp/Make/options similarity index 100% rename from src/decompositionAgglomeration/parMetisDecomp/Make/options rename to src/decompositionMethods/parMetisDecomp/Make/options diff --git a/src/decompositionAgglomeration/parMetisDecomp/parMetisDecomp.C b/src/decompositionMethods/parMetisDecomp/parMetisDecomp.C similarity index 100% rename from src/decompositionAgglomeration/parMetisDecomp/parMetisDecomp.C rename to src/decompositionMethods/parMetisDecomp/parMetisDecomp.C diff --git a/src/decompositionAgglomeration/parMetisDecomp/parMetisDecomp.H b/src/decompositionMethods/parMetisDecomp/parMetisDecomp.H similarity index 100% rename from src/decompositionAgglomeration/parMetisDecomp/parMetisDecomp.H rename to src/decompositionMethods/parMetisDecomp/parMetisDecomp.H diff --git a/src/decompositionAgglomeration/parMetisDecomp/parMetisDecompTemplates.C b/src/decompositionMethods/parMetisDecomp/parMetisDecompTemplates.C similarity index 100% rename from src/decompositionAgglomeration/parMetisDecomp/parMetisDecompTemplates.C rename to src/decompositionMethods/parMetisDecomp/parMetisDecompTemplates.C diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 34a4606e088ade62d6f128c2c021c9524e81c33c..99f3085854c8581f8965071a0688cd32bb1d7de4 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -105,6 +105,7 @@ $(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C $(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C $(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C $(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C $(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..7b5a1dbc45bfe8f5b2b743a7098dde6cf91d323d --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "rotatingWallVelocityFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchField<vector>(p, iF), + origin_(vector::zero), + axis_(vector::zero), + omega_(0) +{} + + +rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +( + const rotatingWallVelocityFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField<vector>(ptf, p, iF, mapper), + origin_(ptf.origin_), + axis_(ptf.axis_), + omega_(ptf.omega_) +{} + + +rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchField<vector>(p, iF), + origin_(dict.lookup("origin")), + axis_(dict.lookup("axis")), + omega_(readScalar(dict.lookup("omega"))) +{ + // Evaluate the wall velocity + updateCoeffs(); +} + + +rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +( + const rotatingWallVelocityFvPatchVectorField& pivpvf +) +: + fixedValueFvPatchField<vector>(pivpvf), + origin_(pivpvf.origin_), + axis_(pivpvf.axis_), + omega_(pivpvf.omega_) +{} + + +rotatingWallVelocityFvPatchVectorField::rotatingWallVelocityFvPatchVectorField +( + const rotatingWallVelocityFvPatchVectorField& pivpvf, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchField<vector>(pivpvf, iF), + origin_(pivpvf.origin_), + axis_(pivpvf.axis_), + omega_(pivpvf.omega_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void rotatingWallVelocityFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Calculate the rotating wall velocity from the specification of the motion + vectorField Up = (-omega_)*((patch().Cf() - origin_) ^ (axis_/mag(axis_))); + + // Remove the component of Up normal to the wall + // just in case it is not exactly circular + vectorField n = patch().nf(); + vectorField::operator=(Up - n*(n & Up)); + + fixedValueFvPatchVectorField::updateCoeffs(); +} + + +void rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const +{ + fvPatchVectorField::write(os); + os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl; + os.writeKeyword("axis") << axis_ << token::END_STATEMENT << nl; + os.writeKeyword("omega") << omega_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchVectorField, + rotatingWallVelocityFvPatchVectorField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..5eed0e60ea464e39bf176e0448c67f90a32533b7 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.H @@ -0,0 +1,192 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::rotatingWallVelocityFvPatchVectorField + +Description + Foam::rotatingWallVelocityFvPatchVectorField + +SourceFiles + rotatingWallVelocityFvPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef rotatingWallVelocityFvPatchVectorField_H +#define rotatingWallVelocityFvPatchVectorField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class rotatingWallVelocityFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class rotatingWallVelocityFvPatchVectorField +: + public fixedValueFvPatchVectorField +{ + // Private data + + //- Origin of the rotation + vector origin_; + + //- Axis of the rotation + vector axis_; + + //- Rotational speed + scalar omega_; + + +public: + + //- Runtime type information + TypeName("rotatingWallVelocity"); + + + // Constructors + + //- Construct from patch and internal field + rotatingWallVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + rotatingWallVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given rotatingWallVelocityFvPatchVectorField + // onto a new patch + rotatingWallVelocityFvPatchVectorField + ( + const rotatingWallVelocityFvPatchVectorField&, + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + rotatingWallVelocityFvPatchVectorField + ( + const rotatingWallVelocityFvPatchVectorField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchVectorField> clone() const + { + return tmp<fvPatchVectorField> + ( + new rotatingWallVelocityFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + rotatingWallVelocityFvPatchVectorField + ( + const rotatingWallVelocityFvPatchVectorField&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchVectorField> clone + ( + const DimensionedField<vector, volMesh>& iF + ) const + { + return tmp<fvPatchVectorField> + ( + new rotatingWallVelocityFvPatchVectorField(*this, iF) + ); + } + + + + // Member functions + + // Access functions + + //- Return the origin of the rotation + const vector& origin() const + { + return origin_; + } + + //- Return the axis of the rotation + const vector& axis() const + { + return axis_; + } + + //- Return the rotational speed + const scalar& omega() const + { + return omega_; + } + + //- Return non-const access to the origin of the rotation + vector& origin() + { + return origin_; + } + + //- Return non-const access to the axis of the rotation + vector& axis() + { + return axis_; + } + + //- Return non-const access to the rotational speed + scalar& omega() + { + return omega_; + } + + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/fvAgglomerationMethods/Allwmake b/src/fvAgglomerationMethods/Allwmake new file mode 100755 index 0000000000000000000000000000000000000000..17118db81821c912197722af3720c7bba6498ddd --- /dev/null +++ b/src/fvAgglomerationMethods/Allwmake @@ -0,0 +1,7 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wmake libso MGridGenGamgAgglomeration + +# ----------------------------------------------------------------- end-of-file diff --git a/src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C similarity index 100% rename from src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C rename to src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomerate.C diff --git a/src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.C b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.C similarity index 100% rename from src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.C rename to src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.C diff --git a/src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.H b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.H similarity index 100% rename from src/decompositionAgglomeration/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.H rename to src/fvAgglomerationMethods/MGridGenGamgAgglomeration/MGridGenGAMGAgglomeration.H diff --git a/src/decompositionAgglomeration/MGridGenGamgAgglomeration/Make/files b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/files similarity index 100% rename from src/decompositionAgglomeration/MGridGenGamgAgglomeration/Make/files rename to src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/files diff --git a/src/decompositionAgglomeration/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options similarity index 100% rename from src/decompositionAgglomeration/MGridGenGamgAgglomeration/Make/options rename to src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index 664eca0463a41ae9e4104fb11991795c9adcb6ce..75a0b041744af33b9de9b805a8c46cabb4031e29 100644 --- a/src/lagrangian/basic/Particle/Particle.H +++ b/src/lagrangian/basic/Particle/Particle.H @@ -329,6 +329,9 @@ public: //- Return current particle position inline vector& position(); + //- Return current cell particle is in + inline label& cell(); + //- Return current cell particle is in inline label cell() const; diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H index 5751ca56cd7d36abd57496caefc066322cd1f869..075d96705d876aee11d5156dc242313fe139022f 100644 --- a/src/lagrangian/basic/Particle/ParticleI.H +++ b/src/lagrangian/basic/Particle/ParticleI.H @@ -303,6 +303,12 @@ inline label Particle<ParticleType>::cell() const return celli_; } +template<class ParticleType> +inline label& Particle<ParticleType>::cell() +{ + return celli_; +} + template<class ParticleType> inline label Particle<ParticleType>::face() const diff --git a/src/meshTools/Make/options b/src/meshTools/Make/options index d550c78e4c260fc31774360f5c72203ff1da6969..1d1560eb5a4b73f7c97f6644a30f146534b5bb5e 100644 --- a/src/meshTools/Make/options +++ b/src/meshTools/Make/options @@ -1,6 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/triSurface/lnInclude \ - -I$(LIB_SRC)/decompositionAgglomeration/decompositionMethods/lnInclude \ + -I$(LIB_SRC)/decompositionMethods/decompositionMethods/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude LIB_LIBS = \ diff --git a/src/meshTools/searchableSurface/searchableCylinder.C b/src/meshTools/searchableSurface/searchableCylinder.C index e2b8426f1fec5448dc51fbc9347b0893e6e9eb60..fcaa42194aab42ce1f06f9e199f215548b92c627 100644 --- a/src/meshTools/searchableSurface/searchableCylinder.C +++ b/src/meshTools/searchableSurface/searchableCylinder.C @@ -105,6 +105,13 @@ Foam::pointIndexHit Foam::searchableCylinder::findNearest } +Foam::scalar Foam::searchableCylinder::radius2(const point& pt) const +{ + const vector x = (pt-point1_) ^ unitDir_; + return x&x; +} + + // From http://www.gamedev.net/community/forums/topic.asp?topic_id=467789 - // intersection of cylinder with ray void Foam::searchableCylinder::findLineAll @@ -118,13 +125,91 @@ void Foam::searchableCylinder::findLineAll near.setMiss(); far.setMiss(); - // Line as P = start + t*V - const vector V(end-start); + vector point1Start(start-point1_); + vector point2Start(start-point2_); + vector point1End(end-point1_); + + // Quick rejection of complete vector outside endcaps + scalar s1 = point1Start&unitDir_; + scalar s2 = point1End&unitDir_; + + if ((s1 < 0 && s2 < 0) || (s1 > magDir_ && s2 > magDir_)) + { + return; + } + + // Line as P = start+t*V where V is unit vector and t=[0..mag(end-start)] + vector V(end-start); + scalar magV = mag(V); + if (magV < ROOTVSMALL) + { + return; + } + V /= magV; + + + // We now get the nearest intersections to start. This can either be + // the intersection with the end plane or with the cylinder side. + + // Get the two points (expressed in t) on the end planes. This is to + // clip any cylinder intersection against. + scalar tPoint1; + scalar tPoint2; + + // Maintain the two intersections with the endcaps + scalar tNear = VGREAT; + scalar tFar = VGREAT; + + { + scalar s = (V&unitDir_); + if (mag(s) > VSMALL) + { + tPoint1 = -s1/s; + tPoint2 = -(point2Start&unitDir_)/s; + if (tPoint2 < tPoint1) + { + Swap(tPoint1, tPoint2); + } + if (tPoint1 > magV || tPoint2 < 0) + { + return; + } + + // See if the points on the endcaps are actually inside the cylinder + if (tPoint1 >= 0 && tPoint1 <= magV) + { + if (radius2(start+tPoint1*V) <= sqr(radius_)) + { + tNear = tPoint1; + } + } + if (tPoint2 >= 0 && tPoint2 <= magV) + { + if (radius2(start+tPoint2*V) <= sqr(radius_)) + { + // Check if already have a near hit from point1 + if (tNear <= 1) + { + tFar = tPoint2; + } + else + { + tNear = tPoint2; + } + } + } + } + else + { + // Vector perpendicular to cylinder. Check for outside already done + // above so just set tpoint to allow all. + tPoint1 = -VGREAT; + tPoint2 = VGREAT; + } + } -//Pout<< "point1:" << point1_ << " point2:" << point2_ -// << " start:" << start << " end:" << end << endl; - const vector x = (start-point1_) ^ unitDir_; + const vector x = point1Start ^ unitDir_; const vector y = V ^ unitDir_; const scalar d = sqr(radius_); @@ -135,11 +220,12 @@ void Foam::searchableCylinder::findLineAll const scalar disc = b*b-4*a*c; -//Pout<< "a:" << a << " b:" << b << " c:" << c << " disc:" << disc -// << endl; + scalar t1 = -VGREAT; + scalar t2 = VGREAT; if (disc < 0) { + // Fully outside return; } else if (disc < ROOTVSMALL) @@ -147,12 +233,40 @@ void Foam::searchableCylinder::findLineAll // Single solution if (mag(a) > ROOTVSMALL) { - scalar t = -b/(2*a); - if (t >= 0 && t <= 1) + t1 = -b/(2*a); + + //Pout<< "single solution t:" << t1 + // << " for start:" << start << " end:" << end + // << " c:" << c << endl; + + if (t1 >= 0 && t1 <= magV && t1 >= tPoint1 && t1 <= tPoint2) + { + // valid. Insert sorted. + if (t1 < tNear) + { + tFar = tNear; + tNear = t1; + } + else if (t1 < tFar) + { + tFar = t1; + } + } + else { - near.setPoint(start + t*V); - near.setHit(); - near.setIndex(0); + return; + } + } + else + { + // Aligned with axis. Check if outside radius + //Pout<< "small discriminant:" << disc + // << " for start:" << start << " end:" << end + // << " magV:" << magV + // << " c:" << c << endl; + if (c > 0) + { + return; } } } @@ -162,41 +276,79 @@ void Foam::searchableCylinder::findLineAll { scalar sqrtDisc = sqrt(disc); - scalar t1 = (-b + sqrtDisc)/2*a; - scalar t2 = (-b - sqrtDisc)/2*a; + t1 = (-b - sqrtDisc)/(2*a); + t2 = (-b + sqrtDisc)/(2*a); + if (t2 < t1) + { + Swap(t1, t2); + } - if (t1 < t2) + if (t1 >= 0 && t1 <= magV && t1 >= tPoint1 && t1 <= tPoint2) { - if (t1 >= 0 && t1 <= 1) + // valid. Insert sorted. + if (t1 < tNear) { - near.setPoint(start + t1*V); - near.setHit(); - near.setIndex(0); + tFar = tNear; + tNear = t1; } - if (t2 >= 0 && t2 <= 1) + else if (t1 < tFar) { - far.setPoint(start + t2*V); - far.setHit(); - far.setIndex(0); + tFar = t1; } } - else + if (t2 >= 0 && t2 <= magV && t2 >= tPoint1 && t2 <= tPoint2) { - if (t2 >= 0 && t2 <= 1) + // valid. Insert sorted. + if (t2 < tNear) { - near.setPoint(start + t2*V); - near.setHit(); - near.setIndex(0); + tFar = tNear; + tNear = t2; } - if (t1 >= 0 && t1 <= 1) + else if (t2 < tFar) { - far.setPoint(start + t1*V); - far.setHit(); - far.setIndex(0); + tFar = t2; } } + //Pout<< "two solutions t1:" << t1 << " t2:" << t2 + // << " for start:" << start << " end:" << end + // << " magV:" << magV + // << " c:" << c << endl; + } + else + { + // Aligned with axis. Check if outside radius + //Pout<< "large discriminant:" << disc + // << " small a:" << a + // << " for start:" << start << " end:" << end + // << " magV:" << magV + // << " c:" << c << endl; + if (c > 0) + { + return; + } + } + } + + // Check tNear, tFar + if (tNear >= 0 && tNear <= magV) + { + near.setPoint(start+tNear*V); + near.setHit(); + near.setIndex(0); + + if (tFar <= magV) + { + far.setPoint(start+tFar*V); + far.setHit(); + far.setIndex(0); } } + else if (tFar >= 0 && tFar <= magV) + { + near.setPoint(start+tFar*V); + near.setHit(); + near.setIndex(0); + } } @@ -216,13 +368,7 @@ Foam::searchableCylinder::searchableCylinder magDir_(mag(point2_-point1_)), unitDir_((point2_-point1_)/magDir_), radius_(radius) -{ - Pout<< "point1_:" << point1_ << endl; - Pout<< "point2_:" << point2_ << endl; - Pout<< "magDir_:" << magDir_ << endl; - Pout<< "unitDir_:" << unitDir_ << endl; - Pout<< "radius_:" << radius_ << endl; -} +{} Foam::searchableCylinder::searchableCylinder @@ -237,13 +383,7 @@ Foam::searchableCylinder::searchableCylinder magDir_(mag(point2_-point1_)), unitDir_((point2_-point1_)/magDir_), radius_(readScalar(dict.lookup("radius"))) -{ - Pout<< "point1_:" << point1_ << endl; - Pout<< "point2_:" << point2_ << endl; - Pout<< "magDir_:" << magDir_ << endl; - Pout<< "unitDir_:" << unitDir_ << endl; - Pout<< "radius_:" << radius_ << endl; -} +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -290,11 +430,10 @@ void Foam::searchableCylinder::findLine { info.setSize(start.size()); - pointIndexHit b; - forAll(start, i) { // Pick nearest intersection. If none intersected take second one. + pointIndexHit b; findLineAll(start[i], end[i], info[i], b); if (!info[i].hit() && b.hit()) { @@ -313,11 +452,10 @@ void Foam::searchableCylinder::findLineAny { info.setSize(start.size()); - pointIndexHit b; - forAll(start, i) { // Discard far intersection + pointIndexHit b; findLineAll(start[i], end[i], info[i], b); if (!info[i].hit() && b.hit()) { diff --git a/src/meshTools/searchableSurface/searchableCylinder.H b/src/meshTools/searchableSurface/searchableCylinder.H index 55ee0354ddd0665e6e37ec85320aca072fe29a25..cae0f058db2863db95ff479381d207c8ad9e57cf 100644 --- a/src/meshTools/searchableSurface/searchableCylinder.H +++ b/src/meshTools/searchableSurface/searchableCylinder.H @@ -86,6 +86,8 @@ private: const scalar nearestDistSqr ) const; + scalar radius2(const point& pt) const; + //- Find intersection with cylinder void findLineAll ( diff --git a/src/thermophysicalModels/combustion/Make/files b/src/thermophysicalModels/combustion/Make/files index fb7defdcb6262693f15b1a407aa787a5b67100e1..70e985783d90225deba8fb5cf844354112e82e48 100644 --- a/src/thermophysicalModels/combustion/Make/files +++ b/src/thermophysicalModels/combustion/Make/files @@ -13,7 +13,7 @@ reactingMixture = $(mixtures)/reactingMixture $(chemistryReader)/chemistryReader.C $(foamChemistryReader)/foamChemistryReader.C $(chemkinReader)/chemkinReader.C -$(chemkinReader)/chemkinLexer.C +$(chemkinReader)/chemkinLexer.L $(combustionMixture)/combustionMixture.C $(reactingMixture)/reactingMixture.C diff --git a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H b/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H index 9ec85039a2e44ef4b37ab1a05663002791adf621..2e7e5602e81cde6e8c0b8f1779aa3d1a34760371 100644 --- a/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H +++ b/src/thermophysicalModels/radiation/radiationConstants/radiationConstants.H @@ -30,6 +30,9 @@ Description \*---------------------------------------------------------------------------*/ +#ifndef radiationConstants_H +#define radiationConstants_H + #include "dimensionedScalar.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,5 +46,8 @@ namespace radiation } } +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif // ************************************************************************* // diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C index 6d07cc3bea2f9e4b84cdc2bf656ec93b02338566..f548d0046a4c113f47fa1c069bd6fb3bbe3c4b9a 100644 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -265,10 +265,10 @@ bool Foam::radiation::fvDOM::read() { if (radiationModel::read()) { - // nothing to read +// Only reading solution parameters - not changing ray geometry -// coeffs_.lookup("nTheta") >> nTheta_; -// coeffs_.lookup("nPhi") >> nPhi_; + coeffs_.readIfPresent("convergence", convergence_); + coeffs_.readIfPresent("maxIter", maxIter_); return true; } diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C index 92c6397fb5d75e77b6b6bc2cbb1d54b6bddf85c1..2aaa7d7e67a7b7accbbbd7dad21bef9f0af66f32 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.C @@ -128,7 +128,7 @@ void Foam::radiation::radiationModel::correct() return; } - if ((time_.timeIndex() == 0) || (time_.timeIndex() % solverFreq_ == 0)) + if (time_.timeIndex() % solverFreq_ == 0) { calculate(); } diff --git a/wmake/rules/linuxPPC64Gcc/X b/wmake/rules/linuxPPC64Gcc/X new file mode 100644 index 0000000000000000000000000000000000000000..5d1f9c5cc54b4689118c6f1f54f0a2d6d7a29827 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib64 -lXext -lX11 diff --git a/wmake/rules/linuxPPC64Gcc/c b/wmake/rules/linuxPPC64Gcc/c new file mode 100644 index 0000000000000000000000000000000000000000..6c0a9e3b49a9f55b06e197aa0e191ab221a22168 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc -m64 -mcpu=power5+ + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -shared +LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/linuxPPC64Gcc/c++ b/wmake/rules/linuxPPC64Gcc/c++ new file mode 100644 index 0000000000000000000000000000000000000000..7590b089a32e5cdf9b0413d02dd01b1286394d60 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/c++ @@ -0,0 +1,21 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast + +CC = g++ -m64 -mcpu=power5+ + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-40 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) + +LINKLIBSO = $(CC) $(c++FLAGS) -shared +LINKEXE = $(CC) $(c++FLAGS) diff --git a/wmake/rules/linuxPPC64Gcc/c++Debug b/wmake/rules/linuxPPC64Gcc/c++Debug new file mode 100644 index 0000000000000000000000000000000000000000..19bdb9c3346fc7a69380dfedd6e7911fe220a965 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb3 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linuxPPC64Gcc/c++Opt b/wmake/rules/linuxPPC64Gcc/c++Opt new file mode 100644 index 0000000000000000000000000000000000000000..2aedabd6280a3476bc58db13139a0a3aa579502b --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/c++Opt @@ -0,0 +1,2 @@ +c++DBUG = +c++OPT = -O3 diff --git a/wmake/rules/linuxPPC64Gcc/c++Prof b/wmake/rules/linuxPPC64Gcc/c++Prof new file mode 100644 index 0000000000000000000000000000000000000000..3bda4dad55e898a8198f6e8bfe21e8d829d7230a --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linuxPPC64Gcc/cDebug b/wmake/rules/linuxPPC64Gcc/cDebug new file mode 100644 index 0000000000000000000000000000000000000000..72b638f458220e329d52b59e3566a3c807101f9d --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linuxPPC64Gcc/cOpt b/wmake/rules/linuxPPC64Gcc/cOpt new file mode 100644 index 0000000000000000000000000000000000000000..e6512b7aab42b97fe9e77a1d60fe586e5c1dc104 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -O3 -fno-gcse diff --git a/wmake/rules/linuxPPC64Gcc/cProf b/wmake/rules/linuxPPC64Gcc/cProf new file mode 100644 index 0000000000000000000000000000000000000000..ca3ac9bf5f0cd61fe99e0f05fa1bd4bdf9fa6cf7 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general new file mode 100644 index 0000000000000000000000000000000000000000..2626ab65d12cbba1680848fdc93cfb2b05f3920b --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/general @@ -0,0 +1,11 @@ +CPP = /lib/cpp $(GFLAGS) +LD = ld -m elf64ppc + +PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ +include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linuxPPC64Gcc/mplib b/wmake/rules/linuxPPC64Gcc/mplib new file mode 100644 index 0000000000000000000000000000000000000000..8a84b4014695e82f55b709ed5144f4b528412137 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplib @@ -0,0 +1,3 @@ +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/linuxPPC64Gcc/mplibGAMMA b/wmake/rules/linuxPPC64Gcc/mplibGAMMA new file mode 100644 index 0000000000000000000000000000000000000000..d62c6250ff4769093207d0ac35ec5bdc16f2f0ab --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibGAMMA @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lgamma diff --git a/wmake/rules/linuxPPC64Gcc/mplibHPMPI b/wmake/rules/linuxPPC64Gcc/mplibHPMPI new file mode 100644 index 0000000000000000000000000000000000000000..574492a236a32f7d87d00bf0e3507a5ac8e54f55 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibHPMPI @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include -D_MPICC_H +PLIBS = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi diff --git a/wmake/rules/linuxPPC64Gcc/mplibLAM b/wmake/rules/linuxPPC64Gcc/mplibLAM new file mode 100644 index 0000000000000000000000000000000000000000..6762b843c122f498a54c6e619febedd964f773cc --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibLAM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi -llam -lpthread -lutil diff --git a/wmake/rules/linuxPPC64Gcc/mplibMPICH b/wmake/rules/linuxPPC64Gcc/mplibMPICH new file mode 100644 index 0000000000000000000000000000000000000000..ac17f7c1d2e2665b7372df09fb3fee4d95b85511 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibMPICH @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpich -lrt diff --git a/wmake/rules/linuxPPC64Gcc/mplibMPICH-GM b/wmake/rules/linuxPPC64Gcc/mplibMPICH-GM new file mode 100644 index 0000000000000000000000000000000000000000..88493ebc7059aac7da8678f743a18077a54b9d00 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibMPICH-GM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpich -L$(GM_LIB_PATH) -lgm diff --git a/wmake/rules/linuxPPC64Gcc/mplibOPENMPI b/wmake/rules/linuxPPC64Gcc/mplibOPENMPI new file mode 100644 index 0000000000000000000000000000000000000000..834d2d3e22aaebee233a19b139b6d99a4d457cf7 --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/linuxPPC64Gcc/mplibQSMPI b/wmake/rules/linuxPPC64Gcc/mplibQSMPI new file mode 100644 index 0000000000000000000000000000000000000000..95ea327379f54d7bab8d03218d9bcf114f63a75b --- /dev/null +++ b/wmake/rules/linuxPPC64Gcc/mplibQSMPI @@ -0,0 +1,4 @@ +PFLAGS = +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi +