diff --git a/bin/foamPackChanged b/bin/foamPackChanged new file mode 100755 index 0000000000000000000000000000000000000000..38fbb3855191aa3a61a78adcae9fa4d8be5da3db --- /dev/null +++ b/bin/foamPackChanged @@ -0,0 +1,110 @@ +#!/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 +# foamPackChanged <directory> <tarFile> +# +# Description +# Packs and compresses files that have a corresponding .orig file +# +#------------------------------------------------------------------------------ +tmpFile=${TMPDIR:-/tmp}/foamPackChanged.$$ + +if [ $# -ne 2 ]; then + echo "Usage : ${0##*/} directory tarFile" + echo "" + echo "Packs and compresses files that have a corresponding .orig file" + echo "" + exit 1 +fi + +# canonical form (no double and no trailing dashes) +packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@') +packFile=$2 + +if [ ! -d $packDir ]; then + echo "Error: directory $packDir does not exist" + exit 1 +fi + +# Clean up on termination and on Ctrl-C +trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT + +fileCount=0 +cat /dev/null > $tmpFile + +find -H $packDir \ + ! -type d \ + -type f \ + -name "*.orig" \ +| sed \ + -e "\@$packDir/lib/@d" \ + -e "\@$packDir/src/other/mico-*/platforms@d" \ + -e "\@$packDir/src/other/mpich-*/platforms@d" \ + -e "\@$packDir/src/other/mpich-*/lib@d" \ + -e "\@$packDir/src/other/lam-*/platforms@d" \ + -e "\@$packDir/src/other/openmpi-*/platforms@d" \ + -e '\@applications/bin/@d' \ + -e '\@/t/@d' \ + -e '\@Make[.A-Za-z]*/[^/]*/@d' \ + -e '\@[Dd]oxygen/html@d' \ + -e '\@[Dd]oxygen/latex@d' \ + -e '\@[Dd]oxygen/man@d' \ + -e "s@$packDir/*@@" \ + | \ + ( + while read file + do + (( fileCount=$fileCount + 1 )) + + file=${file%%.orig} + + if [ -f "$packDir/$file" ] + then + echo $fileCount $file + echo $packDir/$file >> $tmpFile + else + echo "[MISSING]" $file + fi + done + ) + +# file fileCount +fileCount=$(cat $tmpFile | wc -l) +echo "----------------------------------------------------------------------" +echo "pack $fileCount updated (non-.orig) files" + +tar -czpf $packFile --files-from $tmpFile + +if [ $? = 0 ] +then + echo "Finished packing changed files from $packDir into $packFile" +else + echo "Error: failure packing changed files from $packDir into $packFile" + rm -f $packFile 2>/dev/null +fi +echo "----------------------------------------------------------------------" + +# ---------------------------------------------------------------------------- diff --git a/bin/paraFoam.pvs b/bin/paraFoam.pvs new file mode 100644 index 0000000000000000000000000000000000000000..8cbca6dc411ede8c5239ecb8880b0b699a93165e --- /dev/null +++ b/bin/paraFoam.pvs @@ -0,0 +1,12 @@ +# ParaView State Version 2.2 + +set kw(vtkTemp2) [$Application GetMainWindow] +set kw(vtkTemp29) [$kw(vtkTemp2) GetMainView] +set kw(vtkTemp980) [$kw(vtkTemp2) GetAnimationManager] +[$kw(vtkTemp2) GetRotateCameraButton] SetState 1 +$kw(vtkTemp2) ChangeInteractorStyle 1 +set kw(vtkTemp840) [$kw(vtkTemp2) InitializeReadCustom "FoamReader" "%CASE%"] +$kw(vtkTemp2) ReadFileInformation $kw(vtkTemp840) "%CASE%" +$kw(vtkTemp2) FinalizeRead $kw(vtkTemp840) "%CASE%" +set kw(vtkTemp868) [$kw(vtkTemp840) GetPVWidget {Filename}] +$kw(vtkTemp868) SetValue "%CASE%" diff --git a/bin/tools/README b/bin/tools/README new file mode 100644 index 0000000000000000000000000000000000000000..c99723b20e19efb63e6e9dff7a312d9885a55edb --- /dev/null +++ b/bin/tools/README @@ -0,0 +1,2 @@ +Misc. tools for building applications, etc that are useful to have +but which don't really need to be in the PATH. diff --git a/bin/tools/buildParaView3.3 b/bin/tools/buildParaView3.3 new file mode 100755 index 0000000000000000000000000000000000000000..028320139df0e4b544a18e19c10969fbaa2d36c3 --- /dev/null +++ b/bin/tools/buildParaView3.3 @@ -0,0 +1,193 @@ +#!/bin/sh +set -x + +# ParaView 3.x build script +# - normally run from folder above source folder + +# use the version number and the installation location specified +# in etc/apps/paraview3/{bashrc,cshrc} +: ${ParaView_VERSION:=3.3} +: ${ParaView_INST_DIR:=$WM_PROJECT_INST_DIR/paraview-$ParaView_VERSION} + +#!!User: +# set to location of paraview sources and where to build paraview +# PARAVIEW_SRC_DIR=$WM_PROJECT_INST_DIR/src/other/ParaView3 +PARAVIEW_SRC_DIR=/data/cfd2/work/cfdadmin/cvs/ParaView3 +PARAVIEW_BUILD_DIR=$PARAVIEW_SRC_DIR/platforms + +# TODO: extract the version number from the CMakeLists.txt variables: +# PARAVIEW_VERSION_MAJOR, and PARAVIEW_VERSION_MINOR +# ParaView_VERSION="3.3" + +# SET(PARAVIEW_VERSION_MAJOR 3) +# SET(PARAVIEW_VERSION_MINOR 3) + +#!!User: +# select desired features, include Python whenever possible +VERBOSE=OFF +INCLUDE_MPI=OFF +MPI_MAX_PROCS=32 +INCLUDE_PYTHON=ON +INCLUDE_MESA=OFF + +# initialisation +oldpwd=$PWD +unset OBJ_ADD + +# always build shared libraries +CMAKE_VARIABLES="-DBUILD_SHARED_LIBS:BOOL=ON" + +if [ "$VERBOSE" = ON ]; then + CMAKE_VARIABLES="$CMAKE_VARIABLES -DCMAKE_VERBOSE_MAKEFILE=TRUE" +fi + +#**************************************************************************** +# FIX: Attempt to get around seg-fault when building documentation +#CMAKE_VARIABLES="$CMAKE_VARIABLES -BUILD_DOCUMENTATION-ADVANCED:INTERNAL=0" +#**************************************************************************** + +# set python specific options +# NOTE - you'll need both python and python-devel packages installed +# - might need to create a symbolic link to the python library +# - anything after the '.so' gets in the way... +# - might need to run cmake -> make twice to pick up all the links... +if [ "$INCLUDE_PYTHON" = ON ]; then + PYTHON_INCLUDE_DIR=/usr/include/python2.5 + PYTHON_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.5.so + + if [ -d "$PYTHON_INCLUDE_DIR" ]; then + OBJ_ADD="$OBJ_ADD-py" + 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 "non-existent PYTHON_INCLUDE_DIR: $PYTHON_INCLUDE_DIR" + fi +fi + +# set MPI specific options +if [ "$INCLUDE_MPI" = ON ]; then + case "$WM_MPLIB" in + OPENMPI) + MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include + MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so + MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun + ;; + LAM) + MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include + MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so + MPI_RUN=$LAM_ARCH_PATH/bin/mpirun + ;; + MPICH) + MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include + MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so + MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun + ;; + *) + unset INCLUDE_MPI + ;; + esac + + if [ "$INCLUDE_MPI" ]; then + OBJ_ADD="$OBJ_ADD-mpi" + 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" + else + echo "unknown/unsupported mpi: $WM_MPLIB" + fi +fi + +# set MESA specific options +if [ "$INCLUDE_MESA" = ON ]; then + MESA_INCLUDE_DIR=/usr/include/GL + MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so + + if [ -d "$MESA_INCLUDE_DIR" -a -f "$MESA_LIBRARY" ]; then + OBJ_ADD="$OBJ_ADD-mesa" + 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" + else + echo "no MESA information found ... skipping" + fi +fi + + +# finalize the build/install environment +PARAVIEW_OBJ_DIR=$PARAVIEW_BUILD_DIR/$WM_OPTIONS$OBJ_ADD +PARAVIEW_APP_DIR=$ParaView_INST_DIR/platforms/$WM_OPTIONS$OBJ_ADD + +# create paraview build folder +mkdir -p $PARAVIEW_OBJ_DIR +cd $PARAVIEW_OBJ_DIR + +# +# make paraview +# + +# provide a backdoor to skip cmake for repeated builds +if [ -z "$build_no_cmake" ] +then + cmake \ + -DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \ + $CMAKE_VARIABLES \ + $PARAVIEW_SRC_DIR +fi + + +if [ -r /proc/cpuinfo ]; then + WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l` + + [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8 + + make -j $WM_NCOMPPROCS +else + make +fi + + +if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then + echo "Info: Installation completed - proceeding to install" + make install + + # copy VTK headers to install directory + echo "Info: Copying VTK headers" + cp -r $PARAVIEW_SRC_DIR/VTK $PARAVIEW_APP_DIR + cp -r $PARAVIEW_OBJ_DIR/VTK/vtkConfigure.h $PARAVIEW_APP_DIR/VTK + cp -r $PARAVIEW_OBJ_DIR/VTK/vtkstd $PARAVIEW_APP_DIR/VTK + + # copy all .so files to the lib folder + # - NOTE: shouldn't be necessary - but some libs not copied over to the + # install folder +## echo "Info: Copying libs" +## cp $PARAVIEW_OBJ_DIR/bin/*.so* $PARAVIEW_APP_DIR/lib/paraview-$ParaView_VERSION + + echo "Info: Copying ParaViewConfig.cmake" + cp $PARAVIEW_OBJ_DIR/ParaViewConfig.cmake $PARAVIEW_APP_DIR + + if [ "$OBJ_ADD" ]; then + echo "Creating symbolic link in $ParaView_INST_DIR/platforms from $WM_OPTIONS$OBJ_ADD to $WM_OPTIONS" + ( cd $ParaView_INST_DIR/platforms && ln -s $WM_OPTIONS$OBJ_ADD $WM_OPTIONS ) + fi + + echo "Installation complete" + echo "Set environment variables:" + echo " - ParaView_DIR to $PARAVIEW_APP_DIR" + echo " - ParaView_INST_DIR to $PARAVIEW_APP_DIR" + echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN" + echo "Add $ParaView_INST_DIR/bin to PATH" + echo "Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH" + + echo "done." +else + echo "*** Error: Installation failed - see output window" +fi + +# finalisation +cd $oldpwd + +# ----------------------------------------------------------------- end-of-file diff --git a/src/OpenFOAM/interpolations/timeSeries/timeSeries.C b/src/OpenFOAM/interpolations/timeSeries/timeSeries.C new file mode 100644 index 0000000000000000000000000000000000000000..cd52424e32795e310f5e55f047f75a41c69e8b9c --- /dev/null +++ b/src/OpenFOAM/interpolations/timeSeries/timeSeries.C @@ -0,0 +1,402 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "timeSeries.H" +#include "Istream.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<typename T> +Foam::timeSeries<T>::timeSeries(const bounds bound) +: + List<Tuple2<scalar, T> >(), + bounding_(bound) +{} + + +template<typename T> +Foam::timeSeries<T>::timeSeries(const word& bound) +: + List<Tuple2<scalar, T> >(), + bounding_(timeSeries::WARN) +{ + bounding(bound); +} + + +template<typename T> +Foam::timeSeries<T>::timeSeries(Istream& is, const bounds bound) +: + List<Tuple2<scalar, T> >(is), + bounding_(bound) +{} + + +template<typename T> +Foam::timeSeries<T>::timeSeries(Istream& is, const word& bound) +: + List<Tuple2<scalar, T> >(is), + bounding_(timeSeries::WARN) +{ + bounding(bound); +} + + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<typename T> +Foam::timeSeries<T>::~timeSeries() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<typename T> +Foam::word Foam::timeSeries<T>::bounding() const +{ + word enumName("warn"); + + switch (bounding_) + { + case timeSeries::ERROR: + enumName = "error"; + break; + + case timeSeries::WARN: + enumName = "warn"; + break; + + case timeSeries::CLAMP: + enumName = "clamp"; + break; + + case timeSeries::REPEAT: + enumName = "repeat"; + break; + } + + return enumName; +} + + +template<typename T> +void Foam::timeSeries<T>::bounding(const word& bound) +{ + if (bound == "error") + { + bounding_ = timeSeries::ERROR; + } + else if (bound == "warn") + { + bounding_ = timeSeries::WARN; + } + else if (bound == "clamp") + { + bounding_ = timeSeries::CLAMP; + } + else if (bound == "repeat") + { + bounding_ = timeSeries::REPEAT; + } + else + { + WarningIn("Foam::timeSeries<T>::boundingEnum(const word&)") + << "bad bounding specifier " << bound << " using 'warn'" << endl; + + bounding_ = timeSeries::WARN; + } +} + + +template<typename T> +void Foam::timeSeries<T>::check() const +{ + label n = size(); + scalar prevTime = List<Tuple2<scalar, T> >::operator[](0).first(); + + for (label i = 1; i < n; ++i) + { + const scalar currTime = List<Tuple2<scalar, T> >::operator[](i).first(); + + // avoid duplicate times (divide-by-zero error) + if (currTime <= prevTime) + { + FatalErrorIn + ( + "Foam::timeSeries<T>::checkOrder() const" + ) << "out-of-order time: " + << currTime << " at index " << i << nl + << exit(FatalError); + } + prevTime = currTime; + } +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + + +template<typename T> +const Foam::Tuple2<Foam::scalar, T>& +Foam::timeSeries<T>::operator[](const label i) const +{ + label ii = i; + label n = size(); + + if (n <= 1) + { + ii = 0; + } + else if (ii < 0) + { + switch (bounding_) + { + case timeSeries::ERROR: + FatalErrorIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "index (" << ii << ") underflow" << nl + << exit(FatalError); + break; + + case timeSeries::WARN: + WarningIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "index (" << ii << ") underflow" << nl + << " Continuing with the first entry" + << endl; + // fall-through to 'CLAMP' + + case timeSeries::CLAMP: + ii = 0; + break; + + case timeSeries::REPEAT: + while (ii < 0) + { + ii += n; + } + break; + } + } + else if (ii >= n) + { + switch (bounding_) + { + case timeSeries::ERROR: + FatalErrorIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "index (" << ii << ") overflow" << nl + << exit(FatalError); + break; + + case timeSeries::WARN: + WarningIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "index (" << ii << ") overflow" << nl + << " Continuing with the last entry" + << endl; + // fall-through to 'CLAMP' + + case timeSeries::CLAMP: + ii = n - 1; + break; + + case timeSeries::REPEAT: + while (ii >= n) + { + ii -= n; + } + break; + } + } + + return List<Tuple2<scalar, T> >::operator[](ii); +} + + +template<typename T> +T Foam::timeSeries<T>::operator()(const scalar timeValue) const +{ + label n = size(); + + if (n <= 1) + { + return List<Tuple2<scalar, T> >::operator[](0).second(); + } + + scalar minTime = List<Tuple2<scalar, T> >::operator[](0).first(); + scalar maxTime = List<Tuple2<scalar, T> >::operator[](n-1).first(); + scalar lookupTime = timeValue; + + if (lookupTime < minTime) + { + switch (bounding_) + { + case timeSeries::ERROR: + FatalErrorIn + ( + "Foam::timeSeries<T>::operator[](const scalar) const" + ) << "time (" << lookupTime << ") underflow" << nl + << exit(FatalError); + break; + + case timeSeries::WARN: + WarningIn + ( + "Foam::timeSeries<T>::operator[](const scalar) const" + ) << "time (" << lookupTime << ") underflow" << nl + << " Continuing with the first entry" + << endl; + // fall-through to 'CLAMP' + + case timeSeries::CLAMP: + return List<Tuple2<scalar, T> >::operator[](0).second(); + break; + + case timeSeries::REPEAT: + // adjust lookupTime to >= 0 + while (lookupTime < 0) + { + lookupTime += maxTime; + } + break; + } + } + else if (lookupTime >= maxTime) + { + switch (bounding_) + { + case timeSeries::ERROR: + FatalErrorIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "time (" << lookupTime << ") overflow" << nl + << exit(FatalError); + break; + + case timeSeries::WARN: + WarningIn + ( + "Foam::timeSeries<T>::operator[](const label) const" + ) << "time (" << lookupTime << ") overflow" << nl + << " Continuing with the last entry" + << endl; + // fall-through to 'CLAMP' + + case timeSeries::CLAMP: + return List<Tuple2<scalar, T> >::operator[](n-1).second(); + break; + + case timeSeries::REPEAT: + // adjust lookupTime <= maxTime + while (lookupTime > maxTime) + { + lookupTime -= maxTime; + } + break; + } + } + + label lo = 0; + label hi = 0; + + // look for the correct range + for (label i = 0; i < n; ++i) + { + if (lookupTime >= List<Tuple2<scalar, T> >::operator[](i).first()) + { + lo = hi = i; + } + else + { + hi = i; + break; + } + } + + if (lo == hi) + { + // we are at the end of the table - or there is only a single entry + return List<Tuple2<scalar, T> >::operator[](hi).second(); + } + else if (hi == 0) + { + // this treatment should should only occur under these condition: + // -> the 'REPEAT' treatment + // -> (0 <= time <= minTime) + // -> minTime > 0 + // Use the value at maxTime as the value for time=0 + lo = n - 1; + + return + ( + List<Tuple2<scalar, T> >::operator[](lo).second() + + + ( + List<Tuple2<scalar, T> >::operator[](hi).second() + - List<Tuple2<scalar, T> >::operator[](lo).second() + ) + * (lookupTime / minTime) + ); + } + else + { + // normal interpolation + return + ( + List<Tuple2<scalar, T> >::operator[](lo).second() + + + ( + List<Tuple2<scalar, T> >::operator[](hi).second() + - List<Tuple2<scalar, T> >::operator[](lo).second() + ) + * + ( + lookupTime + - List<Tuple2<scalar, T> >::operator[](lo).first() + ) + / + ( + List<Tuple2<scalar, T> >::operator[](hi).first() + - List<Tuple2<scalar, T> >::operator[](lo).first() + ) + ); + } +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/interpolations/timeSeries/timeSeries.H b/src/OpenFOAM/interpolations/timeSeries/timeSeries.H new file mode 100644 index 0000000000000000000000000000000000000000..f581dafe500c23a03f3a830e32dc6b2070dc2764 --- /dev/null +++ b/src/OpenFOAM/interpolations/timeSeries/timeSeries.H @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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::timeSeries + +Description + A list of times and values. + The time values must be positive and monotonically increasing. + + The treatment of out-of-bounds values depends on the current setting + of bounding. + + If @a REPEAT bounding is in effect, the final time value is treated + as being equivalent to time=0 for the following periods. + +Note + - Accessing an empty list will result in an error. + - Accessing a list with a single element will always return the same value. + +SourceFiles + timeSeries.C + +\*---------------------------------------------------------------------------*/ + +#ifndef timeSeries_H +#define timeSeries_H + +#include "List.H" +#include "Tuple2.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class timeSeries Declaration +\*---------------------------------------------------------------------------*/ + +template<class T> +class timeSeries +: + public List<Tuple2<scalar, T> > +{ +public: + + // Public data types + + //- Enumeration for handling out-of-bound times + enum bounds + { + ERROR, /*!< Exit with a FatalError */ + WARN, /*!< Issue warning and clamp value (default) */ + CLAMP, /*!< Clamp value to the start/end value */ + REPEAT /*!< Treat as a repeating list */ + }; + +private: + + // Private data + + //- Enumeration for handling out-of-bound times + bounds bounding_; + +public: + + // Constructors + + //- Construct null, optionally with a given bounding + timeSeries(const bounds = timeSeries::WARN); + + //- Construct null with a given bounding + timeSeries(const word&); + + //- Construct from Istream, optionally with a given bounding + timeSeries(Istream&, const bounds = timeSeries::WARN); + + //- Construct from Istream with a given bounding + timeSeries(Istream&, const word&); + + // Destructor + + ~timeSeries(); + + // Member Functions + + // Access + + //- Return the size + label size() const + { + return List<Tuple2<scalar, T> >::size(); + } + + //- Return the out-of-bounds treatment as a word + word bounding() const; + + // Check + + //- Check that list is monotonically increasing + // Exit with a FatalError if there is a problem + void check() const; + + // Edit + + //- Set the out-of-bounds treatment from enum, return previous setting + bounds bounding(const bounds& bound) + { + bounds prev = bounding_; + bounding_ = bound; + return prev; + } + + //- Set the out-of-bounds treatment from word + void bounding(const word& bound); + + // Member Operators + + //- Return an element of constant Tuple2<scalar, T> + const Tuple2<scalar, T>& operator[](const label) const; + + //- Return an interpolated value + T operator()(const scalar) const; + +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "timeSeries.C" +#endif + +#endif +// ************************************************************************* // diff --git a/wmake/rules/linux64Gcc43/X b/wmake/rules/linux64Gcc43/X new file mode 100644 index 0000000000000000000000000000000000000000..5d1f9c5cc54b4689118c6f1f54f0a2d6d7a29827 --- /dev/null +++ b/wmake/rules/linux64Gcc43/X @@ -0,0 +1,3 @@ +XFLAGS = +XINC = $(XFLAGS) -I/usr/X11R6/include +XLIBS = -L/usr/X11R6/lib64 -lXext -lX11 diff --git a/wmake/rules/linux64Gcc43/c b/wmake/rules/linux64Gcc43/c new file mode 100644 index 0000000000000000000000000000000000000000..80bb80f32f7f8fbcde52fb290d9ec0ec7f0ea603 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c @@ -0,0 +1,16 @@ +.SUFFIXES: .c .h + +cWARN = -Wall + +cc = gcc -m64 + +include $(RULES)/c$(WM_COMPILE_OPTION) + +cFLAGS = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC + +ctoo = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@ + +LINK_LIBS = $(cDBUG) + +LINKLIBSO = $(cc) -shared +LINKEXE = $(cc) -Xlinker -z -Xlinker nodefs diff --git a/wmake/rules/linux64Gcc43/c++ b/wmake/rules/linux64Gcc43/c++ new file mode 100644 index 0000000000000000000000000000000000000000..36b5c29b20b6297dcc3d42dcc5b46342cd34a116 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++ @@ -0,0 +1,21 @@ +.SUFFIXES: .C .cxx .cc .cpp + +c++WARN = -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast + +CC = g++ -m64 + +include $(RULES)/c++$(WM_COMPILE_OPTION) + +ptFLAGS = -DNoRepository -ftemplate-depth-40 + +c++FLAGS = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC + +Ctoo = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@ +cxxtoo = $(Ctoo) +cctoo = $(Ctoo) +cpptoo = $(Ctoo) + +LINK_LIBS = $(c++DBUG) + +LINKLIBSO = $(CC) $(c++FLAGS) -shared +LINKEXE = $(CC) $(c++FLAGS) diff --git a/wmake/rules/linux64Gcc43/c++Debug b/wmake/rules/linux64Gcc43/c++Debug new file mode 100644 index 0000000000000000000000000000000000000000..19bdb9c3346fc7a69380dfedd6e7911fe220a965 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Debug @@ -0,0 +1,2 @@ +c++DBUG = -ggdb3 -DFULLDEBUG +c++OPT = -O0 -fdefault-inline diff --git a/wmake/rules/linux64Gcc43/c++Opt b/wmake/rules/linux64Gcc43/c++Opt new file mode 100644 index 0000000000000000000000000000000000000000..f19996b72da7dec07cabe27333dc4b083b5eff07 --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Opt @@ -0,0 +1,4 @@ +c++DBUG = +c++OPT = -march=opteron -O3 +#c++OPT = -march=nocona -O3 +# -ftree-vectorize -ftree-vectorizer-verbose=3 diff --git a/wmake/rules/linux64Gcc43/c++Prof b/wmake/rules/linux64Gcc43/c++Prof new file mode 100644 index 0000000000000000000000000000000000000000..3bda4dad55e898a8198f6e8bfe21e8d829d7230a --- /dev/null +++ b/wmake/rules/linux64Gcc43/c++Prof @@ -0,0 +1,2 @@ +c++DBUG = -pg +c++OPT = -O2 diff --git a/wmake/rules/linux64Gcc43/cDebug b/wmake/rules/linux64Gcc43/cDebug new file mode 100644 index 0000000000000000000000000000000000000000..72b638f458220e329d52b59e3566a3c807101f9d --- /dev/null +++ b/wmake/rules/linux64Gcc43/cDebug @@ -0,0 +1,2 @@ +cDBUG = -ggdb -DFULLDEBUG +cOPT = -O1 -fdefault-inline -finline-functions diff --git a/wmake/rules/linux64Gcc43/cOpt b/wmake/rules/linux64Gcc43/cOpt new file mode 100644 index 0000000000000000000000000000000000000000..7285a9de969b5bec20a2c21b3289e7788edf1865 --- /dev/null +++ b/wmake/rules/linux64Gcc43/cOpt @@ -0,0 +1,2 @@ +cDBUG = +cOPT = -march=opteron -O3 -fno-gcse diff --git a/wmake/rules/linux64Gcc43/cProf b/wmake/rules/linux64Gcc43/cProf new file mode 100644 index 0000000000000000000000000000000000000000..ca3ac9bf5f0cd61fe99e0f05fa1bd4bdf9fa6cf7 --- /dev/null +++ b/wmake/rules/linux64Gcc43/cProf @@ -0,0 +1,2 @@ +cDBUG = -pg +cOPT = -O2 diff --git a/wmake/rules/linux64Gcc43/dirToString b/wmake/rules/linux64Gcc43/dirToString new file mode 100755 index 0000000000000000000000000000000000000000..1f9e9266a6afac14ad47fa6507d0a988cbf31bbd Binary files /dev/null and b/wmake/rules/linux64Gcc43/dirToString differ diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general new file mode 100644 index 0000000000000000000000000000000000000000..11b48acc3fc0c67c177b464c70de18248881c12d --- /dev/null +++ b/wmake/rules/linux64Gcc43/general @@ -0,0 +1,11 @@ +CPP = /lib/cpp $(GFLAGS) +LD = ld -A64 + +PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl + +include $(GENERAL_RULES)/standard + +include $(RULES)/X +include $(RULES)/c +include $(RULES)/c++ +include $(GENERAL_RULES)/cint diff --git a/wmake/rules/linux64Gcc43/mplib b/wmake/rules/linux64Gcc43/mplib new file mode 100644 index 0000000000000000000000000000000000000000..8a84b4014695e82f55b709ed5144f4b528412137 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplib @@ -0,0 +1,3 @@ +PFLAGS = +PINC = +PLIBS = diff --git a/wmake/rules/linux64Gcc43/mplibGAMMA b/wmake/rules/linux64Gcc43/mplibGAMMA new file mode 100644 index 0000000000000000000000000000000000000000..dc67a60a0bfd9d66c3d4670af920161a3042b47a --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibGAMMA @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(GAMMA_ARCH_PATH)/include +PLIBS = -L$(GAMMA_ARCH_PATH)/lib -lgamma diff --git a/wmake/rules/linux64Gcc43/mplibLAM b/wmake/rules/linux64Gcc43/mplibLAM new file mode 100644 index 0000000000000000000000000000000000000000..ce18f75860143d24f9982db97cd1e4682cae4842 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibLAM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(LAM_ARCH_PATH)/include +PLIBS = -L$(LAM_ARCH_PATH)/lib -lmpi -llam -lpthread -lutil diff --git a/wmake/rules/linux64Gcc43/mplibMPICH b/wmake/rules/linux64Gcc43/mplibMPICH new file mode 100644 index 0000000000000000000000000000000000000000..d586ba3e0393d943de9ce15999a006eb1c50d329 --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibMPICH @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPICH_ARCH_PATH)/include +PLIBS = -L$(MPICH_ARCH_PATH)/lib -lmpich -lrt diff --git a/wmake/rules/linux64Gcc43/mplibMPICH-GM b/wmake/rules/linux64Gcc43/mplibMPICH-GM new file mode 100644 index 0000000000000000000000000000000000000000..74fd9658087b87a0648cfbc0d00e7a0e8606489d --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibMPICH-GM @@ -0,0 +1,3 @@ +PFLAGS = +PINC = -I$(MPICH_ARCH_PATH)/include +PLIBS = -L$(MPICH_ARCH_PATH)/lib -lmpich -L$(GM_LIB_PATH) -lgm diff --git a/wmake/rules/linux64Gcc43/mplibOPENMPI b/wmake/rules/linux64Gcc43/mplibOPENMPI new file mode 100644 index 0000000000000000000000000000000000000000..ea9b4d22993b4e43dd47994196ba8579d1dc51cc --- /dev/null +++ b/wmake/rules/linux64Gcc43/mplibOPENMPI @@ -0,0 +1,3 @@ +PFLAGS = -DOMPI_SKIP_MPICXX +PINC = -I$(OPENMPI_ARCH_PATH)/include +PLIBS = -L$(OPENMPI_ARCH_PATH)/lib -lmpi diff --git a/wmake/rules/linux64Gcc43/wmkdep b/wmake/rules/linux64Gcc43/wmkdep new file mode 100755 index 0000000000000000000000000000000000000000..002e73dea8fc1318429203a4d6982765c3e6f01b Binary files /dev/null and b/wmake/rules/linux64Gcc43/wmkdep differ