From 1785a87350756b814cf39c273d80054e5d012c76 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 5 Jun 2008 11:17:55 +0100 Subject: [PATCH 1/7] updating with mark's changes - consistency --- etc/settings.csh | 54 +++++++++++++++++----------------- etc/settings.sh | 75 +++++++++++++++++++++++------------------------- 2 files changed, 62 insertions(+), 67 deletions(-) diff --git a/etc/settings.csh b/etc/settings.csh index 60b7003d5d..25e238f5ae 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -130,58 +130,56 @@ endif # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ +unset MPI_ARCH_PATH + switch ("$WM_MPLIB") case OPENMPI: - set ompi_version=openmpi-1.2.6 - setenv OPENMPI_ARCH_PATH $thirdParty/$ompi_version/platforms/$WM_OPTIONS - setenv MPI_ARCH_PATH $OPENMPI_ARCH_PATH + set mpi_version=openmpi-1.2.6 + setenv MPI_ARCH_PATH $thirdParty/$mpi_version/platforms/$WM_OPTIONS # Tell OpenMPI where to find it's install directory - setenv OPAL_PREFIX $OPENMPI_ARCH_PATH + setenv OPAL_PREFIX $MPI_ARCH_PATH - AddLib $OPENMPI_ARCH_PATH/lib - AddPath $OPENMPI_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$ompi_version - unset ompi_version + setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version + unset mpi_version breaksw case LAM: - set lam_version=lam-7.1.4 - setenv LAMHOME $thirdParty/$lam_version - setenv LAM_ARCH_PATH $LAMHOME/platforms/$WM_OPTIONS - setenv MPI_ARCH_PATH $LAM_ARCH_PATH + set mpi_version=lam-7.1.4 + setenv MPI_ARCH_PATH $thirdParty/$mpi_version/platforms/$WM_OPTIONS + setenv LAMHOME $thirdParty/$mpi_version - AddLib $LAM_ARCH_PATH/lib - AddPath $LAM_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$lam_version - unset lam_version + setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version + unset mpi_version breaksw case MPICH: - set mpich_version=mpich-1.2.4 - setenv MPICH_ARCH_PATH $thirdParty/$mpich_version/platforms/$WM_OPTIONS - setenv MPICH_ROOT $MPICH_ARCH_PATH - setenv MPI_ARCH_PATH $MPICH_ARCH_PATH + set mpi_version=mpich-1.2.4 + setenv MPI_ARCH_PATH $thirdParty/$mpi_version/platforms/$WM_OPTIONS + setenv MPICH_ROOT $MPI_ARCH_PATH - AddLib $MPICH_ARCH_PATH/lib - AddPath $MPICH_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpich_version - unset mpich_version + setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version + unset mpi_version breaksw case MPICH-GM: setenv MPICH_PATH /opt/mpi - setenv MPICH_ARCH_PATH $MPICH_PATH setenv MPICH_ROOT $MPICH_ARCH_PATH + setenv MPI_ARCH_PATH $MPICH_PATH setenv GM_LIB_PATH /opt/gm/lib64 - setenv MPI_ARCH_PATH $MPICH_ARCH_PATH - AddLib $MPICH_ARCH_PATH/lib + AddLib $MPI_ARCH_PATH/lib AddLib $GM_LIB_PATH - AddPath $MPICH_ARCH_PATH/bin + AddPath $MPI_ARCH_PATH/bin setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm breaksw diff --git a/etc/settings.sh b/etc/settings.sh index bf202613e8..d0faca87d3 100644 --- a/etc/settings.sh +++ b/etc/settings.sh @@ -39,18 +39,22 @@ fi AddPath() { - if [ $# -ge 1 ]; then + while [ $# -ge 1 ] + do [ -d $1 ] || mkdir -p $1 export PATH=$1:$PATH - fi + shift + done } AddLib() { - if [ $# -ge 1 ]; then + while [ $# -ge 1 ] + do [ -d $1 ] || mkdir -p $1 export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH - fi + shift + done } @@ -117,7 +121,7 @@ OpenFOAM) if [ ! -d "$WM_COMPILER_DIR" ] then echo - echo "Warning in $1:" + echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" 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 WM_COMPILER_INST setting to 'System' in this file" @@ -135,73 +139,66 @@ if [ "$WM_COMPILER_BIN" != "" ]; then fi -# Third-party software -# ~~~~~~~~~~~~~~~~~~~~ -thirdParty=$WM_PROJECT_INST_DIR/ThirdParty - - # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ +unset MPI_ARCH_PATH + case "$WM_MPLIB" in OPENMPI) - ompi_version=openmpi-1.2.6 - export OPENMPI_ARCH_PATH=$thirdParty/$ompi_version/platforms/$WM_OPTIONS - export MPI_ARCH_PATH=$OPENMPI_ARCH_PATH + mpi_version=openmpi-1.2.6 + export MPI_ARCH_PATH=$thirdParty/$mpi_version/platforms/$WM_OPTIONS # Tell OpenMPI where to find its install directory - export OPAL_PREFIX=$OPENMPI_ARCH_PATH + export OPAL_PREFIX=$MPI_ARCH_PATH - AddLib $OPENMPI_ARCH_PATH/lib - AddPath $OPENMPI_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$ompi_version - unset ompi_version + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version + unset mpi_version ;; LAM) - lam_version=lam-7.1.4 - export LAMHOME=$thirdParty/$lam_version - export LAM_ARCH_PATH=$LAMHOME/platforms/$WM_OPTIONS - export MPI_ARCH_PATH=$LAM_ARCH_PATH + mpi_version=lam-7.1.4 + export MPI_ARCH_PATH=$thirdParty/$mpi_version/platforms/$WM_OPTIONS + export LAMHOME=$thirdParty/$mpi_version + # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too - AddLib $LAM_ARCH_PATH/lib - AddPath $LAM_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$lam_version - unset lam_version + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version + unset mpi_version ;; MPICH) - mpich_version=mpich-1.2.4 - export MPICH_ARCH_PATH=$thirdParty/$mpich_version/platforms/$WM_OPTIONS + mpi_version=mpich-1.2.4 + export MPI_ARCH_PATH=$thirdParty/$mpi_version/platforms/$WM_OPTIONS export MPICH_ROOT=$MPICH_ARCH_PATH - export MPI_ARCH_PATH=$MPICH_ARCH_PATH - AddLib $MPICH_ARCH_PATH/lib - AddPath $MPICH_ARCH_PATH/bin + AddLib $MPI_ARCH_PATH/lib + AddPath $MPI_ARCH_PATH/bin - export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpich_version - unset mpich_version + export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version + unset mpi_version ;; MPICH-GM) export MPICH_PATH=/opt/mpi - export MPICH_ARCH_PATH=$MPICH_PATH - export MPICH_ROOT=$MPICH_ARCH_PATH + export MPICH_ROOT=$MPICH_PATH + export MPI_ARCH_PATH=$MPICH_PATH export GM_LIB_PATH=/opt/gm/lib64 - export MPI_ARCH_PATH=$MPICH_ARCH_PATH - AddLib $MPICH_ARCH_PATH/lib + AddLib $MPI_ARCH_PATH/lib AddLib $GM_LIB_PATH - AddPath $MPICH_ARCH_PATH/bin + AddPath $MPI_ARCH_PATH/bin export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm ;; GAMMA) export GAMMA_ARCH_PATH=/usr - export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/gamma ;; From e08aa96bb2527fc027901a9203f07fa7047cdea5 Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 5 Jun 2008 12:13:58 +0100 Subject: [PATCH 2/7] Removed section on networking needed for FoamX. Updated gcc to 4.2.? --- README | 86 ++-------------------------------------------------------- 1 file changed, 3 insertions(+), 83 deletions(-) diff --git a/README b/README index 7137010e97..6d8acd3044 100644 --- a/README +++ b/README @@ -104,9 +104,9 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you cannot find an appropriate binary pack for your platform you can build the complete OpenFOAM from the source-pack. First you will need to - compile or obtain a recent version of gcc (we recommend gcc-4.1.?) for + compile or obtain a recent version of gcc (we recommend gcc-4.2.?) for your platform which may be obtained from http://gcc.gnu.org/. Install the - compiler in $WM_PROJECT_INST_DIR/$WM_ARCH/gcc-4.1.? and change the gcc + compiler in $WM_PROJECT_INST_DIR/$WM_ARCH/gcc-4.2.? and change the gcc version number in $WM_PROJECT_DIR/.bashrc and $WM_PROJECT_DIR/.cshrc as appropriate and update the environment variables as in section 3. @@ -167,87 +167,7 @@ http://www.OpenFOAM.org/bugs.html -A. Network settings -~~~~~~~~~~~~~~~~~~~ - OpenFOAM requires a basic level of networking to be set up. Firstly, the - host name must be set - to test, type 'uname -a'. The running shell must - be tcsh, csh, bash or ksh - to test type 'echo $SHELL' - - The user must be able to 'ping' the host machine itself () - to - test, type 'ping -c 1 ' - - If the ping fails then it is possible that that the entry for the host - machine is missing, incorrect or duplicated in the /etc/hosts file. The - user can check this by typing 'grep /etc/hosts' which should return - a single line, typically of the form: - - . - - The must correspond to that in the networking settings of the - machine which can also be checked by typing on Linux '/sbin/ifconfig' - which should produce lines of output that include something similar to the - following: - - eth0 Link encap:Ethernet HWaddr ... - inet addr: ... - - If the user is connected to a network that uses dynamic IP addresses, they - must be particularly careful to ensure that an entry for their hostname/IP - exists in the /etc/hosts file. If the server frequently reallocates IP - addresses across the network, it is advisable that the /etc/hosts file is - updated automatically when any changes occur. - - The user should also be able to contact any other machine that it needs - to, either a remote licence host or other machines that are being used - within some parallel computation. Essentially the user needs to be able to - ping these machines as described in preceeding sections. - - The machine must have one of (or both) remote (rsh) and secure shell (ssh) - running on his/her account. To check whether rsh is running correctly, the - user should type 'rsh ls'. Alternatively the user can check if ssh - is running correctly by typing 'ssh ls'. In either case, the output - to the command should produce a file/directory listing for the current - directory and no other text. If neither command works, we recommend the - user set up rsh for their use as follows: - - Check the rsh executable actually exists, e.g. the path to the executable - should be returned when typing 'which rsh'. Check with the system - administrator that rsh is enabled on the user's account; if not, request - that it is enabled. Create a '.rhosts' file in the $HOME directory - containing entries to access any machines they need to access, i.e. their - own machine and, if different, the licence host machine. The entries are - of the form: ' '. - - Remote shell accesses the .bashrc (or .cshrc) file and will not run - correctly if there is a problem with this file. In particular the user - should be careful with the following: - - The ~/.cshrc (or ~/.bashrc) file should not contain errors that prevent it - from executing fully at startup; all error messages during execution of - the ~/.bashrc (or ~/.cshrc) file should be investigated and acted upon to - eliminate them. echo (print to screen) statements within ~/.bashrc (or - ~/.cshrc) must not be executed during the running of rsh. This does not - mean that echo statements are forbidden from the ~/.cshrc (or ~/.bashrc) - file, but they must be enclosed in a control structure, e.g. an if - statement, that ensures they are not executed when rsh is executed. - For ~.bashrc: - - if [ "$PS1" ]; then - echo "..." - fi - - # or, alternatively - - if /usr/bin/tty -s 2>/dev/null; then - echo "..." - fi - - and, for ~.cshrc: - - if ($?prompt) then ; echo "..." ; endif - - -B. Running OpenFOAM in 32-bit mode on 64-bit machines +A. Running OpenFOAM in 32-bit mode on 64-bit machines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Those users with an installation of Linux on a 64-bit machine may install either or both of the 32-bit version of OpenFOAM (linux) or the 64-bit From ef69bc6c61d7002cbe7de3b86eb78edee1625327 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Jun 2008 13:05:55 +0100 Subject: [PATCH 3/7] bounding box incorrect --- src/triSurface/triSurface/triSurface.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index 265b08d9c8..a3f7fec879 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -1214,7 +1214,11 @@ void triSurface::writeStats(Ostream& os) const { // Calculate bounding box without any additional addressing // Copy of treeBoundBox code. Cannot use meshTools from triSurface... - boundBox bb; + boundBox bb + ( + point(VGREAT, VGREAT, VGREAT), + point(-VGREAT, -VGREAT, -VGREAT) + ); forAll(*this, triI) { const labelledTri& f = operator[](triI); From 74eeaff984edaf7a1c9b059c6e5b7caf6d8d430f Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Jun 2008 13:06:15 +0100 Subject: [PATCH 4/7] typo in comment --- .../surface/surfaceFeatureConvert/surfaceFeatureConvert.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/utilities/surface/surfaceFeatureConvert/surfaceFeatureConvert.C b/applications/utilities/surface/surfaceFeatureConvert/surfaceFeatureConvert.C index 47ba9eb2a9..03c18cd3e9 100644 --- a/applications/utilities/surface/surfaceFeatureConvert/surfaceFeatureConvert.C +++ b/applications/utilities/surface/surfaceFeatureConvert/surfaceFeatureConvert.C @@ -230,8 +230,8 @@ void write int main(int argc, char *argv[]) { argList::noParallel(); - argList::validArgs.append("surface"); - argList::validArgs.append("output name"); + argList::validArgs.append("input file"); + argList::validArgs.append("output file"); # include "setRootCase.H" # include "createTime.H" From d25d392c9f45b3588e92fa345dc2805035fe2373 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Jun 2008 13:09:20 +0100 Subject: [PATCH 5/7] removed call to putenv since incorrect --- src/OSspecific/Unix/Unix.C | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/OSspecific/Unix/Unix.C b/src/OSspecific/Unix/Unix.C index 830f48e71a..e50444a236 100644 --- a/src/OSspecific/Unix/Unix.C +++ b/src/OSspecific/Unix/Unix.C @@ -103,11 +103,7 @@ bool Foam::setEnv const bool overwrite ) { -# ifdef linux return setenv(envName.c_str(), value.c_str(), overwrite) == 0; -# else - return putenv((char*)(envName + '=' + value.c_str()).c_str()) == 0; -# endif } From d536f087b53d453c2ea05d680d121e8e7f39c41a Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 5 Jun 2008 19:23:58 +0100 Subject: [PATCH 6/7] region not preserved when stitching --- .../triSurface/interfaces/STL/readSTLASCII.L | 1 + src/triSurface/triSurface/stitchTriangles.C | 10 +++++----- src/triSurface/triSurface/triSurface.C | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L index c6343dd55e..fe49521d0d 100644 --- a/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L +++ b/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L @@ -438,6 +438,7 @@ bool triSurface::readSTLASCII(const fileName& STLfileName) STLlabels.clear(); + // Stitch all points within SMALL meters. stitchTriangles(rawPoints); // Convert solidNames into regionNames diff --git a/src/triSurface/triSurface/stitchTriangles.C b/src/triSurface/triSurface/stitchTriangles.C index 5b22529bdd..a9bf3c4782 100644 --- a/src/triSurface/triSurface/stitchTriangles.C +++ b/src/triSurface/triSurface/stitchTriangles.C @@ -42,17 +42,16 @@ bool triSurface::stitchTriangles ) { // Merge points - labelList pointMap(rawPoints.size()); - - pointField newPoints(rawPoints.size()); - + labelList pointMap; + pointField newPoints; bool hasMerged = mergePoints(rawPoints, tol, verbose, pointMap, newPoints); if (hasMerged) { if (verbose) { - Pout<< "stitchTriangles : Renumbering all triangles" << endl; + Pout<< "stitchTriangles : Merged from " << rawPoints.size() + << " points down to " << newPoints.size() << endl; } pointField& ps = const_cast(points()); @@ -73,6 +72,7 @@ bool triSurface::stitchTriangles operator[](newTriangleI)[0] = newA; operator[](newTriangleI)[1] = newB; operator[](newTriangleI)[2] = newC; + operator[](newTriangleI).region() = operator[](i).region(); newTriangleI++; } else if (verbose) diff --git a/src/triSurface/triSurface/triSurface.C b/src/triSurface/triSurface/triSurface.C index a3f7fec879..b58c2f6f58 100644 --- a/src/triSurface/triSurface/triSurface.C +++ b/src/triSurface/triSurface/triSurface.C @@ -651,7 +651,7 @@ surfacePatchList triSurface::calcPatches(labelList& faceMap) const { sortedRegion[faceI] = operator[](faceI).region(); } - sortedRegion.sort(); + sortedRegion.stableSort(); faceMap = sortedRegion.indices(); From 935d7a81315a8ce36f051a833cecc61cbe402bc6 Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 5 Jun 2008 20:19:41 +0100 Subject: [PATCH 7/7] Changed format to be spreadsheet-friendly: # x 0.05 0.03 # y 0.05 0.04 # z 0.001 0.001 # Time 0.005 0.130842 7.7749e-05 0.01 0.0554095 -0.0100031 0.015 0.0388121 -0.0115969 --- src/sampling/probes/probes.C | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index 2fcd9688e6..b47f52e1f0 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -231,14 +231,22 @@ bool Foam::probes::checkFieldTypes() probeFilePtrs_.insert(fldName, sPtr); - *sPtr<< '#' << setw(IOstream::defaultPrecision() + 6) - << "Time"; + unsigned int w = IOstream::defaultPrecision() + 7; - forAll(probeLocations_, probeI) + for (direction cmpt=0; cmpt