Merge in fixes

--HG--
branch : bgschaid/minorAdditionsBranch
This commit is contained in:
Bernhard F.W. Gschaider 2013-11-06 17:28:06 +01:00
commit 002822076a
1965 changed files with 1230122 additions and 1306288 deletions

16
.gitignore vendored
View file

@ -98,4 +98,20 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
# The following files are blacklisted because of a DMCA complaint by ANSYS.
src/lduSolvers/tools/PriorityArray.C
src/lduSolvers/tools/PriorityArray.H
src/lduSolvers/amg/amgPolicy/samgPolicy.C
src/lduSolvers/amg/amgPolicy/samgPolicy.H
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
# The following files are blacklisted because of a DMCA complaint by ANSYS.
src/lduSolvers/tools/PriorityArray.C
src/lduSolvers/tools/PriorityArray.H
src/lduSolvers/amg/amgPolicy/samgPolicy.C
src/lduSolvers/amg/amgPolicy/samgPolicy.H
src/lduSolvers/amg/amgPolicy/aamgPolicy.C
src/lduSolvers/amg/amgPolicy/aamgPolicy.H
# end-of-file

View file

@ -35,6 +35,31 @@ then
fi
fi
# Check whether we will be compiling cudaSolvers
if [ -f $CUDA_BIN_DIR/nvcc ]
then
echo
echo "Cuda compiler detected at $CUDA_BIN_DIR/nvcc;"
echo "cudaSolvers will be compiled by default."
echo
# If yes, check presence of $CUDA_ARCH
if [ -z "$CUDA_ARCH" ]
then
echo
echo "\$CUDA_ARCH is required by nvcc compiler but not set."
echo "Check section '-gpu-architecture' in 'man nvcc' for details."
echo
read -r -p "Proceed without compiling cudaSolvers? [Y/n] " response
if [[ $response =~ ^([nN][oO]|[nN])$ ]]
then
exit 0
fi
export CUDA_IGNORE
fi
echo "Cuda architecture set to: $CUDA_ARCH"
fi
# wmake is required for subsequent targets
( cd wmake/src && make )

View file

@ -50,7 +50,7 @@ echo ========================================
echo
# swak4foam
pkg=swak4Foam-0.2.0
pkg=swak4Foam-0.2.4
set -x
rm -rf $WM_THIRD_PARTY_DIR/rpmBuild/BUILD/${pkg}*
set +x

View file

