mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev/
This commit is contained in:
@ -1,156 +1,75 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM.
|
||||||
|
#
|
||||||
|
# OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
# option) any later version.
|
||||||
|
#
|
||||||
|
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
# for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# buildParaView
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Build and install ParaView
|
||||||
|
# - run from folder above source folder
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# ParaView 3.x build script
|
. $WM_PROJECT_DIR/bin/buildParaViewFunctions
|
||||||
# - run from folder above source folder
|
|
||||||
PARAVIEW_SRC="ParaView3.3-cvs"
|
PARAVIEW_SRC="ParaView3.3-cvs"
|
||||||
|
PARAVIEW_MAJOR_VERSION="3.2"
|
||||||
|
|
||||||
VERBOSE="OFF"
|
VERBOSE="OFF"
|
||||||
INCLUDE_MPI="ON"
|
INCLUDE_MPI="ON"
|
||||||
MPI_MAX_PROCS=32
|
MPI_MAX_PROCS=32
|
||||||
INCLUDE_PYTHON="ON"
|
INCLUDE_PYTHON="ON"
|
||||||
|
#PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
|
||||||
|
PYTHON_LIBRARY=""
|
||||||
INCLUDE_MESA="OFF"
|
INCLUDE_MESA="OFF"
|
||||||
|
|
||||||
# initialisation
|
|
||||||
CMAKE_VARIABLES=""
|
|
||||||
PWD=`pwd`
|
|
||||||
OBJ_ADD=""
|
|
||||||
|
|
||||||
# set general options
|
initialiseVariables
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DBUILD_SHARED_LIBS:BOOL=ON"
|
|
||||||
|
|
||||||
if [ "$VERBOSE" = "ON" ]; then
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DCMAKE_VERBOSE_MAKEFILE=TRUE"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# set MPI specific options
|
# set MPI specific options
|
||||||
if [ "$INCLUDE_MPI" = "ON" ]; then
|
if [ "$INCLUDE_MPI" = "ON" ]; then
|
||||||
OBJ_ADD="$OBJ_ADD-mpi"
|
addMpiSupport
|
||||||
|
|
||||||
if [ "$WM_MPLIB" = "OPENMPI" ]; then
|
|
||||||
MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include
|
|
||||||
MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so
|
|
||||||
MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun
|
|
||||||
elif [ "$WM_MPLIB" = "LAM" ]; then
|
|
||||||
MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include
|
|
||||||
MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so
|
|
||||||
MPI_RUN=$LAM_ARCH_PATH/bin/mpirun
|
|
||||||
elif [ "$WM_MPLIB" = "MPICH" ]; then
|
|
||||||
MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include
|
|
||||||
MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so
|
|
||||||
MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun
|
|
||||||
fi
|
|
||||||
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_USE_MPI=ON"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_USE_MPI=ON"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_INCLUDE_PATH=$MPI_INCLUDE_PATH"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_LIBRARY=$MPI_LIBRARY"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPIRUN_EXE=$MPI_RUN"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set python specific options
|
# set python specific options
|
||||||
if [ "$INCLUDE_PYTHON" = "ON" ]; then
|
if [ "$INCLUDE_PYTHON" = "ON" ]; then
|
||||||
WHICH_PYTHON=`which python`
|
addPythonSupport
|
||||||
if [ "$WHICH_PYTHON" != "" ]; then
|
|
||||||
OBJ_ADD="$OBJ_ADD-py"
|
|
||||||
|
|
||||||
PYTHON_LIBRARY=`ldd $WHICH_PYTHON | grep libpython | \
|
|
||||||
sed 's/.* => \(.*\) (.*/\1/'`
|
|
||||||
PYTHON_MAJOR_VERSION=`echo $PYTHON_LIBRARY | \
|
|
||||||
sed 's/.*libpython\(.*\).so.*/\1/'`
|
|
||||||
PYTHON_INCLUDE_DIR=/usr/include/python$PYTHON_MAJOR_VERSION
|
|
||||||
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_ENABLE_PYTHON=ON"
|
|
||||||
CMAKE_VARIABLES= \
|
|
||||||
"$CMAKE_VARIABLES -DPYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_DIR"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPYTHON_LIBRARY=$PYTHON_LIBRARY"
|
|
||||||
else
|
|
||||||
echo "*** Warning: Unable to determine python libray"
|
|
||||||
echo "*** De-activating python support"
|
|
||||||
INCLUDE_PYTHON="OFF"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set MESA specific options
|
# set MESA specific options
|
||||||
if [ "$INCLUDE_MESA" = "ON" ]; then
|
if [ "$INCLUDE_MESA" = "ON" ]; then
|
||||||
OBJ_ADD="$OBJ_ADD-mesa"
|
addMesaSupport
|
||||||
|
|
||||||
MESA_INCLUDE_DIR=/usr/include/GL
|
|
||||||
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
|
|
||||||
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_OPENGL_HAS_OSMESA=ON"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR"
|
|
||||||
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_LIBRARY=$MESA_LIBRARY"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set paraview environment
|
buildParaView
|
||||||
PARAVIEW_SRC_DIR=$PWD/$PARAVIEW_SRC
|
|
||||||
#PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
|
|
||||||
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS
|
|
||||||
|
|
||||||
# remove existing build folder if present
|
installParaView
|
||||||
if [ -e "$PARAVIEW_OBJ_DIR" ]; then
|
|
||||||
rm -rf $PARAVIEW_OBJ_DIR
|
|
||||||
fi
|
|
||||||
|
|
||||||
# create paraview build folder
|
|
||||||
mkdir -p $PARAVIEW_OBJ_DIR
|
|
||||||
cd $PARAVIEW_OBJ_DIR
|
|
||||||
|
|
||||||
echo "Building $PARAVIEW_SRC"
|
|
||||||
echo " MPI support : $INCLUDE_MPI"
|
|
||||||
echo " Python support : $INCLUDE_PYTHON"
|
|
||||||
echo " MESA support : $INCLUDE_MESA"
|
|
||||||
echo " Source : $PARAVIEW_SRC_DIR"
|
|
||||||
echo " Target : $PARAVIEW_OBJ_DIR"
|
|
||||||
|
|
||||||
# make paraview
|
|
||||||
cmake \
|
|
||||||
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
|
|
||||||
$CMAKE_VARIABLES \
|
|
||||||
$PARAVIEW_SRC_DIR
|
|
||||||
|
|
||||||
if [ -r /proc/cpuinfo ]; then
|
|
||||||
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
|
|
||||||
|
|
||||||
if [ $WM_NCOMPPROCS -gt 8 ]; then
|
|
||||||
WM_NCOMPPROCS=8
|
|
||||||
fi
|
|
||||||
|
|
||||||
make -j $WM_NCOMPPROCS
|
|
||||||
else
|
|
||||||
make
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
|
|
||||||
echo " Build complete"
|
|
||||||
|
|
||||||
# replace local links with ParaView_INST_DIR environment variables
|
|
||||||
echo " Replacing path hard links"
|
|
||||||
find . -iname \*.cmake -execdir sed -i \
|
|
||||||
"s,$PARAVIEW_SRC_DIR,\$ENV{ParaView_INST_DIR},g" {} ';' \
|
|
||||||
-print
|
|
||||||
|
|
||||||
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
|
|
||||||
echo " Creating paraview 3.2 soft link to /bin"
|
|
||||||
( mkdir lib && cd lib && ln -s ../bin paraview-3.2 )
|
|
||||||
|
|
||||||
# info on symlinks to screen
|
|
||||||
echo ""
|
|
||||||
echo " ---"
|
|
||||||
echo " Installation complete"
|
|
||||||
echo " Set environment variables:"
|
|
||||||
echo " - ParaView_INST_DIR to $PARAVIEW_SRC_DIR"
|
|
||||||
echo " - ParaView_DIR to $PARAVIEW_OBJ_DIR"
|
|
||||||
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
|
|
||||||
echo " Add $PARAVIEW_OBJ_DIR/bin to PATH"
|
|
||||||
#echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
|
|
||||||
echo " ---"
|
|
||||||
echo "done."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# finalisation
|
# finalisation
|
||||||
cd $PWD
|
cd $PWD
|
||||||
|
|
||||||
|
echo "done."
|
||||||
|
|
||||||
|
|||||||
221
bin/buildParaViewFunctions
Normal file
221
bin/buildParaViewFunctions
Normal file
@ -0,0 +1,221 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM.
|
||||||
|
#
|
||||||
|
# OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by the
|
||||||
|
# Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
# option) any later version.
|
||||||
|
#
|
||||||
|
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
# for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# buildParaViewFunctions
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# ParaView build/install helper functions
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
initialiseVariables ()
|
||||||
|
{
|
||||||
|
CMAKE_VARIABLES=""
|
||||||
|
PWD=`pwd`
|
||||||
|
OBJ_ADD=""
|
||||||
|
|
||||||
|
if [ "$VERBOSE" = "ON" ]; then
|
||||||
|
addCMakeVariable "CMAKE_VERBOSE_MAKEFILE=TRUE"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
addCMakeVariable ()
|
||||||
|
{
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "*** Error: addCMakeVariable()"
|
||||||
|
echo " No variable to add"
|
||||||
|
fi
|
||||||
|
|
||||||
|
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
addMpiSupport ()
|
||||||
|
{
|
||||||
|
OBJ_ADD="$OBJ_ADD-mpi"
|
||||||
|
|
||||||
|
# using OpenFOAM variables to identify location of MPI libraries
|
||||||
|
if [ "$WM_MPLIB" = "OPENMPI" ]; then
|
||||||
|
MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so
|
||||||
|
MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun
|
||||||
|
elif [ "$WM_MPLIB" = "LAM" ]; then
|
||||||
|
MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so
|
||||||
|
MPI_RUN=$LAM_ARCH_PATH/bin/mpirun
|
||||||
|
elif [ "$WM_MPLIB" = "MPICH" ]; then
|
||||||
|
MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so
|
||||||
|
MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun
|
||||||
|
fi
|
||||||
|
|
||||||
|
addCMakeVariable "VTK_USE_MPI=ON"
|
||||||
|
addCMakeVariable "PARAVIEW_USE_MPI=ON"
|
||||||
|
addCMakeVariable "MPI_INCLUDE_PATH=$MPI_INCLUDE_PATH"
|
||||||
|
addCMakeVariable "MPI_LIBRARY=$MPI_LIBRARY"
|
||||||
|
addCMakeVariable "VTK_MPIRUN_EXE=$MPI_RUN"
|
||||||
|
addCMakeVariable "VTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
addPythonSupport ()
|
||||||
|
{
|
||||||
|
WHICH_PYTHON=`which python`
|
||||||
|
if [ -n "$WHICH_PYTHON" ]; then
|
||||||
|
OBJ_ADD="$OBJ_ADD-py"
|
||||||
|
|
||||||
|
if [ -n "$PYTHON_LIBRARY" ]; then
|
||||||
|
# check $PYTHON_LIBRARY if it has been set
|
||||||
|
if [ ! -e "$PYTHON_LIBRARY" ]; then
|
||||||
|
echo "*** Error: libpython not found at location specified " \
|
||||||
|
"by PYTHON_LIBRARY: $PYTHON_LIBRARY"
|
||||||
|
echo " Please set the variable PYTHON_LIBRARY to the full"
|
||||||
|
echo " path to (and including) libpython, or deactivate"
|
||||||
|
echo " python support by setting INCLUDE_PYTHON=OFF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Try to obtain $PYTHON_LIBRARY if not set
|
||||||
|
# - assumes dynamically linked
|
||||||
|
PYTHON_LIBRARY=`ldd $WHICH_PYTHON | grep libpython | \
|
||||||
|
sed 's/.* => \(.*\) (.*/\1/'`
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -n "$PYTHON_LIBRARY" ]; then
|
||||||
|
echo "*** Error: Unable to determine path to python library."
|
||||||
|
echo " Please set the variable PYTHON_LIBRARY to the full"
|
||||||
|
echo " path to (and including) libpython, or deactivate"
|
||||||
|
echo " python support by setting INCLUDE_PYTHON=OFF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PYTHON_MAJOR_VERSION=`echo $PYTHON_LIBRARY | \
|
||||||
|
sed 's/.*libpython\(.*\).so.*/\1/'`
|
||||||
|
PYTHON_INCLUDE_DIR=/usr/include/python$PYTHON_MAJOR_VERSION
|
||||||
|
|
||||||
|
addCMakeVariable "PARAVIEW_ENABLE_PYTHON=ON"
|
||||||
|
addCMakeVariable "PYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_DIR"
|
||||||
|
addCMakeVariable "PYTHON_LIBRARY=$PYTHON_LIBRARY"
|
||||||
|
else
|
||||||
|
echo "*** Error: python not installed"
|
||||||
|
echo "*** De-activate python support by setting " \
|
||||||
|
"INCLUDE_PYTHON=OFF"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
addMesaSupport ()
|
||||||
|
{
|
||||||
|
OBJ_ADD="$OBJ_ADD-mesa"
|
||||||
|
|
||||||
|
MESA_INCLUDE_DIR=/usr/include/GL
|
||||||
|
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
|
||||||
|
|
||||||
|
addCMakeVariable "VTK_OPENGL_HAS_OSMESA=ON"
|
||||||
|
addCMakeVariable "OSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR"
|
||||||
|
addCMakeVariable "OSMESA_LIBRARY=$MESA_LIBRARY"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
buildParaView ()
|
||||||
|
{
|
||||||
|
# set general options
|
||||||
|
addCmakeVariable "DBUILD_SHARED_LIBS:BOOL=ON"
|
||||||
|
|
||||||
|
# set paraview environment
|
||||||
|
PARAVIEW_SRC_DIR=$PWD/$PARAVIEW_SRC
|
||||||
|
#PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
|
||||||
|
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS
|
||||||
|
|
||||||
|
# remove existing build folder if present
|
||||||
|
if [ -e "$PARAVIEW_OBJ_DIR" ]; then
|
||||||
|
rm -rf $PARAVIEW_OBJ_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create paraview build folder
|
||||||
|
mkdir -p $PARAVIEW_OBJ_DIR
|
||||||
|
cd $PARAVIEW_OBJ_DIR
|
||||||
|
|
||||||
|
echo "Building $PARAVIEW_SRC"
|
||||||
|
echo " MPI support : $INCLUDE_MPI"
|
||||||
|
echo " Python support : $INCLUDE_PYTHON"
|
||||||
|
echo " MESA support : $INCLUDE_MESA"
|
||||||
|
echo " Source : $PARAVIEW_SRC_DIR"
|
||||||
|
echo " Target : $PARAVIEW_OBJ_DIR"
|
||||||
|
|
||||||
|
# make paraview
|
||||||
|
cmake \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
|
||||||
|
$CMAKE_VARIABLES \
|
||||||
|
$PARAVIEW_SRC_DIR
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]; then
|
||||||
|
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
|
||||||
|
|
||||||
|
if [ $WM_NCOMPPROCS -gt 8 ]; then
|
||||||
|
WM_NCOMPPROCS=8
|
||||||
|
fi
|
||||||
|
|
||||||
|
make -j $WM_NCOMPPROCS
|
||||||
|
else
|
||||||
|
make
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
installParaView ()
|
||||||
|
{
|
||||||
|
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
|
||||||
|
echo " Build complete"
|
||||||
|
|
||||||
|
cd $PARAVIEW_OBJ_DIR
|
||||||
|
|
||||||
|
# replace local links with ParaView_INST_DIR environment variables
|
||||||
|
echo " Replacing path hard links"
|
||||||
|
find . -iname \*.cmake -execdir sed -i \
|
||||||
|
"s,$PARAVIEW_SRC_DIR,\$ENV{ParaView_INST_DIR},g" {} ';' \
|
||||||
|
-print
|
||||||
|
|
||||||
|
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
|
||||||
|
# - work-around for chosen install location
|
||||||
|
echo " Creating paraview $PARAVIEW_MAJOR_VERSION soft link to /bin"
|
||||||
|
( mkdir lib && cd lib && ln -s ../bin \
|
||||||
|
paraview-$PARAVIEW_MAJOR_VERSION )
|
||||||
|
|
||||||
|
# info on symlinks to screen
|
||||||
|
echo ""
|
||||||
|
echo " ---"
|
||||||
|
echo " Installation complete"
|
||||||
|
echo " Set environment variables:"
|
||||||
|
echo " - ParaView_INST_DIR to $PARAVIEW_SRC_DIR"
|
||||||
|
echo " - ParaView_DIR to $PARAVIEW_OBJ_DIR"
|
||||||
|
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
|
||||||
|
echo " Add $PARAVIEW_OBJ_DIR/bin to PATH"
|
||||||
|
#echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
|
||||||
|
echo " ---"
|
||||||
|
fi
|
||||||
|
}
|
||||||
@ -1,222 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by the
|
|
||||||
Free Software Foundation; either version 2 of the License, or (at your
|
|
||||||
option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "ComponentMixedPointPatchVectorField.H"
|
|
||||||
#include "PointPatchFieldMapper.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
void ComponentMixedPointPatchVectorField<PatchField, PointPatch>
|
|
||||||
::checkFieldSize() const
|
|
||||||
{
|
|
||||||
if
|
|
||||||
(
|
|
||||||
this->size() != this->patch().size()
|
|
||||||
|| refValue_.size() != this->patch().size()
|
|
||||||
|| valueFraction_.size() != this->patch().size()
|
|
||||||
)
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void ComponentMixedPointPatchVectorField::checkField() const"
|
|
||||||
) << "field does not correspond to patch. " << endl
|
|
||||||
<< "Field size: " << this->size()
|
|
||||||
<< " value size: " << refValue_.size()
|
|
||||||
<< " valueFraction size: " << valueFraction_.size()
|
|
||||||
<< " patch size: " << this->patch().size()
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
ComponentMixedPointPatchVectorField<PatchField, PointPatch>::
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const PointPatch& p,
|
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchField<vector>(p, iF),
|
|
||||||
refValue_(p.size()),
|
|
||||||
valueFraction_(p.size())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
ComponentMixedPointPatchVectorField<PatchField, PointPatch>::
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const PointPatch& p,
|
|
||||||
const DimensionedField<vector, pointMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchField<vector>(p, iF, dict),
|
|
||||||
refValue_("refValue", dict, p.size()),
|
|
||||||
valueFraction_("valueFraction", dict, p.size())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
ComponentMixedPointPatchVectorField<PatchField, PointPatch>::
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const ComponentMixedPointPatchVectorField<PatchField, PointPatch>& ptf,
|
|
||||||
const PointPatch& p,
|
|
||||||
const DimensionedField<vector, pointMesh>& iF,
|
|
||||||
const PointPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchField<vector>(ptf, iF),
|
|
||||||
refValue_(ptf.refValue_, mapper),
|
|
||||||
valueFraction_(ptf.valueFraction_, mapper)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
ComponentMixedPointPatchVectorField<PatchField, PointPatch>::
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const ComponentMixedPointPatchVectorField<PatchField, PointPatch>& ptf,
|
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchField<vector>(ptf, iF),
|
|
||||||
refValue_(ptf.refValue_),
|
|
||||||
valueFraction_(ptf.valueFraction_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
void ComponentMixedPointPatchVectorField<PatchField, PointPatch>::autoMap
|
|
||||||
(
|
|
||||||
const PointPatchFieldMapper& m
|
|
||||||
)
|
|
||||||
{
|
|
||||||
refValue_.autoMap(m);
|
|
||||||
valueFraction_.autoMap(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Grab the values using rmap
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
void ComponentMixedPointPatchVectorField<PatchField, PointPatch>::rmap
|
|
||||||
(
|
|
||||||
const PointPatchField<PatchField, PointPatch, vector>& ptf,
|
|
||||||
const labelList& addr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const ComponentMixedPointPatchVectorField& mptf =
|
|
||||||
refCast<const ComponentMixedPointPatchVectorField>(ptf);
|
|
||||||
|
|
||||||
refValue_.rmap(mptf.refValue_, addr);
|
|
||||||
valueFraction_.rmap(mptf.valueFraction_, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluate patch field
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
void ComponentMixedPointPatchVectorField<PatchField, PointPatch>::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
|
||||||
tmp<vectorField> internalValues = this->patchInternalField();
|
|
||||||
|
|
||||||
// Get internal field to insert values into
|
|
||||||
Field<vector>& iF = const_cast<vectorField&>(this->internalField());
|
|
||||||
|
|
||||||
vectorField values =
|
|
||||||
cmptMultiply(refValue_, valueFraction_)
|
|
||||||
+ cmptMultiply(internalValues, vector::one - valueFraction_);
|
|
||||||
|
|
||||||
this->setInInternalField(iF, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Write
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
void ComponentMixedPointPatchVectorField<PatchField, PointPatch>::
|
|
||||||
write(Ostream& os) const
|
|
||||||
{
|
|
||||||
PatchField<vector>::write(os);
|
|
||||||
refValue_.writeEntry("refValue", os);
|
|
||||||
valueFraction_.writeEntry("valueFraction", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,218 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd.
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by the
|
|
||||||
Free Software Foundation; either version 2 of the License, or (at your
|
|
||||||
option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::ComponentMixedPointPatchVectorField
|
|
||||||
|
|
||||||
Description
|
|
||||||
The boundary condition is a mix of a fixedValue and a zeroGradient
|
|
||||||
boundary condition, where a fixedValue/zeroGradient mix may be
|
|
||||||
different for each direction.
|
|
||||||
|
|
||||||
I am still not sure how to do the fixedValue-fixedGradient
|
|
||||||
combination.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
ComponentMixedPointPatchVectorField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef ComponentMixedPointPatchVectorField_H
|
|
||||||
#define ComponentMixedPointPatchVectorField_H
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class ComponentMixedPointPatchVectorField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template
|
|
||||||
<
|
|
||||||
template<class> class PatchField,
|
|
||||||
class PointPatch
|
|
||||||
>
|
|
||||||
class ComponentMixedPointPatchVectorField
|
|
||||||
:
|
|
||||||
public PatchField<vector>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Fraction vector of value used for boundary condition
|
|
||||||
vectorField refValue_;
|
|
||||||
|
|
||||||
//- Fraction vector of value used for boundary condition
|
|
||||||
vectorField valueFraction_;
|
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
|
||||||
|
|
||||||
void checkFieldSize() const;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("componentMixed");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const PointPatch&,
|
|
||||||
const DimensionedField<vector, pointMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const PointPatch&,
|
|
||||||
const DimensionedField<vector, pointMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given patchVectorField onto a new patch
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
|
|
||||||
const PointPatch&,
|
|
||||||
const DimensionedField<vector, pointMesh>&,
|
|
||||||
const PointPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual autoPtr<PatchField<vector> > clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<PatchField<vector> >
|
|
||||||
(
|
|
||||||
new ComponentMixedPointPatchVectorField
|
|
||||||
<PatchField, PointPatch>
|
|
||||||
(
|
|
||||||
*this
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
ComponentMixedPointPatchVectorField
|
|
||||||
(
|
|
||||||
const ComponentMixedPointPatchVectorField<PatchField, PointPatch>&,
|
|
||||||
const DimensionedField<vector, pointMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual autoPtr<PatchField<vector> > clone
|
|
||||||
(
|
|
||||||
const DimensionedField<vector, pointMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return autoPtr<PatchField<vector> >
|
|
||||||
(
|
|
||||||
new ComponentMixedPointPatchVectorField
|
|
||||||
<PatchField, PointPatch>
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Return defining fields
|
|
||||||
|
|
||||||
virtual vectorField& refValue()
|
|
||||||
{
|
|
||||||
return refValue_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const vectorField& refValue() const
|
|
||||||
{
|
|
||||||
return refValue_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
virtual vectorField& valueFraction()
|
|
||||||
{
|
|
||||||
return valueFraction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const vectorField& valueFraction() const
|
|
||||||
{
|
|
||||||
return valueFraction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
|
||||||
virtual void autoMap
|
|
||||||
(
|
|
||||||
const PointPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Reverse map the given PointPatchVectorField onto
|
|
||||||
// this PointPatchVectorField
|
|
||||||
virtual void rmap
|
|
||||||
(
|
|
||||||
const PointPatchField<PatchField, PointPatch, vector>&,
|
|
||||||
const labelList&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Insert boundary value into the internal field
|
|
||||||
virtual void evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType=Pstream::Pstream::blocking
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
# include "ComponentMixedPointPatchVectorField.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user