Merge branch 'nextRelease' of ssh://git.code.sf.net/p/foam-extend/foam-extend-4.0 into nextRelease

This commit is contained in:
Hrvoje Jasak 2018-08-21 14:59:29 +01:00
commit 64ef3b387f
105 changed files with 12018 additions and 3570 deletions

1
.gitignore vendored
View file

@ -93,6 +93,7 @@ PlyParser_FoamFileParser_parsetab.py
*.tar
*.tgz
*.gtgz
*.xz
# ignore the persistent .build tag in the main directory
/.build

View file

@ -98,6 +98,7 @@ uninstallPackage cmake-2.8.11 $1
uninstallPackage cmake-2.8.12 $1
uninstallPackage cmake-3.2.2 $1
uninstallPackage cmake-3.3.2 $1
uninstallPackage cmake-3.11.4 $1
echo
@ -107,5 +108,3 @@ echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -56,6 +56,7 @@ uninstallPackage openmpi-1.4.3 $1
uninstallPackage openmpi-1.5 $1
uninstallPackage openmpi-1.6.5 $1
uninstallPackage openmpi-1.8.4 $1
uninstallPackage openmpi-3.1.0 $1
echo
echo ========================================
@ -64,5 +65,3 @@ echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -182,11 +182,16 @@ echo
( rpm_make -p cmake-3.3.2 -s cmake-3.3.2.spec -u http://www.cmake.org/files/v3.3/cmake-3.3.2.tar.gz )
}
# cmake 3.11.4
#
[ ! -z "$WM_THIRD_PARTY_USE_CMAKE_3114" ] && {
echo "Building cmake 3.11.4"
( rpm_make -p cmake-3.11.4 -s cmake-3.11.4.spec -u http://www.cmake.org/files/v3.11/cmake-3.11.4.tar.gz )
}
echo ========================================
echo Done ThirdParty AllMake: Stage1
echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -104,6 +104,15 @@ then
( rpm_make -p openmpi-1.8.8 -s openmpi-1.8.8.spec -u https://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.8.tar.gz \
-f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs"')
}
# openmpi 3.1.1
#
[ ! -z "$WM_THIRD_PARTY_USE_OPENMPI_311" ] && {
echo "Building openmpi 3.1.1"
( rpm_make -p openmpi-3.1.1 -s openmpi-3.1.1.spec -u https://www.open-mpi.org/software/ompi/v3.1/downloads/openmpi-3.1.1.tar.gz \
-f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_311_ConfigureAdditionalArgs"')
}
# mvipich2-2.2
#
[ ! -z "$WM_THIRD_PARTY_USE_MVAPICH2_22" ] && {
@ -121,5 +130,3 @@ echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -108,6 +108,13 @@ then
echo "Building Mesquite 2.1.2"
( rpm_make -p mesquite-2.1.2 -s mesquite-2.1.2.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/mesquite-2.1.2.tar.gz )
}
# Mesquite 2.3.0
#
[ ! -z "$WM_THIRD_PARTY_USE_MESQUITE_230" ] && {
echo "Building Mesquite 2.3.0"
( rpm_make -p mesquite-2.3.0 -s mesquite-2.3.0.spec -u https://software.sandia.gov/mesquite/mesquite-2.3.0.tar.gz )
# ( rpm_make -p mesquite-2.3.0 -s mesquite-2.3.0.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/mesquite-2.3.0.tar.gz )
}
else
echo "Using system installed Mesquite"
echo ""
@ -183,6 +190,18 @@ then
echo "Building PyFoam 0.6.4"
( rpm_make -p PyFoam-0.6.4 -s PyFoam-0.6.4.spec -u http://openfoamwiki.net/images/3/3b/PyFoam-0.6.4.tar.gz -n PyFoam-0.6.4-1.noarch -a noarch)
}
# PyFoam 0.6.6
#
[ ! -z "$WM_THIRD_PARTY_USE_PYFOAM_066" ] && {
echo "Building PyFoam 0.6.6"
( rpm_make -p PyFoam-0.6.6 -s PyFoam-0.6.6.spec -u https://openfoamwiki.net/images/a/af/PyFoam-0.6.6.tar.gz -n PyFoam-0.6.6-1.noarch -a noarch)
}
# PyFoam 0.6.9
#
[ ! -z "$WM_THIRD_PARTY_USE_PYFOAM_069" ] && {
echo "Building PyFoam 0.6.9"
( rpm_make -p PyFoam-0.6.9 -s PyFoam-0.6.9.spec -u https://files.pythonhosted.org/packages/78/f5/8f65b66c8ac0e5415f785809e182dd0f0dc562a42094e1a86bd22c7d7ece/PyFoam-0.6.9.tar.gz -n PyFoam-0.6.9-1.noarch -a noarch)
}
else
echo "Using system installed PyFoam"
echo ""
@ -191,6 +210,13 @@ fi
# hwloc
if [ -z "$HWLOC_SYSTEM" ]
then
# hwloc 2.0.1
#
[ ! -z "$WM_THIRD_PARTY_USE_HWLOC_201" ] && {
echo "Building hwloc 2.0.1"
( rpm_make -p hwloc-2.0.1 -s hwloc-2.0.1.spec -u http://www.open-mpi.org/software/hwloc/v2.0/downloads/hwloc-2.0.1.tar.gz )
# ( rpm_make -p hwloc-2.0.1 -s hwloc-2.0.1.spec -u http://downloads.sourceforge.net/project/foam-extend/ThirdParty/hwloc-2.0.1.tar.gz )
}
# hwloc 1.10.1
#
[ ! -z "$WM_THIRD_PARTY_USE_HWLOC_1101" ] && {

View file

@ -71,6 +71,12 @@ then
echo "Building Qt 5.8.0"
( rpm_make -p qt-everywhere-opensource-src-5.8.0 -s qt-everywhere-opensource-src-5.8.0.spec -u http://download.qt.io/archive/qt/5.8/5.8.0/single/qt-everywhere-opensource-src-5.8.0.tar.gz )
}
# Qt 5.11.1
#
[ ! -z "$WM_THIRD_PARTY_USE_QT_5111" ] && {
echo "Building Qt 5.11.1"
( rpm_make -p qt-everywhere-src-5.11.1 -s qt-everywhere-src-5.11.1.spec -u http://download.qt.io/archive/qt/5.11/5.11.1/single/qt-everywhere-src-5.11.1.tar.xz )
}
else
echo "Using system installed QT"
echo ""
@ -124,6 +130,14 @@ then
-f --define='_qmakePath $QT_BIN_DIR/qmake'
)
}
# ParaView 5.5.2
#
[ ! -z "$WM_THIRD_PARTY_USE_PARAVIEW_552" ] && {
echo "Building ParaView 5.5.2"
( rpm_make -p ParaView-5.5.2 -s ParaView-5.5.2.spec -u http://www.paraview.org/files/v5.5/ParaView-v5.5.2.tar.gz \
-f --define='_qmakePath $QT_BIN_DIR/qmake'
)
}
else
echo "WARNING: "
echo "WARNING: Skipping the installation of ParaView-4.x.x."
@ -172,5 +186,3 @@ echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -0,0 +1,122 @@
# From https://gitlab.kitware.com/bob.obara/paraview/commit/931c779dde8460fe32aa8a3d19956b175b96e4f9.patch
diff --git a/Plugins/SLACTools/pqSLACDataLoadManager.cxx b/Plugins/SLACTools/pqSLACDataLoadManager.cxx
index 3ba019c26b177f2cd93d19f01a0b3a280aaf6ac2..ce38396f6844e7628d4d225d165f2ac4f6598f19 100644
--- a/Plugins/SLACTools/pqSLACDataLoadManager.cxx
+++ b/Plugins/SLACTools/pqSLACDataLoadManager.cxx
@@ -34,6 +34,7 @@
#include "vtkSMProperty.h"
#include "vtkSMSourceProxy.h"
+#include <QAction>
#include <QPushButton>
#include <QtDebug>
diff --git a/Qt/ApplicationComponents/pqColorMapEditor.cxx b/Qt/ApplicationComponents/pqColorMapEditor.cxx
index 0395185e0ab17a544233e9add78cc926ae19f2cd..88b56745eb0d58e5a6b2f2d2cacd62e66c230901 100644
--- a/Qt/ApplicationComponents/pqColorMapEditor.cxx
+++ b/Qt/ApplicationComponents/pqColorMapEditor.cxx
@@ -59,6 +59,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QDebug>
#include <QKeyEvent>
#include <QPointer>
+#include <QStyle>
#include <QVBoxLayout>
class pqColorMapEditor::pqInternals
diff --git a/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx b/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx
index 908e4598e025fab059a7b6b4097ceddf9cffef6a..820361a2b34abc0af6e4f317d7f77c6a954f7129 100644
--- a/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx
+++ b/Qt/ApplicationComponents/pqDoubleRangeSliderPropertyWidget.cxx
@@ -43,6 +43,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMUncheckedPropertyHelper.h"
#include <QGridLayout>
+#include <QStyle>
class pqDoubleRangeSliderPropertyWidget::pqInternals
{
diff --git a/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx b/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx
index c297dc3d9e7acab31d5fe326a6207fb326893e73..501633f63a1facae26371e9ea75eccdab582a6cc 100644
--- a/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx
+++ b/Qt/ApplicationComponents/pqStandardViewFrameActionsImplementation.cxx
@@ -69,6 +69,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <QPushButton>
#include <QSet>
#include <QShortcut>
+#include <QStyle>
//-----------------------------------------------------------------------------
pqStandardViewFrameActionsImplementation::pqStandardViewFrameActionsImplementation(
diff --git a/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx b/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx
index 6774c2e48e61e6e8278da02075a47b0ecabcd396..e85e614f042143700f938cc855ef486f9f8be2d7 100644
--- a/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx
+++ b/Qt/ApplicationComponents/pqTimeInspectorWidget.cxx
@@ -49,6 +49,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMPropertyHelper.h"
#include "vtkSMSourceProxy.h"
+#include <QHeaderView>
#include <QLineF>
#include <QPainter>
#include <QVariant>
diff --git a/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx b/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx
index 55d31464474eff2f965d959f99dd2db0b5c185bf..93cd995d92e1bbe361857bb9e88d710463da9914 100644
--- a/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx
+++ b/Qt/ApplicationComponents/pqTransferFunctionWidgetPropertyDialog.cxx
@@ -36,6 +36,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkPiecewiseFunction.h"
#include <QString>
+#include <QDoubleValidator>
+
class pqTransferFunctionWidgetPropertyDialog::pqInternals
{
public:
diff --git a/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx b/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx
index 6d2865431ef930a13a9fa0796474dbfb126fc4ac..8d2c4b61cd1038836feb610437f6539dcc6e00bd 100644
--- a/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx
+++ b/Qt/ApplicationComponents/pqViewResolutionPropertyWidget.cxx
@@ -39,6 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMProxy.h"
#include <QIntValidator>
+#include <QStyle>
class pqViewResolutionPropertyWidget::pqInternals
{
diff --git a/Qt/Components/pqChangeInputDialog.cxx b/Qt/Components/pqChangeInputDialog.cxx
index 8a67b10095ee037ad3ee1179b342c72d62d11db9..86db3de01c7dccb0727148e709616d9f4c7debe6 100644
--- a/Qt/Components/pqChangeInputDialog.cxx
+++ b/Qt/Components/pqChangeInputDialog.cxx
@@ -45,6 +45,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkSMProxy.h"
#include "vtkSmartPointer.h"
+#include <QHeaderView>
#include <QItemSelectionModel>
#include <QLineEdit>
#include <QRadioButton>
diff --git a/Qt/Components/pqCinemaTrackSelection.cxx b/Qt/Components/pqCinemaTrackSelection.cxx
index 3d6d9dde19f3860c3f0af54f088e4f3b28d1f7b9..eea2e37680126ced46921749c4e70b1295680032 100644
--- a/Qt/Components/pqCinemaTrackSelection.cxx
+++ b/Qt/Components/pqCinemaTrackSelection.cxx
@@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include <QDebug>
+#include <QHeaderView>
#include "vtkPVArrayInformation.h"
#include "vtkPVDataInformation.h"
diff --git a/Qt/Python/pqPythonShell.cxx b/Qt/Python/pqPythonShell.cxx
index 3d01fd0a96deda60a5c946820b10c54992a6c9fb..bc1a0149360a1d4ae2caa8622ac76f2176608109 100644
--- a/Qt/Python/pqPythonShell.cxx
+++ b/Qt/Python/pqPythonShell.cxx
@@ -52,6 +52,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkStringOutputWindow.h"
#include "vtkWeakPointer.h"
+#include <QAbstractItemView>
#include <QApplication>
#include <QCursor>
#include <QFile>

View file

@ -0,0 +1,295 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for ParaView-5.5.2
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Authors:
# Martin Beaudoin, (2018)
# Andreas Feymark, Chalmers University of Technology, (2013)
# Pascal Beckstein, HZDR, (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# Turning off the Fascist build policy
# Useful for debugging the install section
%define _unpackaged_files_terminate_build 0
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name ParaView
%define release %{_WM_OPTIONS}
%define version 5.5.2
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: ParaView
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.paraview.org/files/v5.5/
Source: %url/%{name}-v%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
Patch0: ParaView-5.5.2.patch
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
#--------------------------------------------------------------------------
#
# Here, we define default compiling options for cmake
#
# One can override the option on the commande line : --define='MACRO EXPR'
#
%{!?_withVerbose: %define _withVerbose false}
%{!?_withMesa: %define _withMesa false}
%{!?_withMPI: %define _withMPI false}
%{!?_withPython: %define _withPython false}
%{!?_withQt: %define _withQt true}
%{!?_qmakePath: %define _qmakePath Undefined}
%{!?_mesaIncludePath: %define _mesaIncludePath Undefined}
%{!?_mesaLibPath: %define _mesaLibPath Undefined}
%{!?_pythonLibPath: %define _pythonLibPath Undefined}
#--------------------------------------------------------------------------
%description
%{summary}
%prep
%setup -q -n %{name}-v%{version}
%patch0 -p1
%build
#
# set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
set +x
echo ""
echo "Compilation options:"
echo " _withVerbose : %{_withVerbose}"
echo " _withMesa : %{_withMesa}"
echo " _withMPI : %{_withMPI}"
echo " _withPython : %{_withPython}"
echo " _withQt : %{_withQt}"
echo " _qmakePath : %{_qmakePath}"
echo " _mesaIncludePath : %{_mesaIncludePath}"
echo " _mesaLibPath : %{_mesaLibPath}"
echo " _pythonLibPath : %{_pythonLibPath}"
echo ""
set -x
# start with these general settings
addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON
addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release
addCMakeVariable BUILD_TESTING:BOOL=OFF
# We build with Python. This is ust too useful
addCMakeVariable PARAVIEW_ENABLE_PYTHON:BOOL=ON
# include development files in "make install"
addCMakeVariable PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON
%ifos darwin
# Additional installation rules for Mac OSX
addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-v%{version}-source/Applications/ParaView-4.4.0_extra_install_Darwin.cmake
# We activate the new Unix-style installation for Mac OS X
addCMakeVariable PARAVIEW_DO_UNIX_STYLE_INSTALLS:BOOL=ON
# Recent version of Mac OSX (Yosemite) cannot compile ParaView with the gcc compiler
# Using clang instead
CC=clang
CXX=clang++
%endif
# Add the value of _qmakePath for QT_QMAKE_EXECUTABLE
addCMakeVariable QT_QMAKE_EXECUTABLE:FILEPATH=%{_qmakePath}
echo "CMAKE_VARIABLES: $CMAKE_VARIABLES"
mkdir -p ./buildObj
cd ./buildObj
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_installPrefix} \
$CMAKE_VARIABLES \
..
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
# On OpenSUSE, rpmbuild, will choke when detecting unreferenced symlinks
# created during installation.
# Qt version 4.8.0 will generate some unreferenced symlinks when
# ParaView is compiled and installed. By enabling the following
# environment variable, the command brp-symlink will still complain
# about missing link targets, but it won't stop rpmbuild from generating
# the final rpm.
# For all other Unix distros, this is a no-op.
export NO_BRP_STALE_LINK_ERROR=yes
cd buildObj
make install DESTDIR=$RPM_BUILD_ROOT
%ifos darwin
# Cleaning up some strange install side effect from option
# PARAVIEW_DO_UNIX_STYLE_INSTALLS
# Need to revisit this section eventually.
if [ -d "$RPM_BUILD_ROOT/$RPM_BUILD_ROOT" ]; then
mv $RPM_BUILD_ROOT/$RPM_BUILD_ROOT/%{_installPrefix}/bin/* $RPM_BUILD_ROOT/%{_installPrefix}/bin
fi
%endif
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin
export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-5.5
export PARAVIEW_VERSION=%{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-5.5_plugins
[ -d \$PARAVIEW_LIB_DIR/paraview-5.5 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.5
# Enable access to the package applications if present
[ -d \$PARAVIEW_BIN_DIR ] && _foamAddPath \$PARAVIEW_BIN_DIR
# Additional binary path if running on Mac OS X
[ -d \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ] && _foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin
setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-5.5
setenv PARAVIEW_VERSION %{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview-5.5_plugins
if ( -e \$PARAVIEW_BIN_DIR ) then
_foamAddPath \$PARAVIEW_BIN_DIR
endif
if ( -e \$PARAVIEW_LIB_DIR/paraview-5.5 ) then
_foamAddLib \$PARAVIEW_LIB_DIR/paraview-5.5
endif
# Additional binary path if running on Mac OS X
if ( -e \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ) then
_foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,205 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for PyFoam-0.6.6
#
# Description
# RPM spec file for PyFoam version 0.6.6
#
# Author:
# Martin Beaudoin (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.6.6
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: https://openfoamwiki.net/images/a/af/PyFoam-0.6.6.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q -n PyFoam-%{version}
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# Temporary settings for the installation
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages
export PYTHONPATH=$RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages:$PYTHONPATH
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
if ! \$?PYTHONPATH then
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
else
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
endif
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if \$?PYFOAM_SITE_DIR then
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the foam-extend environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the foam-extend environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
if ! \$?PYTHONPATH then
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
else
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
endif
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if \$?PYFOAM_SITE_DIR then
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,205 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for PyFoam-0.6.9
#
# Description
# RPM spec file for PyFoam version 0.6.9
#
# Author:
# Martin Beaudoin (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.6.9
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: https://files.pythonhosted.org/packages/78/f5/8f65b66c8ac0e5415f785809e182dd0f0dc562a42094e1a86bd22c7d7ece/PyFoam-0.6.9.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q -n PyFoam-%{version}
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# Temporary settings for the installation
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages
export PYTHONPATH=$RPM_BUILD_ROOT/%{_installPrefix}/lib/python%{pythonVersion}/site-packages:$PYTHONPATH
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
if ! \$?PYTHONPATH then
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
else
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
endif
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if \$?PYFOAM_SITE_DIR then
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the foam-extend environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the foam-extend environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
if ! \$?PYTHONPATH then
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
else
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
endif
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if \$?PYFOAM_SITE_DIR then
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,166 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for cmake-3.11.4
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, (2018)
# Pascal Beckstein, HZDR, (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name cmake
%define release %{_WM_OPTIONS}
%define version 3.11.4
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: cmake
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.cmake.org/files/v3.3/
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
%ifos darwin
# For Mac OSX:
# The configuration of cmake will be using the environment variable MACOSX_DEPLOYMENT_TARGET.
# This variable was initialized using 'sw_vers -productVersion' in etc/bashrc.
# We need to get rid of the revision number from this string. eg turn "10.7.5" into "10.7"
v=( ${MACOSX_DEPLOYMENT_TARGET//./ } )
export MACOSX_DEPLOYMENT_TARGET="${v[0]}.${v[1]}"
echo "Resetting MACOSX_DEPLOYMENT_TARGET to ${MACOSX_DEPLOYMENT_TARGET}"
# Recent version of Mac OSX (Yosemite) cannot compile cmake when gcc is the compiler
# Using clang instead
CC=clang
CXX=clang++
%endif
./configure \
--prefix=%{_installPrefix}
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export CMAKE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export CMAKE_BIN_DIR=\$CMAKE_DIR/bin
# Enable access to the runtime package applications
[ -d \$CMAKE_BIN_DIR ] && _foamAddPath \$CMAKE_BIN_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv CMAKE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv CMAKE_BIN_DIR \$CMAKE_DIR/bin
if ( -e \$CMAKE_BIN_DIR ) then
_foamAddPath \$CMAKE_BIN_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,149 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for hwloc-2.0.1
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name hwloc
%define release %{_WM_OPTIONS}
%define version 2.0.1
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: hwloc
License: the New BSD license
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.open-mpi.org/software/hwloc/v2.0/downloads/hwloc-2.0.1.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
./configure \
--prefix=%{_installPrefix}
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export HWLOC_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export HWLOC_BIN_DIR=\$HWLOC_DIR/bin
# Enable access to the runtime package applications
[ -d \$HWLOC_BIN_DIR ] && _foamAddPath \$HWLOC_BIN_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv HWLOC_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv HWLOC_BIN_DIR \$HWLOC_DIR/bin
if ( -e \$HWLOC_BIN_DIR ) then
_foamAddPath \$HWLOC_BIN_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,175 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for mesquite-2.3.0
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin (2018)
#
# Contributor:
# Philippose Rajan : patch0 for gcc 4.6.x
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name mesquite
%define release %{_WM_OPTIONS}
%define version 2.3.0
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: mesquite
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: https://software.sandia.gov/mesquite
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_FC" ] && export FC="$WM_FC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_FCFLAGS" ] && export FCFLAGS="$WM_FCFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
./configure \
--prefix=%{_installPrefix} \
--libdir=%{_installPrefix}/lib \
--enable-release \
--disable-debug-assertions \
--enable-shared \
--without-cppunit \
--enable-trap-fpe \
--disable-function-timers
# Remove the file include/Mesquite_all_headers.hpp
# This file will be regenerated during the compilation process
[ -e include/Mesquite_all_headers.hpp ] && rm -f include/Mesquite_all_headers.hpp
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -mtune=native -fPIC"
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export MESQUITE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export MESQUITE_BIN_DIR=\$MESQUITE_DIR/bin
export MESQUITE_LIB_DIR=\$MESQUITE_DIR/lib
export MESQUITE_INCLUDE_DIR=\$MESQUITE_DIR/include
# Enable access to the package runtime applications and libraries
[ -d \$MESQUITE_BIN_DIR ] && _foamAddPath \$MESQUITE_BIN_DIR
[ -d \$MESQUITE_LIB_DIR ] && _foamAddLib \$MESQUITE_LIB_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv MESQUITE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv MESQUITE_BIN_DIR \$MESQUITE_DIR/bin
setenv MESQUITE_LIB_DIR \$MESQUITE_DIR/lib
setenv MESQUITE_INCLUDE_DIR \$MESQUITE_DIR/include
if ( -e \$MESQUITE_BIN_DIR ) then
_foamAddPath \$MESQUITE_BIN_DIR
endif
if ( -e \$MESQUITE_LIB_DIR ) then
_foamAddLib \$MESQUITE_LIB_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,264 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for openmpi-3.1.0
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name openmpi
%define release %{_WM_OPTIONS}
%define version 3.1.0
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: openmpi
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.open-mpi.org/software/ompi/v1.8/downloads
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
#--------------------------------------------------------------------------
#
# Here, we define default compiling options for openmpi
#
# One can override the option on the commande line : --define='MACRO EXPR'
#
%{!?_configureAdditionalArgs: %define _configureAdditionalArgs Undefined}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
set +x
echo ""
echo "Compilation options:"
echo " _configureAdditionalArgs : %{_configureAdditionalArgs}"
echo ""
set -x
unset mpiWith
# Enable GridEngine if it appears to be in use
# If you don't want any integration with SGE, simply unset the SGE
# environment variable
if [ -n "$SGE_ROOT" ]
then
mpiWith="$mpiWith --with-sge"
else
mpiWith="$mpiWith --without-sge"
mpiWith="$mpiWith --enable-mca-no-build=ras-gridengine,pls-gridengine"
fi
# Infiniband support
# Adjust according to your local paths
# if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ]
# then
# mpiWith="$mpiWith --with-openib=/usr/local/ofed"
# mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64"
# fi
./configure \
--prefix=%{_installPrefix} \
--exec_prefix=%{_installPrefix} \
--enable-mpirun-prefix-by-default \
--enable-orterun-prefix-by-default \
--enable-shared \
--enable-mpi-cxx \
--disable-static \
--disable-mpi-fortran \
--without-slurm \
`echo %{?_configureAdditionalArgs}`
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export OPENMPI_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export OPENMPI_BIN_DIR=\$OPENMPI_DIR/bin
export OPENMPI_LIB_DIR=\$OPENMPI_DIR/lib
# Enable access to the package runtime applications and libraries
[ -d \$OPENMPI_BIN_DIR ] && _foamAddPath \$OPENMPI_BIN_DIR
[ -d \$OPENMPI_LIB_DIR ] && _foamAddLib \$OPENMPI_LIB_DIR
export MPI_HOME=\$OPENMPI_DIR
export MPI_ARCH_PATH=\$MPI_HOME
export OPAL_PREFIX=\$MPI_ARCH_PATH
# We initialize the rest of the environment using mpicc --showme:
export OPENMPI_INCLUDE_DIR="\`mpicc --showme:incdirs\`"
export OPENMPI_COMPILE_FLAGS="\`mpicc --showme:compile\`"
export OPENMPI_LINK_FLAGS="\`mpicc --showme:link\`"
# Set the foam-extend compilation flags
export PINC=\$OPENMPI_COMPILE_FLAGS
export PLIBS=\$OPENMPI_LINK_FLAGS
if [ "\$FOAM_VERBOSE" -a "\$PS1" ]
then
echo " Environment variables defined for OpenMPI:"
echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR"
echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR"
echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR"
echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS"
echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS"
echo ""
echo " MPI_HOME : \$MPI_HOME"
echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS"
echo " OPAL_PREFIX : \$OPAL_PREFIX"
echo " PINC : \$PINC"
echo " PLIBS : \$PLIBS"
fi
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv OPENMPI_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv OPENMPI_BIN_DIR \$OPENMPI_DIR/bin
setenv OPENMPI_LIB_DIR \$OPENMPI_DIR/lib
# Enable access to the package runtime applications and libraries
if ( -e \$OPENMPI_BIN_DIR ) then
_foamAddPath \$OPENMPI_BIN_DIR
endif
if ( -e \$OPENMPI_LIB_DIR ) then
_foamAddLib \$OPENMPI_LIB_DIR
endif
setenv MPI_HOME \$OPENMPI_DIR
setenv MPI_ARCH_PATH \$MPI_HOME
setenv OPAL_PREFIX \$MPI_ARCH_PATH
# We initialize the rest of the environment using mpicc --showme:
setenv OPENMPI_INCLUDE_DIR "\`mpicc --showme:incdirs\`"
setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`"
setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`"
# Set the foam-extend compilation flags
setenv PINC "\$OPENMPI_COMPILE_FLAGS"
setenv PLIBS "\$OPENMPI_LINK_FLAGS"
if (\$?FOAM_VERBOSE && \$?prompt) then
echo " Environment variables defined for OpenMPI:"
echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR"
echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR"
echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR"
echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS"
echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS"
echo ""
echo " MPI_HOME : \$MPI_HOME"
echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS"
echo " OPAL_PREFIX : \$OPAL_PREFIX"
echo " PINC : \$PINC"
echo " PLIBS : \$PLIBS"
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,264 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for openmpi-3.1.1
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name openmpi
%define release %{_WM_OPTIONS}
%define version 3.1.1
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: openmpi
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.open-mpi.org/software/ompi/v1.8/downloads
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
#--------------------------------------------------------------------------
#
# Here, we define default compiling options for openmpi
#
# One can override the option on the commande line : --define='MACRO EXPR'
#
%{!?_configureAdditionalArgs: %define _configureAdditionalArgs Undefined}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
set +x
echo ""
echo "Compilation options:"
echo " _configureAdditionalArgs : %{_configureAdditionalArgs}"
echo ""
set -x
unset mpiWith
# Enable GridEngine if it appears to be in use
# If you don't want any integration with SGE, simply unset the SGE
# environment variable
if [ -n "$SGE_ROOT" ]
then
mpiWith="$mpiWith --with-sge"
else
mpiWith="$mpiWith --without-sge"
mpiWith="$mpiWith --enable-mca-no-build=ras-gridengine,pls-gridengine"
fi
# Infiniband support
# Adjust according to your local paths
# if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ]
# then
# mpiWith="$mpiWith --with-openib=/usr/local/ofed"
# mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64"
# fi
./configure \
--prefix=%{_installPrefix} \
--exec_prefix=%{_installPrefix} \
--enable-mpirun-prefix-by-default \
--enable-orterun-prefix-by-default \
--enable-shared \
--enable-mpi-cxx \
--disable-static \
--disable-mpi-fortran \
--without-slurm \
`echo %{?_configureAdditionalArgs}`
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export OPENMPI_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export OPENMPI_BIN_DIR=\$OPENMPI_DIR/bin
export OPENMPI_LIB_DIR=\$OPENMPI_DIR/lib
# Enable access to the package runtime applications and libraries
[ -d \$OPENMPI_BIN_DIR ] && _foamAddPath \$OPENMPI_BIN_DIR
[ -d \$OPENMPI_LIB_DIR ] && _foamAddLib \$OPENMPI_LIB_DIR
export MPI_HOME=\$OPENMPI_DIR
export MPI_ARCH_PATH=\$MPI_HOME
export OPAL_PREFIX=\$MPI_ARCH_PATH
# We initialize the rest of the environment using mpicc --showme:
export OPENMPI_INCLUDE_DIR="\`mpicc --showme:incdirs\`"
export OPENMPI_COMPILE_FLAGS="\`mpicc --showme:compile\`"
export OPENMPI_LINK_FLAGS="\`mpicc --showme:link\`"
# Set the foam-extend compilation flags
export PINC=\$OPENMPI_COMPILE_FLAGS
export PLIBS=\$OPENMPI_LINK_FLAGS
if [ "\$FOAM_VERBOSE" -a "\$PS1" ]
then
echo " Environment variables defined for OpenMPI:"
echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR"
echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR"
echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR"
echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS"
echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS"
echo ""
echo " MPI_HOME : \$MPI_HOME"
echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS"
echo " OPAL_PREFIX : \$OPAL_PREFIX"
echo " PINC : \$PINC"
echo " PLIBS : \$PLIBS"
fi
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv OPENMPI_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv OPENMPI_BIN_DIR \$OPENMPI_DIR/bin
setenv OPENMPI_LIB_DIR \$OPENMPI_DIR/lib
# Enable access to the package runtime applications and libraries
if ( -e \$OPENMPI_BIN_DIR ) then
_foamAddPath \$OPENMPI_BIN_DIR
endif
if ( -e \$OPENMPI_LIB_DIR ) then
_foamAddLib \$OPENMPI_LIB_DIR
endif
setenv MPI_HOME \$OPENMPI_DIR
setenv MPI_ARCH_PATH \$MPI_HOME
setenv OPAL_PREFIX \$MPI_ARCH_PATH
# We initialize the rest of the environment using mpicc --showme:
setenv OPENMPI_INCLUDE_DIR "\`mpicc --showme:incdirs\`"
setenv OPENMPI_COMPILE_FLAGS "\`mpicc --showme:compile\`"
setenv OPENMPI_LINK_FLAGS "\`mpicc --showme:link\`"
# Set the foam-extend compilation flags
setenv PINC "\$OPENMPI_COMPILE_FLAGS"
setenv PLIBS "\$OPENMPI_LINK_FLAGS"
if (\$?FOAM_VERBOSE && \$?prompt) then
echo " Environment variables defined for OpenMPI:"
echo " OPENMPI_BIN_DIR : \$OPENMPI_BIN_DIR"
echo " OPENMPI_LIB_DIR : \$OPENMPI_LIB_DIR"
echo " OPENMPI_INCLUDE_DIR : \$OPENMPI_INCLUDE_DIR"
echo " OPENMPI_COMPILE_FLAGS : \$OPENMPI_COMPILE_FLAGS"
echo " OPENMPI_LINK_FLAGS : \$OPENMPI_LINK_FLAGS"
echo ""
echo " MPI_HOME : \$MPI_HOME"
echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
echo " MPIRUN_OPTIONS : \$MPIRUN_OPTIONS"
echo " OPAL_PREFIX : \$OPAL_PREFIX"
echo " PINC : \$PINC"
echo " PLIBS : \$PLIBS"
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,198 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | foam-extend: Open Source CFD
# \\ / O peration |
# \\ / A nd | For copyright notice see file Copyright
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of foam-extend.
#
# foam-extend is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# RPM spec file for qt-everywhere-src-5.11.1
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, (2018)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name qt-everywhere-src
%define release %{_WM_OPTIONS}
%define version 5.11.1
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
%define _unpackaged_files_terminate_build 0
%define _missing_doc_files_terminate_build 0
BuildRoot: %{buildroot}
Summary: qt-everywhere-src
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://download.qt.io/archive/qt/5.11/5.11.1/single
Source: %url/%{name}-%{version}.tar.xz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
# The configure options are taken from the QT5 configuration
# of the ParaView-Superbuild
./configure \
-opensource \
-confirm-license \
-release \
-skip qtconnectivity \
-skip qtgamepad \
-skip qtlocation \
-skip qtmultimedia \
-skip qtsensors \
-skip qtserialport \
-skip qtwayland \
-skip qtwebchannel \
-skip qtwebengine \
-skip qtwebsockets \
-nomake examples \
-nomake tests \
-no-dbus \
-qt-libjpeg \
-qt-pcre \
-system-zlib \
-no-openssl \
-skip qtsvg \
-qt-xcb \
-system-libpng \
-fontconfig \
-prefix %{_installPrefix}
# Explicitely specify LD_LIBRARY_PATH so it can find QT own libraries
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/lib
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
# On a computer with limited memory, say less than 4 GB, you may need to compile
# with only one parallel job to avoid running out of memory.
# So make sure to adjust $WM_NCOMPPROCS accordingly
make -j $WM_NCOMPPROCS
%install
# Makefiles generated by qmake do not to support the DESTDIR= option
# We need to use the INSTALL_ROOT= option instead
# Somehow, we need to clean up for the RPM to install properly
rm -rf %{_installPrefix}
make install INSTALL_ROOT=$RPM_BUILD_ROOT
# Creation of foam-extend specific .csh and .sh files"
echo ""
echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for foam-extend
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export QT_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export QT_BIN_DIR=\$QT_DIR/bin
export QT_LIB_DIR=\$QT_DIR/lib
# Enable access to the runtime package applications
[ -d \$QT_BIN_DIR ] && _foamAddPath \$QT_BIN_DIR
[ -d \$QT_LIB_DIR ] && _foamAddLib \$QT_LIB_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for foam-extend
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv QT_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv QT_BIN_DIR \$QT_DIR/bin
setenv QT_LIB_DIR \$QT_DIR/lib
if ( -e \$QT_BIN_DIR ) then
_foamAddPath \$QT_BIN_DIR
endif
if ( -e \$QT_LIB_DIR ) then
_foamAddLib \$QT_LIB_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -121,9 +121,15 @@ rpm_make()
packageTarBall=`basename $_PACKAGE_URL`
if [ ! -e "SOURCES/$packageTarBall" ]; then
echo "Download $packageTarBall from : $_PACKAGE_URL"
#( cd SOURCES; wget --no-check-certificate $_PACKAGE_URL )
( cd SOURCES; curl -L -k -O $_PACKAGE_URL )
echo "Download $packageTarBall from : $_PACKAGE_URL"
#( cd SOURCES; wget --no-check-certificate $_PACKAGE_URL )
( cd SOURCES; curl --connect-timeout 60 \
--max-time 3600 \
--retry 6 \
--retry-delay 10 \
--retry-max-time 60 \
-L -k -O $_PACKAGE_URL )
fi
fi
@ -284,22 +290,42 @@ uninstallPackage()
pkg="$1";
echo "Removing ${pkg}"
[ -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm ] && \
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm || \
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm"
[ -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz ] && \
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz || \
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz"
[ -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz ] && \
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz || \
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz"
[ -d $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* ] && \
rm -rf $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}* || \
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*"
if [ "$2" = "alsoPackage" ]; then
[ -d $WM_THIRD_PARTY_DIR/packages/$pkg ] && \
rm -rf $WM_THIRD_PARTY_DIR/packages/$pkg || \
echo "Not found: $WM_THIRD_PARTY_DIR/packages/$pkg"
if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}-$WM_OPTIONS.$architecture.rpm ]]; then
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}-$WM_OPTIONS.$architecture.rpm
else
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/RPMS/$architecture/${pkg}*.rpm"
fi
if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz ]]; then
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz
else
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/SOURCES/${pkg}.tar.gz"
fi
if [[ -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz ]]; then
rm -f $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz
else
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/TGZS/$architecture/${pkg}.tgz"
fi
foundDir=false
for dir_ in $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*
do
if [[ -d "$dir_" ]]; then
rm -rf $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*
foundDir=true
fi
done
if [ "$foundDir" = false ] ; then
echo "Not found: $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*"
fi
if [[ "$2" = "alsoPackage" ]]; then
if [[ -d $WM_THIRD_PARTY_DIR/packages/$pkg ]]; then
rm -rf $WM_THIRD_PARTY_DIR/packages/$pkg
else
echo "Not found: $WM_THIRD_PARTY_DIR/packages/$pkg"
fi
else
echo "Add option alsoPackage to remove the installed files."
fi

View file

@ -11,6 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \
-loversetMesh \
-llduSolvers

View file

@ -11,6 +11,7 @@ EXE_INC = \
EXE_LIBS = \
-lincompressibleRASModels \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModel \
-lfiniteVolume \
-loversetMesh \
-llduSolvers

View file

@ -65,13 +65,24 @@ ADD_PARAVIEW_PLUGIN(
if(NOT FOAM_FOUND)
# Config when compiling FOAM library with wmake
TARGET_LINK_LIBRARIES(
PVFoamReader_SM
foam
finiteVolume
vtkPVFoam
pqCore
)
if(${CMAKE_VERSION} VERSION_LESS "2.8.12")
TARGET_LINK_LIBRARIES(
PVFoamReader_SM
foam
finiteVolume
vtkPVFoam
pqCore
)
else()
TARGET_LINK_LIBRARIES(
PVFoamReader_SM
PUBLIC foam
finiteVolume
vtkPVFoam
pqCore
)
endif()
else()
# Config when compiling FOAM library with cmake

View file

@ -91,7 +91,7 @@ runParallel ()
fi
cat system/fvSchemes > $LOG_NAME
cat system/fvSolution >> $LOG_NAME
( $mpirunProg -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 )
( $mpirunProg $MPIRUN_OPTIONS -np $1 $APP_RUN -parallel < /dev/null > $LOG_NAME 2>&1 )
fi
}

View file

@ -96,23 +96,23 @@ export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/ThirdParty
#
# For AllMake.stage2
export WM_THIRD_PARTY_USE_OPENMPI_188=1
export WM_THIRD_PARTY_USE_OPENMPI_311=1
#
# For AllMake.stage3
export WM_THIRD_PARTY_USE_METIS_510=1
export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1
export WM_THIRD_PARTY_USE_LIBCCMIO_261=1
export WM_THIRD_PARTY_USE_MESQUITE_212=1
export WM_THIRD_PARTY_USE_MESQUITE_230=1
export WM_THIRD_PARTY_USE_SCOTCH_604=1
export WM_THIRD_PARTY_USE_PARMETIS_403=1
export WM_THIRD_PARTY_USE_PYFOAM_064=1
export WM_THIRD_PARTY_USE_HWLOC_1101=1
export WM_THIRD_PARTY_USE_PYFOAM_069=1
export WM_THIRD_PARTY_USE_HWLOC_201=1
#
# For AllMake.stage4
#export WM_THIRD_PARTY_USE_QT_486=1
#export WM_THIRD_PARTY_USE_PARAVIEW_440=1
#export WM_THIRD_PARTY_USE_QT_5111=1
#export WM_THIRD_PARTY_USE_PARAVIEW_552=1
# Source files, possibly with some verbosity

View file

@ -82,23 +82,23 @@ setenv WM_THIRD_PARTY_DIR $WM_PROJECT_DIR/ThirdParty
#
# For AllMake.stage2
setenv WM_THIRD_PARTY_USE_OPENMPI_188 1
setenv WM_THIRD_PARTY_USE_OPENMPI_311 1
#
# For AllMake.stage3
setenv WM_THIRD_PARTY_USE_METIS_510 1
setenv WM_THIRD_PARTY_USE_PARMGRIDGEN_10 1
setenv WM_THIRD_PARTY_USE_LIBCCMIO_261 1
setenv WM_THIRD_PARTY_USE_MESQUITE_212 1
setenv WM_THIRD_PARTY_USE_MESQUITE_230 1
setenv WM_THIRD_PARTY_USE_SCOTCH_604 1
setenv WM_THIRD_PARTY_USE_PARMETIS_403 1
setenv WM_THIRD_PARTY_USE_PYFOAM_064 1
setenv WM_THIRD_PARTY_USE_HWLOC_1101 1
setenv WM_THIRD_PARTY_USE_PYFOAM_069 1
setenv WM_THIRD_PARTY_USE_HWLOC_201 1
#
# For AllMake.stage4
#setenv WM_THIRD_PARTY_USE_QT_486 1
#setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1
#setenv WM_THIRD_PARTY_USE_QT_5111 1
#setenv WM_THIRD_PARTY_USE_PARAVIEW_552 1
# Source files, possibly with some verbosity
@ -424,4 +424,3 @@ unset cleanEnv cleanProg colonPath foamInstall foamOldDirs
unalias _foamSource
# -----------------------------------------------------------------------------

View file

@ -53,6 +53,10 @@
#setenv OPENMPI_COMPILE_FLAGS "`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
#setenv OPENMPI_LINK_FLAGS "`$OPENMPI_BIN_DIR/mpicc --showme:link`"
# MPI runtime options
#setenv MPI_BUFFER_SIZE 100000000
#setenv MPIRUN_OPTIONS -oversubscribe # OpenMPI version 3.1
# Specify system installed ThirdParty packages/libraries
# NB: The packages installed under $WM_THIRD_PARTY_DIR
# will always override these values.
@ -199,11 +203,13 @@
#setenv WM_THIRD_PARTY_USE_M4_1416 1
#setenv WM_THIRD_PARTY_USE_BISON_27 1
#setenv WM_THIRD_PARTY_USE_FLEX_2535 1
setenv WM_THIRD_PARTY_USE_CMAKE_322 1
#setenv WM_THIRD_PARTY_USE_CMAKE_322 1
setenv WM_THIRD_PARTY_USE_CMAKE_3114 1
#
# For AllMake.stage2
setenv WM_THIRD_PARTY_USE_OPENMPI_188 1
setenv WM_THIRD_PARTY_USE_OPENMPI_311 1
#setenv WM_THIRD_PARTY_USE_OPENMPI_188 1
#setenv WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs '--enable-mpi-cxx --with-verbs'
#setenv WM_THIRD_PARTY_USE_OPENMPI_165 1
#setenv WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs '--enable-mpi-cxx --with-openib'
@ -219,19 +225,20 @@ setenv WM_THIRD_PARTY_USE_OPENMPI_188 1
setenv WM_THIRD_PARTY_USE_METIS_510 1
setenv WM_THIRD_PARTY_USE_PARMGRIDGEN_10 1
setenv WM_THIRD_PARTY_USE_LIBCCMIO_261 1
setenv WM_THIRD_PARTY_USE_MESQUITE_212 1
setenv WM_THIRD_PARTY_USE_MESQUITE_230 1
setenv WM_THIRD_PARTY_USE_SCOTCH_604 1
#setenv WM_THIRD_PARTY_USE_SCOTCH_600 1
setenv WM_THIRD_PARTY_USE_PARMETIS_403 1
#setenv WM_THIRD_PARTY_USE_ZOLTAN_36 1
setenv WM_THIRD_PARTY_USE_PYFOAM_064 1
setenv WM_THIRD_PARTY_USE_HWLOC_1101 1
setenv WM_THIRD_PARTY_USE_PYFOAM_069 1
setenv WM_THIRD_PARTY_USE_HWLOC_201 1
#setenv WM_THIRD_PARTY_USE_HWLOC_1101 1
#setenv WM_THIRD_PARTY_USE_HWLOC_172 1
#
# For AllMake.stage4
setenv WM_THIRD_PARTY_USE_QT_486 1
setenv WM_THIRD_PARTY_USE_PARAVIEW_440 1
setenv WM_THIRD_PARTY_USE_QT_511 1
setenv WM_THIRD_PARTY_USE_PARAVIEW_552 1
#setenv WM_THIRD_PARTY_USE_PARAVIEW_431 1
#setenv WM_THIRD_PARTY_USE_PARAVIEW_410 1

View file

@ -55,6 +55,10 @@ export FOAM_VERBOSE=1
#export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
#export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
# MPI runtime options
#export MPI_BUFFER_SIZE=100000000
#export MPIRUN_OPTIONS=-oversubscribe # OpenMPI version 3.1
# Specify system installed ThirdParty packages/libraries
# NB: The packages installed under $WM_THIRD_PARTY_DIR
# will always override these values.
@ -211,12 +215,14 @@ export FOAM_VERBOSE=1
#export WM_THIRD_PARTY_USE_M4_1416=1
#export WM_THIRD_PARTY_USE_BISON_27=1
#export WM_THIRD_PARTY_USE_FLEX_2535=1
#export WM_THIRD_PARTY_USE_CMAKE_322=1
#export WM_THIRD_PARTY_USE_CMAKE_332=1
export WM_THIRD_PARTY_USE_CMAKE_322=1
export WM_THIRD_PARTY_USE_CMAKE_3114=1
#
# For AllMake.stage2
export WM_THIRD_PARTY_USE_OPENMPI_188=1
export WM_THIRD_PARTY_USE_OPENMPI_311=1
#export WM_THIRD_PARTY_USE_OPENMPI_188=1
#export WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs='--enable-mpi-cxx --with-verbs'
#export WM_THIRD_PARTY_USE_OPENMPI_165=1
#export WM_THIRD_PARTY_USE_OPENMPI_165_ConfigureAdditionalArgs='--enable-mpi-cxx --with-openib'
@ -232,19 +238,20 @@ export WM_THIRD_PARTY_USE_OPENMPI_188=1
export WM_THIRD_PARTY_USE_METIS_510=1
export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1
export WM_THIRD_PARTY_USE_LIBCCMIO_261=1
export WM_THIRD_PARTY_USE_MESQUITE_212=1
export WM_THIRD_PARTY_USE_MESQUITE_230=1
export WM_THIRD_PARTY_USE_SCOTCH_604=1
#export WM_THIRD_PARTY_USE_SCOTCH_600=1
export WM_THIRD_PARTY_USE_PARMETIS_403=1
#export WM_THIRD_PARTY_USE_ZOLTAN_36=1
export WM_THIRD_PARTY_USE_PYFOAM_064=1
export WM_THIRD_PARTY_USE_HWLOC_1101=1
export WM_THIRD_PARTY_USE_PYFOAM_069=1
export WM_THIRD_PARTY_USE_HWLOC_201=1
#export WM_THIRD_PARTY_USE_HWLOC_1101=1
#export WM_THIRD_PARTY_USE_HWLOC_172=1
#
# For AllMake.stage4
#export WM_THIRD_PARTY_USE_QT_580=1
#export WM_THIRD_PARTY_USE_PARAVIEW_541=1
#export WM_THIRD_PARTY_USE_QT_5111=1
#export WM_THIRD_PARTY_USE_PARAVIEW_552=1
export WM_THIRD_PARTY_USE_QT_486=1
export WM_THIRD_PARTY_USE_PARAVIEW_440=1
#export WM_THIRD_PARTY_USE_PARAVIEW_431=1

View file

@ -224,18 +224,19 @@ export PARAVIEW_BIN_DIR=$PARAVIEW_DIR/bin
#export WM_THIRD_PARTY_USE_METIS_510=1
#export WM_THIRD_PARTY_USE_PARMGRIDGEN_10=1
#export WM_THIRD_PARTY_USE_LIBCCMIO_261=1
#export WM_THIRD_PARTY_USE_MESQUITE_212=1
#export WM_THIRD_PARTY_USE_MESQUITE_230=1
#export WM_THIRD_PARTY_USE_SCOTCH_604=1
##export WM_THIRD_PARTY_USE_SCOTCH_600=1
#export WM_THIRD_PARTY_USE_PARMETIS_403=1
##export WM_THIRD_PARTY_USE_ZOLTAN_36=1
#export WM_THIRD_PARTY_USE_PYFOAM_064=1
#export WM_THIRD_PARTY_USE_PYFOAM_069=1
#export WM_THIRD_PARTY_USE_HWLOC_201=1
#export WM_THIRD_PARTY_USE_HWLOC_1101=1
#export WM_THIRD_PARTY_USE_HWLOC_172=1
#
# For AllMake.stage4
#export WM_THIRD_PARTY_USE_QT_486=1
#export WM_THIRD_PARTY_USE_QT_5111=1
#export WM_THIRD_PARTY_USE_PARAVIEW_431=1
#export WM_THIRD_PARTY_USE_PARAVIEW_410=1

View file

@ -167,7 +167,15 @@ set mpi_version=unknown
switch ("$WM_MPLIB")
case OPENMPI:
if ($?WM_THIRD_PARTY_USE_OPENMPI_188 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ) then
if ($?WM_THIRD_PARTY_USE_OPENMPI_311 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.1/platforms/$WM_OPTIONS ) then
set mpi_version=openmpi-3.1.1
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using openmpi-3.1.1 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
endif
_foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
else if ($?WM_THIRD_PARTY_USE_OPENMPI_188 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ) then
set mpi_version=openmpi-1.8.8
if ($?FOAM_VERBOSE && $?prompt) then
@ -514,6 +522,9 @@ endif
if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_212 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.csh
endif
if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_230 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS/etc/mesquite-2.3.0.csh
endif
# Metis library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -559,6 +570,9 @@ endif
# cmake
# ~~~~~
if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_3114 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-3.11.4/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS/etc/cmake-3.11.4.csh
endif
if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_332 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-3.3.2/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS/etc/cmake-3.3.2.csh
endif
@ -607,9 +621,18 @@ endif
if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_064 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.4/platforms/noarch ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch/etc/PyFoam-0.6.4.csh
endif
if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_066 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.6/platforms/noarch ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch/etc/PyFoam-0.6.6.csh
endif
if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_069 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.9/platforms/noarch ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch/etc/PyFoam-0.6.9.csh
endif
# hwloc
# ~~~~~
if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_201 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-2.0.1/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS/etc/hwloc-2.0.1.csh
endif
if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_1101 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-1.10.1/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS/etc/hwloc-1.10.1.csh
endif
@ -619,6 +642,9 @@ endif
# QT
# ~~~~~
if ( $?QT_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_QT_5111 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS )then
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS/etc/qt-everywhere-src-5.11.1.csh
endif
if ( $?QT_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_QT_580 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS )then
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-5.8.0.csh
endif
@ -628,6 +654,9 @@ endif
# PARAVIEW
# ~~~~~
if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_552 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-5.5.2/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS/etc/ParaView-5.5.2.csh
endif
if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_541 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-5.4.1/platforms/$WM_OPTIONS ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS/etc/ParaView-5.4.1.csh
endif

View file

@ -213,7 +213,16 @@ unset MPI_ARCH_PATH
mpi_version=unknown
case "$WM_MPLIB" in
OPENMPI)
if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_188 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ]
if [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_311 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-3.1.1/platforms/$WM_OPTIONS ]
then
mpi_version=openmpi-3.1.1
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using openmpi-3.1.1 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
fi
_foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.sh
elif [ ! -z $WM_THIRD_PARTY_USE_OPENMPI_188 ] && [ -e $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ]
then
mpi_version=openmpi-1.8.8
if [ "$FOAM_VERBOSE" -a "$PS1" ]
@ -613,6 +622,10 @@ export MPI_BUFFER_SIZE
_foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " MESQUITE_DIR is initialized to: $MESQUITE_DIR"
[ -z "$MESQUITE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_MESQUITE_230 ] && [ -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.3.0/platforms/$WM_OPTIONS/etc/mesquite-2.3.0.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " MESQUITE_DIR is initialized to: $MESQUITE_DIR"
# Load Metis library
@ -662,6 +675,9 @@ export MPI_BUFFER_SIZE
# Load cmake
# ~~~~~~~~~~
[ -z "$CMAKE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_CMAKE_3114 ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.11.4/platforms/$WM_OPTIONS/etc/cmake-3.11.4.sh
}
[ -z "$CMAKE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_CMAKE_332 ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.3.2/platforms/$WM_OPTIONS/etc/cmake-3.3.2.sh
}
@ -718,6 +734,12 @@ export MPI_BUFFER_SIZE
[ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_064 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch/etc/PyFoam-0.6.4.sh
}
[ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_066 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.6/platforms/noarch/etc/PyFoam-0.6.6.sh
}
[ -z "$PYFOAM_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PYFOAM_069 ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.9/platforms/noarch/etc/PyFoam-0.6.9.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYFOAM_DIR is initialized to: $PYFOAM_DIR"
# Make sure that there is a special directory for special PyFoam-scripts
@ -731,6 +753,9 @@ fi
# Load hwloc
# ~~~~~~~~~~~
[ -z "$HWLOC_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_HWLOC_201 ] && [ -e $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-2.0.1/platforms/$WM_OPTIONS/etc/hwloc-2.0.1.sh
}
[ -z "$HWLOC_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_HWLOC_1101 ] && [ -e $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS/etc/hwloc-1.10.1.sh
}
@ -741,6 +766,10 @@ fi
# Load QT
# ~~~~~~~
[ ! -z "$QT_THIRD_PARTY" ] && [ ! -z $WM_THIRD_PARTY_USE_QT_5111 ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-src-5.11.1/platforms/$WM_OPTIONS/etc/qt-everywhere-src-5.11.1.sh
}
# ~~~~~~~
[ ! -z "$QT_THIRD_PARTY" ] && [ ! -z $WM_THIRD_PARTY_USE_QT_580 ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-5.8.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-5.8.0.sh
}
@ -752,6 +781,9 @@ fi
# Load ParaView
# ~~~~~~~~~~~~~
[ -z "$PARAVIEW_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PARAVIEW_552 ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.5.2/platforms/$WM_OPTIONS/etc/ParaView-5.5.2.sh
}
[ -z "$PARAVIEW_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PARAVIEW_541 ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-5.4.1/platforms/$WM_OPTIONS/etc/ParaView-5.4.1.sh
}

View file

@ -44,6 +44,9 @@ wmake libso lduSolvers
wmake libso tetFiniteElement
# We can now compile this library from decompositionMethods
wmake libso decompositionMethods/decomposeReconstruct
# Make dynamicMesh tools
dynamicMesh/AllwmakeLnInclude
dynamicMesh/Allwmake

View file

@ -131,7 +131,7 @@ void Foam::periodicOscillation::stabilise
x -= (x & dir_)*dir_;
// ... then add the correct displacement
x += dir_*sin(omega_*t + phi_);
x += dir_*a_*sin(omega_*t + phi_);
// Set the velocity according to periodic oscillation
@ -140,7 +140,7 @@ void Foam::periodicOscillation::stabilise
u -= (u & dir_)*dir_;
// ... then add the correct velocity
u += dir_*cos(omega_*t + phi_);
u += dir_*a_*omega_*cos(omega_*t + phi_);
}

View file

@ -2,7 +2,8 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso decomposeReconstruct
# We need to recompile this library later, when all the dependencies are ready
#wmake libso decomposeReconstruct
wmakeLnInclude decompositionMethods

View file

@ -37,8 +37,10 @@ $(slidingInterface)/decoupleSlidingInterface.C
repatchCoverage = $(polyMeshModifiers)/repatchCoverage
$(repatchCoverage)/repatchCoverage.C
polyhedralRefinement = $(polyMeshModifiers)/polyhedralRefinement
$(polyhedralRefinement)/polyhedralRefinement.C
refinement = $(polyMeshModifiers)/refinement
$(refinement)/refinement/refinement.C
$(refinement)/polyhedralRefinement/polyhedralRefinement.C
$(refinement)/prismatic2DRefinement/prismatic2DRefinement.C
polyTopoChange/polyTopoChange/polyTopoChange.C
polyTopoChange/polyTopoChange/actions/topoAction/topoActions.C

View file

@ -0,0 +1,245 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyhedralRefinement
Description
Isotropic refinement of polyhedral cells using the mesh modifier engine
Each polyhedral cell is split by the following procedure:
1. Adding points at the edge centre, face centre and cell centre,
2. Adding cells n cells where n is the number of points of the cell,
3. Splitting each face into multiple faces going from:
existing corner point -> new edge centre point -> new face centre
point -> other new edge centre point (sharing the same corner point)
4. Adding internal faces going from:
new edge centre point -> new face centre point -> new cell centre
point -> other new face centre point (sharing the same edge)
SourceFiles
polyhedralRefinement.C
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef polyhedralRefinement_H
#define polyhedralRefinement_H
#include "refinement.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyhedralRefinement Declaration
\*---------------------------------------------------------------------------*/
class polyhedralRefinement
:
public refinement
{
private:
// Private Member Functions
// Helper functions
//- Get least cell level such that the face has at least three
// points smaller than the level
label getAnchorLevel(const label faceI) const;
// Local topology modification functions (operate on cells/faces)
//- Create all internal faces of split cellI into n cells where n is the
// number of cell points
void createInternalFaces
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& faceMidPoint,
const labelList& faceAnchorLevel,
const labelList& edgeMidPoint,
const label cellI,
polyTopoChange& ref
) const;
// Topological change helper functions
//- Get cell added to point of cellI (if any)
label getAnchorCell
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label cellI,
const label faceI,
const label pointI
) const;
//- Set new owner and neighbour (in unspecified order) of pointI
// on faceI
void setNewFaceNeighbours
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label faceI,
const label pointI,
label& own,
label& nei
) const;
//- Find index of point with wantedLevel, starting from fp
label findLevel
(
const face& f,
const label startFp,
const bool searchForward,
const label wantedLevel
) const;
//- Store in maps correspondence from midpoint to anchors and
// faces. Used when creating internal faces
label storeMidPointInfo
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& edgeMidPoint,
const label cellI,
const label faceI,
const bool faceOrder,
const label midPointI,
const label anchorPointI,
const label faceMidPointI,
Map<edge>& midPointToAnchors,
Map<edge>& midPointToFaceMids,
polyTopoChange& ref
) const;
//- If p0 and p1 are existing vertices check if edge is split and insert
// splitPoint. Used with storing mid point
void insertEdgeSplit
(
const labelList& edgeMidPoint,
const label p0,
const label p1,
dynamicLabelList& verts
) const;
// Copy control
//- Disallow default bitwise copy construct
polyhedralRefinement(const polyhedralRefinement&);
//- Disallow default bitwise assignment
void operator=(const polyhedralRefinement&);
protected:
// Protected Pure Virtual Member Functions
// Global topology modification functions (operate on whole polyMesh)
//- Set refinement instruction
virtual void setRefinementInstruction
(
polyTopoChange& ref
) const;
//- Set unrefinement instruction
virtual void setUnrefinementInstruction
(
polyTopoChange& ref
) const;
public:
//- Runtime type information
TypeName("polyhedralRefinement");
// Constructors
//- Construct from dictionary
polyhedralRefinement
(
const word& name,
const dictionary& dict,
const label index,
const polyTopoChanger& mme
);
// Destructor
virtual ~polyhedralRefinement();
// Member Functions
// Edit
//- Set cells to refine given a list of refinement
// candidates. Refinement candidates are extended within the
// function due to possible 4:1 conflicts and specified number of
// buffer layers.
// Note: must be called BEFORE setSplitPointsToUnrefine
virtual void setCellsToRefine
(
const labelList& refinementCellCandidates
);
//- Set split points to unrefine given a list of all mesh points
// that are candidates for unrefinement. Split points are
// determined as a subset of unrefinement candidates, avoiding
// splitting points of cells that are going to be refined at the
// same time and ensuring consistent unrefinement.
// Note: must be called AFTER setCellsToRefine
virtual void setSplitPointsToUnrefine
(
const labelList& unrefinementPointCandidates
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,255 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::prismatic2DRefinement
Description
Isotropic refinement of prismatic cells in 2D using the mesh modifier
engine. Used for 2D cases instead of polyhedralRefinement which carries
unnecessary overhead in terms of number of cells since it splits the cell in
all directions.
Each prismatic cell is split by the following procedure:
1. Adding points at the face centres and edge centres of all faces found on
an special patch: empty or wedge.
2. Adding n cells per existing cell where n is the number of corner points
at the face on special patch (empty or wedge).
3. Splitting each of the faces on special patch (empty or wedge) into
multiple faces going from: existing corner point -> new edge centre point
-> new face centre point -> other new edge centre point (sharing the same
corner point)
4. Spliiting each of the faces not on an special patch (empty or wedge) into
two faces going from: existing corner point -> existing corner point on
the other side -> new edge centre point on the other side -> new edge
centre point on my side
4. Adding internal faces going from:
new edge centre point -> new face centre point -> new other face
centre point on the other side -> new other edge mid point on the other
side
It is an error to try and run this on anything except a 2D mesh.
SourceFiles
prismatic2DRefinement.C
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef prismatic2DRefinement_H
#define prismatic2DRefinement_H
#include "refinement.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class prismatic2DRefinement Declaration
\*---------------------------------------------------------------------------*/
class prismatic2DRefinement
:
public refinement
{
private:
// Private Member Functions
// Helper functions
//- Get least cell level such that the face has at least nPoints
// points smaller than the level
label getAnchorLevel
(
const label faceI,
const label nPoints
) const;
//- Append given face into a dynamic list containing split faces
// that will be split into two faces (third parameter). Additionaly
// append information on which of the two edges of the face are on
// special patch into a dynamic list (fourth parameter)
void appendFaceSplitInfo
(
const label& faceI,
const boolList& edgeOnEmptyPatch,
const labelList& edgeMidPoint,
DynamicList<label>& splitFacesIntoTwo,
DynamicList<Pair<label> >& splitFacesEmptyEdges
) const;
// Topological change helper functions
//- Set new owner and neighbour given anchor pointI, faceI and the
// necessary mapping
void setNewFaceNeighbours
(
const HashTable
<
label,
Pair<label>,
Hash<FixedList<label, 2> >
>& pointCellToAddedCellMap,
const labelListList& cellAddedCells,
const label& faceI,
const label& pointI,
label& own,
label& nei
) const;
//- Get index of point with minimum point level of a face across two
// connected edges starting from a local point index.
// Example: starting from point with level 1 in the upper left
// corner, finds point index of the point with level 0 which is on
// the same face, connected with edge to original point
// 1------1
// |
// |
// 0
// Note: passing face edges and mesh edges as parameters to avoid
// fetching them from mesh due to lazy evaluation
label findMinEdgeConnectedLevel
(
const label& fpI,
const label& faceI,
const face& f,
const labelList& fEdges,
const edgeList& meshEdges
) const;
//- Store two face mids when adding internal faces
void addFaceMids
(
const labelList& faceMidPoint,
const boolList& faceOnEmptyPatch,
const label& faceI,
const label& cellI,
face& newFace
) const;
// Debug functions
//- Check orientation of a split face
void checkNewFaceOrientation
(
polyTopoChange& ref,
const label& faceI,
const face& newFace
) const;
// Copy control
//- Disallow default bitwise copy construct
prismatic2DRefinement(const prismatic2DRefinement&);
//- Disallow default bitwise assignment
void operator=(const prismatic2DRefinement&);
protected:
// Protected Pure Virtual Member Functions
// Global topology modification functions (operate on whole polyMesh)
//- Set refinement instruction
virtual void setRefinementInstruction
(
polyTopoChange& ref
) const;
//- Set unrefinement instruction
virtual void setUnrefinementInstruction
(
polyTopoChange& ref
) const;
public:
//- Runtime type information
TypeName("prismatic2DRefinement");
// Constructors
//- Construct from dictionary
prismatic2DRefinement
(
const word& name,
const dictionary& dict,
const label index,
const polyTopoChanger& mme
);
// Destructor
virtual ~prismatic2DRefinement();
// Member Functions
// Edit
//- Set cells to refine given a list of refinement
// candidates. Refinement candidates are extended within the
// function due to possible 4:1 conflicts and specified number of
// buffer layers.
// Note: must be called BEFORE setSplitPointsToUnrefine
virtual void setCellsToRefine
(
const labelList& refinementCellCandidates
);
//- Set split points to unrefine given a list of all mesh points
// that are candidates for unrefinement. Split points are
// determined as a subset of unrefinement candidates, avoiding
// splitting points of cells that are going to be refined at the
// same time and ensuring consistent unrefinement.
// Note: must be called AFTER setCellsToRefine
void setSplitPointsToUnrefine
(
const labelList& unrefinementPointCandidates
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

File diff suppressed because it is too large Load diff

View file

@ -22,23 +22,28 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::polyhedralRefinement
Foam::refinement
Description
Isotropic refinement of polyhedral cells using the mesh modifier engine
Abstract base class for adaptive mesh refinement using the mesh modifier
engine. The class provides common interface and functionalities for 3D
polyhedral refinement and 2D prismatic refinement.
Each polyhedral cell is split by the following procedure:
1. Adding points at the edge centre, face centre and cell centre,
2. Adding cells n cells where n is the number of points of the cell,
3. Splitting each face into multiple faces going from:
existing corner point -> new edge centre point -> new face centre
point -> other new edge centre point (sharing the same corner point)
4. Adding internal faces going from:
new edge centre point -> new face centre point -> new cell centre
point -> other new face centre point (sharing the same edge)
The common interface includes (pure virtuals) following member functions:
- setCellsToRefine
- setSplitPointsToUnrefine
- calcLevel0EdgeLength
With a lot of ordinary protected member functions which are used by both
derived classes.
Note: I've written it this way in order to avoid unnecesasry code
duplication, but I'm 99% sure that if someone else wants to write additional
refinement strategy (e.g. directional refinement) as derived class, the
interface will need to change.
SourceFiles
polyhedralRefinement.C
refinement.C
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
@ -49,8 +54,8 @@ Notes
\*---------------------------------------------------------------------------*/
#ifndef polyhedralRefinement_H
#define polyhedralRefinement_H
#ifndef refinement_H
#define refinement_H
#include "polyMeshModifier.H"
#include "labelIOList.H"
@ -62,16 +67,16 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class polyhedralRefinement Declaration
Class refinement Declaration
\*---------------------------------------------------------------------------*/
class polyhedralRefinement
class refinement
:
public polyMeshModifier
{
public:
protected:
// Public enumeration for refinement status
// Protected enumeration for refinement status
enum refinementStatus
{
UNREFINED = -1,
@ -80,9 +85,7 @@ public:
};
private:
// Private data
// Protected data
//- Reference to polyMesh for easy access in helper functions
const polyMesh& mesh_;
@ -112,9 +115,6 @@ private:
// c) REFINED = +1 = cell is refined
mutable labelList refinementLevelIndicator_;
//- Typical edge length between unrefined points
scalar level0EdgeLength_;
//- Face remover engine
mutable removeFaces faceRemover_;
@ -132,21 +132,30 @@ private:
//- Number of buffer layers for unrefinement, controlling how far
// the unrefinement region needs to be from current refinement
// region. Therefore, this should always be at least
// nRefinementBufferLayers + 2 to avoid level inconsistencies
// region
label nUnrefinementBufferLayers_;
// Private Member Functions
// Protected Pure Virtual Member Functions
// Helper functions
// Global topology modification functions (operate on whole polyMesh)
//- Get least cell level such that the face has at least three
// points smaller than the level
label getAnchorLevel(const label faceI) const;
//- Set refinement instruction
virtual void setRefinementInstruction
(
polyTopoChange& ref
) const = 0;
//- Calculate level0EdgeLength_ (constructor helper)
void calcLevel0EdgeLength();
//- Set unrefinement instruction
virtual void setUnrefinementInstruction
(
polyTopoChange& ref
) const = 0;
// Protected Member Functions
// Useful helper functions used by derived classes
//- Set file instance for cellLevel_ and pointLevel_
void setInstance(const fileName& inst) const;
@ -158,31 +167,6 @@ private:
void extendMarkedCellsAcrossPoints(boolList& markedCell) const;
// Global topology modification functions (operate on whole polyMesh)
// and directly use local topology modification functions below
//- Refine polyhedral cells. All cellsToRefine_ cells will be split
// into n cells where n is the number of points per cell.
// Guarantees that the 0th element is the original cell label.
// Mapping:
// -split cells: n new ones get added from original
// -split faces: original gets modified; n - 1 new ones get added
// from original
// -added internal faces: added from original cell face (if
// that was internal) or created out-of-nothing (so will not
// get mapped!). Note: could make this inflate from point but
// that will allocate interpolation.
// -points added to split edge: added from edge start()
// -midpoints added: added from cellPoints[0].
void setPolyhedralRefinement(polyTopoChange& ref) const;
//- Remove some of the previously performed refinement. Uses
// splitPointLabels_ to determine the unrefinement.
// All n pointCells of a split point will be combined into
// the lowest numbered cell of those n.
void setPolyhedralUnrefinement(polyTopoChange& ref) const;
// Local topology modification functions (operate on cells/faces)
//- Adds a face on top of existing faceI. Reverses if nessecary
@ -217,46 +201,9 @@ private:
const label nei
) const;
//- Create all internal faces of split cellI into n cells where n is the
// number of cell points
void createInternalFaces
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& faceMidPoint,
const labelList& faceAnchorLevel,
const labelList& edgeMidPoint,
const label cellI,
polyTopoChange& ref
) const;
// Topological change helper functions
//- Get cell added to point of cellI (if any)
label getAnchorCell
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label cellI,
const label faceI,
const label pointI
) const;
//- Set new owner and neighbour (in unspecified order) of pointI
// on faceI
void setNewFaceNeighbours
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label faceI,
const label pointI,
label& own,
label& nei
) const;
//- Store vertices from startFp up to face split point.
// Used when splitting face into n faces where n is the number of
// points in a face (or number of edges)
@ -292,45 +239,6 @@ private:
const label anchorLevel
) const;
//- Find index of point with wantedLevel, starting from fp
label findLevel
(
const face& f,
const label startFp,
const bool searchForward,
const label wantedLevel
) const;
//- Store in maps correspondence from midpoint to anchors and
// faces. Used when creating internal faces
label storeMidPointInfo
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& edgeMidPoint,
const label cellI,
const label faceI,
const bool faceOrder,
const label midPointI,
const label anchorPointI,
const label faceMidPointI,
Map<edge>& midPointToAnchors,
Map<edge>& midPointToFaceMids,
polyTopoChange& ref
) const;
//- If p0 and p1 are existing vertices check if edge is split and insert
// splitPoint. Used with storing mid point
void insertEdgeSplit
(
const labelList& edgeMidPoint,
const label p0,
const label p1,
dynamicLabelList& verts
) const;
// Debug functions
@ -379,22 +287,22 @@ private:
// Copy control
//- Disallow default bitwise copy construct
polyhedralRefinement(const polyhedralRefinement&);
refinement(const refinement&);
//- Disallow default bitwise assignment
void operator=(const polyhedralRefinement&);
void operator=(const refinement&);
public:
//- Runtime type information
TypeName("polyhedralRefinement");
TypeName("refinement");
// Constructors
//- Construct from dictionary
polyhedralRefinement
refinement
(
const word& name,
const dictionary& dict,
@ -405,7 +313,7 @@ public:
// Destructor
virtual ~polyhedralRefinement();
virtual ~refinement();
// Member Functions
@ -422,12 +330,6 @@ public:
return pointLevel_;
}
//- Typical edge length between unrefined points
scalar level0EdgeLength() const
{
return level0EdgeLength_;
}
// Edit
@ -436,7 +338,10 @@ public:
// function due to possible 4:1 conflicts and specified number of
// buffer layers.
// Note: must be called BEFORE setSplitPointsToUnrefine
void setCellsToRefine(const labelList& refinementCellCandidates);
virtual void setCellsToRefine
(
const labelList& refinementCellCandidates
) = 0;
//- Set split points to unrefine given a list of all mesh points
// that are candidates for unrefinement. Split points are
@ -444,10 +349,10 @@ public:
// splitting points of cells that are going to be refined at the
// same time and ensuring consistent unrefinement.
// Note: must be called AFTER setCellsToRefine
void setSplitPointsToUnrefine
virtual void setSplitPointsToUnrefine
(
const labelList& unrefinementPointCandidates
);
) = 0;
// Inherited interface from polyMeshModifier

View file

@ -18,6 +18,7 @@ dynamicPolyRefinementFvMesh/refinementSelection/fieldBoundsRefinement/fieldBound
dynamicPolyRefinementFvMesh/refinementSelection/minCellVolumeRefinement/minCellVolumeRefinement.C
dynamicPolyRefinementFvMesh/refinementSelection/minCellSizeRefinement/minCellSizeRefinement.C
dynamicPolyRefinementFvMesh/refinementSelection/minPatchDistanceRefinement/minPatchDistanceRefinement.C
dynamicPolyRefinementFvMesh/refinementSelection/protectedInitialRefinement/protectedInitialRefinement.C
dynamicPolyRefinementFvMesh/refinementSelection/compositeRefinementSelection/compositeRefinementSelection.C
LIB = $(FOAM_LIBBIN)/libtopoChangerFvMesh

View file

@ -26,6 +26,7 @@ License
#include "dynamicPolyRefinementFvMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "refinementSelection.H"
#include "prismatic2DRefinement.H"
#include "polyhedralRefinement.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -110,28 +111,90 @@ Foam::dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh
),
curTimeIndex_(-1),
refinementSelectionPtr_(refinementSelection::New(*this, refinementDict_))
// Note: initialize refinement selection algorithm after the refinement
// polyMeshModifier has been set. It is possible that the selection
// algorithm needs cellLevel and pointLevel (see e.g.
// protectedInitialRefinement)
refinementSelectionPtr_()
{
// Add the topology modifier engine
Info<< "Adding polyhedralRefinement topology modifier" << endl;
// Only one topo changer engine
topoChanger_.setSize(1);
topoChanger_.set
(
0,
new polyhedralRefinement
(
"polyhedralRefinement",
refinementDict_,
0,
topoChanger_
)
);
// Get number of valid geometric dimensions
const label nGeometricDirs = this->nGeometricD();
switch(nGeometricDirs)
{
case 3:
// Add the polyhedralRefinement engine for 3D isotropic refinement
Info<< "3D case detected. "
<< "Adding polyhedralRefinement topology modifier" << endl;
topoChanger_.set
(
0,
new polyhedralRefinement
(
"polyhedralRefinement",
refinementDict_,
0,
topoChanger_
)
);
break;
case 2:
// Add the prismatic2DRefinement engine for 2D isotropic refinement
Info<< "2D case detected. "
<< "Adding prismatic2DRefinement topology modifier" << endl;
topoChanger_.set
(
0,
new prismatic2DRefinement
(
"prismatic2DRefinement",
refinementDict_,
0,
topoChanger_
)
);
break;
case 1:
FatalErrorIn
(
"dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh"
"\n("
"\n const IOobject& io,"
"\n const word subDictName"
"\n)"
) << "1D case detected. No valid refinement strategy is"
<< " available for 1D cases."
<< abort(FatalError);
break;
default:
FatalErrorIn
(
"dynamicPolyRefinementFvMesh::dynamicPolyRefinementFvMesh"
"\n("
"\n const IOobject& io,"
"\n const word subDictName"
"\n)"
) << "Invalid number of geometric meshes detected: "
<< nGeometricDirs
<< nl << "It appears that this mesh is neither 1D, 2D or 3D."
<< nl << " the mesh."
<< abort(FatalError);
}
// Write mesh and modifiers
topoChanger_.writeOpt() = IOobject::AUTO_WRITE;
topoChanger_.write();
write();
// Initialize refinement selection algorithm after modifiers
refinementSelectionPtr_ = refinementSelection::New(*this, refinementDict_);
}
@ -185,9 +248,8 @@ bool Foam::dynamicPolyRefinementFvMesh::update()
// time step
curTimeIndex_ = time().timeIndex();
// Get reference to polyhedralRefinement polyMeshModifier
polyhedralRefinement& polyRefModifier =
refCast<polyhedralRefinement>(topoChanger_[0]);
// Get reference to base class refinement polyMeshModifier
refinement& refModifier = refCast<refinement>(topoChanger_[0]);
// Create empty list for refinement candidates
labelList refCandidates;
@ -208,9 +270,9 @@ bool Foam::dynamicPolyRefinementFvMesh::update()
Info<< "Skipping refinement for this time-step..." << endl;
}
// Set cells to refine. Note: polyhedralRefinement ensures that face and
// point consistent refinement is performed
polyRefModifier.setCellsToRefine(refCandidates);
// Set cells to refine. Note: refinement needs to make sure that face
// and point consistent refinement is performed
refModifier.setCellsToRefine(refCandidates);
// Create empty list for unrefinement candidates
labelList unrefCandidates;
@ -233,10 +295,10 @@ bool Foam::dynamicPolyRefinementFvMesh::update()
// Set split points to unrefine around.
// Notes:
// 1. polyhedralRefinement ensures that only a consistent set of split
// 1. refinement needs to make sure that only a consistent set of split
// points is used for unrefinement
// 2. Must be called after polyhedralRefinement::setCellsToRefine
polyRefModifier.setSplitPointsToUnrefine(unrefCandidates);
// 2. Must be called after refinement::setCellsToRefine
refModifier.setSplitPointsToUnrefine(unrefCandidates);
// Activate the polyhedral refinement engine if there are some cells to
// refine or there are some split points to unrefine around
@ -249,11 +311,11 @@ bool Foam::dynamicPolyRefinementFvMesh::update()
if (enableTopoChange)
{
polyRefModifier.enable();
refModifier.enable();
}
else
{
polyRefModifier.disable();
refModifier.disable();
}
// Perform refinement and unrefinement in one go

View file

@ -25,7 +25,11 @@ Class
Foam::dynamicPolyRefinementFvMesh
Description
Adaptive mesh refinement for arbitrary polyhedral cells.
Adaptive mesh refinement for isotropic refinement of arbitrary polyhedral
cells in 3D and arbitrary prismatic cells in 2D.
Automatically switches between:
- 3D refinement uses polyhedralRefinement engine
- 2D refinement uses prismatic2DRefinement engine
SourceFiles
dynamicPolyRefinementFvMesh.C
@ -35,6 +39,7 @@ Author
Notes
Generalisation and refactorisation of dynamicRefineMesh for polyhedral cells
in 3D and prismatic cells in 2D.
\*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,228 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#include "protectedInitialRefinement.H"
#include "addToRunTimeSelectionTable.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(protectedInitialRefinement, 0);
addToRunTimeSelectionTable
(
refinementSelection,
protectedInitialRefinement,
dictionary
);
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField>
Foam::protectedInitialRefinement::cellLevelAsField() const
{
// Get cell level
const labelIOList& cLevel = mesh().lookupObject<labelIOList>("cellLevel");
// Create cell level field as volScalarField
tmp<volScalarField> tCellLevelField
(
new volScalarField
(
IOobject
(
"cellLevel",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("zero", dimless, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
volScalarField& cellLevelField = tCellLevelField();
scalarField& cellLevelFieldIn = cellLevelField.internalField();
// Set the field
forAll (cLevel, cellI)
{
cellLevelFieldIn[cellI] = cLevel[cellI];
}
cellLevelField.correctBoundaryConditions();
return tCellLevelField;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::protectedInitialRefinement::protectedInitialRefinement
(
const fvMesh& mesh,
const dictionary& dict
)
:
refinementSelection(mesh, dict),
initialCellLevel_
(
IOobject
(
"initialCellLevel",
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
cellLevelAsField()()
)
{}
// * * * * * * * * * * * * * * * * Destructor* * * * * * * * * * * * * * * * //
Foam::protectedInitialRefinement::~protectedInitialRefinement()
{}
// * * * * * * * * * * * * Public Member Functions * * * * * * * * * * * * * //
Foam::Xfer<Foam::labelList>
Foam::protectedInitialRefinement::refinementCellCandidates() const
{
// All cells are candidates for refinement
labelList refinementCandidates(mesh().nCells());
forAll (refinementCandidates, cellI)
{
refinementCandidates[cellI] = cellI;
}
// Print out some information
Info<< "Selection algorithm " << type() << " selected "
<< returnReduce(refinementCandidates.size(), sumOp<label>())
<< " (all) cells as refinement candidates."
<< endl;
// Return the list in the Xfer container to prevent copying
return refinementCandidates.xfer();
}
Foam::Xfer<Foam::labelList>
Foam::protectedInitialRefinement::unrefinementPointCandidates() const
{
// Create mark-up field for points that are found on initially refined cells
// Note: this can be done more intelligently by either cacheing until load
// balancing actually occurs or holding pointLevel as data member and
// updating it on load balancing. The overall overhead compared to AMR and
// DLB is really small, so there's no need to worry about this yet.
// VV, 10/July/2018
boolList pointsOnRefinedCells(mesh().nPoints(), false);
// Get initial cell level and mesh data
const scalarField& initialCellLevelIn = initialCellLevel_.internalField();
const labelListList& meshCellPoints = mesh().cellPoints();
// Loop through all cells and count number of protected points
label nProtectedPoints = 0;
// Get current cell level
const labelIOList& curCellLevel =
mesh().lookupObject<labelIOList>("cellLevel");
forAll (initialCellLevelIn, cellI)
{
const scalar& cl = initialCellLevelIn[cellI];
const scalar curcl = curCellLevel[cellI];
if ((cl > SMALL) && equal(cl, curcl))
{
// Cell has been refined during meshing and the original level is
// equal to the current level, mark all of its points
const labelList& curCellPoints = meshCellPoints[cellI];
forAll (curCellPoints, i)
{
// Get marker for this point
bool& ptOnRefCell = pointsOnRefinedCells[curCellPoints[i]];
if (!ptOnRefCell)
{
// This points has not been marked yet, mark it and
// increment the counter for protected points
ptOnRefCell = true;
++nProtectedPoints;
}
}
}
else if (cl > (curcl + SMALL))
{
FatalErrorIn
(
"Xfer<labelList>\n"
"protectedInitialRefinement::unrefinementPointCandidates()"
" const"
) << "Detected a cell with initial refinement level greater"
<< " than current refinement level." << nl
<< "cellI: " << cellI << nl
<< "current level: " << curcl << nl
<< "initial level: " << cl << nl
<< "This should not happen."
<< abort(FatalError);
}
}
// Create the list for unrefinement candidates
labelList unrefinementCandidates(mesh().nPoints() - nProtectedPoints);
label nUnrefPoints = 0;
forAll (pointsOnRefinedCells, pointI)
{
if (!pointsOnRefinedCells[pointI])
{
// This point is an unrefinement candidate, set it and increment
unrefinementCandidates[nUnrefPoints++] = pointI;
}
}
// Print out some information
Info<< "Selection algorithm " << type() << " selected "
<< returnReduce(unrefinementCandidates.size(), sumOp<label>())
<< " points as unrefinement candidates."
<< endl;
// Return the list in the Xfer container to prevent copying
return unrefinementCandidates.xfer();
}
// ************************************************************************* //

View file

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::protectedInitialRefinement
Description
This refinement strategy is just a protection to avoid unrefining cells that
are refined during the snappyHexMesh meshing process. It's intended use is
alongside some other refinement strategy as a part of a composite scheme.
Therefore: refinementCellCandidates returns all cells as refinement
candidates, while unrefinementPointCandidates returns all points that don't
touch any of the initially refined cells.
Since snappyHexMesh writes down cellLevel and pointLevel, cells refined in
during meshing could be unrefined, but this is not what we would like to
achieve (after all, if we have included refinement regions in meshing, then
we probably had a good reason for it).
SourceFiles
protectedInitialRefinement.C
Author
Vuko Vukcevic, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef protectedInitialRefinement_H
#define protectedInitialRefinement_H
#include "refinementSelection.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class protectedInitialRefinement Declaration
\*---------------------------------------------------------------------------*/
class protectedInitialRefinement
:
public refinementSelection
{
// Private data
//- Initial cellLevel as volScalarField in order to simplify data
// transfer for dynamic load balancing
volScalarField initialCellLevel_;
// Private Member Functions
// Copy control
//- Disallow default bitwise copy construct
protectedInitialRefinement(const protectedInitialRefinement&);
//- Disallow default bitwise assignment
void operator=(const protectedInitialRefinement&);
// Constructor helper
//- Create and return volScalarField from cellLevel
tmp<volScalarField> cellLevelAsField() const;
public:
//- Runtime type information
TypeName("protectedInitialRefinement");
// Constructors
//- Construct from components
protectedInitialRefinement(const fvMesh& mesh, const dictionary& dict);
//- Destructor
virtual ~protectedInitialRefinement();
// Member Functions
// Selection of refinement/unrefinement candidates
//- Return transferable list of cells to refine
virtual Xfer<labelList> refinementCellCandidates() const;
//- Return transferable list of split points to unrefine
virtual Xfer<labelList> unrefinementPointCandidates() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -144,7 +144,7 @@ public:
//- Return reference to the fluctuation scale to allow adjustment
graph& timeData()
{
return timeDataPtr_;
return timeDataPtr_();
}
const engineTime& engineDB() const

View file

@ -306,6 +306,7 @@ list(APPEND SOURCES
${interpolation}/interpolationCellPointFace/makeInterpolationCellPointFace.C
${interpolation}/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
${interpolation}/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
${interpolation}/interpolationPointMVC/interpolationPointMVC.C
)
set(volPointInterpolation interpolation/volPointInterpolation)

View file

@ -239,6 +239,8 @@ $(interpolation)/interpolationCellPoint/makeInterpolationCellPoint.C
$(interpolation)/interpolationCellPointFace/makeInterpolationCellPointFace.C
$(interpolation)/interpolationCellPointWallModified/cellPointWeightWallModified/cellPointWeightWallModified.C
$(interpolation)/interpolationCellPointWallModified/makeInterpolationCellPointWallModified.C
$(interpolation)/interpolationPointMVC/pointMVCWeight.C
$(interpolation)/interpolationPointMVC/makeInterpolationPointMVC.C
volPointInterpolation = interpolation/volPointInterpolation
$(volPointInterpolation)/pointPatchInterpolation/pointPatchInterpolation.C

View file

@ -212,27 +212,27 @@ public:
}
//- Return inlet-outlet treatment switch
bool inletOutlet() const
Switch inletOutlet() const
{
return inletOutlet_;
}
//- Return reference to inlet-outlet treatment switch
// to allow adjustment
bool& inletOutlet()
Switch& inletOutlet()
{
return inletOutlet_;
}
//- Return supercritical outlet treatment switch
bool correctSupercritical() const
Switch correctSupercritical() const
{
return correctSupercritical_;
}
//- Return reference to supercritical treatment switch
// to allow adjustment
bool& correctSupercritical()
Switch& correctSupercritical()
{
return correctSupercritical_;
}

View file

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interpolationPointMVC.H"
#include "volPointInterpolation.H"
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::interpolationPointMVC<Type>::interpolationPointMVC
(
const GeometricField<Type, fvPatchField, volMesh>& psi
)
:
interpolation<Type>(psi),
psip_(volPointInterpolation::New(psi.mesh()).interpolate(psi))
/*
psip_
(
volPointInterpolation::New(psi.mesh()).interpolate
(
psi,
"volPointInterpolate(" + psi.name() + ')',
true // use cache
)
)
*/
{}
// ************************************************************************* //

View file

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::interpolationPointMVC
Description
Given cell centre values interpolates to vertices and uses these to
do a Mean Value Coordinates interpolation.
\*---------------------------------------------------------------------------*/
#ifndef interpolationPointMVC_H
#define interpolationPointMVC_H
#include "interpolation.H"
#include "pointMVCWeight.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class interpolationPointMVC Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class interpolationPointMVC
:
public interpolation<Type>
{
protected:
// Protected data
//- Interpolated volfield
const GeometricField<Type, pointPatchField, pointMesh> psip_;
public:
//- Runtime type information
TypeName("pointMVC");
// Constructors
//- Construct from components
interpolationPointMVC
(
const GeometricField<Type, fvPatchField, volMesh>& psi
);
// Member Functions
//- Inherit interpolate from interpolation
using interpolation<Type>::interpolate;
//- Interpolate field for the given cellPointWeight
inline Type interpolate(const pointMVCWeight& cpw) const;
//- Interpolate field to the given point in the given cell
inline Type interpolate
(
const vector& position,
const label celli,
const label facei = -1
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "interpolationPointMVCI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "interpolationPointMVC.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,53 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline Type Foam::interpolationPointMVC<Type>::interpolate
(
const pointMVCWeight& cpw
) const
{
return cpw.interpolate(psip_);
}
template<class Type>
inline Type Foam::interpolationPointMVC<Type>::interpolate
(
const vector& position,
const label celli,
const label facei
) const
{
return interpolate
(
pointMVCWeight(this->pMesh_, position, celli, facei)
);
}
// ************************************************************************* //

View file

@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "interpolationPointMVC.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makeInterpolation(interpolationPointMVC);
}
// ************************************************************************* //

View file

@ -0,0 +1,324 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pointMVCWeight.H"
#include "polyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam::debug::debugSwitch
Foam::pointMVCWeight::debug
(
"pointMVCWeight",
0
);
Foam::scalar Foam::pointMVCWeight::tol(SMALL);
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::pointMVCWeight::calcWeights
(
const Map<label>& toLocal,
const face& f,
const DynamicList<point>& u,
const scalarField& dist,
scalarField& weights
) const
{
weights.setSize(toLocal.size());
weights = 0.0;
scalarField theta(f.size());
// recompute theta, the theta computed previously are not robust
forAll(f, j)
{
label jPlus1 = f.fcIndex(j);
scalar l = mag(u[j] - u[jPlus1]);
theta[j] = 2.0*Foam::asin(l/2.0);
}
scalar sumWeight = 0;
forAll(f, j)
{
label pid = toLocal[f[j]];
label jMin1 = f.rcIndex(j);
weights[pid] =
1.0
/ dist[pid]
* (Foam::tan(theta[jMin1]/2.0) + Foam::tan(theta[j]/2.0));
sumWeight += weights[pid];
}
if (sumWeight >= tol)
{
weights /= sumWeight;
}
}
void Foam::pointMVCWeight::calcWeights
(
const polyMesh& mesh,
const labelList& toGlobal,
const Map<label>& toLocal,
const vector& position,
const vectorField& uVec,
const scalarField& dist,
scalarField& weights
) const
{
// Loop over all triangles of all polygons of cell to compute weights
DynamicList<scalar> alpha(100);
DynamicList<scalar> theta(100);
DynamicList<point> u(100);
const Foam::cell& cFaces = mesh.cells()[cellIndex_];
forAll(cFaces, iter)
{
label facei = cFaces[iter];
const face& f = mesh.faces()[facei];
//Pout<< "face:" << facei << " at:"
// << pointField(mesh.points(), f)
// << endl;
// Collect the uVec for the face
forAll(f, j)
{
u(j) = uVec[toLocal[f[j]]];
}
vector v(point::zero);
forAll(f, j)
{
label jPlus1 = f.fcIndex(j);
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
vector temp = u[j] ^ u[jPlus1];
scalar magTemp = mag(temp);
if (magTemp < VSMALL)
{
continue;
}
temp /= magTemp;
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1]
// << " temp:" << temp << endl;
scalar l = min(mag(u[j] - u[jPlus1]), 2.0);
scalar angle = 2.0*Foam::asin(l/2.0);
//Pout<< " j:" << j << " l:" << l << " angle:" << angle << endl;
v += 0.5*angle*temp;
}
scalar vNorm = mag(v);
v /= vNorm;
if ((v & u[0]) < 0)
{
v = -v;
}
//Pout<< " v:" << v << endl;
// angles between edges
forAll(f, j)
{
label jPlus1 = f.fcIndex(j);
//Pout<< " uj:" << u[j] << " ujPlus1:" << u[jPlus1] << endl;
vector n0 = u[j]^v;
n0 /= mag(n0);
vector n1 = u[jPlus1]^v;
n1 /= mag(n1);
scalar l = min(mag(n0 - n1), 2.0);
//Pout<< " l:" << l << endl;
alpha(j) = 2.0*Foam::asin(l/2.0);
vector temp = n0^n1;
if ((temp&v) < 0.0)
{
alpha[j] = -alpha[j];
}
l = min(mag(u[j] - v), 2.0);
//Pout<< " l:" << l << endl;
theta(j) = 2.0*Foam::asin(l/2.0);
}
bool outlierFlag = false;
forAll(f, j)
{
if (mag(theta[j]) < tol)
{
outlierFlag = true;
label pid = toLocal[f[j]];
weights[pid] += vNorm / dist[pid];
break;
}
}
if (outlierFlag)
{
continue;
}
scalar sum = 0.0;
forAll(f, j)
{
label jMin1 = f.rcIndex(j);
sum +=
1.0
/ Foam::tan(theta[j])
* (Foam::tan(alpha[j]/2.0) + Foam::tan(alpha[jMin1]/2.0));
}
// The special case when x lies on the polygon, handle it using 2D mvc.
// In the 2D case, alpha = theta
if (mag(sum) < tol)
{
// Calculate weights using face vertices only
calcWeights(toLocal, f, u, dist, weights);
return;
}
// Normal 3D case
forAll(f, j)
{
label pid = toLocal[f[j]];
label jMin1 = f.rcIndex(j);
weights[pid] +=
vNorm
/ sum
/ dist[pid]
/ Foam::sin(theta[j])
* (Foam::tan(alpha[j]/2.0) + Foam::tan(alpha[jMin1]/2.0));
}
}
// normalise weights
scalar sumWeight = sum(weights);
if (mag(sumWeight) < tol)
{
return;
}
weights /= sumWeight;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pointMVCWeight::pointMVCWeight
(
const polyMesh& mesh,
const vector& position,
const label cellIndex,
const label faceIndex
)
:
cellIndex_((cellIndex != -1) ? cellIndex : mesh.faceOwner()[faceIndex])
{
// Addressing - face vertices to local points and vice versa
const labelList& toGlobal = mesh.cellPoints()[cellIndex_];
Map<label> toLocal(2*toGlobal.size());
forAll(toGlobal, i)
{
toLocal.insert(toGlobal[i], i);
}
// Initialise weights
weights_.setSize(toGlobal.size());
weights_ = 0.0;
// Point-to-vertex vectors and distances
vectorField uVec(toGlobal.size());
scalarField dist(toGlobal.size());
forAll(toGlobal, pid)
{
const point& pt = mesh.points()[toGlobal[pid]];
uVec[pid] = pt-position;
dist[pid] = mag(uVec[pid]);
// Special case: point is close to vertex
if (dist[pid] < tol)
{
weights_[pid] = 1.0;
return;
}
}
// Project onto unit sphere
uVec /= dist;
if (faceIndex < 0)
{
// Face data not supplied
calcWeights
(
mesh,
toGlobal,
toLocal,
position,
uVec,
dist,
weights_
);
}
else
{
DynamicList<point> u(100);
const face& f = mesh.faces()[faceIndex];
// Collect the uVec for the face
forAll(f, j)
{
u(j) = uVec[toLocal[f[j]]];
}
// Calculate weights for face only
calcWeights(toLocal, f, u, dist, weights_);
}
}
// ************************************************************************* //

View file

@ -0,0 +1,162 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::pointMVCWeight
Description
Container to calculate weights for interpolating directly from vertices
of cell using Mean Value Coordinates.
Based on (VTK's vtkMeanValueCoordinatesInterpolator's) implementation
of "Spherical Barycentric Coordinates"
2006 paper Eurographics Symposium on Geometry Processing
by Torsten Langer, Alexander Belyaev and Hans-Peter Seide
SourceFiles
pointMVCWeight.C
\*---------------------------------------------------------------------------*/
#ifndef pointMVCWeight_H
#define pointMVCWeight_H
#include "scalarField.H"
#include "vectorField.H"
#include "Map.H"
#include "DynamicList.H"
#include "point.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class polyMesh;
class pointMesh;
template<class T> class pointPatchField;
template<class Type, template<class> class PatchField, class GeoMesh>
class GeometricField;
class face;
/*---------------------------------------------------------------------------*\
Class pointMVCWeight Declaration
\*---------------------------------------------------------------------------*/
class pointMVCWeight
{
protected:
// Protected data
//- Cell index
const label cellIndex_;
//- Weights applied to cell vertices
scalarField weights_;
// Protected Member Functions
//- Calculate weights from single face's vertices only
void calcWeights
(
const Map<label>& toLocal,
const face& f,
const DynamicList<point>& u,
const scalarField& dist,
scalarField& weights
) const;
//- Calculate weights from all cell's vertices
void calcWeights
(
const polyMesh& mesh,
const labelList& toGlobal,
const Map<label>& toLocal,
const vector& position,
const vectorField& uVec,
const scalarField& dist,
scalarField& weights
) const;
public:
//- Debug switch
static debug::debugSwitch debug;
//- Tolerance used in calculating barycentric co-ordinates
// (applied to normalised values)
static scalar tol;
// Constructors
//- Construct from components
pointMVCWeight
(
const polyMesh& mesh,
const vector& position,
const label celli,
const label facei = -1
);
// Member Functions
//- Cell index
inline label cell() const
{
return cellIndex_;
}
//- Interpolation weights (in order of cellPoints)
inline const scalarField& weights() const
{
return weights_;
}
//- Interpolate field
template<class Type>
inline Type interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>& psip
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "pointMVCWeightI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,48 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "pointFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
inline Type Foam::pointMVCWeight::interpolate
(
const GeometricField<Type, pointPatchField, pointMesh>& psip
) const
{
const labelList& vertices = psip.mesh()().cellPoints()[cellIndex_];
Type t = pTraits<Type>::zero;
forAll(vertices, i)
{
t += psip[vertices[i]]*weights_[i];
}
return t;
}
// ************************************************************************* //

View file

@ -88,7 +88,7 @@ inline To& dynamicCast(From& r)
{
return dynamic_cast<To&>(r);
}
catch (std::bad_cast)
catch (std::bad_cast& e)
{
FatalErrorIn("dynamicCast<To>(From&)")
<< "Attempt to cast type " << typeid(r).name()
@ -109,7 +109,7 @@ inline To& refCast(From& r)
{
return dynamic_cast<To&>(r);
}
catch (std::bad_cast)
catch (std::bad_cast& e)
{
FatalErrorIn("refCast<To>(From&)")
<< "Attempt to cast type " << r.type()

View file

@ -69,6 +69,10 @@ bool read(const char*, uint64_t&);
Istream& operator>>(Istream&, uint64_t&);
Ostream& operator<<(Ostream&, const uint64_t);
#if WM_ARCH_OPTION == 64 && darwin && __clang__
Ostream& operator<<(Ostream&, const uintptr_t);
#endif
//- Template specialization for pTraits<uint64_t>
template<>
class pTraits<uint64_t>

View file

@ -98,5 +98,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const uint64_t i)
return os;
}
#if WM_ARCH_OPTION == 64 && darwin && __clang__
Foam::Ostream& Foam::operator<<(Ostream& os, const uintptr_t i)
{
os.write(label(i));
os.check("Ostream& operator<<(Ostream&, const uintptr_t)");
return os;
}
#endif
// ************************************************************************* //

View file

@ -4,7 +4,8 @@ oversetFringe/oversetFringe/oversetFringe.C
oversetFringe/oversetFringe/newOversetFringe.C
oversetFringe/manualFringe/manualFringe.C
oversetFringe/faceCellsFringe/faceCellsFringe.C
oversetFringe/overlapFringe/overlapFringe.C
oversetFringe/overlapFringe/overlapFringe/overlapFringe.C
oversetFringe/overlapFringe/adaptiveOverlapFringe/adaptiveOverlapFringe.C
oversetFringe/compositeFringe/compositeFringe.C
oversetFringe/overlapFringe/donorSuitability/donorSuitability/donorSuitability.C

View file

@ -115,6 +115,10 @@ private:
// Note that the processor number is the same for all extended
// donors
//- Whether donor (or acceptor) is within bounding box of acceptor
// (or donor)
bool withinBB_;
public:
@ -148,7 +152,8 @@ public:
donorProcNo_(-1),
donorPoint_(vector::zero),
extendedDonorCells_(),
extendedDonorPoints_()
extendedDonorPoints_(),
withinBB_(false)
{}
//- Construct from Istream
@ -161,7 +166,8 @@ public:
donorProcNo_(readLabel(is)),
donorPoint_(is),
extendedDonorCells_(is),
extendedDonorPoints_(is)
extendedDonorPoints_(is),
withinBB_(is)
{}
//- Copy constructor - default
@ -275,19 +281,34 @@ public:
}
}
//- Return whether the donor is within bounding box
bool withinBB() const
{
return withinBB_;
}
// Edit
//- Set withinBB
void setWithinBB(const bool withinBB)
{
withinBB_ = withinBB;
}
//- Set hit: donor found
void setDonor
(
const label& donorCell,
const label& donorProcNo,
const point& donorPoint
const point& donorPoint,
const bool withinBB
)
{
donorCell_ = donorCell;
donorProcNo_ = donorProcNo;
donorPoint_ = donorPoint;
withinBB_ = withinBB;
}
//- Set extended donors by going through neighbours of currently set
@ -355,6 +376,8 @@ public:
extendedDonorCells_ = rd.extendedDonorCells_;
extendedDonorPoints_ = rd.extendedDonorPoints_;
withinBB_ = rd.withinBB_;
}
@ -371,7 +394,8 @@ public:
&& a.acceptorProcNo_ == b.acceptorProcNo_
&& a.acceptorPoint_ == b.acceptorPoint_
&& a.donorCell_ == b.donorCell_
&& a.donorProcNo_ == b.donorProcNo_;
&& a.donorProcNo_ == b.donorProcNo_
&& a.withinBB_ == b.withinBB_;
// Note: do not check whether extended neighbours are the same, we
// assume they will be if donor data is the same
@ -399,8 +423,8 @@ public:
>> rd.donorProcNo_
>> rd.donorPoint_
>> rd.extendedDonorCells_
>> rd.extendedDonorPoints_;
>> rd.extendedDonorPoints_
>> rd.withinBB_;
return is;
}
@ -414,8 +438,8 @@ public:
<< rd.donorProcNo_ << token::SPACE
<< rd.donorPoint_ << token::SPACE
<< rd.extendedDonorCells_ << token::SPACE
<< rd.extendedDonorPoints_;
<< rd.extendedDonorPoints_ << token::SPACE
<< rd.withinBB_;
return os;
}
};

View file

@ -42,5 +42,6 @@
}
}
// regionIndex.write();
// Write region index
regionIndex.write();
}