@ -93,7 +93,7 @@ echo
#( rpm_make -p flex-2.5.35 -s flex-2.5.35.spec -u http://downloads.sourceforge.net/project/flex/flex/flex-2.5.35/flex-2.5.35.tar.gz )
# cmake
( rpm_make -p cmake-2.8.11 -s cmake-2.8.11.spec -u http://www.cmake.org/files/v2.8/cmake-2.8.11.tar.gz )
( rpm_make -p cmake-2.8.12 -s cmake-2.8.12.spec -u http://www.cmake.org/files/v2.8/cmake-2.8.12.tar.gz )
echo ========================================
echo Done ThirdParty AllMake: Stage1

View file

@ -68,7 +68,7 @@ then
#( rpm_make -p openmpi-1.4.1 -s openmpi-1.4.1.spec -u http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.1.tar.gz )
#( rpm_make -p openmpi-1.5 -s openmpi-1.5.spec -u http://www.open-mpi.org/software/ompi/v1.5/downloads/openmpi-1.5.tar.gz )
#( rpm_make -p openmpi-1.4.3 -s openmpi-1.4.3.spec -u http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.3.tar.gz )
( rpm_make -p openmpi-1.6.3 -s openmpi-1.6.3.spec -u http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.3.tar.gz )
( rpm_make -p openmpi-1.6.5 -s openmpi-1.6.5.spec -u http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.5.tar.gz )
else
echo "Using system installed OpenMPI"
echo ""

View file

@ -140,7 +140,7 @@ fi
# hwloc
if [ -z "$HWLOC_SYSTEM" ]
then
( rpm_make -p hwloc-1.7.1 -s hwloc-1.7.1.spec -u http://www.open-mpi.org/software/hwloc/v1.7/downloads/hwloc-1.7.1.tar.gz )
( rpm_make -p hwloc-1.7.2 -s hwloc-1.7.2.spec -u http://www.open-mpi.org/software/hwloc/v1.7/downloads/hwloc-1.7.2.tar.gz )
else
echo "Using system installed hwloc"
echo ""

View file

@ -95,8 +95,14 @@ Patch1: ParMGridGen-1.0.patch
%endif
%build
[ -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"
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
make -j $WM_NCOMPPROCS CC=$CC
%install
# Manual installation

View file

@ -0,0 +1,161 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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
#
# Script
# RPM spec file for cmake-2.8.12
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2010)
#
#------------------------------------------------------------------------------
# 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 2.8.12
%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/v2.8/
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}"
%endif
./configure \
--prefix=%{_installPrefix}
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
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 OpenFOAM
#
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,151 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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
#
# Script
# RPM spec file for hwloc-1.7.2
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2013)
#
#------------------------------------------------------------------------------
# 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 1.7.2
%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/v1.7/downloads/hwloc-1.7.2.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 OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
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 OpenFOAM
#
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

@ -102,11 +102,11 @@ Patch0: metis-5.0pre2_patch_darwin
%ifos darwin
# The parameter -D_POSIX_C_SOURCE=200809 has a side effect on Mac OS X
(cd GKlib/trunk && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC")
(cd libmetis && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC")
(cd GKlib/trunk && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC" CC=$CC)
(cd libmetis && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC" CC=$CC)
%else
(cd GKlib/trunk && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC -D_POSIX_C_SOURCE=200809")
(cd libmetis && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC -D_POSIX_C_SOURCE=200809")
(cd GKlib/trunk && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC -D_POSIX_C_SOURCE=200809" CC=$CC)
(cd libmetis && make -j $WM_NCOMPPROCS OPTFLAGS="-O3 -fPIC -D_POSIX_C_SOURCE=200809" CC=$CC)
%endif
%install

View file

@ -0,0 +1,249 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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
#
# Script
# RPM spec file for openmpi-1.6.3
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2013)
#
#------------------------------------------------------------------------------
# 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 1.6.5
%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.6/downloads
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"
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 \
--disable-static \
--disable-mpi-f77 \
--disable-mpi-f90 \
--disable-mpi-cxx \
--without-slurm \
--enable-mpi-profile $mpiWith \
--disable-vt
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
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 OpenFOAM 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 " OPAL_PREFIX : \$OPAL_PREFIX"
echo " PINC : \$PINC"
echo " PLIBS : \$PLIBS"
fi
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
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 OpenFOAM 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 " 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

@ -106,8 +106,8 @@ Patch0: scotch-5.1.10b_patch_0
%endif
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS scotch
make -j $WM_NCOMPPROCS ptscotch
make -j $WM_NCOMPPROCS scotch CC="$WM_CC" CXX="$WM_CXX" CCD="$WM_CC" CCS="$WM_CC" AR="$WM_CC"
make -j $WM_NCOMPPROCS ptscotch AR="$WM_CC"
%install
cd src

View file

@ -34,6 +34,8 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "objectRegistry.H"
#include "Time.H"
#include "ODESolver.H"
#include "sixDOFbodies.H"
#include "OFstream.H"

View file

@ -90,8 +90,8 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
{
# include "rhoEqn.H"
# include "UEqn.H"
# include "rhoEqn.H"
# include "UEqn.H"
# include "ftEqn.H"
# include "bEqn.H"
@ -106,8 +106,8 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "pEqn.H"
}
# include "pEqn.H"
}
turbulence->correct();
}

View file

@ -51,7 +51,7 @@ if (ign.ignited())
fvm::ddt(rho, b)
+ mvConvection->fvmDiv(phi, b)
+ fvm::div(phiSt, b, "div(phiSt,b)")
- fvm::Sp(fvc::div(phiSt), b)
+ fvm::SuSp(-fvc::div(phiSt), b)
- fvm::laplacian(turbulence->alphaEff(), b)
);
@ -65,7 +65,8 @@ if (ign.ignited())
// ~~~~~~~~~~~
bEqn.solve();
Info<< "min(b) = " << min(b).value() << endl;
Info<< "min(b) = " << min(b).value()
<< " max(b) = " << max(b).value() << endl;
// Calculate coefficients for Gulder's flame speed correlation
@ -138,7 +139,7 @@ if (ign.ignited())
(
fvm::ddt(rho, Su)
+ fvm::div(phi + phiXi, Su, "div(phiXi,Su)")
- fvm::Sp(fvc::div(phiXi), Su)
+ fvm::SuSp(-fvc::div(phiXi), Su)
==
- fvm::SuSp(-rho*Rc*Su0/Su, Su)
- fvm::SuSp(rho*(sigmas + Rc), Su)
@ -203,7 +204,7 @@ if (ign.ignited())
(
fvm::ddt(rho, Xi)
+ fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)")
- fvm::Sp(fvc::div(phiXi), Xi)
+ fvm::SuSp(-fvc::div(phiXi), Xi)
==
rho*R
- fvm::Sp(rho*(R - G), Xi)

View file

@ -30,7 +30,6 @@
const volScalarField& T = thermo.T();
Info<< "\nReading field U\n" << endl;
volVectorField U
(

View file

@ -4,7 +4,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../../../../src/equationReader/lnInclude
-I$(LIB_SRC)/equationReader/lnInclude
EXE_LIBS = \
-lincompressibleRASModels \

View file

@ -24,6 +24,8 @@ License
\*---------------------------------------------------------------------------*/
#include "objectRegistry.H"
#include "Time.H"
#include "regionProperties.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View file

@ -53,7 +53,7 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "readPISOControls.H"
#include "readPIMPLEControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "createMRFZones.H"
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readPIMPLEControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
@ -77,21 +77,26 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
#include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
// Pressure-velocity corrector
int oCorr = 0;
do
{
#include "pEqn.H"
}
twoPhaseProperties.correct();
#include "continuityErrs.H"
# include "alphaEqnSubCycle.H"
turbulence->correct();
# include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
{
# include "pEqn.H"
}
# include "continuityErrs.H"
turbulence->correct();
} while (++oCorr < nOuterCorr);
runTime.write();

View file

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createDynamicFvMesh.H"
# include "readGravitationalAcceleration.H"
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"
@ -96,31 +96,36 @@ int main(int argc, char *argv[])
# include "meshCourantNo.H"
}
twoPhaseProperties.correct();
# include "alphaEqnSubCycle.H"
# include "UEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
// Pressure-velocity corrector
int oCorr = 0;
do
{
# include "pEqn.H"
}
twoPhaseProperties.correct();
p = pd + rho*gh;
# include "alphaEqnSubCycle.H"
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
# include "UEqn.H"
turbulence->correct();
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}
p = pd + rho*gh;
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
turbulence->correct();
} while (++oCorr < nOuterCorr);
runTime.write();

View file

@ -1,14 +1,14 @@
# include "readTimeControls.H"
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
bool correctPhi = true;
if (piso.found("correctPhi"))
if (pimple.found("correctPhi"))
{
correctPhi = Switch(piso.lookup("correctPhi"));
correctPhi = Switch(pimple.lookup("correctPhi"));
}
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
if (pimple.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo"));
}

View file

@ -1,11 +1,11 @@
label nAlphaCorr
(
readLabel(piso.lookup("nAlphaCorr"))
readLabel(pimple.lookup("nAlphaCorr"))
);
label nAlphaSubCycles
(
readLabel(piso.lookup("nAlphaSubCycles"))
readLabel(pimple.lookup("nAlphaSubCycles"))
);
if (nAlphaSubCycles > 1)

View file

@ -49,17 +49,17 @@ Description
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "readGravitationalAcceleration.H"
#include "readPISOControls.H"
#include "initContinuityErrs.H"
#include "createFields.H"
#include "readTimeControls.H"
#include "correctPhi.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readGravitationalAcceleration.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "readTimeControls.H"
# include "correctPhi.H"
# include "CourantNo.H"
# include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,42 +67,47 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readPISOControls.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
# include "readPIMPLEControls.H"
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
twoPhaseProperties.correct();
#include "alphaEqnSubCycle.H"
#include "UEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
// Pressure-velocity corrector
int oCorr = 0;
do
{
#include "pEqn.H"
}
twoPhaseProperties.correct();
#include "continuityErrs.H"
# include "alphaEqnSubCycle.H"
p = pd + rho*gh;
# include "UEqn.H"
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}
turbulence->correct();
# include "continuityErrs.H"
p = pd + rho*gh;
if (pd.needReference())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pdRefCell)
);
}
turbulence->correct();
} while (++oCorr < nOuterCorr);
runTime.write();

