diff --git a/TODO b/TODO index 09132f1213..c2fd049c26 100644 --- a/TODO +++ b/TODO @@ -20,7 +20,10 @@ OK - parallel finite volume with processorCyclic: channelFoam OK - preProcessing/foamUpgradeCyclics -- amg +OK - amg. +Tested on unitTestCases/singleCyclic/ + +- initTransfer in GAMGprocessorInterfaces using nonblocking+tags - test createPatch pointSync - pointFields on cyclics. volPointInterpolation. - jumpCyclics diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/Make/options b/applications/utilities/preProcessing/foamUpgradeCyclics/Make/options index ac444f6f83..93ae287538 100644 --- a/applications/utilities/preProcessing/foamUpgradeCyclics/Make/options +++ b/applications/utilities/preProcessing/foamUpgradeCyclics/Make/options @@ -1,5 +1,4 @@ EXE_INC = \ - -DFULLDEBUG -g -O0 \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ diff --git a/etc/apps/ensight/cshrc b/etc/apps/ensight/cshrc index 0126a8ea50..36f4dac076 100644 --- a/etc/apps/ensight/cshrc +++ b/etc/apps/ensight/cshrc @@ -22,7 +22,7 @@ # along with OpenFOAM; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# Script +# File # ensight/cshrc # # Description @@ -40,11 +40,11 @@ if ( -r $CEI_HOME ) then # special treatment for 32bit OpenFOAM and 64bit Ensight if ($WM_ARCH == linux && `uname -m` == x86_64) then - setenv CEI_ARCH linux_2.6_32 + setenv CEI_ARCH linux_2.6_32 endif # add to path - set path=($CEI_HOME/bin $path) + setenv PATH ${CEI_HOME}/bin:${PATH} setenv ENSIGHT9_INPUT dummy setenv ENSIGHT9_READER $FOAM_LIBBIN diff --git a/etc/cshrc b/etc/cshrc index 9ef6fb2d06..fd3e7d6834 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -22,7 +22,7 @@ # along with OpenFOAM; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# Script +# File # etc/cshrc # # Description @@ -35,13 +35,13 @@ setenv WM_PROJECT OpenFOAM if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION 1.6 ################################################################################ -# USER EDITABLE PART +# USER EDITABLE PART. Note changes made here may be lost with the next upgrade # # either setenv FOAM_INST_DIR before sourcing this file or set # foamInstall below to where OpenFOAM is installed # -# Location of FOAM installation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Location of the OpenFOAM installation +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set foamInstall = $HOME/$WM_PROJECT # set foamInstall = ~$WM_PROJECT # set foamInstall = /usr/local/$WM_PROJECT @@ -64,12 +64,22 @@ setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION - # Location of third-party software # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION +# Source files, possibly with some verbosity +alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; source \!*' + +# Add in preset user or site preferences: +set foamPrefs=`$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh` +if ( $status == 0 ) then + _foamSource $foamPrefs +endif +unset foamPrefs + + # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ # WM_OSTYPE = POSIX | ???? @@ -199,68 +209,63 @@ default: endsw -# Clean standard environment variables (path/PATH, LD_LIBRARY_PATH, MANPATH) +# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -set cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath +set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath -if (! $?LD_LIBRARY_PATH ) then - setenv LD_LIBRARY_PATH '' -endif -if (! $?MANPATH) then - setenv MANPATH '' -endif +if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH '' +if (! $?MANPATH) setenv MANPATH '' -#- Clean path/PATH -set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set cleanEnv=`$cleanProg "$colonPath" "$foamOldDirs"` +#- Clean PATH (path) +set cleaned=`$foamClean "$PATH" "$foamOldDirs"` if ( $status == 0 ) then - set path=`echo "$cleanEnv" | sed -e 's/:/ /g'` + unset PATH + setenv PATH $cleaned endif #- Clean LD_LIBRARY_PATH -setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"` +set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` +if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned #- Clean MANPATH -setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"` +set cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` +if ( $status == 0 ) setenv MANPATH $cleaned # Source project setup files # ~~~~~~~~~~~~~~~~~~~~~~~~~~ -alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Executing: \!*"; source \!*' - _foamSource $WM_PROJECT_DIR/etc/settings.csh _foamSource $WM_PROJECT_DIR/etc/aliases.csh # Source user setup files for optional packages # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc # Clean environment paths again. Only remove duplicates # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#- Clean path/PATH -set colonPath=`echo "$path" | sed -e 's/ /:/g'` -set cleanEnv=`$cleanProg "$colonPath"` -if ( $status == 0 ) then - set path=`echo "$cleanEnv" | sed -e 's/:/ /g'` -endif +#- Clean PATH (path) +set cleaned=`$foamClean "$PATH"` +if ( $status == 0 ) setenv PATH $cleaned #- Clean LD_LIBRARY_PATH -setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH"` +set cleaned=`$foamClean "$LD_LIBRARY_PATH"` +if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned -#- Clean MANPATH -setenv MANPATH `$cleanProg "$MANPATH"`: +#- Clean MANPATH (trailing ':' to find system pages) +set cleaned=`$foamClean "$MANPATH"`: +if ( $status == 0 ) setenv MANPATH "$cleaned" #- Clean LD_PRELOAD if ( $?LD_PRELOAD ) then - setenv LD_PRELOAD `$cleanProg "$LD_PRELOAD"` + set cleaned=`$foamClean "$LD_PRELOAD"` + if ( $status == 0 ) setenv LD_PRELOAD $cleaned endif # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ -unset cleanEnv cleanProg colonPath foamInstall foamOldDirs +unset cleaned foamClean foamInstall foamOldDirs unalias _foamSource -# ----------------------------------------------------------------------------- +# ----------------------------------------------------------------- end-of-file diff --git a/etc/settings.csh b/etc/settings.csh index 78fd05490f..5d2950662c 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -2,7 +2,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -22,7 +22,7 @@ # along with OpenFOAM; if not, write to the Free Software Foundation, # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# Script +# File # etc/settings.csh # # Description @@ -32,11 +32,11 @@ #------------------------------------------------------------------------------ # prefix to PATH -alias _foamAddPath 'set path=(\!* $path)' +alias _foamAddPath 'setenv PATH \!*\:${PATH}' # prefix to LD_LIBRARY_PATH alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}' # prefix to MANPATH -alias _foamAddManPath 'setenv MANPATH \!*\:${MANPATH}' +alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}' # location of the jobControl directory setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl @@ -68,41 +68,35 @@ setenv FOAM_SOLVERS $FOAM_APP/solvers setenv FOAM_RUN $WM_PROJECT_USER_DIR/run # add OpenFOAM scripts and wmake to the path -set path=($WM_DIR $WM_PROJECT_DIR/bin $path) +setenv PATH ${WM_DIR}:${WM_PROJECT_DIR}/bin:${PATH} -_foamAddPath $FOAM_APPBIN -_foamAddPath $FOAM_SITE_APPBIN -_foamAddPath $FOAM_USER_APPBIN -_foamAddLib $FOAM_LIBBIN -_foamAddLib $FOAM_SITE_LIBBIN -_foamAddLib $FOAM_USER_LIBBIN +_foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN} + # Make sure to pick up dummy versions of external libraries last +_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy # Select compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# compilerInstall = OpenFOAM | System -set compilerInstall=OpenFOAM +# compilerInstall = OpenFOAM | system +if ( ! $?compilerInstall ) set compilerInstall=OpenFOAM switch ("$compilerInstall") case OpenFOAM: switch ("$WM_COMPILER") case Gcc: - setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.4.3/platforms/$WM_ARCH$WM_COMPILER_ARCH - _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.2/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib - _foamAddLib $WM_THIRD_PARTY_DIR/gmp-5.0.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib + setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.3 + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.2/lib + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-5.0.1/lib breaksw case Gcc442: - setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.4.2/platforms/$WM_ARCH$WM_COMPILER_ARCH - _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib - _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib + setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.4.2 + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib breaksw case Gcc43: - setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH - _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib - _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib - breaksw - case Gcc42: - setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH + setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gcc-4.3.3 + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/mpfr-2.4.1/lib + _foamAddLib $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/gmp-4.2.4/lib breaksw endsw @@ -112,14 +106,13 @@ case OpenFOAM: echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:" echo " Cannot find $WM_COMPILER_DIR 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 " change the 'compilerInstall' setting to 'system' in this file" echo endif _foamAddPath ${WM_COMPILER_DIR}/bin - _foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH} - _foamAddLib ${WM_COMPILER_DIR}/lib - _foamAddManPath ${WM_COMPILER_DIR}/man + _foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}:${WM_COMPILER_DIR}/lib + _foamAddMan ${WM_COMPILER_DIR}/man breaksw endsw @@ -128,33 +121,30 @@ endsw # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ -unset MPI_ARCH_PATH +unsetenv MPI_ARCH_PATH MPI_HOME switch ("$WM_MPLIB") case OPENMPI: set mpi_version=openmpi-1.4.1 - setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version - setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS + setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version # Tell OpenMPI where to find its install directory setenv OPAL_PREFIX $MPI_ARCH_PATH _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - _foamAddManPath $MPI_ARCH_PATH/man + _foamAddMan $MPI_ARCH_PATH/man setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version breaksw case SYSTEMOPENMPI: - # This uses the installed openmpi. It needs mpicc installed! - set mpi_version=openmpi-system # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI - setenv PINC `mpicc --showme:compile` + setenv PINC `mpicc --showme:compile` setenv PLIBS `mpicc --showme:link` set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'` @@ -165,7 +155,7 @@ case SYSTEMOPENMPI: echo " libmpi dir : $libDir" endif - _foamAddLib $libDir + _foamAddLib $libDir setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version libDir @@ -174,11 +164,11 @@ case SYSTEMOPENMPI: case MPICH: set mpi_version=mpich2-1.1.1p1 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version - setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS + setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version _foamAddPath $MPI_ARCH_PATH/bin _foamAddLib $MPI_ARCH_PATH/lib - _foamAddManPath $MPI_ARCH_PATH/share/man + _foamAddMan $MPI_ARCH_PATH/share/man setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version unset mpi_version @@ -189,9 +179,9 @@ case MPICH-GM: setenv MPICH_PATH $MPI_ARCH_PATH setenv GM_LIB_PATH /opt/gm/lib64 - _foamAddPath $MPI_ARCH_PATH/bin - _foamAddLib $MPI_ARCH_PATH/lib - _foamAddLib $GM_LIB_PATH + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + _foamAddLib $GM_LIB_PATH setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm breaksw @@ -233,18 +223,18 @@ case MPI: case FJMPI: setenv MPI_ARCH_PATH /opt/FJSVmpi2 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi - _foamAddPath $MPI_ARCH_PATH/bin - _foamAddLib $MPI_ARCH_PATH/lib/sparcv9 - _foamAddLib /opt/FSUNf90/lib/sparcv9 - _foamAddLib /opt/FJSVpnidt/lib + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib/sparcv9 + _foamAddLib /opt/FSUNf90/lib/sparcv9 + _foamAddLib /opt/FJSVpnidt/lib breaksw case QSMPI: setenv MPI_ARCH_PATH /usr/lib/mpi setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi - _foamAddPath $MPI_ARCH_PATH/bin - _foamAddLib $MPI_ARCH_PATH/lib + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib breaksw @@ -258,7 +248,7 @@ _foamAddLib $FOAM_MPI_LIBBIN # Set the minimum MPI buffer size (used by all platforms except SGI MPI) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -set minBufferSize=20000000 +if ( ! $?minBufferSize ) set minBufferSize=20000000 if ( $?MPI_BUFFER_SIZE ) then if ( $MPI_BUFFER_SIZE < $minBufferSize ) then @@ -276,8 +266,8 @@ if ( $?CGAL_LIB_DIR ) then endif -# Switch on the hoard memory allocator if available -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Enable the hoard memory allocator if available +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #if ( -f $FOAM_LIBBIN/libhoard.so ) then # setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD} #endif @@ -285,8 +275,7 @@ endif # cleanup environment: # ~~~~~~~~~~~~~~~~~~~~ -unalias _foamAddPath -unalias _foamAddLib -unset minBufferSize +unalias _foamAddPath _foamAddLib _foamAddMan +unset compilerInstall minBufferSize -# ----------------------------------------------------------------------------- +# ----------------------------------------------------------------- end-of-file diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 7aa89c629f..26dd4cd677 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -252,19 +252,18 @@ $(lduInterfaceFields)/lduInterfaceField/lduInterfaceField.C $(lduInterfaceFields)/processorLduInterfaceField/processorLduInterfaceField.C $(lduInterfaceFields)/cyclicLduInterfaceField/cyclicLduInterfaceField.C -/* GAMG = $(lduMatrix)/solvers/GAMG +/* +*/ $(GAMG)/GAMGSolver.C $(GAMG)/GAMGSolverAgglomerateMatrix.C $(GAMG)/GAMGSolverScalingFactor.C $(GAMG)/GAMGSolverSolve.C - GAMGInterfaces = $(GAMG)/interfaces $(GAMGInterfaces)/GAMGInterface/GAMGInterface.C $(GAMGInterfaces)/GAMGInterface/newGAMGInterface.C $(GAMGInterfaces)/processorGAMGInterface/processorGAMGInterface.C $(GAMGInterfaces)/cyclicGAMGInterface/cyclicGAMGInterface.C - GAMGInterfaceFields = $(GAMG)/interfaceFields $(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceField.C $(GAMGInterfaceFields)/GAMGInterfaceField/newGAMGInterfaceField.C @@ -284,7 +283,6 @@ $(pairGAMGAgglomeration)/pairGAMGAgglomerationCombineLevels.C algebraicPairGAMGAgglomeration = $(GAMGAgglomerations)/algebraicPairGAMGAgglomeration $(algebraicPairGAMGAgglomeration)/algebraicPairGAMGAgglomeration.C -*/ meshes/lduMesh/lduMesh.C diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C index 0bacb37798..e0724eceef 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C @@ -155,7 +155,7 @@ void cyclicPointPatchField::swapAddSeparated } } - addToInternalField(pField, pf, cyclicPatch_.separatedPoints()); + addToInternalField(pField, pf); } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C index f6d8444e56..6030e48040 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C @@ -103,27 +103,27 @@ void processorPointPatchField::initSwapAddSeparated ) const { - if (Pstream::parRun()) - { - // Get internal field into correct order for opposite side - Field pf - ( - this->patchInternalField - ( - pField, - procPatch_.reverseMeshPoints() - ) - ); - - OPstream::write - ( - commsType, - procPatch_.neighbProcNo(), - reinterpret_cast(pf.begin()), - pf.byteSize(), - procPatch_.tag() - ); - } +// if (Pstream::parRun()) +// { +// // Get internal field into correct order for opposite side +// Field pf +// ( +// this->patchInternalField +// ( +// pField, +// procPatch_.reverseMeshPoints() +// ) +// ); +// +// OPstream::write +// ( +// commsType, +// procPatch_.neighbProcNo(), +// reinterpret_cast(pf.begin()), +// pf.byteSize(), +// procPatch_.tag() +// ); +// } } @@ -134,29 +134,29 @@ void processorPointPatchField::swapAddSeparated Field& pField ) const { - if (Pstream::parRun()) - { - Field pnf(this->size()); - - IPstream::read - ( - commsType, - procPatch_.neighbProcNo(), - reinterpret_cast(pnf.begin()), - pnf.byteSize(), - procPatch_.tag() - ); - - if (doTransform()) - { - const processorPolyPatch& ppp = procPatch_.procPolyPatch(); - const tensor& forwardT = ppp.forwardT(); - - transform(pnf, forwardT, pnf); - } - - addToInternalField(pField, pnf, procPatch_.separatedPoints()); - } +// if (Pstream::parRun()) +// { +// Field pnf(this->size()); +// +// IPstream::read +// ( +// commsType, +// procPatch_.neighbProcNo(), +// reinterpret_cast(pnf.begin()), +// pnf.byteSize(), +// procPatch_.tag() +// ); +// +// if (doTransform()) +// { +// const processorPolyPatch& ppp = procPatch_.procPolyPatch(); +// const tensor& forwardT = ppp.forwardT(); +// +// transform(pnf, forwardT, pnf); +// } +// +// addToInternalField(pField, pnf, procPatch_.separatedPoints()); +// } } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C index 3034a595f1..4a6e93db2b 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.C @@ -96,17 +96,27 @@ processorCyclicPointPatchField::~processorCyclicPointPatchField() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -void processorCyclicPointPatchField::initSwapAdd(Field& pField) -const +void processorCyclicPointPatchField::initSwapAddSeparated +( + const Pstream::commsTypes commsType, + Field& pField +) const { if (Pstream::parRun()) { - // Get internal field into my point order - Field pf(this->patchInternalField(pField)); + // Get internal field into correct order for opposite side + Field pf + ( + this->patchInternalField + ( + pField, + procPatch_.reverseMeshPoints() + ) + ); OPstream::write ( - Pstream::blocking, + commsType, procPatch_.neighbProcNo(), reinterpret_cast(pf.begin()), pf.byteSize(), @@ -117,7 +127,11 @@ const template -void processorCyclicPointPatchField::swapAdd(Field& pField) const +void processorCyclicPointPatchField::swapAddSeparated +( + const Pstream::commsTypes commsType, + Field& pField +) const { if (Pstream::parRun()) { @@ -125,7 +139,7 @@ void processorCyclicPointPatchField::swapAdd(Field& pField) const IPstream::read ( - Pstream::blocking, + commsType, procPatch_.neighbProcNo(), reinterpret_cast(pnf.begin()), pnf.byteSize(), @@ -134,129 +148,14 @@ void processorCyclicPointPatchField::swapAdd(Field& pField) const if (doTransform()) { - procPatch_.procPolyPatch().transform(pnf); + const processorCyclicPolyPatch& ppp = + procPatch_.procCyclicPolyPatch(); + const tensor& forwardT = ppp.forwardT(); - //const processorPolyPatch& ppp = procPatch_.procPolyPatch(); - //const labelList& nonGlobalPatchPoints = - // procPatch_.nonGlobalPatchPoints(); - // - //// Mark patch that transformed point: - //// -3 : global patch point so handled in different patch - //// -2 : nonGlobalPatchPoints, initial value - //// -1 : originating from internal face, no transform necessary - //// >=0 : originating from coupled patch - //labelList hasTransformed(ppp.nPoints(), -3); - //forAll(nonGlobalPatchPoints, i) - //{ - // hasTransformed[nonGlobalPatchPoints[i]] = -2; - //} - // - //forAll(ppp.patchIDs(), subI) - //{ - // label patchI = ppp.patchIDs()[subI]; - // - // if (patchI == -1) - // { - // for - // ( - // label faceI = ppp.starts()[subI]; - // faceI < ppp.starts()[subI+1]; - // faceI++ - // ) - // { - // const face& f = ppp.localFaces()[faceI]; - // - // forAll(f, fp) - // { - // label pointI = f[fp]; - // - // if (hasTransformed[pointI] == -3) - // { - // // special point, handled elsewhere - // } - // else if (hasTransformed[pointI] == -2) - // { - // // first visit. Just mark. - // hasTransformed[pointI] = patchI; - // } - // else if (hasTransformed[pointI] == patchI) - // { - // // already done - // } - // else - // { - // FatalErrorIn - // ( - // "processorCyclicPointPatchField::" - // "swapAdd(Field& pField) const" - // ) << "Point " << pointI - // << " on patch " << ppp.name() - // << " already transformed by patch " - // << hasTransformed[pointI] - // << abort(FatalError); - // } - // } - // } - // } - // else if - // ( - // !refCast - // ( - // ppp.boundaryMesh()[patchI] - // ).parallel() - // ) - // { - // const tensor& T = refCast - // ( - // ppp.boundaryMesh()[patchI] - // ).forwardT(); - // - // for - // ( - // label faceI = ppp.starts()[subI]; - // faceI < ppp.starts()[subI+1]; - // faceI++ - // ) - // { - // const face& f = ppp.localFaces()[faceI]; - // - // forAll(f, fp) - // { - // label pointI = f[fp]; - // - // if (hasTransformed[pointI] == -3) - // { - // // special point, handled elsewhere - // } - // else if (hasTransformed[pointI] == -2) - // { - // pnf[pointI] = transform(T, pnf[pointI]); - // - // hasTransformed[pointI] = patchI; - // } - // else if (hasTransformed[pointI] == patchI) - // { - // // already done - // } - // else - // { - // FatalErrorIn - // ( - // "processorCyclicPointPatchField::" - // "swapAdd(Field& pField) const" - // ) << "Point " << pointI - // << " on patch " << ppp.name() - // << " subPatch " << patchI - // << " already transformed by patch " - // << hasTransformed[pointI] - // << abort(FatalError); - // } - // } - // } - // } - //} + transform(pnf, forwardT, pnf); } + // All points are separated addToInternalField(pField, pnf); } } diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H index d0ece8d33a..6b5f9b3377 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/processorCyclic/processorCyclicPointPatchField.H @@ -169,11 +169,19 @@ public: ) {} - //- Initialise swap of patch point values - virtual void initSwapAdd(Field&) const; + //- Initialise swap of non-collocated patch point values + virtual void initSwapAddSeparated + ( + const Pstream::commsTypes commsType, + Field& + ) const; //- Complete swap of patch point values and add to local values - virtual void swapAdd(Field&) const; + virtual void swapAddSeparated + ( + const Pstream::commsTypes commsType, + Field& + ) const; }; diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.C index 11716ab844..4d60178110 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.C @@ -37,9 +37,11 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::cyclicLduInterface::cyclicLduInterface(const label neighbPatchID) -: - neighbPatchID_(neighbPatchID) +//Foam::cyclicLduInterface::cyclicLduInterface(const label neighbPatchID) +//: +// neighbPatchID_(neighbPatchID) +//{} +Foam::cyclicLduInterface::cyclicLduInterface() {} diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H index 21b70b59be..26e104e3a0 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/cyclicLduInterface.H @@ -52,8 +52,8 @@ class cyclicLduInterface { // Private data - //- Coupled patch - const label neighbPatchID_; +// //- Coupled patch +// const label neighbPatchID_; // const cyclicLduInterface* neighbPatch_; @@ -64,8 +64,11 @@ public: // Constructors - //- Construct from components - cyclicLduInterface(const label neighbPatchID); +// //- Construct from components +// cyclicLduInterface(const label neighbPatchID); + + //- Construct null + cyclicLduInterface(); // Destructor @@ -76,22 +79,13 @@ public: // Access - //- Return processor number - label neighbPatchID() const - { - return neighbPatchID_; - } + //- Return neighbour + virtual label neighbPatchID() const = 0; -// //- Return processor number -// const cyclicLduInterface& neighbPatch() const -// { -// if (!neighbPatch_) -// { -// FatalErrorIn("cyclicLduInterface::neighbPatch() const") -// << "Not owner." << abort(FatalError); -// } -// return neighbPatchID_; -// } + virtual bool owner() const = 0; + + //- Return processor number + virtual const cyclicLduInterface& neighbPatch() const = 0; //- Return face transformation tensor virtual const tensor& forwardT() const = 0; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C index 8530c936ff..c132994ec7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C @@ -246,6 +246,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing inti, GAMGInterface::New ( + inti, + coarseInterfaces, fineInterfaces[inti], fineInterfaces[inti].interfaceInternalField(restrictMap), fineInterfaces[inti].internalFieldTransfer diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H index f316be43b1..6cd8dd0dda 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.H @@ -130,13 +130,13 @@ public: } //- Return face transformation tensor - virtual const tensorField& forwardT() const + virtual const tensor& forwardT() const { return cyclicInterface_.forwardT(); } //- Return neighbour-cell transformation tensor - virtual const tensorField& reverseT() const + virtual const tensor& reverseT() const { return cyclicInterface_.reverseT(); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H index a39de1c764..6027f5f36e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/processorGAMGInterfaceField/processorGAMGInterfaceField.H @@ -153,7 +153,7 @@ public: } //- Return face transformation tensor - virtual const tensorField& forwardT() const + virtual const tensor& forwardT() const { return procInterface_.forwardT(); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H index 0e701d157d..3f4cafffb3 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.H @@ -37,8 +37,9 @@ SourceFiles #ifndef GAMGInterface_H #define GAMGInterface_H -#include "lduInterface.H" +//#include "lduInterface.H" #include "autoPtr.H" +#include "lduInterfacePtrsList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,6 +59,12 @@ protected: // Protected data + //- My index in coarseInterfaces + const label index_; + + //- All interfaces + const lduInterfacePtrsList& coarseInterfaces_; + //- Face-cell addressing labelField faceCells_; @@ -90,11 +97,15 @@ public: GAMGInterface, lduInterface, ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, const lduInterface& fineInterface, const labelField& localRestrictAddressing, const labelField& neighbourRestrictAddressing ), ( + index, + coarseInterfaces, fineInterface, localRestrictAddressing, neighbourRestrictAddressing @@ -108,6 +119,8 @@ public: // the fine interface static autoPtr New ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, const lduInterface& fineInterface, const labelField& localRestrictAddressing, const labelField& neighbourRestrictAddressing @@ -120,10 +133,15 @@ public: // local and neighbour restrict addressing GAMGInterface ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, const lduInterface&, const labelField&, const labelField& ) + : + index_(index), + coarseInterfaces_(coarseInterfaces) {} @@ -137,6 +155,16 @@ public: return faceCells_.size(); } + virtual label index() const + { + return index_; + } + + virtual const lduInterfacePtrsList& coarseInterfaces() const + { + return coarseInterfaces_; + } + //- Return faceCell addressing virtual const unallocLabelList& faceCells() const { diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C index 7cb1ecf147..1c2cc33de6 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/newGAMGInterface.C @@ -32,6 +32,8 @@ License Foam::autoPtr Foam::GAMGInterface::New ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, const lduInterface& fineInterface, const labelField& localRestrictAddressing, const labelField& neighbourRestrictAddressing @@ -60,6 +62,8 @@ Foam::autoPtr Foam::GAMGInterface::New ( cstrIter() ( + index, + coarseInterfaces, fineInterface, localRestrictAddressing, neighbourRestrictAddressing diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C index a7ef01306c..8b2b66ec04 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/cyclicGAMGInterface/cyclicGAMGInterface.C @@ -46,23 +46,37 @@ namespace Foam Foam::cyclicGAMGInterface::cyclicGAMGInterface ( + const label index, + const lduInterfacePtrsList& coarseInterfaces, const lduInterface& fineInterface, const labelField& localRestrictAddressing, const labelField& neighbourRestrictAddressing ) : - cyclicLduInterface - ( - refCast(fineInterface).neighbPatchID() - ), GAMGInterface ( + index, + coarseInterfaces, fineInterface, localRestrictAddressing, neighbourRestrictAddressing ), fineCyclicInterface_(refCast(fineInterface)) { +// //if (debug) +// { +// Pout<< "On fineInterface " << index << " with faceCells:" +// << fineInterface.faceCells() << endl; +// forAll(localRestrictAddressing, ffi) +// { +// Pout<< " local face " << ffi +// << " is on agglom cell " << localRestrictAddressing[ffi] +// << " nbr face on agglom cell " +// << neighbourRestrictAddressing[ffi] +// << endl; +// } +// } + // Make a lookup table of entries for owner/neighbour Map > neighboursTable ( @@ -77,20 +91,32 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface label nCoarseFaces = 0; - label sizeBy2 = localRestrictAddressing.size()/2; - - for (label ffi=0; ffi& curNbrs = neighboursTable.find(curMaster)(); @@ -141,81 +167,110 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface } // end for all fine faces - faceCells_.setSize(2*nCoarseFaces, -1); - faceRestrictAddressing_.setSize(localRestrictAddressing.size(), -1); + + //faceCells_.setSize(nCoarseFaces, -1); + faceCells_.setSize(2*nCoarseFaces); + faceRestrictAddressing_.setSize(localRestrictAddressing.size()); labelList contents = neighboursTable.toc(); // Reset face counter for re-use nCoarseFaces = 0; - // On master side, the owner addressing is stored in table of contents - forAll (contents, masterI) +// if (owner()) { - SLList