View file

@ -0,0 +1,239 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.1
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
adaptiveOverlapFringe
Description
Adaptive overlap fringe algorithm with fall-back mechanism
Holds and manages following data:
- fringeHolesPtr_: holds fringe holes which are basically discarded
acceptors from previous iterations
- acceptorsPtr_: holds current set of acceptors to consider
- finalDonorAcceptorsPtr_: final set of donor/acceptors which will be used
for the overset interpolation
- donorSuitability_: run-time selectable Donor Suitability Function
- initPatchNames_: optional list of patches that we use to start the
acceptor search from
- minGlobalFraction_: minimum allowable global fraction of suitable pairs
- cumulativeDonorAcceptorsPtr_: list of suitable donor/acceptor pairs
- fringeIter_: iteration counter
Member function updateIteration controls the iterative process:
- Checks whether given donor/acceptors are suitable and filters them,
- If the user-specified criterion controlled by minGlobalFraction_ is not
reached (i.e. suitable overlap has not been found), then we loop through
unsuitable acceptors and mark their neighbours (excluding existing
acceptors and holes) as candidate acceptors for the next iteration,
- Unsuitable acceptors become fringe holes.
Authors
Josip Katavic, FMENA Zagreb. All rights reserved.
Vuko Vukcevic, FMENA Zagreb. All rights reserved.
SourceFiles
adaptiveOverlapFringe.C
Notes
Based on original overlapFringe assembly algorithm.
\*---------------------------------------------------------------------------*/
#ifndef adaptiveOverlapFringe_H
#define adaptiveOverlapFringe_H
#include "overlapFringe.H"
#include "donorSuitability.H"
#include "optimisationSwitch.H"
#include "volFields.H"
#include "FIFOStack.H"
#include "iterationData.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class adaptiveOverlapFringe Declaration
\*---------------------------------------------------------------------------*/
class adaptiveOverlapFringe
:
public oversetFringe
{
// Private data
//- Fringe hole cells
mutable labelList* fringeHolesPtr_;
//- Acceptor cells
mutable labelList* acceptorsPtr_;
//- Final donor/acceptor pairs for this region (fringe)
mutable donorAcceptorList* finalDonorAcceptorsPtr_;
//- Iteration history - filtered donor/acceptor pairs, fringe holes and
// average donor/acceptor suitability fraction
mutable FIFOStack<iterationData> iterationDataHistory_;
// Optional initialization data
//- Name of the cell set defining initial holes (empty by default).
// Useful when the resolution of the background mesh is much
// coarser than the front mesh and no hole is found
const word holesSetName_;
//- Optional list of patches to start the iterative fringe assembly
// process (empty list by default). Useful when we actually have
// a hole as a patch in the background mesh
const wordList initPatchNames_;
// Data for iteration control
//- Run-time selectable donor/acceptor suitability handler
autoPtr<donorSuitability::donorSuitability> donorSuitability_;
//- Iteration counter
mutable label fringeIter_;
//- User defined number of iterations - by default 4 iterations will
// be made
const label specifiedIterationsNumber_;
//- Relative iteration counter
mutable label relativeCounter_;
//- Additional iteration switch
const Switch additionalIterations_;
//- Penalty coefficient for orhpan donors, i.e. orhpan donors
// suitability
const scalar orphanSuitability_;
// Suitable donor/acceptor pairs
mutable donorAcceptorDynamicList suitableDAPairs_;
//- Suitable pairs cumulative suitability
mutable scalar suitablePairsSuit_;
// Private Member Functions
// Copy control
//- Disallow default bitwise copy construct
adaptiveOverlapFringe(const adaptiveOverlapFringe&);
//- Disallow default bitwise assignment
void operator=(const adaptiveOverlapFringe&);
// Addressing manipulation functions
//- Calculate hole-acceptor addressing
void calcAddressing() const;
//- Clear hole-acceptor addressing
void clearAddressing() const;
// Private Static Functions
//- Sort function - third parameter for max_element function
static bool sortBySuitabilityValue
(
const iterationData& lhsObject,
const iterationData& rhsObject
);
public:
//- Runtime type information
TypeName("adaptiveOverlap");
// Constructors
//- Construct from dictionary
adaptiveOverlapFringe
(
const fvMesh& mesh,
const oversetRegion& region,
const dictionary& dict
);
//- Destructor
virtual ~adaptiveOverlapFringe();
// Member Functions
//- Update iteration.
virtual bool updateIteration
(
donorAcceptorList& donorAcceptorRegionData
) const;
//- Return list of hole cells
// Fringe hole cells are collected in addition to geometric hole
// cells, which fall outside of all donor regions
virtual const labelList& fringeHoles() const;
//- Return list of acceptor cells
virtual const labelList& candidateAcceptors() const;
//- Return list of final donor acceptor pairs. Note: caller may
// invalidate finalDonorAcceptorsPtr_ for optimisation purposes
virtual donorAcceptorList& finalDonorAcceptors() const;
//- Update the fringe
virtual void update() const;
//- Loop through all iteration data objects from iterationDataHistory_
// data member and calculate slope, i.e. suitability fraction values
// trend using linear least squares method.
void suitabilityFractionSlope
(
FIFOStack<iterationData>,
scalar& alpha,
scalar& beta
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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::iterationData
Description
Representation of the data type needed to track the history of the
iterative process in which the most appropriate donor/acceptor pairs are
sought.
Holds and manages following data:
- fringeHoles_: list of fringe holes from one iteration. In the first
iteration fringe holes are hole cells generated from the hole cutting
process. In the following iterations fringeHoles_ represents holes
from the hole cutting process and discarded acceptors from previous
iterations.
- donorAcceptorPairs_: donorAcceptorList which holds donor/acceptor pairs
from one iteration. This list is not filtered.
- suitability_: average suitability fraction from one iteration. If this
value is higher, donor/acceptor pairs are more suitable.
- iteration_: iteration number which is needed for calculating slope using
least square method.
SourceFiles
iterationData.C
Author
Josip Katavic, FMENA Zagreb. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef iterationData_H
#define iterationData_H
#include "donorAcceptorList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class iterationData Declaration
\*---------------------------------------------------------------------------*/
class iterationData
{
// Private data
//- Pre-final donor/acceptor pairs
const donorAcceptorList donorAcceptorPairs_;
//- List of fringe holes
const labelList fringeHoles_;
//- Average suitability fraction for all donor/acceptor pairs
const scalar suitability_;
//- Iteration number
const label iteration_;
public:
// Constructors
//- Construct from Foam::adaptiveOverlap::updateIteration data by
// transfering the ownership from parameters to data members
iterationData
(
const Xfer<donorAcceptorList>& donorAcceptorPairs,
const Xfer<labelList>& fringeHoles,
const scalar averageSuitability,
const label iteration
)
:
donorAcceptorPairs_(donorAcceptorPairs),
fringeHoles_(fringeHoles),
suitability_(averageSuitability),
iteration_(iteration)
{}
// Note: There is no need for 'the big three' implementation because
// this class does not hold pointers as data members, so use implicit
// copy constructor, assignment operator and destructor.
// Access
//- Return reference to donor/acceptor pairs
const donorAcceptorList& donorAcceptorPairs() const
{
return donorAcceptorPairs_;
}
//- Return reference to fringe holes
const labelList& fringeHoles() const
{
return fringeHoles_;
}
//- Return reference to suitability fraction
const scalar& suitability() const
{
return suitability_;
}
//- Return reference to iteration number
const label& iteration() const
{
return iteration_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "cellBoundingBoxDiagonal.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
#include "oversetRegion.H"
#include "addToRunTimeSelectionTable.H"
@ -50,14 +50,14 @@ addToRunTimeSelectionTable
Foam::donorSuitability::cellBoundingBoxDiagonal::cellBoundingBoxDiagonal
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
donorSuitability(overlapFringeAlgorithm, dict)
donorSuitability(oversetFringeAlgorithm, dict)
{
// Get reference to fvMesh
const fvMesh& mesh = overlapFringeAlgorithm.mesh();
const fvMesh& mesh = oversetFringeAlgorithm.mesh();
// Get necessary mesh data
const cellList& cells = mesh.cells();

View file

@ -73,7 +73,7 @@ public:
//- Construct from components
cellBoundingBoxDiagonal
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "cellVolumes.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
#include "oversetRegion.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
@ -51,14 +51,14 @@ addToRunTimeSelectionTable
Foam::donorSuitability::cellVolumes::cellVolumes
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
donorSuitability(overlapFringeAlgorithm, dict)
donorSuitability(oversetFringeAlgorithm, dict)
{
// Get local donor suitability function using cell volumes
const scalarField& localDsf = overlapFringeAlgorithm.mesh().V().field();
const scalarField& localDsf = oversetFringeAlgorithm.mesh().V().field();
// Combine donor suitability function data across processors for parallel
// run

View file

@ -70,7 +70,7 @@ public:
//- Construct from components
cellVolumes
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "donorSuitability.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,11 +43,11 @@ defineRunTimeSelectionTable(donorSuitability, dictionary);
Foam::donorSuitability::donorSuitability::donorSuitability
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
overlapFringe_(overlapFringeAlgorithm),
oversetFringe_(oversetFringeAlgorithm),
coeffDict_
(
dict.subDict("donorSuitability")
@ -100,20 +100,4 @@ void Foam::donorSuitability::donorSuitability::combineDonorSuitabilityFunction
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::overlapFringe&
Foam::donorSuitability::donorSuitability::overlapFringeAlgorithm() const
{
return overlapFringe_;
}
const Foam::dictionary&
Foam::donorSuitability::donorSuitability::coeffDict() const
{
return coeffDict_;
}
// ************************************************************************* //

View file

@ -26,7 +26,7 @@ Class
Description
An abstract base class for donor suitability algorithms. This class is
used by overlapFringe algorithm to optimise overlap given donor suitability
used by oversetFringe algorithm to optimise overlap given donor suitability
function.
Donor suitability criteria is given in isDonorSuitable member function. The
@ -43,6 +43,9 @@ SourceFiles
Author
Vuko Vukcevic, FMENA Zagreb. All rights reserved.
Contributor
Josip Katavic, FMENA Zagreb. All rights reserved.
\*---------------------------------------------------------------------------*/
#ifndef donorSuitability_H
@ -61,7 +64,7 @@ namespace Foam
{
// Forward declaration of classes
class overlapFringe;
class oversetFringe;
namespace donorSuitability
{
@ -74,8 +77,8 @@ class donorSuitability
{
// Private data
//- Reference to overlapFringe algorithm
const overlapFringe& overlapFringe_;
//- Reference to oversetFringe algorithm
const oversetFringe& oversetFringe_;
//- Subdictionary for acceptor set specification
const dictionary coeffDict_;
@ -141,10 +144,10 @@ public:
donorSuitability,
dictionary,
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
),
(overlapFringeAlgorithm, dict)
(oversetFringeAlgorithm, dict)
);
@ -153,7 +156,7 @@ public:
//- Construct from components
donorSuitability
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);
@ -163,13 +166,13 @@ public:
//- Return an autoPtr to the selected donorSuitability
static autoPtr<donorSuitability> New
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);
//- Destructor
// Note: the destructor is pure virtual to make this class abstract
// Note: the destructor is pure virtual to make this class abstract
virtual ~donorSuitability() = 0;
@ -177,23 +180,54 @@ public:
// Access
//- Return a const reference to overlapFringe algorithm
const overlapFringe& overlapFringeAlgorithm() const;
//- Return a const reference to oversetFringe algorithm
inline const oversetFringe& oversetFringeAlgorithm() const
{
return oversetFringe_;
}
//- Return coefficient dictionary
const dictionary& coeffDict() const;
inline const dictionary& coeffDict() const
{
return coeffDict_;
}
//- Return threshold
inline const scalar& threshold() const
{
return threshold_;
}
// Overlap minimisation via Donor Suitability Function
//- Is this donor/acceptor pair suitable
bool isDonorSuitable
//- Donor/acceptor pair suitability fraction.
// Subtract smaller DSF from the greater. Divide difference with
// greater DSF to get relative difference. Return relative
// difference (a value which is always between 0 and 1. Higher
// value means better suitability).
scalar suitabilityFraction
(
const donorAcceptor& daPair
) const
{
// Note: do not check whether a donor is valid (has been found)
// for this acceptor.
// Check whether the donor is valid for this pair
if (!daPair.donorFound())
{
FatalErrorIn
(
"scalar donorSuitability::suitabilityFraction"
"\n("
"\n const donorAcceptor& daPair"
"\n) const"
) << "Acceptor: " << daPair.acceptorCell()
<< " on processor: " << daPair.acceptorProcNo()
<< " did not find donor candidate."
<< nl
<< "Please review your fringe assembly settings"
<< " (or try using adaptiveOverlap fringe algorithm)."
<< abort(FatalError);
}
// Get donor suitability function in acceptor/donor pair
const scalar& dsfAcceptor =
@ -205,21 +239,24 @@ public:
// need to take the absolute value
if (dsfAcceptor > dsfDonor)
{
return
(
(dsfAcceptor - dsfDonor)/
(dsfAcceptor + SMALL)
) < threshold_;
return (1 - (dsfAcceptor - dsfDonor)/(dsfAcceptor + SMALL));
}
else
{
return
(
(dsfDonor - dsfAcceptor)/
(dsfDonor + SMALL)
) < threshold_;
return (1 - (dsfDonor - dsfAcceptor)/(dsfDonor + SMALL));
}
}
//- Is this donor/acceptor pair suitable?
// if sutabilityFraction > threshold
bool isDonorSuitable
(
const donorAcceptor& daPair
) const
{
return (suitabilityFraction(daPair)) > threshold_;
}
};

View file

@ -31,7 +31,7 @@ License
Foam::autoPtr<Foam::donorSuitability::donorSuitability>
Foam::donorSuitability::donorSuitability::New
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
{
@ -48,7 +48,7 @@ Foam::donorSuitability::donorSuitability::New
(
"donorSuitability::donorSuitability::New\n"
"(\n"
" const overlapFringe& overlapFringeAlgorithm,\n"
" const oversetFringe& oversetFringeAlgorithm,\n"
" const dictionary& dict\n"
")"
) << "Unknown donorSuitability type " << donorSuitabilityTypeName
@ -58,7 +58,7 @@ Foam::donorSuitability::donorSuitability::New
<< exit(FatalError);
}
return autoPtr<donorSuitability>(cstrIter()(overlapFringeAlgorithm, dict));
return autoPtr<donorSuitability>(cstrIter()(oversetFringeAlgorithm, dict));
}

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "faceArea.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
#include "oversetRegion.H"
#include "surfaceFields.H"
#include "addToRunTimeSelectionTable.H"
@ -51,14 +51,14 @@ addToRunTimeSelectionTable
Foam::donorSuitability::faceArea::faceArea
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
donorSuitability(overlapFringeAlgorithm, dict)
donorSuitability(oversetFringeAlgorithm, dict)
{
// Get fvMesh reference
const fvMesh& mesh = overlapFringeAlgorithm.mesh();
const fvMesh& mesh = oversetFringeAlgorithm.mesh();
// Get local donor suitability function using minium face area of a cell
scalarField localDsf(mesh.nCells(), GREAT);

View file

@ -70,7 +70,7 @@ public:
//- Construct from components
faceArea
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "noSuitability.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
#include "oversetRegion.H"
#include "addToRunTimeSelectionTable.H"
@ -45,18 +45,18 @@ addToRunTimeSelectionTable(donorSuitability, noSuitability, dictionary);
Foam::donorSuitability::noSuitability::noSuitability
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
donorSuitability(overlapFringeAlgorithm, dict)
donorSuitability(oversetFringeAlgorithm, dict)
{
// Need to initialise donor suitability function
const scalarField localDsf(overlapFringeAlgorithm.mesh().nCells(), 0);
const scalarField localDsf(oversetFringeAlgorithm.mesh().nCells(), 0);
this->combineDonorSuitabilityFunction(localDsf);
// Set threshold to dummy large value
this->threshold() = GREAT;
// Set threshold to SMALL such that all the pairs become suitable
this->threshold() = SMALL;
}

View file

@ -67,7 +67,7 @@ public:
//- Construct from components
noSuitability
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);

View file

@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "patchDistance.H"
#include "overlapFringe.H"
#include "oversetFringe.H"
#include "oversetRegion.H"
#include "patchWave.H"
#include "polyPatchID.H"
@ -52,14 +52,14 @@ addToRunTimeSelectionTable
Foam::donorSuitability::patchDistance::patchDistance
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
)
:
donorSuitability(overlapFringeAlgorithm, dict)
donorSuitability(oversetFringeAlgorithm, dict)
{
// Get reference to fvMesh
const fvMesh& mesh = overlapFringeAlgorithm.mesh();
const fvMesh& mesh = oversetFringeAlgorithm.mesh();
// Get distance patch names for master and donor regions
wordList masterRegionPatchNames =

View file

@ -71,7 +71,7 @@ public:
//- Construct from components
patchDistance
(
const overlapFringe& overlapFringeAlgorithm,
const oversetFringe& oversetFringeAlgorithm,
const dictionary& dict
);

View file

@ -41,6 +41,92 @@ namespace Foam
addToRunTimeSelectionTable(oversetFringe, overlapFringe, dictionary);
}
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
void Foam::overlapFringe::evaluateNonOversetBoundaries
(
volScalarField::GeometricBoundaryField& psib
)
{
// Code practically copy/pasted from GeometricBoundaryField::evaluateCoupled
// GeometricBoundaryField should be redesigned to accomodate for such needs
if
(
Pstream::defaultComms() == Pstream::blocking
|| Pstream::defaultComms() == Pstream::nonBlocking
)
{
forAll(psib, patchI)
{
// Get fvPatchField
fvPatchScalarField& psip = psib[patchI];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.initEvaluate(Pstream::defaultComms());
}
}
// Block for any outstanding requests
if (Pstream::defaultComms() == Pstream::nonBlocking)
{
IPstream::waitRequests();
OPstream::waitRequests();
}
forAll(psib, patchI)
{
// Get fvPatchField
fvPatchScalarField& psip = psib[patchI];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.evaluate(Pstream::defaultComms());
}
}
}
else if (Pstream::defaultComms() == Pstream::scheduled)
{
// Get the mesh by looking at first fvPatchField
const lduSchedule& patchSchedule =
psib[0].dimensionedInternalField().mesh().globalData().
patchSchedule();
forAll(patchSchedule, patchEvalI)
{
if (patchSchedule[patchEvalI].init)
{
// Get fvPatchField
fvPatchScalarField psip = psib[patchSchedule[patchEvalI].patch];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.initEvaluate(Pstream::scheduled);
}
}
else
{
// Get fvPatchField
fvPatchScalarField psip = psib[patchSchedule[patchEvalI].patch];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.evaluate(Pstream::scheduled);
}
}
}
}
else
{
FatalErrorIn("overlapFringe::evaluateNonOversetBoundaries()")
<< "Unsuported communications type "
<< Pstream::commsTypeNames[Pstream::defaultCommsType()]
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::overlapFringe::calcAddressing() const
@ -56,8 +142,8 @@ void Foam::overlapFringe::calcAddressing() const
// Algorithm:
// - Create indicator field for correct data exchange accross processor
// boundaries
// - Get holes from overset region and mark immediate neighbours of
// holes as acceptors
// - Get holes from overset region (and optionally from specified set)
// and mark immediate neighbours of holes as acceptors
// - Loop through (optionally) user specified patches for
// initialising the overlap fringe assembly, marking face cells
@ -102,9 +188,26 @@ void Foam::overlapFringe::calcAddressing() const
// holes)
boolList eligibleAcceptors(mesh.nCells(), true);
forAll (cutHoles, hI)
// Read user specified holes into allHoles list. Note: if the cell set
// is not found, the list will be empty
labelList allHoles
(
cellSet
(
mesh,
holesSetName_,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
).toc()
);
// Extend allHoles with cutHoles
allHoles.append(cutHoles);
// Mark all holes
forAll (allHoles, hI)
{
const label& holeCellI = cutHoles[hI];
const label& holeCellI = allHoles[hI];
// Mask eligible acceptors
eligibleAcceptors[holeCellI] = false;
@ -113,6 +216,7 @@ void Foam::overlapFringe::calcAddressing() const
processorIndicatorIn[holeCellI] = 1.0;
}
// Dynamic list for storing acceptors.
// Note 1: capacity set to number of cells (trading off memory for
// efficiency)
@ -120,11 +224,11 @@ void Foam::overlapFringe::calcAddressing() const
// mask
dynamicLabelList candidateAcceptors(mesh.nCells());
// Loop through cut holes and find acceptor candidates
forAll (cutHoles, hI)
// Loop through all holes and find acceptor candidates
forAll (allHoles, hI)
{
// Get neighbours of this hole cell
const labelList& hNbrs = cc[cutHoles[hI]];
const labelList& hNbrs = cc[allHoles[hI]];
// Loop through neighbours of this hole cell
forAll (hNbrs, nbrI)
@ -152,6 +256,7 @@ void Foam::overlapFringe::calcAddressing() const
// Get reference to region cell zone
const cellZone& rcz = region().zone();
// Loop through patches and mark face cells as eligible acceptors
forAll (initPatchNames_, nameI)
{
@ -242,6 +347,23 @@ void Foam::overlapFringe::calcAddressing() const
}
}
// Issue an error if no acceptors have been found for initial guess
if (returnReduce(candidateAcceptors.size(), sumOp<label>()) == 0)
{
FatalErrorIn
(
"void adaptiveOverlapFringe::calcAddressing() const"
) << "Did not find any acceptors to begin with."
<< "Check definition of adaptiveOverlap in oversetMeshDict"
<< " for region: " << this->region().name() << nl
<< "More specifically, check definition of:" << nl
<< "1. holePatches (mandatory entry)" << nl
<< "2. holes (optional entry)" << nl
<< "3. initPatchNames (optional entry)"
<< abort(FatalError);
}
// Now we have a decent first guess for acceptors that will be used as
// an initial condition for the iterative overlap assembly
// process.
@ -261,87 +383,6 @@ void Foam::overlapFringe::clearAddressing() const
}
void Foam::overlapFringe::evaluateNonOversetBoundaries
(
volScalarField::GeometricBoundaryField& psib
) const
{
// Code practically copy/pasted from GeometricBoundaryField::evaluateCoupled
// GeometricBoundaryField should be redesigned to accomodate for such needs
if
(
Pstream::defaultComms() == Pstream::blocking
|| Pstream::defaultComms() == Pstream::nonBlocking
)
{
forAll(psib, patchI)
{
// Get fvPatchField
fvPatchScalarField& psip = psib[patchI];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.initEvaluate(Pstream::defaultComms());
}
}
// Block for any outstanding requests
if (Pstream::defaultComms() == Pstream::nonBlocking)
{
IPstream::waitRequests();
OPstream::waitRequests();
}
forAll(psib, patchI)
{
// Get fvPatchField
fvPatchScalarField& psip = psib[patchI];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.evaluate(Pstream::defaultComms());
}
}
}
else if (Pstream::defaultComms() == Pstream::scheduled)
{
const lduSchedule& patchSchedule =
region().mesh().globalData().patchSchedule();
forAll(patchSchedule, patchEvalI)
{
if (patchSchedule[patchEvalI].init)
{
// Get fvPatchField
fvPatchScalarField psip = psib[patchSchedule[patchEvalI].patch];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.initEvaluate(Pstream::scheduled);
}
}
else
{
// Get fvPatchField
fvPatchScalarField psip = psib[patchSchedule[patchEvalI].patch];
if (psip.coupled() && !isA<oversetFvPatchScalarField>(psip))
{
psip.evaluate(Pstream::scheduled);
}
}
}
}
else
{
FatalErrorIn("overlapFringe::evaluateNonOversetBoundaries()")
<< "Unsuported communications type "
<< Pstream::commsTypeNames[Pstream::defaultCommsType()]
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from dictionary
@ -357,14 +398,16 @@ Foam::overlapFringe::overlapFringe
acceptorsPtr_(NULL),
finalDonorAcceptorsPtr_(NULL),
donorSuitability_
(
donorSuitability::donorSuitability::New(*this, dict)
),
holesSetName_(dict.lookupOrDefault<word>("holes", word())),
initPatchNames_
(
dict.lookupOrDefault<wordList>("initPatchNames", wordList())
),
donorSuitability_
(
donorSuitability::donorSuitability::New(*this, dict)
),
minGlobalFraction_
(
readScalar(dict.lookup("suitablePairFraction"))
@ -803,6 +846,15 @@ bool Foam::overlapFringe::updateIteration
}
}
if (returnReduce(newAcceptors.empty(), andOp<bool>()))
{
FatalErrorIn("overlapFringe::updateIteration()")
<< "Did not find any new candidate acceptors."
<< nl
<< "Please review your overlap fringe assembly settings."
<< abort(FatalError);
}
// Transfer back cumulative fringe holes into the fringeHolesPtr_
fringeHolesPtr_->transfer(cumFringeHoles);
@ -817,7 +869,6 @@ bool Foam::overlapFringe::updateIteration
}
const Foam::labelList& Foam::overlapFringe::fringeHoles() const
{
if (!fringeHolesPtr_)

View file

@ -39,9 +39,6 @@ Description
acceptor search from
- minGlobalFraction_: minimum allowable global fraction of suitable pairs
- cumulativeDonorAcceptorsPtr_: list of suitable donor/acceptor pairs
- cacheFringe_: switch to control whether to cache the fringe for next
mesh updates (start from latest suitable set of acceptors, rather than
from the beginning)
- fringeIter_: iteration counter
Member function updateIteration controls the iterative process:
@ -94,15 +91,24 @@ class overlapFringe
mutable donorAcceptorList* finalDonorAcceptorsPtr_;
// Optional initialization data
//- Name of the cell set defining initial holes (empty by default).
// Useful when the resolution of the background mesh is much
// coarser than the front mesh and no hole is found
const word holesSetName_;
//- Optional list of patches to start the iterative fringe assembly
// process (empty list by default). Useful when we actually have
// a hole as a patch in the background mesh
const wordList initPatchNames_;
// Data for iteration control
//- Run-time selectable donor/acceptor suitability handler
autoPtr<donorSuitability::donorSuitability> donorSuitability_;
//- List of patches to start the iterative fringe assembly process
// (empty list by default)
const wordList initPatchNames_;
//- Minimum global fraction of suitable donors. Iteration process
// stops if the calculated fraction is greater than the minimum
// allowable fraction
@ -120,25 +126,23 @@ class overlapFringe
// Private Member Functions
//- Disallow default bitwise copy construct
overlapFringe(const overlapFringe&);
// Copy control
//- Disallow default bitwise assignment
void operator=(const overlapFringe&);
//- Disallow default bitwise copy construct
overlapFringe(const overlapFringe&);
//- Disallow default bitwise assignment
void operator=(const overlapFringe&);
//- Calculate hole-acceptor addressing
void calcAddressing() const;
// Addressing calculation functions
//- Clear hole-acceptor addressing
void clearAddressing() const;
//- Calculate hole-acceptor addressing
void calcAddressing() const;
//- Clear hole-acceptor addressing
void clearAddressing() const;
//- Helper function used to evaluate coupled boundaries, excluding
// overset patch
void evaluateNonOversetBoundaries
(
volScalarField::GeometricBoundaryField& psib
) const;
public:
@ -146,6 +150,16 @@ public:
TypeName("overlap");
// Static Member Functions
//- Helper function used to evaluate coupled boundaries, excluding
// overset patch
static void evaluateNonOversetBoundaries
(
volScalarField::GeometricBoundaryField& psib
);
// Constructors
//- Construct from dictionary
@ -157,9 +171,8 @@ public:
);
// Destructor
virtual ~overlapFringe();
//- Destructor
virtual ~overlapFringe();
// Member Functions