View file

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createMesh.H"
# include "readGravitationalAcceleration.H"
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
# include "initContinuityErrs.H"
# include "createFields.H"
# include "createPorousZones.H"
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readPISOControls.H"
# include "readPIMPLEControls.H"
# include "readTimeControls.H"
# include "CourantNo.H"
# include "setDeltaT.H"
@ -79,21 +79,26 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
twoPhaseProperties.correct();
# include "alphaEqnSubCycle.H"
# include "UEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
// Pressure-velocity corrector
int oCorr = 0;
do
{
# include "pEqn.H"
}
twoPhaseProperties.correct();
# include "continuityErrs.H"
# include "alphaEqnSubCycle.H"
turbulence->correct();
# include "UEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}
# include "continuityErrs.H"
turbulence->correct();
} while (++oCorr < nOuterCorr);
runTime.write();

View file

@ -1,9 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso materialModels
wmake newStressedFoam
wmake newContactStressFoam

View file

@ -1,237 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2007 Hrvoje Jasak
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Class
componentReference
Description
Class contains data for a component reference as used in stress
analysis solvers.
SourceFiles
componentReferenceI.H
componentReference.C
componentReferenceIO.C
\*---------------------------------------------------------------------------*/
#ifndef componentReference_H
#define componentReference_H
#include "polyPatchID.H"
#include "fvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class componentReference Declaration
\*---------------------------------------------------------------------------*/
class componentReference
{
// Private data
//- Patch ID
polyPatchID patchID_;
//- Face index
label faceIndex_;
//- Direction
direction dir_;
//- Value in direction
scalar value_;
// Private Member Functions
//- Create direction given a name
direction getDir(const dictionary& dict) const
{
word dirName(dict.lookup("direction"));
if (dirName == "x" || dirName == "X")
{
return vector::X;
}
else if (dirName == "y" || dirName == "Y")
{
return vector::Y;
}
else if (dirName == "z" || dirName == "Z")
{
return vector::Z;
}
else
{
FatalIOErrorIn
(
"vector::component componentReference::getComp("
"const word& dirName) const",
dict
) << "Direction " << dirName << " not recognised. Please "
<< "use x, y or z" << abort(FatalIOError);
// Dummy return to keep compiler happy
return vector::X;
}
}
//- Check if patch face is in range
void checkPatchFace(const fvMesh& mesh) const
{
if
(
!patchID_.active()
|| faceIndex_ >= mesh.boundaryMesh()[patchID_.index()].size()
)
{
FatalErrorIn
(
"void checkPatchFace(const componentReference::fvMesh&)"
"const"
) << "Non-existing patch or index out of range."
<< abort(FatalError);
}
}
public:
// Public classes
//- Class used for the read-construction of
// PtrLists of componentReference
class iNew
{
const fvMesh& mesh_;
public:
iNew(const fvMesh& mesh)
:
mesh_(mesh)
{}
autoPtr<componentReference> operator()(Istream& is) const
{
dictionary crDict(is);
autoPtr<componentReference> cr
(
new componentReference(mesh_, crDict)
);
return cr;
}
};
// Constructors
//- Construct from components
componentReference
(
const fvMesh& mesh,
const word& patchName,
const label faceIndex,
const direction dir,
const scalar value
)
:
patchID_(patchName, mesh.boundaryMesh()),
faceIndex_(faceIndex),
dir_(dir),
value_(value)
{
checkPatchFace(mesh);
}
//- Construct from dictionary
componentReference
(
const fvMesh& mesh,
const dictionary& dict
)
:
patchID_(dict.lookup("patch"), mesh.boundaryMesh()),
faceIndex_(readLabel(dict.lookup("face"))),
dir_(getDir(dict)),
value_(readScalar(dict.lookup("value")))
{
checkPatchFace(mesh);
}
//- Clone
autoPtr<componentReference> clone() const
{
return autoPtr<componentReference>(new componentReference(*this));
}
// Destructor - default
// Member Functions
//- Return patch index
label patchIndex() const
{
return patchID_.index();
}
//- Return face index
label faceIndex() const
{
return faceIndex_;
}
//- Return direction
direction dir() const
{
return dir_;
}
//- Return value
scalar value() const
{
return value_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -1,265 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2007 Hrvoje Jasak
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Description
\*---------------------------------------------------------------------------*/
#include "cohesiveLawFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "rheologyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedGradientFvPatchVectorField(p, iF),
cohesiveLawPtr_(NULL),
relaxationFactor_(1.0),
traction_(p.size(), vector::zero)
{}
cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchVectorField(p, iF),
cohesiveLawPtr_
(
cohesiveLaw::New(dict.lookup("cohesiveLaw"), dict).ptr()
),
relaxationFactor_(readScalar(dict.lookup("relaxationFactor"))),
traction_(p.size(), vector::zero)
{
fvPatchVectorField::operator=(patchInternalField());
gradient() = vector::zero;
}
cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
(
const cohesiveLawFvPatchVectorField& cpf
)
:
fixedGradientFvPatchVectorField(cpf),
cohesiveLawPtr_(cpf.cohesiveLawPtr_->clone().ptr()),
relaxationFactor_(cpf.relaxationFactor_),
traction_(cpf.traction_)
{}
cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
(
const cohesiveLawFvPatchVectorField& cpf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchVectorField(cpf, p, iF, mapper),
cohesiveLawPtr_(cpf.cohesiveLawPtr_->clone().ptr()),
relaxationFactor_(cpf.relaxationFactor_),
traction_(cpf.traction_, mapper)
{}
cohesiveLawFvPatchVectorField::cohesiveLawFvPatchVectorField
(
const cohesiveLawFvPatchVectorField& cpf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedGradientFvPatchVectorField(cpf, iF),
cohesiveLawPtr_(cpf.cohesiveLawPtr_->clone().ptr()),
relaxationFactor_(cpf.relaxationFactor_),
traction_(cpf.traction_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const cohesiveLaw& cohesiveLawFvPatchVectorField::law() const
{
if (!cohesiveLawPtr_)
{
FatalErrorIn
(
"const cohesiveLaw& cohesiveLawFvPatchVectorField::law() const"
) << "Law pointer not set" << abort(FatalError);
}
return *cohesiveLawPtr_;
}
void cohesiveLawFvPatchVectorField::autoMap
(
const fvPatchFieldMapper& m
)
{
if (cohesiveLawPtr_ == NULL)
{
FatalErrorIn("cohesiveFvPatchVectorField::autoMap")
<< "NULL cohesive law"
<< abort(FatalError);
}
fixedGradientFvPatchVectorField::autoMap(m);
traction_.autoMap(m);
}
// Reverse-map the given fvPatchField onto this fvPatchField
void cohesiveLawFvPatchVectorField::rmap
(
const fvPatchVectorField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchVectorField::rmap(ptf, addr);
const cohesiveLawFvPatchVectorField& dmptf =
refCast<const cohesiveLawFvPatchVectorField>(ptf);
// No need to grab the cohesive zone pointer more than once
if (!cohesiveLawPtr_)
{
cohesiveLawPtr_ = dmptf.cohesiveLawPtr_->clone().ptr();
relaxationFactor_ = dmptf.relaxationFactor_;
}
traction_.rmap(dmptf.traction_, addr);
}
// Update the coefficients associated with the patch field
void cohesiveLawFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
// Looking up rheology
const fvPatchField<scalar>& mu =
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchField<scalar>& lambda =
lookupPatchField<volScalarField, scalar>("lambda");
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
lookupPatchField<volTensorField, tensor>("grad(U)");
// Patch displacement
const vectorField& U = *this;
// Patch stress
tensorField sigma = mu*(gradU + gradU.T()) + I*(lambda*tr(gradU));
// Normal stress component
scalarField sigmaN = (n & (n & sigma));
scalarField delta = -(n & U);
label sizeByTwo = patch().size()/2;
for(label i = 0; i < sizeByTwo; i++)
{
scalar tmp = delta[i];
delta[i] += delta[sizeByTwo + i];
delta[sizeByTwo + i] += tmp;
}
forAll (traction_, faceI)
{
if (delta[faceI] < 0)
{
// Return from traction to symmetryPlane??
traction_[faceI] = law().sigmaMax().value()*n[faceI];
}
else if(delta[faceI] > law().deltaC().value())
{
// Traction free
traction_[faceI] = vector::zero;
}
else
{
// Calculate cohesive traction from cohesive zone model
traction_[faceI] = law().traction(delta[faceI])*n[faceI];
}
}
gradient() =
(
traction_
- (n & (mu*gradU.T() - (mu + lambda)*gradU))
- n*lambda*tr(gradU)
)/(2.0*mu + lambda);
fixedGradientFvPatchVectorField::updateCoeffs();
}
// Write
void cohesiveLawFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
traction_.writeEntry("traction", os);
os.writeKeyword("cohesiveLaw") << law().type()
<< token::END_STATEMENT << nl;
os.writeKeyword("relaxationFactor") << relaxationFactor_
<< token::END_STATEMENT << nl;
law().writeDict(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchVectorField, cohesiveLawFvPatchVectorField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -1,205 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\*---------------------------------------------------------------------------*/
#include "tractionDisplacementFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "rheologyModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
tractionDisplacementFvPatchVectorField::
tractionDisplacementFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedGradientFvPatchVectorField(p, iF),
UName_("undefined"),
rheologyName_("undefined"),
traction_(p.size(), vector::zero),
pressure_(p.size(), 0.0)
{
fvPatchVectorField::operator=(patchInternalField());
gradient() = vector::zero;
}
tractionDisplacementFvPatchVectorField::
tractionDisplacementFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedGradientFvPatchVectorField(p, iF),
UName_(dict.lookup("U")),
rheologyName_(dict.lookup("rheology")),
traction_("traction", dict, p.size()),
pressure_("pressure", dict, p.size())
{
fvPatchVectorField::operator=(patchInternalField());
gradient() = vector::zero;
Info << "rf: " << rheologyName_ << endl;
}
tractionDisplacementFvPatchVectorField::
tractionDisplacementFvPatchVectorField
(
const tractionDisplacementFvPatchVectorField& tdpvf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchVectorField(tdpvf, p, iF, mapper),
UName_(tdpvf.UName_),
rheologyName_(tdpvf.rheologyName_),
traction_(tdpvf.traction_, mapper),
pressure_(tdpvf.pressure_, mapper)
{}
tractionDisplacementFvPatchVectorField::
tractionDisplacementFvPatchVectorField
(
const tractionDisplacementFvPatchVectorField& tdpvf
)
:
fixedGradientFvPatchVectorField(tdpvf),
UName_(tdpvf.UName_),
rheologyName_(tdpvf.rheologyName_),
traction_(tdpvf.traction_),
pressure_(tdpvf.pressure_)
{}
tractionDisplacementFvPatchVectorField::
tractionDisplacementFvPatchVectorField
(
const tractionDisplacementFvPatchVectorField& tdpvf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedGradientFvPatchVectorField(tdpvf, iF),
UName_(tdpvf.UName_),
rheologyName_(tdpvf.rheologyName_),
traction_(tdpvf.traction_),
pressure_(tdpvf.pressure_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void tractionDisplacementFvPatchVectorField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedGradientFvPatchVectorField::autoMap(m);
traction_.autoMap(m);
pressure_.autoMap(m);
}
// Reverse-map the given fvPatchField onto this fvPatchField
void tractionDisplacementFvPatchVectorField::rmap
(
const fvPatchVectorField& ptf,
const labelList& addr
)
{
fixedGradientFvPatchVectorField::rmap(ptf, addr);
const tractionDisplacementFvPatchVectorField& dmptf =
refCast<const tractionDisplacementFvPatchVectorField>(ptf);
traction_.rmap(dmptf.traction_, addr);
pressure_.rmap(dmptf.pressure_, addr);
}
// Update the coefficients associated with the patch field
void tractionDisplacementFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
// Looking up rheology
const rheologyModel& rheology =
this->db().objectRegistry::lookupObject<rheologyModel>(rheologyName_);
const scalarField mu = rheology.mu()().boundaryField()[patch().index()];
const scalarField lambda =
rheology.lambda()().boundaryField()[patch().index()];
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
gradient() =
(
(traction_ - (pressure_)*n)
- (n & (mu*gradU.T() - (mu + lambda)*gradU))
- n*lambda*tr(gradU)
)/(2.0*mu + lambda);
fixedGradientFvPatchVectorField::updateCoeffs();
}
// Write
void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
os.writeKeyword("U") << UName_ << token::END_STATEMENT << nl;
os.writeKeyword("rheology") << rheologyName_ << token::END_STATEMENT << nl;
traction_.writeEntry("traction", os);
pressure_.writeEntry("pressure", os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField(fvPatchVectorField, tractionDisplacementFvPatchVectorField);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -3,18 +3,21 @@ cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso solidModels
wmake elasticContactIncrSolidFoam
wmake elasticContactNonLinULSolidFoam
wmake elasticContactSolidFoam
wmake elasticGravitySolidFoam
wmake elasticAcpSolidFoam
wmake elasticIncrAcpSolidFoam
wmake elasticIncrSolidFoam
wmake elasticNonLinIncrTLSolidFoam
wmake elasticNonLinTLSolidFoam
wmake elasticNonLinULSolidFoam
wmake elasticPlasticNonLinULSolidFoam
wmake elasticOrthoAcpSolidFoam
wmake elasticOrthoNonLinULSolidFoam
wmake elasticOrthoSolidFoam
wmake elasticPlasticSolidFoam
wmake elasticPlasticNonLinTLSolidFoam
wmake elasticPlasticNonLinULSolidFoam
wmake elasticSolidFoam
wmake elasticThermalSolidFoam
wmake icoFsiElasticNonLinULSolidFoam
wmake viscoElasticSolidFoam
(cd utilities; wmake all)

View file

@ -0,0 +1,19 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso materialModels
wmake stressedFoam
wmake contactStressFoam
wmake newStressedFoam
wmake newContactStressFoam
wmake stressFemFoam
wmake icoFsiFoam
wmake solidDisplacementFoam
wmake solidEquilibriumDisplacementFoam

View file

@ -109,7 +109,7 @@
Info<< "Reading contact patch IDs etc.\n" << endl;
const dictionary& contactPatchDict
(
mesh.solutionDict().subDict("contactPatch")
mesh.solutionDict().subDict("contactPatch")
);
label gradPatch(readLabel(contactPatchDict.lookup("gradPatchID")));
label dirPatch(readLabel(contactPatchDict.lookup("dirPatchID")));

View file

@ -2,14 +2,15 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
$(WM_DECOMP_INC) \
-I$(LIB_SRC)/tetFiniteElement/lnInclude \
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetMotionSolver/lnInclude \
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude \
EXE_LIBS = \
-lfiniteVolume \
-ldynamicFvMesh \
-ldynamicMesh \
-ltetFiniteElement \
-ltetMotionSolver \
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite
$(WM_DECOMP_LIBS) \
-llduSolvers

View file

@ -1,7 +1,7 @@
{
// SIMPLE loop
for (int corr = 0; corr < nCorr; corr++)
for (int corr=0; corr<nCorr; corr++)
{
fvVectorMatrix UEqn
(

View file

@ -169,7 +169,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
lookupPatchField<volTensorField, tensor>("grad(U)");
patch().lookupPatchField<volTensorField, tensor>("grad(U)");
gradient() =
(

View file

@ -213,7 +213,7 @@ void cohesiveZoneFvPatchVectorField::updateCoeffs()
rheology.lambda()().boundaryField()[patch().index()];
const fvPatchField<tensor>& gradU =
lookupPatchField<volTensorField, tensor>
patch().lookupPatchField<volTensorField, tensor>
(
"grad(" +UName_ + ")"
);

View file

@ -195,7 +195,7 @@ void nusseltFvPatchScalarField::updateCoeffs()
// Lookup temperature diffusivity of the patch
const fvPatchField<scalar>& DT =
this->lookupPatchField<volScalarField, scalar>(DTName_);
this->patch().lookupPatchField<volScalarField, scalar>(DTName_);
// Calculate flux
scalarField tempFlux = alpha_*(Tinternal - Tinf_);

View file

@ -68,7 +68,6 @@ tractionDisplacementFvPatchVectorField
traction_("traction", dict, p.size()),
pressure_("pressure", dict, p.size())
{
Info << "creating tractionDisplacement boundary" << endl;
fvPatchVectorField::operator=(patchInternalField());
gradient() = vector::zero;
Info << "rf: " << rheologyName_ << endl;
@ -182,6 +181,7 @@ void tractionDisplacementFvPatchVectorField::updateCoeffs()
fixedGradientFvPatchVectorField::updateCoeffs();
}
// Write
void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
{

View file

@ -180,7 +180,7 @@ void tractionDisplacementThermoFvPatchVectorField::updateCoeffs()
vectorField n = patch().nf();
const fvPatchField<tensor>& gradU =
lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
patch().lookupPatchField<volTensorField, tensor>("grad(" +UName_ + ")");
// Thermal component
@ -189,7 +189,7 @@ void tractionDisplacementThermoFvPatchVectorField::updateCoeffs()
this->db().objectRegistry::lookupObject<thermalModel>(thermoName_);
const fvPatchField<scalar>& T =
lookupPatchField<volScalarField, scalar>(TName_);
patch().lookupPatchField<volScalarField, scalar>(TName_);
const scalarField rhoThreeKalpha =
rheology.rho()().boundaryField()[patch().index()]*

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