View file

@ -35,7 +35,7 @@ SourceFiles
#ifndef oversetFvPatchField_H
#define oversetFvPatchField_H
#include "coupledFvPatchField.H"
#include "coupledFvPatchFields.H"
#include "oversetLduInterfaceField.H"
#include "oversetFvPatch.H"
#include "oversetMesh.H"

View file

@ -197,10 +197,11 @@ void Foam::oversetRegion::calcDonorAcceptorCells() const
// - cellSearch (depends on eligible donors).
if (!regionFoundSuitableOverlap)
{
deleteDemandDrivenData(curRegion.holeCellsPtr_);
deleteDemandDrivenData(curRegion.eligibleDonorCellsPtr_);
deleteDemandDrivenData(curRegion.cellSearchPtr_);
}
deleteDemandDrivenData(curRegion.holeCellsPtr_);
deleteDemandDrivenData(curRegion.eligibleDonorCellsPtr_);
}
} while (!foundGlobalOverlap);
@ -1164,14 +1165,17 @@ bool Foam::oversetRegion::updateDonorAcceptors() const
// Get index obtained by octree
const label donorCandidateIndex = pih.index();
// Whether acceptor is within donor's bounding box
const bool withinBB = mesh_.pointInCellBB
(
curP,
curDonors[donorCandidateIndex]
);
if
(
!daPair.donorFound()
|| mesh_.pointInCellBB
(
curP,
curDonors[donorCandidateIndex]
)
|| withinBB
|| (
mag(cc[curDonors[donorCandidateIndex]] - curP)
< mag(daPair.donorPoint() - curP)
@ -1183,7 +1187,8 @@ bool Foam::oversetRegion::updateDonorAcceptors() const
(
curDonors[donorCandidateIndex],
Pstream::myProcNo(),
cc[curDonors[donorCandidateIndex]]
cc[curDonors[donorCandidateIndex]],
withinBB
);
// Set extended donors
@ -1352,10 +1357,18 @@ bool Foam::oversetRegion::updateDonorAcceptors() const
{
// This acceptor has been previously visited, meaning we have to
// make a choice whether to update it or not. At this point, the
// choice will be based on least distance from acceptor cell centre
// to donor cell centre. Run-time selectable Donor Suitability
// Functions will be applied in oversetFringe
if (curDA.distance() < curDACombined.distance())
// choice will be based on:
// a) If this donor is within bounding box and the original one is
// not, prefer the new donor
// b) Otherwise prefert on e with least distance from acceptor cell
// centre to donor cell centre.
// Run-time selectable Donor Suitability Function will be applied
// in oversetFringe
if
(
(curDA.withinBB() && !curDACombined.withinBB())
|| (curDA.distance() < curDACombined.distance())
)
{
// This is a better candidate for the same acceptor, set donor
// accordingly
@ -1363,12 +1376,35 @@ bool Foam::oversetRegion::updateDonorAcceptors() const
(
curDA.donorCell(),
curDA.donorProcNo(),
curDA.donorPoint()
curDA.donorPoint(),
curDA.withinBB()
);
}
}
}
// Update withinBB flag if the donor is within bounding box of acceptor
// (previously we checked whether the acceptor is within bounding box of
// donor)
forAll (combinedDonorAcceptorList, daI)
{
donorAcceptor& curDA = combinedDonorAcceptorList[daI];
// If the acceptor is not within bounding box of donor, set the flag
// other way around
if (!curDA.withinBB())
{
curDA.setWithinBB
(
mesh_.pointInCellBB
(
curDA.donorPoint(),
curDA.acceptorCell()
)
);
}
}
// Check whether all acceptors have been visited. Used for testing/debugging
// parallel comms
if (oversetMesh::debug)

View file

@ -551,23 +551,23 @@ Foam::tmp<Foam::vectorField> Foam::tractionBoundaryGradient::snGrad
"((threeK*rho)*alpha)"
);
if (!incremental)
{
const fvPatchScalarField& DT =
patch.lookupPatchField<volScalarField, scalar>("DT");
if (incremental)
{
const fvPatchScalarField& DT =
patch.lookupPatchField<volScalarField, scalar>("DT");
gradient += n*threeKalpha*DT;
}
else
{
const fvPatchScalarField& T =
patch.lookupPatchField<volScalarField, scalar>("T");
gradient += n*threeKalpha*DT;
}
else
{
const fvPatchScalarField& T =
patch.lookupPatchField<volScalarField, scalar>("T");
const scalarField T0 =
thermo.T0()().boundaryField()[patch.index()];
const scalarField T0 =
thermo.T0()().boundaryField()[patch.index()];
gradient += n*threeKalpha*(T - T0);
}
gradient += n*threeKalpha*(T - T0);
}
}
// Higher order non-linear terms

View file

@ -21,7 +21,9 @@ surfaceFile "multipleOrifices.stl";
maxCellSize 5.0;
//boundaryCellSize 2.0;
boundaryCellSize 2.0;
minCellSize 1.0;
localRefinement
{
@ -40,15 +42,15 @@ localRefinement
cellSize 0.3;
}
"tubes.*"
{
cellSize 0.4;
}
// "tubes.*"
// {
// cellSize 0.6;
// }
}
boundaryLayers
{
nLayers 1;
nLayers 0;
}
renameBoundary

View file

@ -40,7 +40,7 @@ regions
donorSuitability
{
type cellVolumes;
threshold 0.99;
threshold 0.2;
}
}
}

View file

@ -40,7 +40,7 @@ regions
donorSuitability
{
type cellVolumes;
threshold 0.99;
threshold 0.2;
}
}
}

View file

@ -49,10 +49,10 @@ regions
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 40% within each other
type cellVolumes;
threshold 0.6;
threshold 0.4;
}
}
}
@ -79,10 +79,10 @@ regions
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 50% within each other
type cellVolumes;
threshold 0.6;
threshold 0.5;
}
}
}
@ -109,8 +109,8 @@ regions
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 40% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 40% within each other
type cellVolumes;
threshold 0.4;
}

View file

@ -62,7 +62,7 @@ boundaryField
airfoil
{
type nutWallFunction;
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;

View file

@ -12,6 +12,7 @@ cleanCase
\rm -rf surfaces
\rm -f *raw
\rm -rf logs nohup.out
\rm -rf postProcessing
mkdir constant/polyMesh
cp -r save 0

View file

@ -46,4 +46,4 @@ runApplication $application2
# Perform sampling
runApplication sample -latestTime
timeStep=$(grep "^endTime" system/controlDict | awk '{ print $2 }' | sed 's/;//g')
cp -v surfaces/$timeStep/p_solidWall.raw .
cp -v postProcessing/surfaces/$timeStep/p_solidWall.raw .

View file

@ -35,25 +35,26 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames ();
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 12; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// more than 20% of the larger cell
type cellVolumes;
threshold 0.6;
threshold 0.2;
}
}
}
@ -65,23 +66,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetMiddle);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.9;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 60% within each other
type cellVolumes;
threshold 0.6;
}
@ -95,23 +97,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetFront);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 40% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 40% within each other
type cellVolumes;
threshold 0.4;
}

View file

@ -62,7 +62,7 @@ boundaryField
airfoil
{
type nutWallFunction;
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;

View file

@ -62,7 +62,7 @@ boundaryField
airfoil
{
type nutWallFunction;
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;

View file

@ -12,6 +12,7 @@ cleanCase
\rm -rf surfaces
\rm -f *raw
\rm -rf logs nohup.out
\rm -rf postProcessing
mkdir constant/polyMesh
cp -r save 0

View file

@ -10,14 +10,14 @@ application2="simpleOversetFoam"
\cp -r ../oversetMeshes/backgroundMesh/constant/polyMesh constant/.
# Merge meshes and clean up
runApplication mergeMeshes .. explicitOverset . ../oversetMeshes/middleMesh
runApplication mergeMeshes .. implicitConservativeOverset . ../oversetMeshes/middleMesh
\rm -rf constant/polyMesh
\mv 1/polyMesh constant
rm -rf 1
\rm -f constant/polyMesh/pointZones constant/polyMesh/pointZones.gz constant/polyMesh/faceZones constant/polyMesh/faceZones.gz constant/polyMesh/cellZones constant/polyMesh/cellZones.gz
\mv log.mergeMeshes log.mergeMeshes-backgroundMiddle
runApplication mergeMeshes .. explicitOverset . ../oversetMeshes/frontMesh
runApplication mergeMeshes .. implicitConservativeOverset . ../oversetMeshes/frontMesh
\rm -rf constant/polyMesh
\mv 1/polyMesh constant
rm -rf 1
@ -46,4 +46,4 @@ runApplication $application2
# Perform sampling
runApplication sample -latestTime
timeStep=$(grep "^endTime" system/controlDict | awk '{ print $2 }' | sed 's/;//g')
cp -v surfaces/$timeStep/p_solidWall.raw .
cp -v postProcessing/surfaces/$timeStep/p_solidWall.raw .

View file

@ -35,25 +35,26 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames ();
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 12; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// more than 20% of the larger cell
type cellVolumes;
threshold 0.6;
threshold 0.2;
}
}
}
@ -65,23 +66,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetMiddle);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.9;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 60% within each other
type cellVolumes;
threshold 0.6;
}
@ -95,23 +97,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetFront);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 40% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 40% within each other
type cellVolumes;
threshold 0.4;
}

View file

@ -62,7 +62,7 @@ boundaryField
airfoil
{
type nutWallFunction;
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;

View file

@ -62,7 +62,7 @@ boundaryField
airfoil
{
type nutWallFunction;
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;

View file

@ -12,6 +12,7 @@ cleanCase
\rm -rf surfaces
\rm -f *raw
\rm -rf logs nohup.out
\rm -rf postProcessing
mkdir constant/polyMesh
cp -r save 0

View file

@ -10,14 +10,14 @@ application2="simpleOversetFoam"
\cp -r ../oversetMeshes/backgroundMesh/constant/polyMesh constant/.
# Merge meshes and clean up
runApplication mergeMeshes .. explicitOverset . ../oversetMeshes/middleMesh
runApplication mergeMeshes .. implicitNonConservativeOverset . ../oversetMeshes/middleMesh
\rm -rf constant/polyMesh
\mv 1/polyMesh constant
rm -rf 1
\rm -f constant/polyMesh/pointZones constant/polyMesh/pointZones.gz constant/polyMesh/faceZones constant/polyMesh/faceZones.gz constant/polyMesh/cellZones constant/polyMesh/cellZones.gz
\mv log.mergeMeshes log.mergeMeshes-backgroundMiddle
runApplication mergeMeshes .. explicitOverset . ../oversetMeshes/frontMesh
runApplication mergeMeshes .. implicitNonConservativeOverset . ../oversetMeshes/frontMesh
\rm -rf constant/polyMesh
\mv 1/polyMesh constant
rm -rf 1
@ -46,4 +46,4 @@ runApplication $application2
# Perform sampling
runApplication sample -latestTime
timeStep=$(grep "^endTime" system/controlDict | awk '{ print $2 }' | sed 's/;//g')
cp -v surfaces/$timeStep/p_solidWall.raw .
cp -v postProcessing/surfaces/$timeStep/p_solidWall.raw .

View file

@ -35,25 +35,26 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames ();
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 12; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// more than 20% of the larger cell
type cellVolumes;
threshold 0.6;
threshold 0.2;
}
}
}
@ -65,23 +66,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetMiddle);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.9;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 60% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 60% within each other
type cellVolumes;
threshold 0.6;
}
@ -95,23 +97,24 @@ regions
fringe
{
type overlap;
type adaptiveOverlap;
// Optional list of patches to start the fringe minimisation from
initPatchNames (OversetFront);
// Fraction of minimum allowable suitable pairs respecting the
// chosen donor suitability criteria
suitablePairFraction 0.8;
// Number of iterations for adaptive overlap search
specifiedIterationsNumber 5; // 5 by default
// Whether to start fringe assembly from the previous set of
// acceptors (for moving mesh cases)
cacheFringe no;
// Whether to try additional iterations
additionalIterations yes; // yes by default
// Orphan suitability
orphanSuitability 0; // 1 by default
donorSuitability
{
// Donor/acceptor pair must have cell volumes that differ not
// more than 40% of the larger cell
// Donor/acceptor pair must have cell volumes that are at least
// 40% within each other
type cellVolumes;
threshold 0.4;
}

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