Merge remote-tracking branch 'remotes/origin/mixingPlane_RC1'

Conflicts:
	ThirdParty/AllMake.stage1
	ThirdParty/AllMake.stage4
	applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options
	etc/settings.csh
	etc/settings.sh
	src/OpenFOAM/Make/files
	src/finiteVolume/Make/files
This commit is contained in:
Hrvoje Jasak 2012-04-25 10:49:05 +01:00
commit ad5af13ef9
495 changed files with 277310 additions and 157 deletions

View file

@ -4,10 +4,10 @@
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "OpenFOAM-1.6-ext_testing")
set(CTEST_PROJECT_NAME "OpenFOAM-1.6-ext")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "openfoam-extend.sourceforge.net")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.6-ext_testing")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=OpenFOAM-1.6-ext")
set(CTEST_DROP_SITE_CDASH TRUE)

6
ThirdParty/AllMake vendored
View file

@ -71,6 +71,12 @@ echo
# Running stage 4
./AllMake.stage4
# Running stage 5
# This stage depends on a properly compiled installation
# of OpenFOAM. On a brand new installation of OpenFOAM-1.6-ext,
# this stage should be called last in your compilation process
./AllMake.stage5
echo ========================================
echo Done ThirdParty Allwmake
echo ========================================

View file

@ -89,7 +89,8 @@ 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.5 -s cmake-2.8.5.spec -u http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz )
( rpm_make -p cmake-2.8.6 -s cmake-2.8.6.spec -u http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz )
echo ========================================
echo Done ThirdParty AllMake: Stage1

View file

@ -125,6 +125,17 @@ fi
# echo ""
#fi
# PyFoam
if [ -z "$PYFOAM_SYSTEM" ]
then
# ( rpm_make -p PyFoam-0.5.6 -s PyFoam-0.5.6.spec -u http://openfoamwiki.net/images/b/b8/PyFoam-0.5.6.tar.gz -n PyFoam-0.5.6-1.noarch -a noarch)
( rpm_make -p PyFoam-0.5.7 -s PyFoam-0.5.7.spec -u http://openfoamwiki.net/images/d/dc/PyFoam-0.5.7.tar.gz -n PyFoam-0.5.7-1.noarch -a noarch)
else
echo "Using system installed PyFoam"
echo ""
fi
echo ========================================
echo Done ThirdParty AllMake: Stage3
echo ========================================

View file

@ -56,10 +56,10 @@ echo Starting ThirdParty AllMake: Stage4
echo ========================================
echo
# qt-everywhere-opensource-src-4.7.0
# qt-everywhere-opensource-src-4.7.4
if [ ! -z "$QT_THIRD_PARTY" ]
then
( rpm_make -p qt-everywhere-opensource-src-4.7.0 -s qt-everywhere-opensource-src-4.7.0.spec -u http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.0.tar.gz )
( rpm_make -p qt-everywhere-opensource-src-4.7.4 -s qt-everywhere-opensource-src-4.7.4.spec -u http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.4.tar.gz )
else
echo "Using system installed QT"
echo ""
@ -73,7 +73,6 @@ then
if [ -d "$QT_BIN_DIR" -a -r "$QT_BIN_DIR"/qmake ]
then
# ( rpm_make -p ParaView-3.8.1 -s ParaView-3.8.1.spec -u http://www.paraview.org/files/v3.8/ParaView-3.8.1.tar.gz \
( rpm_make -p ParaView-3.12.0 -s ParaView-3.12.0.spec -u http://www.paraview.org/files/v3.12/ParaView-3.12.0.tar.gz \
-a --define='_qmakePath $QT_BIN_DIR/qmake'
)
@ -81,6 +80,7 @@ then
echo "WARNING: "
# echo "WARNING: Skipping the installation of ParaView-3.10.1."
echo "WARNING: Skipping the installation of ParaView-3.8.1."
# echo "WARNING: Skipping the installation of ParaView-3.14.1."
echo "WARNING: Please make sure the QT_BIN_DIR environment variable properly"
echo "WARNING: initialized in the file prefs.sh or prefs.csh"
echo "WARNING: The command \$QT_BIN_DIR/qmake needs to be valid"

113
ThirdParty/AllMake.stage5 vendored Executable file
View file

@ -0,0 +1,113 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake.stage5
#
# Description
# Build script for ThirdParty packages not requiring rpm packaging
#
#
# Requirements:
# 1: Your OpenFOAM environment must be properly initialized
# 2: OpenFOAM must already been compiled because swak4Foam depends on
# OpenFOAM include files and libraries
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# run from Third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
#------------------------------------------------------------------------------
echo "========================================"
echo "Starting ThirdParty AllMake: Stage5 "
echo "========================================"
echo
# swak4Foam - Version 0.2.0
# In fact, we are basically tracking the head branch from the Mercurial repository
# which is also replicated under the Breeder_1.7 section of the Subversion repository
#
if [ -z "$SWAK4FOAM_SYSTEM" ]
then
# Do we need to download the source code?
# We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
# We will not generate a rpm package, but all ThirdParty source code will be
# centralized under the same scratch area
if [ ! -e ./rpmBuild/BUILD/swak4Foam-0.2.0 ];
then
echo "Checking for a Mercurial client: hg"
command -v hg >/dev/null
if [ $? -eq 0 ];
then
echo "Using Mercurial/hg to download the source code for swak4Foam"
(cd ./rpmBuild/BUILD; hg clone http://openfoam-extend.hg.sourceforge.net:8000/hgroot/openfoam-extend/swak4Foam swak4Foam-0.2.0)
else
echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
command -v svn >/dev/null
if [ $? -eq 0 ];
then
echo "Using Subversion/svn to download the source code for swak4Foam"
(cd ./rpmBuild/BUILD; svn checkout https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.7/libraries/swak4Foam swak4Foam-0.2.0)
else
echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
exit -1
fi
fi
# We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
# If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
# comment out the next two lines
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
# We recompile everything
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; ./Allwclean; ./Allwmake)
else
echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-0.2.0"
echo "Please remove this directory if you want to refresh your installation of swak4Foam"
fi
echo ""
else
echo "Using system installed swak4Foam"
echo ""
fi
echo "========================================"
echo "Done ThirdParty AllMake: Stage5 "
echo "========================================"
echo
# ----------------------------------------------------------------- end-of-file

68
ThirdParty/AllMake.stage6 vendored Executable file
View file

@ -0,0 +1,68 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake.stage6
#
# Description
# Build script for ThirdParty packages located under LocalDev
#
#
# Requirements:
# 1: Your OpenFOAM environment must be properly initialized
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# run from Third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
#------------------------------------------------------------------------------
echo "========================================"
echo "Starting ThirdParty AllMake: Stage6 "
echo "========================================"
echo
# Local developments from Hydro-Quebec (Turbomachinery)
# Temporary solution until we find a more suitable place
# for this. MB
(cd ./LocalDev/Hydro-Quebec/PyFoam; ./AllMake)
echo "========================================"
echo "Done ThirdParty AllMake: Stage6 "
echo "========================================"
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -0,0 +1,73 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 3 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, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake
#
# Description
# Installation script for local development
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
command -v python -V >/dev/null
if [ ! $? -eq 0 ];
then
echo "Error: You need to install python in order to run these PyFoam scripts"
exit -1
fi
if [ -z "$PYFOAM_DIR" ]
then
echo "Error: Missing environment variable \$PYFOAM_DIR."
echo " Please execute the script ThirdParty/AllMake.stage5 to install PyFoam."
echo " Then, make sure to freshen your OpenFOAM environment by sourcing your main"
echo " OpenFOAM configuration file."
exit -1
fi
pythonVersion=$(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
set -x
# pyFoamChangeMixingPlaneBoundary.py
cp pyFoamChangeMixingPlaneBoundary.py $PYFOAM_DIR/bin
cp ChangeMixingPlaneBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
# pyFoamChangeGGIBoundary.py
# Same as pyFoamModifyGGIBoundary.py. We just harmonize the name with rest of PyFoam
cp pyFoamChangeGGIBoundary.py $PYFOAM_DIR/bin
cp ChangeGGIBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
set +x
echo ========================================
echo Done
echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -0,0 +1,156 @@
"""
Application-class that implements pyFoamChangeGGIBoundary.py
Modification of GGI and cyclicGGI interface parameters in
constant/polymesh/boundary file.
Author:
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
"""
from PyFoamApplication import PyFoamApplication
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from os import path
import sys
import re
class ChangeGGIBoundary(PyFoamApplication):
def __init__(self,args=None):
description="""\
Change GGI boundary condition parameters
"""
PyFoamApplication.__init__(self,
args=args,
description=description,
usage="%prog <caseDirectory> ggiPatchName",
interspersed=True,
changeVersion=False,
nr=2)
def addOptions(self):
self.parser.add_option("--shadowPatch",
action="store",
dest="shadowPatch",
default=None,
help='Name of the shadowPatch')
self.parser.add_option("--shadowName",
action="store",
dest="shadowName",
default=None,
help='Name of the shadowPatch. Deprecated. Use --shadowPatch instead')
self.parser.add_option("--zone",
action="store",
dest="zone",
default=None,
help='Name of the zone for the GGI patch')
self.parser.add_option("--patchZoneName",
action="store",
dest="patchZoneName",
default=None,
help='Name of the zone for the GGI patch. Deprecated. Use --zone instead')
self.parser.add_option("--bridgeOverlap",
action="store",
dest="bridgeOverlap",
default=None,
help='bridgeOverlap flag (on/off)')
self.parser.add_option("--bridgeOverlapFlag",
action="store",
dest="bridgeOverlapFlag",
default=None,
help='bridgeOverlap flag (on/off). Deprecated. Use --bridgeOverlap instead')
self.parser.add_option("--rotationAxis",
action="store",
dest="rotationAxis",
default=None,
help='rotation axis for cyclicGgi')
self.parser.add_option("--rotationAngle",
action="store",
dest="rotationAngle",
default=None,
help='rotation axis angle for cyclicGgi')
self.parser.add_option("--separationOffset",
action="store",
dest="separationOffset",
default=None,
help='separation offset for cyclicGgi')
self.parser.add_option("--test",
action="store_true",
default=False,
dest="test",
help="Only print the new boundary file")
def run(self):
fName=self.parser.getArgs()[0]
bName=self.parser.getArgs()[1]
boundary=ParsedParameterFile(path.join(".",fName,"constant","polyMesh","boundary"),debug=False,boundaryDict=True)
bnd=boundary.content
if type(bnd)!=list:
self.error("Problem with boundary file (not a list)")
found=False
for val in bnd:
if val==bName:
found=True
elif found:
bcType=val["type"]
if re.match("cyclicGgi", bcType)!= None or re.match("ggi", bcType)!= None:
if self.parser.getOptions().shadowPatch!=None:
shadowPatch=self.parser.getOptions().shadowPatch
val["shadowPatch"]=shadowPatch
if shadowPatch not in bnd:
self.error("\n Option --shadowPatch for patch:",bName,": there is no patch called",shadowPatch,"\n")
if self.parser.getOptions().zone!=None:
val["zone"]=self.parser.getOptions().zone
if self.parser.getOptions().bridgeOverlap!=None:
val["bridgeOverlap"]=self.parser.getOptions().bridgeOverlap
if val["type"]=="cyclicGgi":
if self.parser.getOptions().rotationAxis!=None:
val["rotationAxis"]=self.parser.getOptions().rotationAxis
if self.parser.getOptions().rotationAngle!=None:
val["rotationAngle"]=self.parser.getOptions().rotationAngle
if self.parser.getOptions().separationOffset!=None:
val["separationOffset"]=self.parser.getOptions().separationOffset
# Deprecated
if self.parser.getOptions().shadowName!=None:
self.warning("\n PatchName:",bName,": Option --shadowName is deprecated. Use --shadowPatch instead\n")
shadowName=self.parser.getOptions().shadowName
val["shadowPatch"]=shadowName
if shadowName not in bnd:
self.error("\n Option --shadowName for patch:",bName,": there is no patch called",shadowName,"\n")
# Deprecated
if self.parser.getOptions().patchZoneName!=None:
self.warning("\n PatchName:",bName,": Option --patchZoneName is deprecated. Use --zone instead\n")
val["zone"]=self.parser.getOptions().patchZoneName
# Deprecated
if self.parser.getOptions().bridgeOverlapFlag!=None:
self.warning("\n PatchName:",bName,": Option --bridgeOverlapFlag is deprecated. Use --bridgeOverlap instead\n")
val["bridgeOverlap"]=self.parser.getOptions().bridgeOverlapFlag
else:
print "Unsupported GGI type '",bcType,"' for patch",bName
break
if not found:
self.error("Boundary",bName,"not found in",bnd[::2])
if self.parser.getOptions().test:
print boundary
else:
boundary.writeFile()

View file

@ -0,0 +1,139 @@
"""
Application-class that implements pyFoamChangeMixingPlaneBoundary.py
Change various mixingPlane interface attributes in
constant/polymesh/boundary file.
Author:
Martin Beaudoin, Hydro-Quebec, 2012. All rights reserved
"""
from PyFoamApplication import PyFoamApplication
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from os import path
import sys
class ChangeMixingPlaneBoundary(PyFoamApplication):
def __init__(self,args=None):
description="""
Change MixingPlane boundary condition parameters
"""
PyFoamApplication.__init__(self,
args=args,
description=description,
usage="%prog <caseDirectory> mixingPlanePatchName",
interspersed=True,
changeVersion=False,
nr=2)
def addOptions(self):
self.parser.add_option("--shadowPatch",
action="store",
dest="shadowPatch",
default=None,
help='Name of the shadowPatch')
self.parser.add_option("--coordinateSystemName",
action="store",
dest="coordinateSystemName",
default="mixingCS",
help='coordinateSystemName (mixingCS)')
self.parser.add_option("--coordinateSystemType",
action="store",
dest="coordinateSystemType",
default=None,
help='coordinateSystemType (cyindrical/spherical)')
self.parser.add_option("--coordinateSystemOrigin",
action="store",
dest="coordinateSystemOrigin",
default=None,
help='origin for coordinate system of mixingPlane')
self.parser.add_option("--coordinateSystemE1",
action="store",
dest="coordinateSystemE1",
default=None,
help='axis E1 for coordinate system of mixingPlane')
self.parser.add_option("--coordinateSystemE3",
action="store",
dest="coordinateSystemE3",
default=None,
help='axis E3 for coordinate system of mixingPlane')
self.parser.add_option("--assembly",
action="store",
dest="assembly",
default=None,
help='Assembly (master|slave|both|userdefined')
self.parser.add_option("--orientation",
action="store",
dest="orientation",
default=None,
help='Orientation of profile (\
dirX_spanY| \
dirX_spanZ|dirY_spanX|dirY_spanZ|dirZ_spanX|dirZ_spanY|dirR_spanTheta|dirR_spanZ|dirTheta_spanZ|dirTheta_spanR|dirZ_spanTheta|dirZ_spanR|unknown)')
self.parser.add_option("--test",
action="store_true",
default=False,
dest="test",
help="Only print the new boundary file")
def run(self):
fName=self.parser.getArgs()[0]
bName=self.parser.getArgs()[1]
boundary=ParsedParameterFile(path.join(".",fName,"constant","polyMesh","boundary"),debug=False,boundaryDict=True)
bnd=boundary.content
if type(bnd)!=list:
print "Problem with boundary file (not a list)"
sys.exit(-1)
found=False
for val in bnd:
if val==bName:
found=True
elif found:
if val["type"]=="mixingPlane":
if self.parser.getOptions().shadowPatch!=None:
val["shadowPatch"]=self.parser.getOptions().shadowPatch
if self.parser.getOptions().orientation!=None:
val["orientation"]=self.parser.getOptions().orientation
if val.has_key("coordinateSystem")==False:
val["coordinateSystem"]={}
if self.parser.getOptions().coordinateSystemName!=None:
val["coordinateSystem"]["name"]=self.parser.getOptions().coordinateSystemName
if self.parser.getOptions().coordinateSystemType!=None:
val["coordinateSystem"]["type"]=self.parser.getOptions().coordinateSystemType
if self.parser.getOptions().coordinateSystemOrigin!=None:
val["coordinateSystem"]["origin"]=self.parser.getOptions().coordinateSystemOrigin
if self.parser.getOptions().coordinateSystemE1!=None:
val["coordinateSystem"]["e1"]=self.parser.getOptions().coordinateSystemE1
if self.parser.getOptions().coordinateSystemE3!=None:
val["coordinateSystem"]["e3"]=self.parser.getOptions().coordinateSystemE3
if self.parser.getOptions().assembly!=None:
val["assembly"]=self.parser.getOptions().assembly
if self.parser.getOptions().orientation!=None:
val["orientation"]=self.parser.getOptions().orientation
break
if not found:
print "Boundary",bName,"not found in",bnd[::2]
sys.exit(-1)
if self.parser.getOptions().test:
print boundary
else:
boundary.writeFile()

View file

@ -0,0 +1,6 @@
PyFoam scripts for handling GGI and mixingPlane cases.
--
Martin Beaudoin
Hydro-Quebec
April 2012

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
from PyFoam.Applications.ChangeGGIBoundary import ChangeGGIBoundary
ChangeGGIBoundary()

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
from PyFoam.Applications.ChangeMixingPlaneBoundary import ChangeMixingPlaneBoundary
ChangeMixingPlaneBoundary()

13
ThirdParty/LocalDev/Readme.txt vendored Normal file
View file

@ -0,0 +1,13 @@
This directory contains ThirdParty developments specific to the mixingPlane_RC1 branch.
Those developments might eventually find a more suitable home elsewhere.
Instead of spreading these developments around in various repositories, I find
it more convenient to regroup them under this directory.
So expect this ThirdParty/LocalDev directory to disappear eventually, once its
content will prove it usefulness.
--
Martin Beaudoin
Hydro-Quebec
April 2012

View file

@ -1,6 +1,18 @@
diff -ruN ParMGridGen-1.0_orig/MGridGen/IMlib/IMlib.h ParMGridGen-1.0/MGridGen/IMlib/IMlib.h
--- ParMGridGen-1.0_orig/MGridGen/IMlib/IMlib.h 2001-11-08 18:41:25.000000000 -0500
+++ ParMGridGen-1.0/MGridGen/IMlib/IMlib.h 2011-12-24 13:46:41.000000000 -0500
@@ -43,7 +43,7 @@
#ifdef DMALLOC
#include <dmalloc.h>
#else
-#include <malloc.h>
+#include <sys/malloc.h>
#endif
/*************************************************************************
diff -ruN ParMGridGen-1.0_orig/MGridGen/IMlib/Makefile ParMGridGen-1.0/MGridGen/IMlib/Makefile
--- ParMGridGen-1.0_orig/MGridGen/IMlib/Makefile 2001-12-04 17:46:56.000000000 -0500
+++ ParMGridGen-1.0/MGridGen/IMlib/Makefile 2010-10-31 17:29:25.000000000 -0400
+++ ParMGridGen-1.0/MGridGen/IMlib/Makefile 2011-12-24 13:24:17.000000000 -0500
@@ -33,7 +33,7 @@
.c.o:
$(CC) $(CFLAGS) -c $*.c
@ -16,10 +28,9 @@ diff -ruN ParMGridGen-1.0_orig/MGridGen/IMlib/Makefile ParMGridGen-1.0/MGridGen/
realclean:
- rm -f *.o ; rm -f ./libIMlib.a
+ rm -f *.o ; rm -f ./libIMlib.$(LIBEXT)
Binary files ParMGridGen-1.0_orig/MGridGen/IMlib/libIMlib.dylib and ParMGridGen-1.0/MGridGen/IMlib/libIMlib.dylib differ
diff -ruN ParMGridGen-1.0_orig/MGridGen/Lib/Makefile ParMGridGen-1.0/MGridGen/Lib/Makefile
--- ParMGridGen-1.0_orig/MGridGen/Lib/Makefile 2001-12-04 18:01:00.000000000 -0500
+++ ParMGridGen-1.0/MGridGen/Lib/Makefile 2010-10-31 17:29:25.000000000 -0400
+++ ParMGridGen-1.0/MGridGen/Lib/Makefile 2011-12-24 13:24:17.000000000 -0500
@@ -22,7 +22,7 @@
INCLUDES = -I./ -I$(IMLIBDIR) $(INCDIR)
CFLAGS = $(COPTIONS) $(OPTFLAGS) $(DEBUGFLAGS) $(INCLUDES)
@ -44,10 +55,21 @@ diff -ruN ParMGridGen-1.0_orig/MGridGen/Lib/Makefile ParMGridGen-1.0/MGridGen/Li
realclean:
- rm -f *.o ; rm -f ../../libmgrid.a
+ rm -f *.o ; rm -f ./libMGridGen.$(LIBEXT)
Binary files ParMGridGen-1.0_orig/MGridGen/Lib/libMGridGen.dylib and ParMGridGen-1.0/MGridGen/Lib/libMGridGen.dylib differ
diff -ruN ParMGridGen-1.0_orig/MGridGen/Lib/mgridgen.h ParMGridGen-1.0/MGridGen/Lib/mgridgen.h
--- ParMGridGen-1.0_orig/MGridGen/Lib/mgridgen.h 2001-11-08 18:41:25.000000000 -0500
+++ ParMGridGen-1.0/MGridGen/Lib/mgridgen.h 2011-12-24 13:48:18.000000000 -0500
@@ -26,7 +26,7 @@
#ifdef DMALLOC
#include <dmalloc.h>
#else
-#include <malloc.h>
+#include <sys/malloc.h>
#endif
#include "defs.h"
diff -ruN ParMGridGen-1.0_orig/MGridGen/Programs/Makefile ParMGridGen-1.0/MGridGen/Programs/Makefile
--- ParMGridGen-1.0_orig/MGridGen/Programs/Makefile 2001-12-04 18:02:26.000000000 -0500
+++ ParMGridGen-1.0/MGridGen/Programs/Makefile 2010-10-31 17:29:25.000000000 -0400
+++ ParMGridGen-1.0/MGridGen/Programs/Makefile 2011-12-24 13:24:17.000000000 -0500
@@ -1,6 +1,6 @@
include ../../Makefile.in
@ -57,8 +79,16 @@ diff -ruN ParMGridGen-1.0_orig/MGridGen/Programs/Makefile ParMGridGen-1.0/MGridG
ifeq ($(ddmalloc),yes)
DEBUGFLAGS := $(DEBUGFLAGS) -DDMALLOC -DDEBUG
diff -ruN ParMGridGen-1.0_orig/Makefile.in ParMGridGen-1.0/Makefile.in
--- ParMGridGen-1.0_orig/Makefile.in 2001-12-04 19:30:33.000000000 -0500
+++ ParMGridGen-1.0/Makefile.in 2010-10-31 17:30:58.000000000 -0400
--- ParMGridGen-1.0_orig/Makefile.in 2011-12-24 13:54:44.000000000 -0500
+++ ParMGridGen-1.0/Makefile.in 2011-12-24 13:49:26.000000000 -0500
@@ -1,6 +1,6 @@
#--------------------------------------------------------------------------
# Which make to use
-make = gmake
+make = make
# Which compiler to use
# CC is the compiler for the serial code
@@ -12,7 +12,7 @@
OPTFLAGS = -O3
@ -72,8 +102,9 @@ diff -ruN ParMGridGen-1.0_orig/Makefile.in ParMGridGen-1.0/Makefile.in
# In which directories to look for any additional libraries
LIBDIR = -L../.. \
- -L/usr/lib32/
+ -L../Lib \
-L/usr/lib32/
+ -L/usr/lib/
# Set some flags
DEBUGFLAGS =
@ -98,4 +129,3 @@ diff -ruN ParMGridGen-1.0_orig/Makefile.in ParMGridGen-1.0/Makefile.in
#--------------------------------------------------------------------------
#
Binary files ParMGridGen-1.0_orig/mgridgen and ParMGridGen-1.0/mgridgen differ

View file

@ -1,6 +1,6 @@
diff -ruN ParMetis-3.1.1_orig/METISLib/Makefile ParMetis-3.1.1/METISLib/Makefile
--- ParMetis-3.1.1_orig/METISLib/Makefile 2007-03-19 13:46:34.000000000 -0400
+++ ParMetis-3.1.1/METISLib/Makefile 2010-10-31 17:13:46.000000000 -0400
+++ ParMetis-3.1.1/METISLib/Makefile 2011-12-24 15:06:49.000000000 -0500
@@ -19,7 +19,7 @@
.c.o:
$(CC) $(CFLAGS) -c $*.c
@ -19,10 +19,9 @@ diff -ruN ParMetis-3.1.1_orig/METISLib/Makefile ParMetis-3.1.1/METISLib/Makefile
checkin:
Binary files ParMetis-3.1.1_orig/METISLib/libmetis-parmetis.dylib and ParMetis-3.1.1/METISLib/libmetis-parmetis.dylib differ
diff -ruN ParMetis-3.1.1_orig/Makefile.in ParMetis-3.1.1/Makefile.in
--- ParMetis-3.1.1_orig/Makefile.in 2008-11-17 18:47:06.000000000 -0500
+++ ParMetis-3.1.1/Makefile.in 2010-10-31 17:20:54.000000000 -0400
+++ ParMetis-3.1.1/Makefile.in 2011-12-24 15:06:49.000000000 -0500
@@ -10,7 +10,7 @@
INCDIR =
@ -51,7 +50,7 @@ diff -ruN ParMetis-3.1.1_orig/Makefile.in ParMetis-3.1.1/Makefile.in
VERNUM =
diff -ruN ParMetis-3.1.1_orig/ParMETISLib/Makefile ParMetis-3.1.1/ParMETISLib/Makefile
--- ParMetis-3.1.1_orig/ParMETISLib/Makefile 2008-11-17 17:43:23.000000000 -0500
+++ ParMetis-3.1.1/ParMETISLib/Makefile 2010-10-31 17:13:46.000000000 -0400
+++ ParMetis-3.1.1/ParMETISLib/Makefile 2011-12-24 15:06:49.000000000 -0500
@@ -22,7 +22,7 @@
$(CC) $(CFLAGS) -c $*.c
@ -70,10 +69,24 @@ diff -ruN ParMetis-3.1.1_orig/ParMETISLib/Makefile ParMetis-3.1.1/ParMETISLib/Ma
checkin:
Binary files ParMetis-3.1.1_orig/ParMETISLib/libparmetis.dylib and ParMetis-3.1.1/ParMETISLib/libparmetis.dylib differ
diff -ruN ParMetis-3.1.1_orig/ParMETISLib/stdheaders.h ParMetis-3.1.1/ParMETISLib/stdheaders.h
--- ParMetis-3.1.1_orig/ParMETISLib/stdheaders.h 2008-09-16 17:39:19.000000000 -0400
+++ ParMetis-3.1.1/ParMETISLib/stdheaders.h 2011-12-24 15:07:42.000000000 -0500
@@ -13,8 +13,11 @@
#include <stdio.h>
+#ifdef __STDC__
#include <stdlib.h>
+#else
#include <malloc.h>
+#endif
#include <string.h>
#include <ctype.h>
#include <math.h>
diff -ruN ParMetis-3.1.1_orig/Programs/Makefile ParMetis-3.1.1/Programs/Makefile
--- ParMetis-3.1.1_orig/Programs/Makefile 2008-11-17 18:47:06.000000000 -0500
+++ ParMetis-3.1.1/Programs/Makefile 2010-10-31 17:13:46.000000000 -0400
+++ ParMetis-3.1.1/Programs/Makefile 2011-12-24 15:06:49.000000000 -0500
@@ -6,9 +6,9 @@
CFLAGS = $(COPTIONS) $(OPTFLAGS) $(INCLUDES)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,16 @@
diff a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -403,6 +403,12 @@
DESTINATION ${PV_INSTALL_CMAKE_DIR}
COMPONENT Development)
+ # install ParaViewUse.cmake
+ INSTALL(
+ FILES ${ParaView_SOURCE_DIR}/ParaViewUse.cmake
+ DESTINATION ${PV_INSTALL_CMAKE_DIR}
+ COMPONENT Development)
+
# Re-configure for the install.
SET(SOURCE_TREE ${ParaView_SOURCE_DIR})
SET(BUILD_TREE ${ParaView_BINARY_DIR})

View file

@ -0,0 +1,12 @@
diff -ruN ParaView-3.14.1_orig/Applications/ParaView-3.14.1_extra_install_Darwin.cmake ParaView-3.14.1/Applications/ParaView-3.14.1_extra_install_Darwin.cmake
--- ParaView-3.14.1_orig/Applications/ParaView-3.14.1_extra_install_Darwin.cmake 1969-12-31 19:00:00.000000000 -0500
+++ ParaView-3.14.1/Applications/ParaView-3.14.1_extra_install_Darwin.cmake 2010-11-06 19:34:12.000000000 -0400
@@ -0,0 +1,8 @@
+#
+# Additional install rules for Mac OS X platforms
+#
+INSTALL (DIRECTORY ../../buildObj/bin/paraview.app
+ DESTINATION ${PV_INSTALL_BIN_DIR}
+ USE_SOURCE_PERMISSIONS
+ COMPONENT Runtime)
+

View file

@ -7,11 +7,12 @@ diff -ruN libccmio-2.6.1_orig/config/config.gnu.to.star libccmio-2.6.1/config/co
# $Id: config.gnu.to.star,v 1.4 2006/06/05 21:12:16 geoffp Exp $
@@ -34,6 +34,7 @@
@@ -34,6 +34,8 @@
x86_64-unknown-linux-gnu-null) echo linux64_2.4-x86-glibc_2.2.5 ;;
ppc64-unknown-linux-gnu-null) echo linux64_2.6-pwr4-glibc_2.3.3 ;;
i386-apple-darwin8-null) echo i386-apple-darwin8 ;;
+ i386-apple-darwin10-null) echo i386-apple-darwin10 ;;
+ i386-apple-darwin11-null) echo i386-apple-darwin11 ;;
*) echo unknown ;;
esac
@ -33,12 +34,15 @@ diff -ruN libccmio-2.6.1_orig/config/config.system libccmio-2.6.1/config/config.
# $Id: config.system,v 1.2 2005/09/29 22:19:19 geoffp Exp $
@@ -87,6 +87,9 @@
@@ -87,6 +87,12 @@
i386-apple-darwin8.11.1)
echo i386-apple-darwin8 ;;
+ i386-apple-darwin10.5.0 | i386-apple-darwin10.7.0 | i386-apple-darwin10.8.0)
+ echo i386-apple-darwin10 ;;
+
+ i386-apple-darwin11.2.0 )
+ echo i386-apple-darwin11 ;;
+
*)
echo unknown

View file

@ -73,7 +73,7 @@ License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis
URL: http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/OLD
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools

View file

@ -0,0 +1,289 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 ParaView-3.14.1
#
# 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 thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name ParaView
%define release %{_WM_OPTIONS}
%define version 3.14.1
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: ParaView
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.paraview.org/files/v3.14/
Source: %url/%{name}-%{version}-Source.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
Patch0: ParaView-3.14.1.patch_0_ParaView.git_0f43430
Patch1: ParaView-3.14.1.patch_1
Patch2: ParaView-3.14.1.patch_darwin
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
#--------------------------------------------------------------------------
#
# Here, we define default compiling options for cmake
#
# One can override the option on the commande line : --define='MACRO EXPR'
#
%{!?_withVerbose: %define _withVerbose false}
%{!?_withMesa: %define _withMesa false}
%{!?_withMPI: %define _withMPI false}
%{!?_withPython: %define _withPython false}
%{!?_withQt: %define _withQt true}
%{!?_qmakePath: %define _qmakePath Undefined}
%{!?_mesaIncludePath: %define _mesaIncludePath Undefined}
%{!?_mesaLibPath: %define _mesaLibPath Undefined}
%{!?_pythonLibPath: %define _pythonLibPath Undefined}
#--------------------------------------------------------------------------
%description
%{summary}
%prep
%setup -q -n ParaView-3.14.1-Source
# Patch from ParaView.git
# BUG #13065. CMake files were not being installed correctly.
%patch0 -p1
# Correction to BUG #13065.
%patch1 -p1
%ifos darwin
# Patch for proper install of paraview binary under Mac OS X
%patch2 -p1
%endif
%build
#
# set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
set +x
echo ""
echo "Compilation options:"
echo " _withVerbose : %{_withVerbose}"
echo " _withMesa : %{_withMesa}"
echo " _withMPI : %{_withMPI}"
echo " _withPython : %{_withPython}"
echo " _withQt : %{_withQt}"
echo " _qmakePath : %{_qmakePath}"
echo " _mesaIncludePath : %{_mesaIncludePath}"
echo " _mesaLibPath : %{_mesaLibPath}"
echo " _pythonLibPath : %{_pythonLibPath}"
echo ""
set -x
# start with these general settings
addCMakeVariable VTK_USE_TK:BOOL=OFF
addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF
addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release
# include development files in "make install"
addCMakeVariable PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON
# new alternative to "make HTMLDocumentation"
addCMakeVariable PARAVIEW_GENERATE_PROXY_DOCUMENTATION:BOOL=OFF
%ifos darwin
# Additional installation rules for Mac OS X
addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-%{version}-Source/Applications/ParaView-3.14.1_extra_install_Darwin.cmake
%endif
# Add the value of _qmakePath for QT_QMAKE_EXECUTABLE
addCMakeVariable QT_QMAKE_EXECUTABLE:FILEPATH=%{_qmakePath}
echo "CMAKE_VARIABLES: $CMAKE_VARIABLES"
mkdir -p ./buildObj
cd ./buildObj
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_installPrefix} \
$CMAKE_VARIABLES \
..
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
# On OpenSUSE, rpmbuild, will choke when detecting unreferenced symlinks
# created during installation.
# Qt version 4.6.3 will generate some unreferenced symlinks when
# ParaView is compiled and installed. By enabling the following
# environment variable, the command brp-symlink will still complain
# about missing link targets, but it won't stop rpmbuild from generating
# the final rpm.
# For all other Unix distros, this is a no-op.
export NO_BRP_STALE_LINK_ERROR=yes
cd buildObj
make install DESTDIR=$RPM_BUILD_ROOT
# 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 PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin
export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-3.14
export PARAVIEW_VERSION=%{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview_plugins
[ -d \$PARAVIEW_LIB_DIR/paraview-3.14 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-3.14
# Enable access to the package applications if present
[ -d \$PARAVIEW_BIN_DIR ] && _foamAddPath \$PARAVIEW_BIN_DIR
# Additional binary path if running on Mac OS X
[ -d \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ] && _foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin
setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-3.14
setenv PARAVIEW_VERSION %{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview_plugins
if ( -e \$PARAVIEW_BIN_DIR ) then
_foamAddPath \$PARAVIEW_BIN_DIR
endif
if ( -e \$PARAVIEW_LIB_DIR/paraview-3.14 ) then
_foamAddLib \$PARAVIEW_LIB_DIR/paraview-3.14
endif
# Additional binary path if running on Mac OS X
if ( -e \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ) then
_foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
# Make sure we clean the installation directory. Somehow, make install generates files there. Need to revisit this eventually.
(rm -rf %{_prefix}/packages/%{name}-%{version} )
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{_prefix}/packages/%{name}-%{version}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -206,7 +206,7 @@ cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin
export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-3.8
export PARAVIEW_VERSION=%{version}
@ -236,7 +236,7 @@ cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.cs
setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin
setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-3.8
setenv PARAVIEW_VERSION %{version}

View file

@ -0,0 +1,187 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 PyFoam-0.5.6
#
# Description
# RPM spec file for PyFoam version 0.5.6
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# 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 thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.5.6
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: http://openfoamwiki.net/images/b/b8/PyFoam-0.5.6.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# 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 PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
if ( -e \$PYFOAM_DIR/bin ) then
setenv PATH \$PYFOAM_DIR/bin:\$PATH
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,187 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 PyFoam-0.5.7
#
# Description
# RPM spec file for PyFoam version 0.5.7
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# 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 thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.5.7
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: http://openfoamwiki.net/images/d/dc/PyFoam-0.5.7.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# 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 PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
if ( -e \$PYFOAM_SITE_DIR/bin ) then
_foamAddPath \$PYFOAM_SITE_DIR/bin
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages:\$PYTHONPATH
if ( -e \$PYFOAM_DIR/bin ) then
setenv PATH \$PYFOAM_DIR/bin:\$PATH
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,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 cmake-2.8.6
#
# 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 thi 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.6
%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"
./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

@ -99,6 +99,7 @@ Patch0: libccmio-2.6.1.patch_0
%ifos darwin
# Missing configuration for Mac OS X 10
[ ! -d configi386-apple-darwin10 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin10
[ ! -d configi386-apple-darwin11 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin11
%endif
# Warning:
# 1: The name of the ADF library will be renamed to libadf_ccmio since this

View file

@ -0,0 +1,164 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / 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 qt-everywhere-opensource-src-4.7.4
#
# 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 thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name qt-everywhere-opensource-src
%define release %{_WM_OPTIONS}
%define version 4.7.4
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
%define _unpackaged_files_terminate_build 0
%define _missing_doc_files_terminate_build 0
BuildRoot: %{buildroot}
Summary: qt-everywhere-opensource-src
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src
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 \
-opensource --confirm-license=yes \
-release -shared \
-nomake examples -nomake demos \
--prefix=%{_installPrefix}
# Explicitely specify LD_LIBRARY_PATH so it can find QT own libraries
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/lib
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
# Makefiles generated by qmake do not to support the DESTDIR= option
# We need to use the INSTALL_ROOT= option instead
make install INSTALL_ROOT=$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 QT_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export QT_BIN_DIR=\$QT_DIR/bin
# Enable access to the runtime package applications
[ -d \$QT_BIN_DIR ] && _foamAddPath \$QT_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 QT_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv QT_BIN_DIR \$QT_DIR/bin
if ( -e \$QT_BIN_DIR ) then
_foamAddPath \$QT_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

@ -59,8 +59,9 @@ rpm_make()
_SPECFILE=''
_PACKAGE_URL=''
_ADDITIONALFLAGS=''
_RPMFILENAME=''
while getopts p:s:u:a: flags
while getopts p:s:u:f:n:a: flags
do
case $flags in
p) _PACKAGE=$OPTARG
@ -69,7 +70,11 @@ rpm_make()
;;
s) _SPECFILE=$OPTARG
;;
a) _ADDITIONALFLAGS=$OPTARG
f) _ADDITIONALFLAGS=$OPTARG
;;
n) _RPMFILENAME=$OPTARG
;;
a) architecture=$OPTARG
;;
esac
done
@ -86,9 +91,17 @@ rpm_make()
echo "Updating the ThirdParty environment variables before building package $_PACKAGE"
. $WM_PROJECT_DIR/etc/settings.sh
rpmName=$_PACKAGE-$WM_OPTIONS.$architecture
if [ "$_RPMFILENAME" = "" ]; then
rpmName=$_PACKAGE-$WM_OPTIONS.$architecture
else
# Filename for the RPM was overridden from the command line
rpmName=$_RPMFILENAME
fi
rpmFile=$buildBase/RPMS/$architecture/$rpmName.rpm
echo "RPM file name : $rpmFile"
# We check immediatly if the RPM binary package is available in the local RPMs vault.
# If so, we basically uninstall/reinstall the package. This is handy for installation
# on machines with no Internet access, so without downloading capabilities. If one wants to
@ -117,10 +130,16 @@ rpm_make()
fi
# Install RPM package if not done already
if [ ! -e "$WM_THIRD_PARTY_DIR/packages/$_PACKAGE/platforms/$WM_OPTIONS" ]; then
if [ "$architecture" = "noarch" ]; then
installDir=$WM_THIRD_PARTY_DIR/packages/$_PACKAGE/platforms/noarch
else
installDir=$WM_THIRD_PARTY_DIR/packages/$_PACKAGE/platforms/$WM_OPTIONS
fi
if [ ! -e "$installDir" ]; then
echo "Installing package: $_PACKAGE"
rpm_uninstall $_PACKAGE
rpm_install $_PACKAGE
rpm_uninstall $_PACKAGE $rpmName
rpm_install $_PACKAGE $rpmName $rpmFile
else
echo "Package $_PACKAGE is already installed"
fi
@ -129,6 +148,7 @@ rpm_make()
unset _SPECFILE
unset _PACKAGE_URL
unset _ADDITIONALFLAGS
unset _RPMFILENAME
echo "Done installing package $_PACKAGE"
echo ""
@ -146,8 +166,8 @@ rpm_build()
cd $buildBase
[ -e ./SPECS/$specFile ] || {
echo "rpm_build: missing SPEC file for package $package. Aborting."
return 1
echo "rpm_build: Error: missing SPEC file for package $package. Aborting."
exit -1
}
#Build RPM package
@ -164,7 +184,7 @@ rpm_build()
rpm_uninstall()
{
package="$1"
rpmName=$package-$WM_OPTIONS.$architecture
rpmName="$2"
cd $buildBase
@ -184,14 +204,13 @@ rpm_uninstall()
rpm_install()
{
package="$1";
rpmName=$package-$WM_OPTIONS.$architecture;
rpmFile=$buildBase/RPMS/$architecture/$rpmName.rpm;
rpmName="$2";
rpmFile="$3";
echo " Installing $package using RPM file: $rpmFile";
${RPM_CMD} ${RPM_CMD_XTRA_OPTIONS} -ivh \
$rpmFile \
--dbpath $buildBase/rpmDB --force --nodeps;
}
#

View file

@ -4,12 +4,18 @@
(
Time::controlDictName,
rootDirMaster,
caseDirMaster
caseDirMaster,
"system",
"constant",
!args.optionFound("noFunctionObjects")
);
Time runTimeToAdd
(
Time::controlDictName,
rootDirToAdd,
caseDirToAdd
caseDirToAdd,
"system",
"constant",
!args.optionFound("noFunctionObjects")
);

View file

@ -7,6 +7,7 @@
argList::validArgs.append("root to add");
argList::validArgs.append("case to add");
argList::validOptions.insert("addRegion", "name");
argList::validOptions.insert("noFunctionObjects", "");
argList args(argc, argv);

View file

@ -259,7 +259,8 @@ bool domainDecomposition::writeDecomposition()
time().rootPath(),
processorCasePath,
"system",
"constant"
"constant",
true
);
// Create the mesh

View file

@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(PARAVIEW_INCLUDE_DIR)/paraview-3.12 \
-I$(PARAVIEW_INCLUDE_DIR) \
-I../PV3FoamReader
LIB_LIBS = \

View file

@ -251,24 +251,23 @@ Darwin)
then
# Use Mac-Ports-Compiler instead of Apple-gcc-4.2
case $WM_COMPILER in
Gcc43)
export WM_CC='gcc-mp-4.3'
export WM_CXX='g++-mp-4.3'
;;
Gcc44)
export WM_CC='gcc-mp-4.4'
export WM_CXX='g++-mp-4.4'
;;
Gcc45)
export WM_CC='gcc-mp-4.5'
export WM_CXX='g++-mp-4.5'
;;
*)
export WM_COMPILER=
;;
esac
Gcc43)
export WM_CC='gcc-mp-4.3'
export WM_CXX='g++-mp-4.3'
;;
Gcc44)
export WM_CC='gcc-mp-4.4'
export WM_CXX='g++-mp-4.4'
;;
Gcc45)
export WM_CC='gcc-mp-4.5'
export WM_CXX='g++-mp-4.5'
;;
*)
export WM_COMPILER=
;;
esac
fi
;;
SunOS)

View file

@ -140,10 +140,32 @@
#setenv PARAVIEW_DIR path_to_system_installed_paraview
#setenv PARAVIEW_BIN_DIR $PARAVIEW_DIR/bin
# System installed bison
#setenv BISON_SYSTEM 1
# System installed flex
#setenv FLEX_SYSTEM 1
# System installed m4
#setenv M4_SYSTEM 1
# System installed PyFoam
#setenv PYFOAM_SYSTEM 1
# System installed swak4Foam
#setenv SWAK4FOAM_SYSTEM 1
# Specify ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~~
#setenv ParaView_VERSION git # eg, cvs/git version
#setenv ParaView_MAJOR 3.7
# System identifier for the OpenFOAM CDash test harness on openfoam-extend
#
# By default, your system FQN/hostname will be used as the system identifier
# when publishing your test harness results on the OpenFOAM CDash server
# on openfoam-extend.
# You can override your identifier using this environment variable
#setenv CDASH_SUBMIT_LOCAL_HOST_ID choose_your_CDash_system_identifer
# ----------------------------------------------------------------- end-of-file

View file

@ -151,9 +151,23 @@ compilerInstall=System
# System installed m4
#export M4_SYSTEM=1
# System installed PyFoam
#export PYFOAM_SYSTEM=1
# System installed swak4Foam
#export SWAK4FOAM_SYSTEM=1
# Specify ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~~
#export ParaView_VERSION=git # eg, cvs/git version
#export ParaView_MAJOR=3.7
# System identifier for the OpenFOAM CDash test harness on openfoam-extend
#
# By default, your system FQN/hostname will be used as the system identifier
# when publishing your test harness results on the OpenFOAM CDash server
# on openfoam-extend.
# You can override your identifier using this environment variable
#export CDASH_SUBMIT_LOCAL_HOST_ID=choose_your_CDash_system_identifer
# ----------------------------------------------------------------- end-of-file

View file

@ -435,6 +435,12 @@ if ( $?PYTHON_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/Python-2.7/platfo
_foamSource $WM_THIRD_PARTY_DIR/packages/Python-2.7/platforms/$WM_OPTIONS/etc/Python-2.7.csh
endif
# PyFoam
# ~~~~~~
if ( $?PYFOAM_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.5.7 ) then
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.5.7/platforms/noarch/etc/PyFoam-0.5.7.csh
endif
# QT
# ~~~~~
if ( $?QT_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS )then
@ -449,6 +455,10 @@ if ( $?PARAVIEW_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.12.0
# _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.csh
endif
#if ( $?PARAVIEW_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.14.1 ) then
# _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.14.1/platforms/$WM_OPTIONS/etc/ParaView-3.14.1.csh
#endif
if ( $WM_ARCH == "darwinIntel" || $WM_ARCH == "darwinIntel64" ) then
setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}
endif

View file

@ -70,7 +70,7 @@ _foamSource()
}
# location of the jobControl directory
export FOAM_JOB_DIR=$HOME/$WM_PROJECT/jobControl
export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
# wmake configuration
export WM_DIR=$WM_PROJECT_DIR/wmake
@ -140,7 +140,7 @@ OpenFOAM)
_foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.sh
_foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.sh
_foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS/etc/gcc-4.4.5.sh
;;
;;
Gcc43)
export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
_foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
@ -480,8 +480,8 @@ export MPI_BUFFER_SIZE
# Load cmake
# ~~~~~~~~~~
[ -z "$CMAKE_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-2.8.5/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.5/platforms/$WM_OPTIONS/etc/cmake-2.8.5.sh
[ -z "$CMAKE_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/cmake-2.8.6/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.6/platforms/$WM_OPTIONS/etc/cmake-2.8.6.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " CMAKE_DIR is initialized to: $CMAKE_DIR"
@ -509,8 +509,8 @@ export MPI_BUFFER_SIZE
# Load zoltan
# ~~~~~~~~~~
[ -z "$ZOLTAN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/zoltan_3.5 ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/zoltan_3.5/platforms/$WM_OPTIONS/etc/zoltan_3.5.sh
[ -z "$ZOLTAN_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/zoltan-3.5 ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/zoltan-3.5/platforms/$WM_OPTIONS/etc/zoltan-3.5.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " ZOLTAN_DIR is initialized to: $ZOLTAN_DIR"
@ -522,11 +522,23 @@ export MPI_BUFFER_SIZE
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYTHON_DIR is initialized to: $PYTHON_DIR"
# Load PyFoam
# ~~~~~~~~~~~
[ -z "$PYFOAM_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/PyFoam-0.5.7 ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.5.7/platforms/noarch/etc/PyFoam-0.5.7.sh
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PYFOAM_DIR is initialized to: $PYFOAM_DIR"
# Load QT
# ~~~~~~~
<<<<<<< HEAD
[ ! -z "$QT_THIRD_PARTY" ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.0.sh
=======
[ ! -z "$QT_THIRD_PARTY" ] && [ -e $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.4 ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.4/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.4.sh
>>>>>>> remotes/origin/mixingPlane_RC1
}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " QT_DIR is initialized to: $QT_DIR"
@ -538,6 +550,10 @@ export MPI_BUFFER_SIZE
#[ -z "$PARAVIEW_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS ] && {
# _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.sh
}
#[ -z "$PARAVIEW_SYSTEM" ] && [ -e $WM_THIRD_PARTY_DIR/packages/ParaView-3.14.1 ] && {
# _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.14.1/platforms/$WM_OPTIONS/etc/ParaView-3.14.1.sh
#}
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARAVIEW_DIR is initialized to: $PARAVIEW_DIR"

View file

@ -192,7 +192,7 @@ void Foam::sigFpe::set(const bool verbose)
{
if (verbose)
{
Info<< "SigFpe : Enabling floating point exception trapping"
Info<< "SigFpe : Enabling floating point exception trapping"
<< " (FOAM_SIGFPE)." << endl;
}

View file

@ -251,7 +251,7 @@ $(lduAddressing)/lduInterface/processorLduInterface.C
$(lduAddressing)/lduInterface/cyclicLduInterface.C
$(lduAddressing)/lduInterface/ggiLduInterface.C
$(lduAddressing)/lduInterface/overlapGgiLduInterface.C
/*$(lduAddressing)/lduInterface/mixingPlaneLduInterface.C*/
$(lduAddressing)/lduInterface/mixingPlaneLduInterface.C
$(lduAddressing)/lduInterface/regionCoupleLduInterface.C
lduInterfaceFields = $(lduAddressing)/lduInterfaceFields
@ -259,7 +259,7 @@ $(lduInterfaceFields)/lduInterfaceField/lduInterfaceField.C
$(lduInterfaceFields)/processorLduInterfaceField/processorLduInterfaceField.C
$(lduInterfaceFields)/cyclicLduInterfaceField/cyclicLduInterfaceField.C
$(lduInterfaceFields)/ggiLduInterfaceField/ggiLduInterfaceField.C
/*$(lduInterfaceFields)/mixingPlaneLduInterfaceField/mixingPlaneLduInterfaceField.C*/
$(lduInterfaceFields)/mixingPlaneLduInterfaceField/mixingPlaneLduInterfaceField.C
$(lduInterfaceFields)/overlapGgiLduInterfaceField/overlapGgiLduInterfaceField.C
$(lduInterfaceFields)/regionCoupleLduInterfaceField/regionCoupleLduInterfaceField.C
@ -277,7 +277,6 @@ $(GAMGInterfaces)/cyclicGAMGInterface/cyclicGAMGInterface.C
$(GAMGInterfaces)/ggiGAMGInterface/ggiGAMGInterface.C
$(GAMGInterfaces)/cyclicGgiGAMGInterface/cyclicGgiGAMGInterface.C
$(GAMGInterfaces)/regionCoupleGAMGInterface/regionCoupleGAMGInterface.C
/*$(GAMGInterfaces)/mixingPlaneGAMGInterface/mixingPlaneGAMGInterface.C*/
GAMGInterfaceFields = $(GAMG)/interfaceFields
$(GAMGInterfaceFields)/GAMGInterfaceField/GAMGInterfaceField.C
@ -287,7 +286,7 @@ $(GAMGInterfaceFields)/cyclicGAMGInterfaceField/cyclicGAMGInterfaceField.C
$(GAMGInterfaceFields)/ggiGAMGInterfaceField/ggiGAMGInterfaceField.C
$(GAMGInterfaceFields)/cyclicGgiGAMGInterfaceField/cyclicGgiGAMGInterfaceField.C
$(GAMGInterfaceFields)/regionCoupleGAMGInterfaceField/regionCoupleGAMGInterfaceField.C
/*$(GAMGInterfaceFields)/mixingPlaneGAMGInterfaceField/mixingPlaneGAMGInterfaceField.C*/
$(GAMGInterfaceFields)/mixingPlaneGAMGInterfaceField/mixingPlaneGAMGInterfaceField.C
GAMGAgglomerations = $(GAMG)/GAMGAgglomerations
@ -367,7 +366,7 @@ $(constraintPolyPatches)/ggi/ggiPolyPatch.C
$(constraintPolyPatches)/cyclicGgi/cyclicGgiPolyPatch.C
$(constraintPolyPatches)/overlapGgi/overlapGgiPolyPatch.C
$(constraintPolyPatches)/overlapGgi/overlapGgiPolyPatchGeometry.C
/*$(constraintPolyPatches)/mixingPlane/mixingPlanePolyPatch.C*/
$(constraintPolyPatches)/mixingPlane/mixingPlanePolyPatch.C
$(constraintPolyPatches)/regionCouple/regionCouplePolyPatch.C
derivedPolyPatches = $(polyPatches)/derived
@ -483,7 +482,7 @@ $(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/ggi/ggiPointPatch.C
$(constraintPointPatches)/cyclicGgi/cyclicGgiPointPatch.C
$(constraintPointPatches)/overlapGgi/overlapGgiPointPatch.C
/*$(constraintPointPatches)/mixingPlane/mixingPlanePointPatch.C*/
$(constraintPointPatches)/mixingPlane/mixingPlanePointPatch.C
$(constraintPointPatches)/regionCouple/regionCouplePointPatch.C
derivedPointPatches = $(pointPatches)/derived
@ -558,7 +557,7 @@ interpolations = interpolations
interpolation = $(interpolations)/interpolation
$(interpolations)/patchToPatchInterpolation/PatchToPatchInterpolationName.C
$(interpolations)/GGIInterpolation/GGIInterpolationName.C
/*$(interpolations)/CircumferentialAveragingInterpolation/CircumferentialAveragingInterpolationName.C*/
$(interpolations)/MixingPlaneInterpolation/MixingPlaneInterpolationName.C
$(interpolations)/RBFInterpolation/RBFInterpolation.C
$(interpolations)/RBFInterpolation/RBFFunctions/RBFFunction/RBFFunction.C
$(interpolations)/RBFInterpolation/RBFFunctions/RBFFunction/newRBFFunction.C

View file

@ -85,5 +85,171 @@ Foam::tensor Foam::RodriguesRotation
return rotTensor;
}
Foam::tensor Foam::RodriguesRotation2
(
const vector& rotationAxis,
const scalar& rotationAngle,
const bool inDegrees
)
{
scalar magRotAxis = mag(rotationAxis);
if (magRotAxis < SMALL)
{
FatalErrorIn
(
"tensor RodriguesRotation2\n"
"(\n"
" const vector& rotationAxis,\n"
" const scalar& rotationAngle\n"
")"
) << "Incorrectly defined axis: " << rotationAxis
<< abort(FatalError);
}
scalar theta = rotationAngle;
if (inDegrees)
{
theta *= mathematicalConstant::pi/180.0;
}
const vector k = rotationAxis/magRotAxis;
const scalar k1 = k[0];
const scalar k2 = k[1];
const scalar k3 = k[2];
// [k]_x
const tensor rotationT (
0, -k3, k2,
k3, 0, -k1,
-k2, k1, 0
);
// kk' - I
const tensor projectionT (
k1*k1 - 1.0, k1*k2, k1*k3,
k2*k1, k2*k2 - 1.0, k2*k3,
k3*k1, k3*k2, k3*k3 - 1.0);
const scalar cosTheta = cos(theta);
const scalar sinTheta = sin(theta);
return I + sinTheta*rotationT + (1 - cosTheta)*projectionT;
}
Foam::tensor Foam::RodriguesRotation
(
const vector& rotationAxis,
const vector& vi,
const vector& vf
)
{
scalar magRotAxis = mag(rotationAxis);
if (magRotAxis < SMALL)
{
FatalErrorIn
(
"tensor RodriguesRotation\n"
"(\n"
" const vector& rotationAxis,\n"
" const vector& vi\n"
" const vector& vf\n"
")"
) << "Incorrectly defined axis: " << rotationAxis
<< abort(FatalError);
}
const vector k = rotationAxis/magRotAxis;
const scalar k1 = k[0];
const scalar k2 = k[1];
const scalar k3 = k[2];
// [k]_x
const tensor rotationT (
0, -k3, k2,
k3, 0, -k1,
-k2, k1, 0
);
// kk' - I
const tensor projectionT (
k1*k1 - 1.0, k1*k2, k1*k3,
k2*k1, k2*k2 - 1.0, k2*k3,
k3*k1, k3*k2, k3*k3 - 1.0);
// Project both vectors onto the plane defined by the rotation axis
vector nvi = -(projectionT & vi);
vector nvf = -(projectionT & vf);
nvi = nvi/mag(nvi);
nvf = nvf/mag(nvf);
const vector crossNviNvf = nvi ^ nvf;
const scalar cosTheta = nvi & nvf;
const scalar sinTheta = mag(crossNviNvf) * sign(crossNviNvf & k);
return I + sinTheta*rotationT + (1 - cosTheta)*projectionT;
}
Foam::tensorField Foam::RodriguesRotation
(
const vector& rotationAxis,
const vectorField& vi,
const vectorField& vf
)
{
scalar magRotAxis = mag(rotationAxis);
if (magRotAxis < SMALL)
{
FatalErrorIn
(
"tensor RodriguesRotation\n"
"(\n"
" const vector& rotationAxis,\n"
" const vectorField& vi\n"
" const vectorField& vf\n"
")"
) << "Incorrectly defined axis: " << rotationAxis
<< abort(FatalError);
}
const vector k = rotationAxis/magRotAxis;
const scalar k1 = k[0];
const scalar k2 = k[1];
const scalar k3 = k[2];
// [k]_x
const tensor rotationT (
0, -k3, k2,
k3, 0, -k1,
-k2, k1, 0
);
// kk' - I
const tensor projectionT (
k1*k1 - 1.0, k1*k2, k1*k3,
k2*k1, k2*k2 - 1.0, k2*k3,
k3*k1, k3*k2, k3*k3 - 1.0);
// Project both vectors onto the plane defined by the rotation axis
vectorField nvi = -(projectionT & vi);
vectorField nvf = -(projectionT & vf);
nvi = nvi/mag(nvi);
nvf = nvf/mag(nvf);
const vectorField crossNviNvf = nvi ^ nvf;
const scalarField cosTheta = nvi & nvf;
const scalarField sinTheta = mag(crossNviNvf) * sign(crossNviNvf & k);
const tensorField I_F(vi.size(), I);
const tensorField rotationT_F(vi.size(), rotationT);
const tensorField projectionT_F(vi.size(), projectionT);
return I_F + sinTheta*rotationT_F + (1 - cosTheta)*projectionT_F;
}
// ************************************************************************* //

View file

@ -28,9 +28,10 @@ Class
Description
Compute rotation tensor base on Rodrigues' Rotation Formula
http://mathworld.wolfram.com/RodriguesRotationFormula.html
http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
Author
Martin Beaudoin and Robert Magnan, Hydro-Quebec, (2008)
Martin Beaudoin, Hydro-Quebec, (2008, 2011)
SourceFiles
RodriguesRotation.C
@ -40,8 +41,10 @@ SourceFiles
#ifndef RodriguesRotation_H
#define RodriguesRotation_H
#include "tmp.H"
#include "vector.H"
#include "tensor.H"
#include "tensorField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +52,10 @@ namespace Foam
{
// Compute rotation tensor using Rodrigues' Rotation Formula
// Formulation taken from:
// http://mathworld.wolfram.com/RodriguesRotationFormula.html
//
// Requires: rotation axis + rotation angle
tensor RodriguesRotation
(
const vector& rotationAxis,
@ -57,6 +63,41 @@ tensor RodriguesRotation
const bool inDegrees = true
);
// Compute rotation tensor using Rodrigues' Rotation Formula
// Slightly different formulation taken from:
// http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
//
// Requires: rotation axis + rotation angle
tensor RodriguesRotation2
(
const vector& rotationAxis,
const scalar& rotationAngle,
const bool inDegrees = true
);
// Compute rotation tensor using Rodrigues' Rotation Formula
// http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
//
// Requires: rotation axis + initial vector + final vector
tensor RodriguesRotation
(
const vector& rotationAxis,
const vector& vi,
const vector& vf
);
// Compute rotation tensorField using Rodrigues' Rotation Formula
// http://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula
//
// Requires: rotation axis + initial vectorField + final vectorField
Foam::tensorField RodriguesRotation
(
const vector& rotationAxis,
const vectorField& vi,
const vectorField& vf
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -87,4 +87,22 @@ void Foam::NamedEnum<Enum, nEnum>::write(const Enum e, Ostream& os) const
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class Enum, int nEnum>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const NamedEnum<Enum, nEnum>& n
)
{
for (int e = 0; e < nEnum; e++)
{
os << e << " " << n.names[e] << nl;
}
return os;
}
// ************************************************************************* //

View file

@ -44,6 +44,15 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Enum, int nEnum>
class NamedEnum;
template<class Enum, int nEnum>
Ostream& operator<<(Ostream&, const NamedEnum<Enum, nEnum>&);
/*---------------------------------------------------------------------------*\
Class NamedEnum Declaration
\*---------------------------------------------------------------------------*/
@ -111,6 +120,16 @@ public:
{
return names[e];
}
// Friend operators
friend Ostream& operator<< <Enum, nEnum>
(
Ostream&,
const NamedEnum<Enum, nEnum>&
);
};

View file

@ -27,6 +27,7 @@ License
#include "IOstream.H"
#include "coordinateSystem.H"
#include "coordinateSystems.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -201,6 +202,18 @@ Foam::coordinateSystem::~coordinateSystem()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo Foam::coordinateSystem::spanLimited() const
{
return spanInfo(Pair<bool>(false, false));
}
Foam::boundBox Foam::coordinateSystem::spanBounds() const
{
return boundBox::greatBox;
}
Foam::dictionary Foam::coordinateSystem::dict(bool ignoreType) const
{
dictionary dict;
@ -307,7 +320,7 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
{
if (subDict)
{
os << indent << name_ << nl
os << indent << nl
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
}
@ -323,6 +336,8 @@ void Foam::coordinateSystem::writeDict(Ostream& os, bool subDict) const
os.writeKeyword("note") << note_ << token::END_STATEMENT << nl;
}
os.writeKeyword("name") << name_ << token::END_STATEMENT << nl;
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
os.writeKeyword("origin") << origin_ << token::END_STATEMENT << nl;
os.writeKeyword("e1") << e1() << token::END_STATEMENT << nl;
os.writeKeyword("e3") << e3() << token::END_STATEMENT << nl;

View file

@ -130,6 +130,7 @@ SourceFiles
#define coordinateSystem_H
#include "vector.H"
#include "Pair.H"
#include "point.H"
#include "tensor.H"
#include "vectorField.H"
@ -143,6 +144,9 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
class boundBox;
/*---------------------------------------------------------------------------*\
Class coordinateSystem Declaration
\*---------------------------------------------------------------------------*/
@ -200,6 +204,9 @@ public:
//- Runtime type information
TypeName("coordinateSystem");
//- Type reporting on min-max bounds on coordinate span
typedef FixedList<Pair<bool>, 3> spanInfo;
// Constructors
@ -245,7 +252,7 @@ public:
coordinateSystem(Istream&);
//- Return clone
autoPtr<coordinateSystem> clone() const
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new coordinateSystem(*this));
}
@ -309,6 +316,15 @@ public:
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
// Access
//- Return name
@ -468,7 +484,7 @@ public:
// Member Operators
//- assign from dictionary
//- Assign from dictionary
void operator=(const dictionary&);

View file

@ -28,6 +28,7 @@ License
#include "Switch.H"
#include "mathematicalConstants.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -112,6 +113,40 @@ Foam::cylindricalCS::cylindricalCS
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo Foam::cylindricalCS::spanLimited() const
{
spanInfo b(Pair<bool>(true, true));
// Upper bound or r is unlimited
b[0] = Pair<bool>(true, false);
// z is unlimited
b[2] = Pair<bool>(false, false);
return b;
}
Foam::boundBox Foam::cylindricalCS::spanBounds() const
{
return boundBox
(
vector
(
0,
( inDegrees_ ? -180.0 : -mathematicalConstant::pi ),
-GREAT
),
vector
(
GREAT,
( inDegrees_ ? 180.0 : mathematicalConstant::pi ),
GREAT
)
);
}
bool Foam::cylindricalCS::inDegrees() const
{
return inDegrees_;

View file

@ -135,9 +135,24 @@ public:
//- Construct from dictionary
cylindricalCS(const word& name, const dictionary&);
//- Return clone
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new cylindricalCS(*this));
}
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
//- Are angles in degrees?
bool inDegrees() const;

View file

@ -28,6 +28,7 @@ License
#include "Switch.H"
#include "mathematicalConstants.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -124,6 +125,53 @@ Foam::ellipticCylindricalCS::ellipticCylindricalCS
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo
Foam::ellipticCylindricalCS::spanLimited() const
{
spanInfo b(Pair<bool>(true, true));
// Upper bound or r is unlimited
b[0] = Pair<bool>(true, false);
// z is unlimited
b[2] = Pair<bool>(false, false);
return b;
}
Foam::boundBox Foam::ellipticCylindricalCS::spanBounds() const
{
return boundBox
(
vector
(
0,
( inDegrees_ ? -180.0 : -mathematicalConstant::pi ),
-GREAT
),
vector
(
GREAT,
( inDegrees_ ? 180.0 : mathematicalConstant::pi ),
GREAT
)
);
}
bool Foam::ellipticCylindricalCS::inDegrees() const
{
return inDegrees_;
}
bool& Foam::ellipticCylindricalCS::inDegrees()
{
return inDegrees_;
}
Foam::vector Foam::ellipticCylindricalCS::localToGlobal
(
const vector& local,

View file

@ -150,9 +150,29 @@ public:
const dictionary& dict
);
//- Return clone
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new ellipticCylindricalCS(*this));
}
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
//- Are angles in degrees?
bool inDegrees() const;
//- Non-const access to inDegrees
bool& inDegrees();
};

View file

@ -25,6 +25,9 @@ License
\*---------------------------------------------------------------------------*/
#include "parabolicCylindricalCS.H"
#include "mathematicalConstants.H"
#include "Switch.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -43,9 +46,10 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::parabolicCylindricalCS::parabolicCylindricalCS()
Foam::parabolicCylindricalCS::parabolicCylindricalCS(const bool inDegrees)
:
coordinateSystem()
coordinateSystem(),
inDegrees_(inDegrees)
{}
@ -53,10 +57,12 @@ Foam::parabolicCylindricalCS::parabolicCylindricalCS
(
const word& name,
const point& origin,
const coordinateRotation& cr
const coordinateRotation& cr,
const bool inDegrees
)
:
coordinateSystem(name, origin, cr)
coordinateSystem(name, origin, cr),
inDegrees_(inDegrees)
{}
@ -66,12 +72,60 @@ Foam::parabolicCylindricalCS::parabolicCylindricalCS
const dictionary& dict
)
:
coordinateSystem(name, dict)
coordinateSystem(name, dict),
inDegrees_(dict.lookupOrDefault<Switch>("degrees", true))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo
Foam::parabolicCylindricalCS::spanLimited() const
{
spanInfo b(Pair<bool>(true, true));
// Upper bound or r is unlimited
b[0] = Pair<bool>(true, false);
// z is unlimited
b[2] = Pair<bool>(false, false);
return b;
}
Foam::boundBox Foam::parabolicCylindricalCS::spanBounds() const
{
return boundBox
(
vector
(
0,
( inDegrees_ ? -180.0 : -mathematicalConstant::pi ),
-GREAT
),
vector
(
GREAT,
( inDegrees_ ? 180.0 : mathematicalConstant::pi ),
GREAT
)
);
}
bool Foam::parabolicCylindricalCS::inDegrees() const
{
return inDegrees_;
}
bool& Foam::parabolicCylindricalCS::inDegrees()
{
return inDegrees_;
}
Foam::vector Foam::parabolicCylindricalCS::localToGlobal
(
const vector& local,

View file

@ -56,6 +56,11 @@ class parabolicCylindricalCS
:
public coordinateSystem
{
// Private data members
//- Are angles in degrees? (default = true)
bool inDegrees_;
protected:
@ -94,19 +99,43 @@ public:
// Constructors
//- Construct null
parabolicCylindricalCS();
parabolicCylindricalCS(const bool inDegrees = true);
//- Construct from origin and rotation
parabolicCylindricalCS
(
const word& name,
const point& origin,
const coordinateRotation&
const coordinateRotation&,
const bool inDegrees = true
);
//- Construct from dictionary
parabolicCylindricalCS(const word&, const dictionary&);
//- Return clone
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new parabolicCylindricalCS(*this));
}
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
//- Are angles in degrees?
bool inDegrees() const;
//- Non-const access to inDegrees
bool& inDegrees();
};

View file

@ -29,6 +29,7 @@ License
#include "one.H"
#include "Switch.H"
#include "mathematicalConstants.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -113,6 +114,37 @@ Foam::sphericalCS::sphericalCS
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo Foam::sphericalCS::spanLimited() const
{
spanInfo b(Pair<bool>(true, true));
// Upper bound or r is unlimited
b[0] = Pair<bool>(true, false);
return b;
}
Foam::boundBox Foam::sphericalCS::spanBounds() const
{
return boundBox
(
vector
(
0,
( inDegrees_ ? -180.0 : -mathematicalConstant::pi ),
( inDegrees_ ? -90.0 : -mathematicalConstant::pi/2 )
),
vector
(
GREAT,
( inDegrees_ ? 180.0 : mathematicalConstant::pi ),
( inDegrees_ ? 90.0 : mathematicalConstant::pi/2 )
)
);
}
bool Foam::sphericalCS::inDegrees() const
{
return inDegrees_;

View file

@ -133,9 +133,24 @@ public:
//- Construct from dictionary
sphericalCS(const word& name, const dictionary&);
//- Return clone
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new sphericalCS(*this));
}
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
//- Are angles in degrees?
bool inDegrees() const;

View file

@ -25,8 +25,10 @@ License
\*---------------------------------------------------------------------------*/
#include "toroidalCS.H"
#include "addToRunTimeSelectionTable.H"
#include "mathematicalConstants.H"
#include "Switch.H"
#include "boundBox.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -44,11 +46,13 @@ Foam::toroidalCS::toroidalCS
const word& name,
const point& origin,
const coordinateRotation& cr,
const scalar radius
const scalar radius,
const bool inDegrees
)
:
coordinateSystem(name, origin, cr),
radius_(radius)
radius_(radius),
inDegrees_(inDegrees)
{}
@ -59,12 +63,56 @@ Foam::toroidalCS::toroidalCS
)
:
coordinateSystem(name, dict),
radius_(readScalar(dict.lookup("radius")))
radius_(readScalar(dict.lookup("radius"))),
inDegrees_(dict.lookupOrDefault<Switch>("degrees", true))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::coordinateSystem::spanInfo Foam::toroidalCS::spanLimited() const
{
spanInfo b(Pair<bool>(true, true));
// Upper bound or r is unlimited
b[0] = Pair<bool>(true, false);
return b;
}
Foam::boundBox Foam::toroidalCS::spanBounds() const
{
return boundBox
(
vector
(
0,
( inDegrees_ ? -180.0 : -mathematicalConstant::pi ),
( inDegrees_ ? -180.0 : -mathematicalConstant::pi )
),
vector
(
GREAT,
( inDegrees_ ? 180.0 : mathematicalConstant::pi ),
( inDegrees_ ? 180.0 : mathematicalConstant::pi )
)
);
}
bool Foam::toroidalCS::inDegrees() const
{
return inDegrees_;
}
bool& Foam::toroidalCS::inDegrees()
{
return inDegrees_;
}
Foam::vector Foam::toroidalCS::localToGlobal
(
const vector& local,

View file

@ -60,6 +60,10 @@ class toroidalCS
//- Radius of the torus
scalar radius_;
//- Are angles in degrees? (default = true)
bool inDegrees_;
// Private Member Functions
//- Convert from local coordinate system to the global Cartesian system
@ -100,16 +104,38 @@ public:
const word& name,
const point& origin,
const coordinateRotation&,
const scalar radius
const scalar radius,
const bool inDegrees = true
);
//- Construct from dictionary
toroidalCS(const word& name, const dictionary&);
//- Return clone
virtual autoPtr<coordinateSystem> clone() const
{
return autoPtr<coordinateSystem>(new toroidalCS(*this));
}
// Member Functions
// Global information about the coordinate system
//- Directions in which the span is limited
virtual spanInfo spanLimited() const;
//- Span bounds
virtual boundBox spanBounds() const;
//- Are angles in degrees?
bool inDegrees() const;
//- Non-const access to inDegrees
bool& inDegrees();
//- Return radius
scalar radius() const
{

View file

@ -191,7 +191,8 @@ Foam::Time::Time
const fileName& rootPath,
const fileName& caseName,
const word& systemName,
const word& constantName
const word& constantName,
const bool enableFunctionObjects
)
:
TimePaths
@ -234,7 +235,7 @@ Foam::Time::Time
runTimeModifiable_(true),
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
functionObjects_(*this, enableFunctionObjects)
{
setControls();
}
@ -246,7 +247,8 @@ Foam::Time::Time
const fileName& rootPath,
const fileName& caseName,
const word& systemName,
const word& constantName
const word& constantName,
const bool enableFunctionObjects
)
:
TimePaths
@ -290,7 +292,7 @@ Foam::Time::Time
runTimeModifiable_(true),
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
functionObjects_(*this, enableFunctionObjects)
{
setControls();
}
@ -301,7 +303,8 @@ Foam::Time::Time
const fileName& rootPath,
const fileName& caseName,
const word& systemName,
const word& constantName
const word& constantName,
const bool enableFunctionObjects
)
:
TimePaths
@ -344,7 +347,7 @@ Foam::Time::Time
runTimeModifiable_(true),
readLibs_(controlDict_, "libs"),
functionObjects_(*this)
functionObjects_(*this, enableFunctionObjects)
{}

View file

@ -187,7 +187,8 @@ public:
const fileName& rootPath,
const fileName& caseName,
const word& systemName = "system",
const word& constantName = "constant"
const word& constantName = "constant",
const bool enableFunctionObjects = true
);
//- Construct given dictionary, rootPath and casePath
@ -197,7 +198,8 @@ public:
const fileName& rootPath,
const fileName& caseName,
const word& systemName = "system",
const word& constantName = "constant"
const word& constantName = "constant",
const bool enableFunctionObjects = true
);
//- Construct given endTime, rootPath and casePath
@ -206,7 +208,8 @@ public:
const fileName& rootPath,
const fileName& caseName,
const word& systemName = "system",
const word& constantName = "constant"
const word& constantName = "constant",
const bool enableFunctionObjects = true
);

View file

@ -208,6 +208,21 @@ void Foam::primitiveEntry::readEntry(const dictionary& dict, Istream& is)
}
else
{
// When reading an invalid global controlDict file, the following call
// to FatalIOErrorIn will crash with a "Segmentation Fault", and will
// fail to generate any useful error message to the console.
// This additional error message will at least leave a minimal trace.
//
// The cause of the Seg. fault is still unknown, but seems to be related
// to the initialization of the string member attributes of the global
// object FatalIOError. (MB 05/2011)
//
std::cerr << "--> Error from: "
<< "primitiveEntry::readEntry(const dictionary&, Istream&)"
<< std::endl;
std::cerr << "--> Fatal error reading input from: "
<< is.name() << std::endl;
FatalIOErrorIn
(
"primitiveEntry::readEntry(const dictionary&, Istream&)",

View file

@ -48,6 +48,7 @@ Foam::argList::initValidTables::initValidTables()
validOptions.set("case", "dir");
validOptions.set("parallel", "");
validParOptions.set("parallel", "");
validOptions.set("noFunctionObjects", "");
Pstream::addValidParOptions(validParOptions);
}
@ -311,17 +312,21 @@ Foam::argList::argList
string dateString = clock::date();
string timeString = clock::clockTime();
fileName ctrlDict = debug::controlDict().name();
string ctrlDictString = ctrlDict.path()/ctrlDict.name();
// Print the banner once only for parallel runs
if (Pstream::master() && bannerEnabled)
{
IOobject::writeBanner(Info, true)
<< "Build : " << Foam::FOAMbuild << nl
<< "Exec : " << argListString.c_str() << nl
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
<< "Host : " << hostName() << nl
<< "PID : " << pid() << endl;
<< "Build : " << Foam::FOAMbuild << nl
<< "Exec : " << argListString.c_str() << nl
<< "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl
<< "Host : " << hostName() << nl
<< "PID : " << pid() << nl
<< "CtrlDict : " << ctrlDictString.c_str()
<< endl;
}
jobInfo.add("startDate", dateString);
@ -528,8 +533,8 @@ Foam::argList::argList
if (Pstream::master() && bannerEnabled)
{
Info<< "Case : " << (rootPath_/globalCase_).c_str() << nl
<< "nProcs : " << nProcs << endl;
Info<< "Case : " << (rootPath_/globalCase_).c_str() << nl
<< "nProcs : " << nProcs << endl;
if (parRunControl_.parRun())
{

View file

@ -77,9 +77,19 @@ Foam::dictionary& Foam::debug::controlDict()
{
if (!controlDictPtr_)
{
// Allow users to override the location of the global controlDict
// dictionary using an environment variable. Using this environment
// variable, one can assign a different global controlDict for each
// case, without having to modify the "default" ones.
fileName globControlDictFileName = getEnv("FOAM_GLOBAL_CONTROLDICT");
// Fallback to default locations if filename is empty or not valid
if( ! isFile(globControlDictFileName) )
globControlDictFileName = findEtcFile("controlDict", true);
controlDictPtr_ = new dictionary
(
IFstream(findEtcFile("controlDict", true))()
IFstream(globControlDictFileName)()
);
}

View file

@ -8,5 +8,8 @@
(
Foam::Time::controlDictName,
args.rootPath(),
args.caseName()
args.caseName(),
"system",
"constant",
!args.optionFound("noFunctionObjects")
);

View file

@ -0,0 +1,499 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
MixingPlane interpolation functions
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include <sys/time.h>
#include <sstream>
#include <iomanip>
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
template<class Type>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
interpolate
(
const Field<Type>& srcF,
const labelListList& srcAddr,
const scalarListList& srcWeights,
const labelListList& dstAddr,
const scalarListList& dstWeights,
Field<Type>& dstResultF
) const
{
// The src to profile transfer is done using weighted averaging
// evaluation of srcF.
// See: http://en.wikipedia.org/wiki/Weighted_mean
//
// sum(w*phi)
// average(phi) == -----------
// sum(w)
//
// Note however that in our case, the weighting factors utilized
// for the computation of the weighted average are GGI weighting
// factors. So for every interpolation band, we have the following
// situation, thanks to the intrinsic conservativeness of the GGI
// interface:
//
// sum(w) == 1.0
//
// which leads to the following simplification:
//
// average(phi) == sum(w*phi)
int nbrProfileBands = interpolationProfile_.size() - 1;
List<Type> profileBandValues(nbrProfileBands, pTraits<Type>::zero);
scalarField srcScalingValues(nbrProfileBands, 0.0);
forAll (srcAddr, bandI)
{
forAll (srcAddr[bandI], faceI)
{
profileBandValues[bandI] +=
srcF[srcAddr[bandI][faceI]]*srcWeights[bandI][faceI];
// NB: The next operation should be computed only
// once... and should sum up to 1.0 Let's keep this
// operation for now, until the mixingPlane interface is
// fully debugged (MB, 07/2010)
srcScalingValues[bandI] += srcWeights[bandI][faceI];
if (debug <= -200)
{
Info << "bande: " << bandI
<< " src valeur: " << srcF[srcAddr[bandI][faceI]]
<< " src weight: " << srcWeights[bandI][faceI] << endl;
}
}
}
// We don't need to divide the profileBandValues by the
// srcScalingValues because the srcScalingValues are identically
// equal to 1.0, thanks to the conservativeness of the GGI
// weighting factors
//profileBandValues = profileBandValues/srcScalingValues;
// profileBandValues are now the circumferentially averaged values
// The profile to dst transfer is done by simply distributing the
// average value accordingly to the dst weighting factors
forAll (dstAddr, faceI)
{
const labelList& curAddr = dstAddr[faceI];
const scalarList& curW = dstWeights[faceI];
forAll (curAddr, bandI)
{
dstResultF[faceI] += profileBandValues[curAddr[bandI]]*curW[bandI];
if (debug <= -200)
{
Info<< "bande: " << dstAddr[faceI][bandI]
<< " dst valeur: " << dstResultF[faceI]
<< " dst weight: " << dstWeights[faceI][bandI] << endl;
}
}
}
if (debug <= -500)
{
error::printStack(Info);
Info<< "srcF : " << srcF << nl
<< "srcAddr : " << srcAddr << nl
<< "srcWeights: " << srcWeights << nl
<< "profileBandValues: " << profileBandValues << nl
<< "srcScalingValues: " << srcScalingValues << nl
<< "dstAddr : " << dstAddr << nl
<< "dstWeights: " << dstWeights << nl
<< "dstResultF: " << dstResultF << nl
<< "srcScalingValues: " << srcScalingValues << endl;
}
if (debug <= -999)
{
fileName traceFileDir("./mixingPlaneTraceFiles");
if (!exists(traceFileDir))
{
mkDir(traceFileDir);
}
struct timeval tod;
gettimeofday(&tod, NULL);
//struct timespec tp;
//clock_gettime(CLOCK_MONOTONIC, &tp);
std::ostringstream osBuffer;
osBuffer
<< Foam::name(tod.tv_sec)
<< "." << std::setfill('0') << std::setw(6)
<< Foam::name(tod.tv_usec);
fileName traceFileName(traceFileDir/"profileValues_" + osBuffer.str());
OFstream dumpFileSrc(traceFileName + "_orig");
OFstream dumpFileDst(traceFileName + "_interpolated");
OFstream dumpFileProfile(traceFileName + "_profile");
//Foam::error::printStack(Info);
InfoIn
(
"MixingPlaneInterpolation::interpolate"
) << "Dumping src profiles to: " << traceFileName + "_orig" << nl
<< "Dumping interpolated profiles to : "
<< traceFileName + "_interpolated" << nl
<< "Dumping profile values to: "
<< traceFileName + "_profile" << endl;
dumpFileDst << dstResultF << endl;
dumpFileSrc << srcF << endl;
dumpFileProfile << profileBandValues << endl;
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != masterPatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::masterToSlave("
"const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: "
<< masterPatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError);
}
// Move master data from 'patch space' to 'profile space'
// MB: We need this back
Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "masterPatchToProfileT(): " << masterPatchToProfileT() << endl
<< "slaveProfileToPatchT(): " << slaveProfileToPatchT() << endl
<< endl;
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
slavePatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
interpolate
(
profileFF, // Master data in 'profile space'
masterPatchToProfileAddr(), // From master: compute the average
masterPatchToProfileWeights(),
slaveProfileToPatchAddr(), // To slave we distribute the average from
slaveProfileToPatchWeights(), // profile to patch
result
);
// Apply transform to bring the slave field back from 'profile space'
// to 'patch space'
transform(result, slaveProfileToPatchT(), result); // MB: We need this back
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToSlave
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = masterToSlave(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != slavePatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::slaveToMaster("
"const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: "
<< slavePatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError);
}
// Move slave data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "slavePatchToProfileT(): " << slavePatchToProfileT() << endl
<< "masterProfileToPatchT(): " << masterProfileToPatchT() << endl
<< endl;
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
masterPatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
interpolate
(
profileFF, // Slave data in 'profile space'
slavePatchToProfileAddr(), // From slave: compute the average
slavePatchToProfileWeights(),
masterProfileToPatchAddr(), // To master: distribute the average
masterProfileToPatchWeights(),
result
);
// Apply transform to bring the master field back from 'profile space'
// to 'patch space'
transform(result, masterProfileToPatchT(), result);
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToMaster
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = slaveToMaster(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != masterPatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::masterToMaster("
"const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: "
<< masterPatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError);
}
// Move master data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(masterPatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "masterPatchToProfileT(): " << masterPatchToProfileT() << endl
<< endl;
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
masterPatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
interpolate
(
profileFF, // Master data in 'profile space'
masterPatchToProfileAddr(), // From master: compute the average
masterPatchToProfileWeights(),
masterProfileToPatchAddr(), // To master: distribute the average
masterProfileToPatchWeights(),
result
);
// Apply transform to bring the master field back from 'profile space'
// to 'patch space'
transform(result, masterProfileToPatchT(), result);
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::masterToMaster
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = masterToMaster(tff());
tff.clear();
return tint;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave
(
const Field<Type>& patchFF
) const
{
if (patchFF.size() != slavePatch_.size())
{
FatalErrorIn
(
"MixingPlaneInterpolation::slaveToSlave("
"const Field<Type> ff)"
) << "given field does not correspond to patch. Patch size: "
<< slavePatch_.size() << " field size: " << patchFF.size()
<< abort(FatalError);
}
// Move slave data from 'patch space' to 'profile space'
Field<Type> profileFF = transform(slavePatchToProfileT(), patchFF);
if (debug > 1)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave: "
<< "patchFF: " << patchFF << endl
<< "profileFF: " << profileFF << endl
<< "slavePatchToProfileT(): " << slavePatchToProfileT() << endl
<< endl;
}
// Do interpolation
tmp<Field<Type> > tresult
(
new Field<Type>
(
slavePatch_.size(),
pTraits<Type>::zero
)
);
Field<Type>& result = tresult();
interpolate
(
profileFF, // Slave data in 'profile space'
slavePatchToProfileAddr(), // From slave: compute the average
slavePatchToProfileWeights(),
slaveProfileToPatchAddr(), // To slave: distribute the average
slaveProfileToPatchWeights(),
result
);
// Apply transform to bring the slave field back from 'profile space'
// to 'patch space'
transform(result, slaveProfileToPatchT(), result);
return tresult;
}
template<class MasterPatch, class SlavePatch>
template<class Type>
tmp<Field<Type> >
MixingPlaneInterpolation<MasterPatch, SlavePatch>::slaveToSlave
(
const tmp<Field<Type> >& tff
) const
{
tmp<Field<Type> > tint = slaveToSlave(tff());
tff.clear();
return tint;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,477 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
Mixing plane class dealing with transfer of data between two
primitivePatches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "MixingPlaneInterpolation.H"
#include "demandDrivenData.H"
#include "PrimitivePatch.H"
#include "IOmanip.H"
#include "transform.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
Foam::direction
MixingPlaneInterpolation<MasterPatch, SlavePatch>::spanwiseSwitch() const
{
// Spanwise switch
switch (orientationType_)
{
case DIR_Y_SPAN_X:
case DIR_Z_SPAN_X:
case DIR_THETA_SPAN_R:
case DIR_Z_SPAN_R:
{
return vector::X;
}
break;
case DIR_X_SPAN_Y:
case DIR_Z_SPAN_Y:
case DIR_R_SPAN_THETA:
case DIR_Z_SPAN_THETA:
{
return vector::Y;
}
break;
case DIR_X_SPAN_Z:
case DIR_Y_SPAN_Z:
case DIR_R_SPAN_Z:
case DIR_THETA_SPAN_Z:
{
return vector::Z;
}
break;
default:
{
FatalErrorIn
(
"direction MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::spanwiseSwitch() const"
) << "Bad orientation type: "
<< MixingPlaneInterpolationName::orientationNames_
[orientationType_]
<< "Available types: "
<< MixingPlaneInterpolationName::orientationNames_
<< abort(FatalError);
// Dummy return
return vector::X;
}
}
}
template<class MasterPatch, class SlavePatch>
Foam::direction
MixingPlaneInterpolation<MasterPatch, SlavePatch>::directionalSwitch() const
{
// Directional switch
switch (orientationType_)
{
case DIR_X_SPAN_Y:
case DIR_X_SPAN_Z:
case DIR_R_SPAN_THETA:
case DIR_R_SPAN_Z:
{
return vector::X;
}
break;
case DIR_Y_SPAN_X:
case DIR_Y_SPAN_Z:
case DIR_THETA_SPAN_R:
case DIR_THETA_SPAN_Z:
{
return vector::Y;
}
break;
case DIR_Z_SPAN_X:
case DIR_Z_SPAN_Y:
case DIR_Z_SPAN_R:
case DIR_Z_SPAN_THETA:
{
return vector::Z;
}
break;
default:
{
FatalErrorIn
(
"tmp<pointField> MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::directionalSwitch() const"
) << "Bad orientation type: "
<< MixingPlaneInterpolationName::orientationNames_
[orientationType_]
<< "Available types: "
<< MixingPlaneInterpolationName::orientationNames_
<< abort(FatalError);
// Dummy return
return vector::X;
}
}
}
template<class MasterPatch, class SlavePatch>
void MixingPlaneInterpolation<MasterPatch, SlavePatch>::clearOut()
{
clearTransfomedPatches();
clearMixingPlanePatch();
clearAddressing();
clearTransforms();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
MixingPlaneInterpolation
(
const MasterPatch& masterPatch,
const SlavePatch& slavePatch,
const coordinateSystem& cs,
const MixingPlaneInterpolationName::assembly& assemblyType,
const MixingPlaneInterpolationName::orientation& orientationType,
const pointField& interpolationProfile
)
:
masterPatch_(masterPatch),
slavePatch_(slavePatch),
cs_(cs),
assemblyType_(assemblyType),
orientationType_(orientationType),
interpolationProfile_(interpolationProfile),
forwardT_(),
reverseT_(),
forwardSep_(),
transformedMasterPatchPtr_(NULL),
transformedShadowPatchPtr_(NULL),
mixingPlanePatchPtr_(NULL),
masterPatchToProfileTPtr_(NULL),
masterProfileToPatchTPtr_(NULL),
slavePatchToProfileTPtr_(NULL),
slaveProfileToPatchTPtr_(NULL),
masterPatchToProfileAddrPtr_(NULL),
masterProfileToPatchAddrPtr_(NULL),
masterPatchToProfileWeightsPtr_(NULL),
masterProfileToPatchWeightsPtr_(NULL),
slavePatchToProfileAddrPtr_(NULL),
slaveProfileToPatchAddrPtr_(NULL),
slavePatchToProfileWeightsPtr_(NULL),
slaveProfileToPatchWeightsPtr_(NULL)
{
// Check size of transform. They should be equal to slave patch size
// if the transform is not constant
if (forwardT_.size() > 1 || reverseT_.size() > 1)
{
if
(
forwardT_.size() != slavePatch_.size()
|| reverseT_.size() != masterPatch_.size()
)
{
FatalErrorIn
(
"MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::MixingPlaneInterpolation"
) << "Incorrectly defined transform: forwardT: "
<< forwardT_.size() << " patch: " << slavePatch_.size()
<< " reverseT: " << reverseT_.size()
<< " patch: " << masterPatch_.size()
<< abort(FatalError);
}
}
masterPatchToProfileAddr();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
MixingPlaneInterpolation<MasterPatch, SlavePatch>::~MixingPlaneInterpolation()
{
clearOut();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
const Foam::standAlonePatch&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::mixingPlanePatch() const
{
if (!mixingPlanePatchPtr_)
{
calcMixingPlanePatch();
}
return *mixingPlanePatchPtr_;
}
template<class MasterPatch, class SlavePatch>
const Foam::standAlonePatch&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
transformedMasterPatch() const
{
if (!transformedMasterPatchPtr_)
{
calcTransformedPatches();
}
return *transformedMasterPatchPtr_;
}
template<class MasterPatch, class SlavePatch>
const Foam::standAlonePatch&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
transformedShadowPatch() const
{
if (!transformedShadowPatchPtr_)
{
calcTransformedPatches();
}
return *transformedShadowPatchPtr_;
}
template<class MasterPatch, class SlavePatch>
const labelListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterPatchToProfileAddr() const
{
if (!masterPatchToProfileAddrPtr_)
{
calcAddressing();
}
return *masterPatchToProfileAddrPtr_;
}
template<class MasterPatch, class SlavePatch>
const labelListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterProfileToPatchAddr() const
{
if (!masterProfileToPatchAddrPtr_)
{
calcAddressing();
}
return *masterProfileToPatchAddrPtr_;
}
template<class MasterPatch, class SlavePatch>
const scalarListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterPatchToProfileWeights() const
{
if (!masterPatchToProfileWeightsPtr_)
{
calcAddressing();
}
return *masterPatchToProfileWeightsPtr_;
}
template<class MasterPatch, class SlavePatch>
const scalarListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterProfileToPatchWeights() const
{
if (!masterProfileToPatchWeightsPtr_)
{
calcAddressing();
}
return *masterProfileToPatchWeightsPtr_;
}
template<class MasterPatch, class SlavePatch>
const labelListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slavePatchToProfileAddr() const
{
if (!slavePatchToProfileAddrPtr_)
{
calcAddressing();
}
return *slavePatchToProfileAddrPtr_;
}
template<class MasterPatch, class SlavePatch>
const labelListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slaveProfileToPatchAddr() const
{
if (!slaveProfileToPatchAddrPtr_)
{
calcAddressing();
}
return *slaveProfileToPatchAddrPtr_;
}
template<class MasterPatch, class SlavePatch>
const scalarListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slavePatchToProfileWeights() const
{
if (!slavePatchToProfileWeightsPtr_)
{
calcAddressing();
}
return *slavePatchToProfileWeightsPtr_;
}
template<class MasterPatch, class SlavePatch>
const scalarListList&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slaveProfileToPatchWeights() const
{
if (!slaveProfileToPatchWeightsPtr_)
{
calcAddressing();
}
return *slaveProfileToPatchWeightsPtr_;
}
template<class MasterPatch, class SlavePatch>
const tensorField&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterPatchToProfileT() const
{
if (!masterPatchToProfileTPtr_)
{
calcTransforms();
}
return *masterPatchToProfileTPtr_;
}
template<class MasterPatch, class SlavePatch>
const tensorField&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
masterProfileToPatchT() const
{
if (!masterProfileToPatchTPtr_)
{
calcTransforms();
}
return *masterProfileToPatchTPtr_;
}
template<class MasterPatch, class SlavePatch>
const tensorField&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slavePatchToProfileT() const
{
if (!slavePatchToProfileTPtr_)
{
calcTransforms();
}
return *slavePatchToProfileTPtr_;
}
template<class MasterPatch, class SlavePatch>
const tensorField&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
slaveProfileToPatchT() const
{
if (!slaveProfileToPatchTPtr_)
{
calcTransforms();
}
return *slaveProfileToPatchTPtr_;
}
template<class MasterPatch, class SlavePatch>
bool
MixingPlaneInterpolation<MasterPatch, SlavePatch>::movePoints()
{
clearOut();
return true;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,576 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
MixingPlaneInterpolation
Description
The mixingPlaneInterplation class is implementing the interpolation of face
data between two primitivePatches using mixing plane averaging.
Some overview of this development can be found here:
OpenFOAM TURBO TOOLS: FROM GENERAL PURPOSE CFD TO TURBOMACHINERY SIMULATIONS
H. Jasak, M. Beaudoin, Proceedings of ASME-JSME-KSME Joint Fluids
Engineering Conference 2011, AJK2011-FED, July 24-29, 2011, Hamamatsu,
Shizuoka, JAPAN
Steady-state capabilities for hydroturbines with OpenFOAM,
M. Page, M. Beaudoin, A.-M. Giroux, Internationnal Journal of Fluid
Machinery and Systems, 4(1):160170, Jan-Mar 2011.
Development of a General Grid Interface for Turbomachinery simulations with
OpenFOAM, M. Beaudoin, H. Jasak, Open Source CFD International Conference,
December 2008
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
Giving credit where credit is due:
1: Hakan Nilsson from the Chalmers University of Technology came up with the
initial idea of using a combination of 2 GGI interfaces sharing a common
single-face 360 degree ribbons patch in order to compute the circumferential
average of fields. This implementation of the mixingPlane interpolation
algorithm is an exploration of this simple, but rather powerful idea.
2: Maryse Page from Hydro-Quebec provided many test cases and many
simulation runs for testing this interpolation algorithm. Testing is
obviously an essential part of any new development.
3: The authors also want to acknowledge the useful comments from many
colleagues in the OpenFOAM Turbomachinery Special Interest Group.
Nomenclature
ribbon = face object over which we are averaging
direction = axis in which ribbon width is measured
span = axis in which ribbon length is measured
All ribbons have identical length in the chosen coordinate system
SourceFiles
MixingPlaneInterpolation.C
MixingPlaneProfile.C
MixingPlaneInterpolationPatches.C
MixingPlaneInterpolationAddressing.C
MixingPlaneInterpolate.C
\*---------------------------------------------------------------------------*/
#ifndef MixingPlaneInterpolation_H
#define MixingPlaneInterpolation_H
#include "Pstream.H"
#include "className.H"
#include "labelList.H"
#include "scalarField.H"
#include "pointField.H"
#include "FieldFields.H"
#include "faceList.H"
#include "intersection.H"
#include "point2D.H"
#include "NamedEnum.H"
#include "coordinateSystem.H"
#include "boundBox.H"
#include "ggiInterpolation.H"
#include "cylindricalCS.H"
#include "primitivePatch.H"
#include "standAlonePatch.H"
#include <map>
#include <list>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class MixingPlaneInterpolationName Declaration
\*---------------------------------------------------------------------------*/
class MixingPlaneInterpolationName
{
public:
// Public enumerations
//- Define profile assembly rule
enum assembly
{
MASTER,
SLAVE,
BOTH,
USER_DEFINED // User-defined through a file
};
//- Define orientation of profile used to generate the mixing patch
enum orientation
{
UNKNOWN,
// Cartesian coordinate systems
DIR_X_SPAN_Y,
DIR_X_SPAN_Z,
DIR_Y_SPAN_X,
DIR_Y_SPAN_Z,
DIR_Z_SPAN_X,
DIR_Z_SPAN_Y,
// Cylindrical coordinate systems
DIR_R_SPAN_THETA,
DIR_R_SPAN_Z,
DIR_THETA_SPAN_R,
DIR_THETA_SPAN_Z,
DIR_Z_SPAN_R,
DIR_Z_SPAN_THETA
};
//- Define type of mixing for field over patch
enum mixingType
{
averageFromNeighbourPatch,
averageFromNeighbourCellCenter,
averageFromOwnPatch,
zeroGradient,
doNothing
};
// Static data
ClassName("MixingPlaneInterpolation");
//- Assembly names
static const NamedEnum<assembly, 4> assemblyNames_;
//- Orientation names
static const NamedEnum<orientation, 13> orientationNames_;
//- mixing names
static const NamedEnum<mixingType, 5> mixingTypeNames_;
// Constructors
//- Construct null
MixingPlaneInterpolationName()
{}
};
/*---------------------------------------------------------------------------*\
Class MixingPlaneInterpolation Declaration
\*---------------------------------------------------------------------------*/
template<class MasterPatch, class SlavePatch>
class MixingPlaneInterpolation
:
public MixingPlaneInterpolationName
{
// Private data types
typedef std::map<Foam::scalar, std::list<Foam::point> > profileHistogram;
// Private data
//- Reference to the master patch
const MasterPatch& masterPatch_;
//- Reference to the slave patch
const SlavePatch& slavePatch_;
// We need to get some patches identification for debugging purposes
// Since we are currently using primitive patches for the interpolator
// we need to memorize this information when using the constructor
//- Coordinate system for averaging
const coordinateSystem& cs_;
//- Type of mixing plane assembly algorithm
assembly assemblyType_;
//- Orientation of the mixing plane
// direction = axis in which ribbon width is measured
// span = axis in which ribbon length is measured
orientation orientationType_;
//- Interpolation profile
// This list of points defines the profile generating the 'n'
// circular bands we are going to use for
// the circumferential averaging algorithm. For for 'n'
// circular bands, we need 'n + 1' points.
mutable pointField interpolationProfile_;
//- Slave-to-master transformation tensor. Transforms slave data to
// master plane. Size equals number of slave faces; zero length
// indicates no transform. Size 1 indicates constant transform
const tensorField forwardT_;
//- Master-to-slave transformation tensor. Transforms slave data to
// master plane. Size equals number of master faces; zero length
// indicates no transform. Size 1 indicates constant transform
const tensorField reverseT_;
//- Slave-to-master separation vector. Translation of slave data to
// master plane. Size equals number of slave faces; zero length
// indicates no translation.
const vectorField forwardSep_;
// Demand-driven data
//- Transformed master patch
mutable standAlonePatch* transformedMasterPatchPtr_;
//- Transformed shadow patch
mutable standAlonePatch* transformedShadowPatchPtr_;
//- Interpolating patch: strips of the mixing plane
mutable standAlonePatch* mixingPlanePatchPtr_;
//- Tensors for transforming the fields onto a single profile
// before averaging
mutable tensorField* masterPatchToProfileTPtr_;
mutable tensorField* masterProfileToPatchTPtr_;
mutable tensorField* slavePatchToProfileTPtr_;
mutable tensorField* slaveProfileToPatchTPtr_;
// Master patch-to-profile interpolation
//- Master addressing
mutable labelListList* masterPatchToProfileAddrPtr_;
mutable labelListList* masterProfileToPatchAddrPtr_;
//- Master weights
mutable scalarListList* masterPatchToProfileWeightsPtr_;
mutable scalarListList* masterProfileToPatchWeightsPtr_;
// Slave patch-to-profile interpolation
//- Slave addressing
mutable labelListList* slavePatchToProfileAddrPtr_;
mutable labelListList* slaveProfileToPatchAddrPtr_;
//- Slave weights
mutable scalarListList* slavePatchToProfileWeightsPtr_;
mutable scalarListList* slaveProfileToPatchWeightsPtr_;
// Private Member Functions
//- Disallow default bitwise copy construct
MixingPlaneInterpolation
(
const MixingPlaneInterpolation&
);
//- Disallow default bitwise assignment
void operator=(const MixingPlaneInterpolation&);
// Helper functions for demand-driven data
//- Return span
direction spanwiseSwitch() const;
//- Return direction
direction directionalSwitch() const;
//- Construct profile histogram
void updateProfileHistogram
(
profileHistogram& histo,
const point& profileCoord, // 3D point
const direction dir, // Sorting dimension 0: x, 1: y, 2: z
const scalar halfSizeBin // half size of min histogram bin width
) const;
//- Create an interpolation profile from histograms
// Note: histograms are adjusted to achieve full overlap
// HJ, 6/Nov/2009
tmp<pointField> computeProfileFromHistograms
(
const profileHistogram& masterHisto,
const profileHistogram& slaveHisto,
const scalar halfSizeBin // half size of min histogram bin width
) const;
//- Remove interpolationProfile_ points located outside of either
// master/slave patch boundingBox,
// with the exception of the first and last profile points
void removeNonOverlappedProfilePoints
(
boundBox& masterBB,
boundBox& slaveBB
) const;
//- Find and modify patch faces straddling the histogram span
// eg. -180,+180 angle cylindrical coordinate system
void correctStraddlingFaces
(
faceList& cylCoordFaces,
pointField& cylCoordFacesPoint
) const;
//- Calculate transformed patches
void calcTransformedPatches() const;
//- Calculate mixing patch
void calcMixingPlanePatch() const;
//- Calculate addressing and weights
void calcAddressing() const;
//- Calculate Cartesian to Cylindrical tranformation tensor field for
// master and slave patches
void calcTransforms() const;
//- Create an interpolation profile from histograms
tmp<pointField> calcProfile() const;
//- Clear transformed patches
void clearTransfomedPatches();
//- Calculate mixing patch
void clearMixingPlanePatch();
//- Clear addressing
void clearAddressing();
//- Clear transforms
void clearTransforms();
//- Clear all geometry and addressing
void clearOut();
// Interpolation data access
//- Interpolate given source and target, addressing and weights
template<class Type>
void interpolate
(
const Field<Type>& srcF,
const labelListList& srcAddr,
const scalarListList& srcWeights,
const labelListList& dstAddr,
const scalarListList& dstWeights,
Field<Type>& dstResultF
) const;
//- Is a transform required?
inline bool doTransform() const
{
return false;
}
//- Is a separation required?
inline bool doSeparation() const
{
return false;
}
public:
// Constructors
//- Construct from components
MixingPlaneInterpolation
(
const MasterPatch& masterPatch,
const SlavePatch& slavePatch,
const coordinateSystem& cs,
const MixingPlaneInterpolationName::assembly& assemblyType,
const MixingPlaneInterpolationName::orientation& orientationType,
const pointField& interpolationProfile
);
// Destructor
~MixingPlaneInterpolation();
// Member Functions
// Access
//- Return master patch
const MasterPatch& masterPatch() const
{
return masterPatch_;
}
//- Return slave patch
const SlavePatch& slavePatch() const
{
return slavePatch_;
}
//- Return interpolation profile
const pointField& interpolationProfile() const;
//- Return mixing plane patch
const standAlonePatch& mixingPlanePatch() const;
//- Return transformed patch
const standAlonePatch& transformedMasterPatch() const;
//- Return transformed patch
const standAlonePatch& transformedShadowPatch() const;
//- Return reference to master addressing
const labelListList& masterPatchToProfileAddr() const;
const labelListList& masterProfileToPatchAddr() const;
//- Return reference to master weights
const scalarListList& masterPatchToProfileWeights() const;
const scalarListList& masterProfileToPatchWeights() const;
//- Return reference to slave addressing
const labelListList& slavePatchToProfileAddr() const;
const labelListList& slaveProfileToPatchAddr() const;
//- Return reference to slave weights
const scalarListList& slavePatchToProfileWeights() const;
const scalarListList& slaveProfileToPatchWeights() const;
//- Return reference to masterPatchToProfile tensor field
const tensorField& masterPatchToProfileT() const;
//- Return reference to masterProfileToPatchT tensor field
const tensorField& masterProfileToPatchT() const;
//- Return reference to slavePatchToProfileT tensor field
const tensorField& slavePatchToProfileT() const;
//- Return reference to slaveProfileToPatchT tensor field
const tensorField& slaveProfileToPatchT() const;
// Interpolation functions
//- Interpolate from master to slave
template<class Type>
tmp<Field<Type> > masterToSlave
(
const Field<Type>& pf
) const;
template<class Type>
tmp<Field<Type> > masterToSlave
(
const tmp<Field<Type> >& tpf
) const;
//- Interpolate from slave to master
template<class Type>
tmp<Field<Type> > slaveToMaster
(
const Field<Type>& pf
) const;
template<class Type>
tmp<Field<Type> > slaveToMaster
(
const tmp<Field<Type> >& tpf
) const;
//- Interpolate from master to master
//- (self circumferential averaging)
template<class Type>
tmp<Field<Type> > masterToMaster
(
const Field<Type>& pf
) const;
template<class Type>
tmp<Field<Type> > masterToMaster
(
const tmp<Field<Type> >& tpf
) const;
//- Interpolate from slave to slave
//- (self circumferential averaging)
template<class Type>
tmp<Field<Type> > slaveToSlave
(
const Field<Type>& pf
) const;
template<class Type>
tmp<Field<Type> > slaveToSlave
(
const tmp<Field<Type> >& tpf
) const;
// Edit
//- Correct weighting factors for moving mesh.
bool movePoints();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
#ifdef NoRepository
# include "MixingPlaneInterpolation.C"
# include "MixingPlaneProfile.C"
# include "MixingPlaneInterpolationPatches.C"
# include "MixingPlaneInterpolationAddressing.C"
# include "MixingPlaneInterpolate.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,532 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
Mixing plane class dealing with transfer of data between two
primitivePatches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "MixingPlaneInterpolation.H"
#include "demandDrivenData.H"
#include "PrimitivePatch.H"
#include "IOmanip.H"
#include "transform.H"
#include "RodriguesRotation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Compute master and slave patch addressing and weighting factors
//
// Addressing:
// Given the interpolation profile, find under which profile interval falls
// any given master and slave patch faces.
//
// Weighting factors:
// Find the amount of area intersection any given patch faces has with an
// imaginary ribbon spanned from the profile interval that overlaps it.
// Weighting factor == 1.0: The face is completely overlapped
// by its ribbon,
// Weighting factor == 0.0: The face is not overlapped by its ribbon.
// GGI weighting factors are well suited for this.
//
// For every interpolation profile intervals, we got:
// 'n' addresses and weighting factors for the master patch
// 'm' addresses and weighting factors for the slave patch
//
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcAddressing() const
{
if
(
masterPatchToProfileAddrPtr_
|| masterProfileToPatchAddrPtr_
|| masterPatchToProfileWeightsPtr_
|| masterProfileToPatchWeightsPtr_
|| slavePatchToProfileAddrPtr_
|| slaveProfileToPatchAddrPtr_
|| slavePatchToProfileWeightsPtr_
|| slaveProfileToPatchWeightsPtr_
)
{
FatalErrorIn
(
"void MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::calcAddressing() const"
) << "Addressing already calculated"
<< abort(FatalError);
}
if(debug)
{
Info<< "Creating internal GGIs: Large values for the master GGI "
<< "weighting factor corrections are expected."
<< endl;
}
// Construct 2 GGIs in order to evaluate the interpolation weighting
// factors and the addressing
// - Since the profile cannot exactly match either master and slave
// patches perfectly (discretization effects),
// - it is best to use a GGI in order to compute those parameters
// Basic GGI with no mesh transform nor separation
const tensorField noTransform(0);
const vectorField noTranslation(0);
// NB: It is important here that the "ribbon patch" be the master patch
// for each GGIs.
// We have to remember that when evaluating the GGI weighting factors,
// the slave patch faces points
// are projected onto a plane defined at every single master patch
// faces. We then compute a 2D polygon
// intersection using Sutherland-Hodgman, and so on...
// It is thus important that the "ribbon patch" be the same master
// patch for both GGI because the faces
// for both masterPatchCylCoord and slavePatchCylCoord will then be
// projected onto a common geometry.
// By doing so, we hope to minimize geometrical discretization errors
// introduced by the possibly different
// master and slave patch mesh resolution.
GGIInterpolation<standAlonePatch, standAlonePatch>
masterCircumAvgPatchToPatch
(
this->mixingPlanePatch(),
this->transformedMasterPatch(),
noTransform,
noTransform,
noTranslation,
0.0,
0.0,
true // Scale GGI weights
);
GGIInterpolation<standAlonePatch, standAlonePatch>
slaveCircumAvgPatchToPatch
(
this->mixingPlanePatch(),
this->transformedShadowPatch(),
noTransform,
noTransform,
noTranslation,
0.0,
0.0,
true // Scale GGI weights
);
// Memorized the GGI addressing and weighting factors
//
// Basically, the master/slave weights and the master/slave addr values
// from both GGI gives us the information necessary to compute the
// fields circumferential average on the master side, and to transfer
// that averaged value properly back to the slave side.
//
// We get, for each master/slave patches: which face contribute to which
// ribbon, and in which proportion.
//
// The GGI weighting factors will be use to compute the circumferential
// weighted average.
// Since the GGI weighting factors are in fact already factoring in the
// ratio of intersected area versus the full facet area,
// we do end up with a surface-area weighted average when using the GGI
// weighting factors... Pretty neat... MB :)
// Once we collect this information, we will can simply discard the GGIs
// we no longer need them
// The transfer from patch to profile requires the master
// weighting factors so we can do a proper facet surface weighted average
masterPatchToProfileAddrPtr_ =
new labelListList(masterCircumAvgPatchToPatch.masterAddr());
masterPatchToProfileWeightsPtr_ =
new scalarListList(masterCircumAvgPatchToPatch.masterWeights());
slavePatchToProfileAddrPtr_ =
new labelListList(slaveCircumAvgPatchToPatch.masterAddr());
slavePatchToProfileWeightsPtr_ =
new scalarListList(slaveCircumAvgPatchToPatch.masterWeights());
// The transfer from profile to patch requires the slave weighting
// factors so we can transfer the information back to the
// slave patch using the standard GGI mechanism
masterProfileToPatchAddrPtr_ =
new labelListList(masterCircumAvgPatchToPatch.slaveAddr());
masterProfileToPatchWeightsPtr_ =
new scalarListList(masterCircumAvgPatchToPatch.slaveWeights());
slaveProfileToPatchAddrPtr_ =
new labelListList(slaveCircumAvgPatchToPatch.slaveAddr());
slaveProfileToPatchWeightsPtr_ =
new scalarListList(slaveCircumAvgPatchToPatch.slaveWeights());
}
// Generate Cartesian/Cylindrical tranformation tensor fields for
// master and slave patches
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcTransforms() const
{
// Collapse in spanwise direction
const direction spanDir = spanwiseSwitch();
#define useRodrigues
#ifndef useRodrigues
const direction directionDir = directionalSwitch();
#endif
// Master side
masterPatchToProfileTPtr_ = new tensorField(masterPatch_.size());
tensorField& mPatchToProfileT = *masterPatchToProfileTPtr_;
masterProfileToPatchTPtr_ = new tensorField(masterPatch_.size());
tensorField& mProfileToPatchT = *masterProfileToPatchTPtr_;
if (cs_.name() == "coordinateSystem")
{
// Identity tensor for cartesian space
mPatchToProfileT = tensor(sphericalTensor::I);
mProfileToPatchT = tensor(sphericalTensor::I);
}
else
{
// Get master patch face centers.
// Warning: Face normals are not a good choice here. We need a vector
// that will intersect the rotation axis. Furthermore, if the surface
// normals are all parallel with the rotation axis, no valid rotation
// tensors can be computed
// Use face cell centers cause the fields are taken from cell centers
vectorField globalMasterVectors =
masterPatch_.faceCellCentres() - cs_.origin();
// We need unit vectors for computing rotation tensor
// We also need vectors lying into the plane normal to the rotation
// axis. This is a major limitation of the current implementation of
// rotationTensor() that is being used for computing rotation tensors:
// we cannot specify the rotation axis. Instead, when using
// rotationTensor(), the rotation axis will be aligned with the normal
// of the plane spanned by the two vectors.
// RodriguesRotation() was designed to overcome these limitations.
#ifndef useRodrigues
globalMasterVectors.replace(directionDir, 0);
Info << "Debug: " << masterPatch_.faceCellCentres() - globalMasterVectors << endl;
globalMasterVectors /= mag(globalMasterVectors);
#endif
// Move face vector into the local coordinate system
vectorField localMasterVectors = cs_.localVector(globalMasterVectors);
// Translate everything to theta=0
localMasterVectors.replace(spanDir, 0);
// Transform back to global
vectorField transformMasterVectors = cs_.globalVector(localMasterVectors);
if( debug )
{
Info << "Debug: globalMasterVectors: " << globalMasterVectors << endl;
Info << "Debug: transformMasterVectors: " << transformMasterVectors << endl;
}
// Calculate transform tensors. These are pure rotation tensors, aligned
// with the reference frame rotation axis
mPatchToProfileT =
#ifndef useRodrigues
rotationTensor
(
#else
RodriguesRotation
(
cs_.axis(),
#endif
globalMasterVectors,
transformMasterVectors
);
mProfileToPatchT =
#ifndef useRodrigues
rotationTensor
(
#else
RodriguesRotation
(
cs_.axis(),
#endif
transformMasterVectors,
globalMasterVectors
);
#if 0
{
vectorField globalMasterVectors2 = masterPatch_.faceCellCentres() - cs_.origin();
globalMasterVectors2 /= mag(globalMasterVectors);
vectorField localMasterVectors2 = cs_.localVector(globalMasterVectors2);
localMasterVectors2.replace(spanDir, 0);
vectorField transformMasterVectors2 = cs_.globalVector(localMasterVectors2);
Info << "master delta face transf: " << mag(mPatchToProfileT - RodriguesRotation(cs_.axis(), globalMasterVectors, transformMasterVectors)) << endl;
Info << "master delta face transf: " << mag(mProfileToPatchT - RodriguesRotation(cs_.axis(), transformMasterVectors, globalMasterVectors )) << endl;
Info << "master delta face: " << mag(mPatchToProfileT - RodriguesRotation(cs_.axis(), globalMasterVectors2, transformMasterVectors2)) << endl;
Info << "master delta face: " << mag(mProfileToPatchT - RodriguesRotation(cs_.axis(), transformMasterVectors2, globalMasterVectors2 )) << endl;
}
#endif
if (debug != 0)
{
// We can remove this later when agree this is ok.
const vectorField& masterFaceCntr = masterPatch_.faceCellCentres();
pointField transformedFaceCentre1 = transform
(
mPatchToProfileT,
masterFaceCntr
);
pointField transformedFaceCentre2 = transform
(
mProfileToPatchT,
transformedFaceCentre1
);
Info << "::calcTransforms(): mPatchToProfileT: " << mPatchToProfileT << endl;
Info << "::calcTransforms(): mProfileToPatchT: " << mProfileToPatchT << endl;
Info << "::calcTransforms(): globalMasterVectors: " << globalMasterVectors << endl;
Info << "::calcTransforms(): localMasterVectors: " << localMasterVectors << endl;
Info << "::calcTransforms(): transformMasterVectors: " << transformMasterVectors << endl;
Info << "::calcTransforms(): masterFaceCntr: " << masterFaceCntr << endl;
Info << "::calcTransforms(): transformedFaceCentre1: " << transformedFaceCentre1 << endl;
Info << "::calcTransforms(): transformedFaceCentre2: " << transformedFaceCentre2 << endl;
Info << "::calcTransforms(): deltaMag direct: " << mag(transformedFaceCentre1) - mag(masterFaceCntr) << endl;
Info << "::calcTransforms(): deltaMag reverse: " << mag(transformedFaceCentre2) - mag(masterFaceCntr) << endl;
InfoIn
(
"MixingPlaneInterpolation"
"<MasterPatch, SlavePatch>::calcTransforms()"
) << "master face centre transformation check: "
<< "(should be zero!) = "
<< " mag : " << mag(transformedFaceCentre2 - masterFaceCntr) << endl
<< " sum mag: " << sum(mag(transformedFaceCentre2 - masterFaceCntr))
<< endl;
}
}
// Slave side
slavePatchToProfileTPtr_ = new tensorField(slavePatch_.size());
tensorField& sPatchToProfileT = *slavePatchToProfileTPtr_;
slaveProfileToPatchTPtr_ = new tensorField(slavePatch_.size());
tensorField& sProfileToPatchT = *slaveProfileToPatchTPtr_;
if (cs_.name() == "coordinateSystem")
{
// Identity tensor for cartesian space
sPatchToProfileT = tensor(sphericalTensor::I);
sProfileToPatchT = tensor(sphericalTensor::I);
}
else
{
// Get slave patch face centers.
// Warning: Face normals are not a good choice here. We need a vector
// that will intersect the rotation axis. Furthermore, if the surface
// normals are all parallel with the rotation axis, no valid rotation
// tensors can be computed
vectorField globalSlaveVectors =
slavePatch_.faceCellCentres() - cs_.origin();
// We need unit vectors for computing rotation tensor
// We also need vectors lying into the plane normal to the rotation
// axis. This is a major limitation of the current implementation of
// rotationTensor() that is being used for computing rotation tensors:
// we cannot specify the rotation axis. Instead, when using
// rotationTensor(), the rotation axis will be aligned with the normal
// of the plane spanned by the two vectors.
// RodriguesRotation() was designed to overcome these limitations.
#ifndef useRodrigues
globalSlaveVectors.replace(directionDir, 0);
Info << "Debug: " << slavePatch_.faceCellCentres() - globalSlaveVectors << endl;
globalSlaveVectors /= mag(globalSlaveVectors);
#endif
// Move face vector into the local coordinate system
vectorField localSlaveVectors = cs_.localVector(globalSlaveVectors);
// Translate everything to theta=0
localSlaveVectors.replace( spanDir, 0 );
// Transform back to global
vectorField transformSlaveVectors = cs_.globalVector(localSlaveVectors);
// Calculate transform tensors. These are pure rotation tensors, aligned
// with the reference frame rotation axis
sPatchToProfileT =
#ifndef useRodrigues
rotationTensor
(
#else
RodriguesRotation
(
cs_.axis(),
#endif
globalSlaveVectors,
transformSlaveVectors
);
sProfileToPatchT =
#ifndef useRodrigues
rotationTensor
(
#else
RodriguesRotation
(
cs_.axis(),
#endif
transformSlaveVectors,
globalSlaveVectors
);
#if 0
{
vectorField globalSlaveVectors2 = slavePatch_.faceCellCentres() - cs_.origin();
globalSlaveVectors2 /= mag(globalSlaveVectors);
vectorField localSlaveVectors2 = cs_.localVector(globalSlaveVectors2);
localSlaveVectors2.replace(spanDir, 0);
vectorField transformSlaveVectors2 = cs_.globalVector(localSlaveVectors2);
Info << "slave delta face transf: " << mag(sPatchToProfileT - RodriguesRotation(cs_.axis(), globalSlaveVectors, transformSlaveVectors)) << endl;
Info << "slave delta face transf: " << mag(sProfileToPatchT - RodriguesRotation(cs_.axis(), transformSlaveVectors, globalSlaveVectors )) << endl;
Info << "slave delta face: " << mag(sPatchToProfileT - RodriguesRotation(cs_.axis(), globalSlaveVectors2, transformSlaveVectors2)) << endl;
Info << "slave delta face: " << mag(sProfileToPatchT - RodriguesRotation(cs_.axis(), transformSlaveVectors2, globalSlaveVectors2 )) << endl;
}
#endif
if (debug != 0)
{
// We can remove this later when agree this is ok.
const vectorField& slaveFaceCntr = slavePatch_.faceCellCentres();
pointField transformedFaceCentre1 = transform
(
sPatchToProfileT,
slaveFaceCntr
);
pointField transformedFaceCentre2 = transform
(
sProfileToPatchT,
transformedFaceCentre1
);
Info << "::calcTransforms(): globalSlaveVectors: " << globalSlaveVectors << endl;
Info << "::calcTransforms(): localSlaveVectors: " << localSlaveVectors << endl;
Info << "::calcTransforms(): transformSlaveVectors: " << transformSlaveVectors << endl;
Info << "::calcTransforms(): slaveFaceCntr: " << slaveFaceCntr << endl;
Info << "::calcTransforms(): transformedFaceCentre1: " << transformedFaceCentre1 << endl;
Info << "::calcTransforms(): transformedFaceCentre2: " << transformedFaceCentre2 << endl;
Info << "::calcTransforms(): deltaMag direct: " << mag(transformedFaceCentre1) - mag(slaveFaceCntr) << endl;
Info << "::calcTransforms(): deltaMag reverse: " << mag(transformedFaceCentre2) - mag(slaveFaceCntr) << endl;
InfoIn
(
"MixingPlaneInterpolation"
"<SlavePatch, SlavePatch>::calcTransforms()"
) << "slave face centre transformation check: "
<< "(should be zero!) = "
<< " mag : " << mag(transformedFaceCentre2 - slaveFaceCntr) << endl
<< " sum mag: " << sum(mag(transformedFaceCentre2 - slaveFaceCntr))
<< endl;
}
}
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::clearAddressing()
{
// Master side
deleteDemandDrivenData(masterPatchToProfileAddrPtr_);
deleteDemandDrivenData(masterProfileToPatchAddrPtr_);
deleteDemandDrivenData(masterPatchToProfileWeightsPtr_);
deleteDemandDrivenData(masterProfileToPatchWeightsPtr_);
// Slave side
deleteDemandDrivenData(slavePatchToProfileAddrPtr_);
deleteDemandDrivenData(slaveProfileToPatchAddrPtr_);
deleteDemandDrivenData(slavePatchToProfileWeightsPtr_);
deleteDemandDrivenData(slaveProfileToPatchWeightsPtr_);
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::clearTransforms()
{
// Master side
deleteDemandDrivenData(masterPatchToProfileTPtr_);
deleteDemandDrivenData(masterProfileToPatchTPtr_);
// Slave side
deleteDemandDrivenData(slavePatchToProfileTPtr_);
deleteDemandDrivenData(slaveProfileToPatchTPtr_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
Shared template name for MixingPlane interpolation
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "MixingPlaneInterpolation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::MixingPlaneInterpolationName, 0);
template<>
const char*
Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::assembly,
4
>::names[] =
{
"master",
"slave",
"both",
"userDefined"
};
const Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::assembly,
4
>
Foam::MixingPlaneInterpolationName::assemblyNames_;
template<>
const char*
Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::orientation,
13
>::names[] =
{
"unknown",
"dirX_spanY",
"dirX_spanZ",
"dirY_spanX",
"dirY_spanZ",
"dirZ_spanX",
"dirZ_spanY",
"dirR_spanTheta",
"dirR_spanZ",
"dirTheta_spanR",
"dirTheta_spanZ",
"dirZ_spanR",
"dirZ_spanTheta"
};
const Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::orientation,
13
>
Foam::MixingPlaneInterpolationName::orientationNames_;
template<>
const char*
Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::mixingType,
5
>::names[] =
{
"averageFromNeighbourPatch",
"averageFromNeighbourCellCenter",
"averageFromOwnPatch",
"zeroGradient",
"doNothing"
};
const Foam::NamedEnum
<
Foam::MixingPlaneInterpolationName::mixingType,
5
>
Foam::MixingPlaneInterpolationName::mixingTypeNames_;
// ************************************************************************* //

View file

@ -0,0 +1,451 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
Mixing plane class dealing with transfer of data between two
primitivePatches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "MixingPlaneInterpolation.H"
#include "demandDrivenData.H"
#include "PrimitivePatch.H"
#include "IOmanip.H"
#include "transform.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- Find and fix the patch faces that have cylindrical points coordinates in
// contact with or split on both sides of the -180/+180 degree
// axis eg: [-179,+179]
//
// The cure is simple: we first find the problematic faces, (there might be
// none), then we modify only their angle coordinate in
// order to bring the whole face across the angle = +0 axis instead.
// This is a simple shift in cylindrical coordinates,
// but also a pure rotation in cartesian space for the faces.
//
// Since the only objective for these localCoordFaces is to create a patch for
// constructing a temporary GGI in cylindrical coordinate
// space, a single shift will have no effect whatsoever on the GGI weights
// because we are using 360 degrees face ribbons for the other
// GGI patch.
//
// By doing so, we will obvioulsy mess up the clean topology of the original
// cylindrical coordinates patch by shifting around a few faces;
// but keep in mind the only topology necessary for the GGI is the faces
// topology. A bunch of arbitrary located faces is as good as a bunch
// of cleanly laid-out faces into a regular patch. By only shifting the face
// along the angle axis, the face topology is preserved.
//
// Another interesting side-effect of this procedure is that it will cut
// a 360 degrees patch along the -180/+180 axis, leaving two un-connected
// "right-side" and "left-side" edges when switching the patch points to
// cylindrical coordinates.
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
correctStraddlingFaces
(
faceList& localCoordFaces,
pointField& localCoordFacesPoint
) const
{
// Memorize the list of displaced points so we can add them once at the
// end. This minimizes the
// memory reallocation necessary if we would do it one at a time instead.
typedef std::map<label, point> labelPointMap;
labelPointMap newFacePoints;
label newPointLabel = localCoordFacesPoint.size();
// Collect data on span limiting frm coordinate system
coordinateSystem::spanInfo spanLimited = cs_.spanLimited();
boundBox spanBounds = cs_.spanBounds();
const direction spanDir = spanwiseSwitch();
// If there are no limits on both sides of the span,
// adjustment can be skipped
if
(
!spanLimited[spanDir].first()
|| !spanLimited[spanDir].second()
)
{
// Nothing to do
return;
}
// Check if coordinate system is limited in spanwise range
scalar maxSpan = spanBounds.max().component(spanDir);
if (debug)
{
Info<< "Fixing span straddle in direction " << spanDir
<< " for span " << maxSpan << endl;
}
// Do all faces
forAll (localCoordFaces, sFi)
{
bool faceIsOk(true);
scalarField pointsAngleValues =
localCoordFaces[sFi].points
(
localCoordFacesPoint
).component(spanDir);
for (label i = 0; i < pointsAngleValues.size(); i++)
{
for (label j = i + 1; j < pointsAngleValues.size(); j++)
{
// We shift away any faces in contact with the
// straddling axis
if
(
(
mag(pointsAngleValues[i] - pointsAngleValues[j])
> maxSpan
)
|| (mag(mag(pointsAngleValues[i]) - maxSpan)) < VSMALL
|| (mag(mag(pointsAngleValues[j]) - maxSpan)) < VSMALL
)
{
// We need to correct this
// Grab the original points labels
labelList pointLbls = localCoordFaces[sFi];
forAll (pointLbls, ptI)
{
point ptCoord = localCoordFacesPoint[pointLbls[ptI]];
// Switch point across the +0 angle axis
if (ptCoord[spanDir] < 0.0)
{
ptCoord[spanDir] = ptCoord[spanDir] + maxSpan;
}
else
{
ptCoord[spanDir] = ptCoord[spanDir] - maxSpan;
}
// Memorize data in order to reallocate
// localCoordFacesPoint only once
newFacePoints.insert
(
std::pair<label, point>(newPointLabel, ptCoord)
);
// Memorize the new point label right away for this
// face and increment index for the next
localCoordFaces[sFi][ptI] = newPointLabel++;
}
// Done with this face
faceIsOk = false;
break;
}
}
if (!faceIsOk) break;
}
}
// Transfer the new points information into localCoordFacesPoint using
// only one reallocation
// We probably have point duplicates here; no big deal...
localCoordFacesPoint.setSize
(
localCoordFacesPoint.size() + newFacePoints.size()
);
forAllIter(labelPointMap, newFacePoints, nPi)
{
// First == label, Second == point
localCoordFacesPoint[nPi->first] = nPi->second;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::
calcTransformedPatches() const
{
if
(
transformedMasterPatchPtr_
|| transformedShadowPatchPtr_
)
{
FatalErrorIn
(
"void MixingPlaneInterpolation::calcTransformedPatches() const"
) << "Patches already calculated"
<< abort(FatalError);
}
// Duplicate the master/slave patch faces
faceList masterFaces = masterPatch_.localFaces();
faceList slaveFaces = slavePatch_.localFaces();
// Let's compute the patches coordinates values in mixing coordinates
pointField masterPointsLocalCoord =
cs_.localPosition(masterPatch_.localPoints());
pointField slavePointsLocalCoord =
cs_.localPosition(slavePatch_.localPoints());
// Next, we need to find and fix the patch faces that have straddled
// the span
// Note: The face indices and the local coordinates and the
// number of points may be modified within correctStraddlingFaces
// MB, 27/Jan/2011
correctStraddlingFaces(masterFaces, masterPointsLocalCoord);
correctStraddlingFaces(slaveFaces, slavePointsLocalCoord);
if(debug)
{
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcTransformedPatches(): "
<< "masterPointsLocalCoord: "
<< masterPointsLocalCoord << endl;
Info << "MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcTransformedPatches(): "
<< "slavePointsLocalCoord: "
<< slavePointsLocalCoord << endl;
}
// Create the local coords patches
transformedMasterPatchPtr_ =
new standAlonePatch
(
masterFaces,
masterPointsLocalCoord
);
transformedShadowPatchPtr_ =
new standAlonePatch
(
slaveFaces,
slavePointsLocalCoord
);
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcMixingPlanePatch() const
{
if (mixingPlanePatchPtr_)
{
FatalErrorIn
(
"void MixingPlaneInterpolation<MasterPatch, SlavePatch>::"
"calcMixingPlanePatch() const"
) << "Circumferential average patch alreacy calculated"
<< abort(FatalError);
}
const pointField& profile = this->interpolationProfile();
// Create patch from profile
// Grab the bounding boxes of master and slave
boundBox masterBB
(
transformedMasterPatch().localPoints(),
false
);
boundBox slaveBB
(
transformedShadowPatch().localPoints(),
false
);
// Collect data on span limiting from coordinate system
coordinateSystem::spanInfo spanLimited = cs_.spanLimited();
boundBox spanBounds = cs_.spanBounds();
const direction spanDir = spanwiseSwitch();
// Get span from bounding boxes
scalar minSpan =
Foam::min
(
masterBB.min()[spanDir],
slaveBB.min()[spanDir]
) - SMALL;
scalar maxSpan =
Foam::max
(
masterBB.max()[spanDir],
slaveBB.max()[spanDir]
) + SMALL;
if (debug)
{
Info << "::calcMixingPlanePatch: minSpan from patch BB : " << minSpan << endl;
Info << "::calcMixingPlanePatch: maxSpan from patch BB : " << maxSpan << endl;
}
// Correct for limited span
if (spanLimited[spanDir].first())
{
minSpan = spanBounds.min()[spanDir];
}
if (spanLimited[spanDir].second())
{
maxSpan = spanBounds.max()[spanDir];
}
if (debug)
{
Info << "::calcMixingPlanePatch: minSpan after checking spanLimited : " << minSpan << endl;
Info << "::calcMixingPlanePatch: maxSpan after checking spanLimited : " << maxSpan << endl;
}
label nRibbons = profile.size() - 1;
// Points for averaging patch in the local coordinate system
pointField mixingPatchPoints(2*nRibbons + 2);
label nextPointID = 0;
faceList mixingPatchFaces(nRibbons);
scalarField mixingPatchFacesArea(nRibbons);
// Insert lower bound points and expand to bounds
mixingPatchPoints[0] = profile[0];
mixingPatchPoints[0].replace(spanDir, minSpan);
mixingPatchPoints[1] = profile[0];
mixingPatchPoints[1].replace(spanDir, maxSpan);
nextPointID = 2;
// Create patch faces
forAll (mixingPatchFaces, fI)
{
label fi2 = 2*fI;
// Add top bound points and expand to bounds
mixingPatchPoints[nextPointID] = profile[fI + 1];
mixingPatchPoints[nextPointID].replace(spanDir, minSpan);
nextPointID++;
mixingPatchPoints[nextPointID] = profile[fI + 1];
mixingPatchPoints[nextPointID].replace(spanDir, maxSpan);
nextPointID++;
face curFace(4);
curFace[0] = fi2;
curFace[1] = fi2 + 1;
curFace[2] = fi2 + 3;
curFace[3] = fi2 + 2;
mixingPatchFaces[fI] = curFace;
#if 0
// Work in progress... MB 06_2011
// Compute face area
if (spanLimited[spanDir].first() || spanLimited[spanDir].first())
{
scalar ribbonWidth = mag(profile[fI + 1] - profile[fI]);
mixingPatchFacesArea[fI] = 0.0;
}
else
mixingPatchFacesArea[fI] = curFace.mag(mixingPatchPoints);
#endif
}
mixingPlanePatchPtr_ =
new standAlonePatch
(
mixingPatchFaces,
mixingPatchPoints
);
if (debug > 0)
{
Info << "::calcMixingPlanePatch():mixingPatchFacesArea(): " << mixingPatchFacesArea << endl;
InfoIn
(
"void MixingPlaneInterpolation::calcMixingPlanePatch()"
) << "mixingPatch: "
<< *mixingPlanePatchPtr_ << nl
<< "mixingPatch.points : "
<< mixingPlanePatchPtr_->points() << endl;
}
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::clearTransfomedPatches()
{
deleteDemandDrivenData(transformedMasterPatchPtr_);
deleteDemandDrivenData(transformedShadowPatchPtr_);
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::clearMixingPlanePatch()
{
deleteDemandDrivenData(mixingPlanePatchPtr_);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,509 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
MixingPlane interpolation functions
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
namespace Foam
{
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
tmp<pointField>
MixingPlaneInterpolation<MasterPatch, SlavePatch>::computeProfileFromHistograms
(
const profileHistogram& masterHisto,
const profileHistogram& slaveHisto,
const scalar halfSizeBin
) const
{
// Find min, max bounds
scalar histoMinValue =
Foam::min
(
masterHisto.begin()->first,
slaveHisto.begin()->first
);
scalar histoMaxValue =
Foam::max
(
(--masterHisto.end())->first,
(--slaveHisto.end())->first
);
// Next, we compare both histograms, leap-frogging from one histogram
// to the other, everytime jumping to the next largest value from
// a given position
std::list<point> leapFrogProfile(0);
scalar curRvalue = histoMinValue;
if (masterHisto.find(curRvalue) != masterHisto.end())
{
leapFrogProfile.push_back
(
*(masterHisto.find(curRvalue)->second.begin())
);
}
else
{
leapFrogProfile.push_back
(
*(slaveHisto.find(curRvalue)->second.begin())
);
}
do
{
profileHistogram::const_iterator nextMaster =
masterHisto.lower_bound(curRvalue + halfSizeBin - SMALL);
profileHistogram::const_iterator nextSlave =
slaveHisto.lower_bound(curRvalue + halfSizeBin - SMALL);
if
(
nextMaster == masterHisto.end()
|| nextSlave == slaveHisto.end()
)
{
// We are done
if (curRvalue != histoMaxValue)
{
if (masterHisto.find(histoMaxValue) != masterHisto.end())
{
leapFrogProfile.push_back
(
*(masterHisto.find(histoMaxValue)->second.begin())
);
}
else
{
leapFrogProfile.push_back
(
*(slaveHisto.find(histoMaxValue)->second.begin())
);
}
}
break;
}
// Leap frog to the next largest delta
// Please note that we are not taking into account the number of
// values at the specific map index (the attribute called 'second'
// of the map container)
// So by leap-frogging this way, we might ran into the situation
// where the next jump will bring us to a radius value shared by only
// one patch face point, and we might oversee a slightly smaller
// radius shared by 100s of points.
// There is a definite advantage of sticking to existing radius values
// for the profile because this will tend to keep the number of
// GGI face neighbours low.
// I am not sure if there is a nice solution to this problem.... MB
//
curRvalue = max(nextMaster->first, nextSlave->first);
if (masterHisto.find(curRvalue) != masterHisto.end())
{
leapFrogProfile.push_back
(
*(masterHisto.find(curRvalue)->second.begin())
);
}
else
{
leapFrogProfile.push_back
(
*(slaveHisto.find(curRvalue)->second.begin())
);
}
} while (curRvalue != histoMaxValue);
// Re-package the data into pointField
tmp<pointField> tprofile(new pointField(leapFrogProfile.size()));
pointField& profile = tprofile();
label pI = 0;
forAllIter (std::list<point>, leapFrogProfile, lI)
{
profile[pI++] = *lI;
}
return tprofile;
}
template<class MasterPatch, class SlavePatch>
void
MixingPlaneInterpolation<MasterPatch, SlavePatch>::updateProfileHistogram
(
profileHistogram& histo,
const point& profileCoord, // 3D point reference
const direction dir, // Sorting dimension 0: x, 1: y, 2: z
const scalar halfSizeBin // half size of min width for histogram bins
) const
{
bool foundNewBin = true;
scalar keyValue = profileCoord.component(dir);
forAllIter (profileHistogram, histo, histoI)
{
if
(
keyValue >= histoI->first - halfSizeBin
&& keyValue < histoI->first + halfSizeBin
)
{
foundNewBin = false;
histoI->second.push_back(profileCoord);
break;
}
}
if (foundNewBin)
{
std::list<point> initValue;
initValue.push_back(profileCoord);
histo.insert
(
std::pair<scalar, std::list<point> >(keyValue, initValue)
);
}
}
template<class MasterPatch, class SlavePatch>
tmp<pointField>
MixingPlaneInterpolation<MasterPatch, SlavePatch>::calcProfile() const
{
// First, transform patch points over one single global profile
// into local coordinates
pointField masterGlobalProfile =
cs_.localPosition(masterPatch_.localPoints());
pointField slaveGlobalProfile =
cs_.localPosition(slavePatch_.localPoints());
// Collapse all points in the span direction
const direction spanDir = spanwiseSwitch();
masterGlobalProfile.replace(spanDir, 0);
slaveGlobalProfile.replace(spanDir, 0);
if (debug)
{
InfoIn
(
"tmp<pointField> MixingPlaneInterpolation::calcProfile()"
) << "masterGlobalProfile: " << masterGlobalProfile << nl
<< "slaveGlobalProfile: " << slaveGlobalProfile << endl;
}
// Find the smallest edge length from both patches.
// This length will control the size of the bins for the histograms
// we are about to build.
scalar masterMinEdgeLength = GREAT;
const edgeList& masterEdgeList = masterPatch_.edges();
forAll (masterEdgeList, mEi)
{
masterMinEdgeLength =
Foam::min
(
masterMinEdgeLength,
masterEdgeList[mEi].mag(masterPatch_.localPoints())
);
}
scalar slaveMinEdgeLength = GREAT;
const edgeList& slaveEdgeList = slavePatch_.edges();
forAll (slaveEdgeList, sEi)
{
slaveMinEdgeLength =
Foam::min
(
slaveMinEdgeLength,
slaveEdgeList[sEi].mag(slavePatch_.localPoints())
);
}
// There is no point classifying data to a resolution smaller than the
// largest of the two minimum edges found.
// This will drive the size of the smallest bin needed to construct the
// z and r histograms
scalar halfMinSizeBin =
Foam::max(masterMinEdgeLength, slaveMinEdgeLength)/2.0;
if (debug)
{
InfoIn
(
"tmp<pointField> MixingPlaneInterpolation::calcProfile()"
) << "halfMinSizeBin: " << halfMinSizeBin << endl;
}
// Build master and slave histogram
profileHistogram masterHistogram;
profileHistogram slaveHistogram;
// Directional switch
const direction dirDir = directionalSwitch();
// Master side
forAll (masterGlobalProfile, mI)
{
updateProfileHistogram
(
masterHistogram,
masterGlobalProfile[mI],
dirDir,
halfMinSizeBin
);
}
// Shadow side
forAll (slaveGlobalProfile, sI)
{
updateProfileHistogram
(
slaveHistogram,
slaveGlobalProfile[sI],
dirDir,
halfMinSizeBin
);
}
if (debug > 1)
{
// Write histograms
forAllIter (profileHistogram, masterHistogram, zHi)
{
Info<< "master histo (z, n): (" << zHi->first << " "
<< static_cast<int>(zHi->second.size()) << ")" << endl;
}
forAllIter (profileHistogram, slaveHistogram, zHi)
{
Info<< "slave histo (z, n): (" << zHi->first << " "
<< static_cast<int>(zHi->second.size()) << ")" << endl;
}
}
pointField profileBeforeClip;
// Select which type of profile we need
switch (assemblyType_)
{
// To Do: add uniform mixing plane
case MASTER:
{
profileBeforeClip = computeProfileFromHistograms
(
masterHistogram,
masterHistogram,
halfMinSizeBin
);
}
break;
case SLAVE:
{
profileBeforeClip = computeProfileFromHistograms
(
slaveHistogram,
slaveHistogram,
halfMinSizeBin
);
}
break;
case BOTH:
{
profileBeforeClip = computeProfileFromHistograms
(
masterHistogram,
slaveHistogram,
halfMinSizeBin
);
}
break;
case USER_DEFINED:
default:
{
FatalErrorIn
(
"tmp<pointField> MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::calcProfile() const"
) << "Bad type of mixing plane assembly: "
<< MixingPlaneInterpolationName::assemblyNames_[assemblyType_]
<< nl << "Available types are: " << nl
<< MixingPlaneInterpolationName::assemblyNames_
<< abort(FatalError);
}
}
// Remove interpolationProfile_ points located outside of either
// master/slave patch boundingBox,
// with the exception of the first and last profile points
// Martin to work here. HJ, 27/Jan/2011
boundBox masterBB
(
masterGlobalProfile,
false
);
boundBox slaveBB
(
slaveGlobalProfile,
false
);
// Expand the bounding box in the spanwise direction
// Note: All points are collapsed to zero in spanDir
// It is sufficient to expand the box by 1 in this direction
masterBB.min().replace(spanDir, -1);
masterBB.max().replace(spanDir, 1);
slaveBB.min().replace(spanDir, -1);
slaveBB.max().replace(spanDir, 1);
boundBox globSpanBB
(
point(Foam::min(masterBB.min(), slaveBB.min()))
- point(SMALL, SMALL, SMALL),
point(Foam::max(masterBB.max(), slaveBB.max()))
+ point(SMALL, SMALL, SMALL)
);
if (debug)
{
InfoIn
(
"tmp<pointField> MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::calcProfile() const"
) << setprecision(12) << nl
<< "masterBB: " << masterBB << nl
<< "slaveBB: " << slaveBB << nl
<< "globSpanBB: " << globSpanBB << nl
<< "initial profile values: " << profileBeforeClip << endl;
}
// Iterate through profile, removing points located
// outside of either master/slave BB
tmp<pointField> tprofile(new pointField(profileBeforeClip.size()));
pointField& profile = tprofile();
label curIndex = 0;
forAll (profileBeforeClip, pI)
{
if (globSpanBB.contains(profileBeforeClip[pI]))
{
// We keep that profile point
profile[curIndex] = profileBeforeClip[pI];
curIndex++; // Next slot
}
else
{
if (debug)
{
InfoIn
(
"MixingPlaneInterpolation"
"<MasterPatch, SlavePatch>::"
"removeNonOverlappedProfilePoints"
) << setprecision(12) << " Removing point: "
<< profileBeforeClip[pI] << endl;
}
}
}
profile.setSize(curIndex);
if (profile.size() < 2)
{
FatalErrorIn
(
"tmp<pointField> MixingPlaneInterpolation<MasterPatch, "
"SlavePatch>::calcProfile() const"
) << "Lost all points in profile: " << profile
<< abort(FatalError);
}
if (debug)
{
InfoIn
(
"MixingPlaneInterpolation<MasterPatch, SlavePatch>::"
"removeNonOverlappedProfilePoints"
) << "cleaned-up profile values: " << profile << endl;
}
return tprofile;
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class MasterPatch, class SlavePatch>
const Foam::pointField&
MixingPlaneInterpolation<MasterPatch, SlavePatch>::interpolationProfile() const
{
if (interpolationProfile_.size() == 0)
{
// Not a user-defined profile: calculate as per algorithm
interpolationProfile_ = calcProfile();
}
return interpolationProfile_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneInterpolation
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
Description
Mixing plane interpolation: typedefs for polyPatch and faceZone
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneInterpolation_H
#define mixingPlaneInterpolation_H
#include "MixingPlaneInterpolation.H"
#include "PrimitivePatch.H"
#include "face.H"
#include "SubList.H"
#include "pointField.H"
#include "polyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
#if 0
typedef MixingPlaneInterpolation
<
PrimitivePatch<face, SubList, const pointField&>,
PrimitivePatch<face, SubList, const pointField&>
> mixingPlaneInterpolation;
#else
typedef MixingPlaneInterpolation
<
polyPatch,
polyPatch
> mixingPlaneInterpolation;
#endif
#if 0
// Activated later, when parallelization
typedef MixingPlaneInterpolation
<
PrimitivePatch<face, List, const pointField&>,
PrimitivePatch<face, List, const pointField&>
> mixingPlaneZoneInterpolation;
#endif
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
Contributor
Martin Beaudoin, Hydro-Quebec, 2009.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneLduInterface.H"
#include "diagTensorField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlaneLduInterface, 0);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mixingPlaneLduInterface::~mixingPlaneLduInterface()
{}
// ************************************************************************* //

View file

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneLduInterface
Description
An abstract base class for mixingPlane coupled interfaces.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneLduInterface.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneLduInterface_H
#define mixingPlaneLduInterface_H
#include "lduInterface.H"
#include "primitiveFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneLduInterface Declaration
\*---------------------------------------------------------------------------*/
class mixingPlaneLduInterface
{
protected:
// Protected data
//- Transfer buffer
mutable labelField labelTransferBuffer_;
//- Field transfer buffer
mutable scalarField fieldTransferBuffer_;
public:
//- Runtime type information
TypeName("mixingPlaneLduInterface");
// Constructors
//- Construct null
mixingPlaneLduInterface()
:
labelTransferBuffer_(),
fieldTransferBuffer_()
{}
// Destructor
virtual ~mixingPlaneLduInterface();
// Member Functions
//- Is this the master side?
virtual bool master() const = 0;
//- Return shadow interface index
virtual label shadowIndex() const = 0;
//- Return shadow interface
virtual const mixingPlaneLduInterface& shadowInterface() const = 0;
//- Return fine level addressing
virtual const labelListList& addressing() const = 0;
//- Return weights
virtual const scalarListList& weights() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
//- Return face reverse transformation tensor
virtual const tensorField& reverseT() const = 0;
// Transfer buffer access
//- Return contents of the label transfer buffer
const labelField& labelTransferBuffer() const
{
return labelTransferBuffer_;
}
//- Return contents of the field transfer buffer
const scalarField& fieldTransferBuffer() const
{
return fieldTransferBuffer_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor:
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneLduInterfaceField.H"
#include "diagTensorField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlaneLduInterfaceField, 0);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mixingPlaneLduInterfaceField::~mixingPlaneLduInterfaceField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mixingPlaneLduInterfaceField::transformCoupleField
(
scalarField& pnf,
const direction cmpt
) const
{
if (doTransform())
{
if (forwardT().size() == 1)
{
pnf *= pow(diag(forwardT()[0]).component(cmpt), rank());
}
else
{
pnf *= pow(diag(forwardT())().component(cmpt), rank());
}
}
}
// ************************************************************************* //

View file

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneLduInterfaceField
Description
Abstract base class for mixingPlane coupled interface fields.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneLduInterfaceField.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneLduInterfaceField_H
#define mixingPlaneLduInterfaceField_H
#include "primitiveFieldsFwd.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneLduInterfaceField Declaration
\*---------------------------------------------------------------------------*/
class mixingPlaneLduInterfaceField
{
public:
//- Runtime type information
TypeName("mixingPlaneLduInterfaceField");
// Constructors
//- Construct given coupled patch
mixingPlaneLduInterfaceField()
{}
// Destructor
virtual ~mixingPlaneLduInterfaceField();
// Member Functions
// Access
//- Is the transform required
virtual bool doTransform() const = 0;
//- Return face transformation tensor
virtual const tensorField& forwardT() const = 0;
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const = 0;
//- Return rank of component for transform
virtual int rank() const = 0;
//- Transform given patch internal field
void transformCoupleField
(
scalarField& psiInternal,
const direction cmpt
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -32,6 +32,10 @@ namespace Foam
{
defineTypeNameAndDebug(DILUPreconditioner, 0);
lduPreconditioner::
addsymMatrixConstructorToTable<DILUPreconditioner>
addDILUPreconditionerSymMatrixConstructorToTable_;
lduPreconditioner::
addasymMatrixConstructorToTable<DILUPreconditioner>
addDILUPreconditionerAsymMatrixConstructorToTable_;

View file

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
Contributor
Martin Beaudoin, Hydro-Quebec, 2009.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneGAMGInterfaceField.H"
#include "addToRunTimeSelectionTable.H"
#include "lduMatrix.H"
#include "OSspecific.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlaneGAMGInterfaceField, 0);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
mixingPlaneGAMGInterfaceField,
lduInterface
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mixingPlaneGAMGInterfaceField::mixingPlaneGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterface
)
:
GAMGInterfaceField(GAMGCp, fineInterface),
mixingPlaneInterface_(refCast<const mixingPlaneGAMGInterface>(GAMGCp)),
doTransform_(false),
rank_(0),
transferBuffer_()
{
const mixingPlaneLduInterfaceField& p =
refCast<const mixingPlaneLduInterfaceField>(fineInterface);
doTransform_ = p.doTransform();
rank_ = p.rank();
}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::mixingPlaneGAMGInterfaceField::~mixingPlaneGAMGInterfaceField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::mixingPlaneGAMGInterfaceField::initInterfaceMatrixUpdate
(
const scalarField& psiInternal,
scalarField&,
const lduMatrix&,
const scalarField&,
const direction,
const Pstream::commsTypes commsType
) const
{
mixingPlaneInterface_.initInternalFieldTransfer(commsType, psiInternal);
}
void Foam::mixingPlaneGAMGInterfaceField::updateInterfaceMatrix
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix&,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const
{
scalarField pnf =
mixingPlaneInterface_.internalFieldTransfer(commsType, psiInternal);
transformCoupleField(pnf, cmpt);
const unallocLabelList& faceCells = mixingPlaneInterface_.faceCells();
forAll(faceCells, elemI)
{
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
// ************************************************************************* //

View file

@ -0,0 +1,180 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::mixingPlaneGAMGInterfaceField
Description
GAMG agglomerated mixingPlane interface field.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneGAMGInterfaceField.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneGAMGInterfaceField_H
#define mixingPlaneGAMGInterfaceField_H
#include "GAMGInterfaceField.H"
#include "mixingPlaneGAMGInterface.H"
#include "mixingPlaneLduInterfaceField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneGAMGInterfaceField Declaration
\*---------------------------------------------------------------------------*/
class mixingPlaneGAMGInterfaceField
:
public GAMGInterfaceField,
virtual public mixingPlaneLduInterfaceField
{
// Private data
//- Local reference cast into the mixingPlane interface
const mixingPlaneGAMGInterface& mixingPlaneInterface_;
//- Is the transform required
bool doTransform_;
//- Rank of component for transformation
int rank_;
//- Transfer buffer
mutable scalarField transferBuffer_;
// Private Member Functions
//- Disallow default bitwise copy construct
mixingPlaneGAMGInterfaceField(const mixingPlaneGAMGInterfaceField&);
//- Disallow default bitwise assignment
void operator=(const mixingPlaneGAMGInterfaceField&);
public:
//- Runtime type information
TypeName("mixingPlane");
// Constructors
//- Construct from GAMG interface and fine level interface field
mixingPlaneGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const lduInterfaceField& fineInterfaceField
);
// Destructor
virtual ~mixingPlaneGAMGInterfaceField();
// Member Functions
// Access
//- Return size
label size() const
{
return mixingPlaneInterface_.size();
}
// Interface matrix update
//- Initialise neighbour matrix update
virtual void initInterfaceMatrixUpdate
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix& m,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix&,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- MixingPlane interface functions
//- Does the interface field perform the transfromation
virtual bool doTransform() const
{
return doTransform_;
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
{
return mixingPlaneInterface_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
{
return mixingPlaneInterface_.reverseT();
}
//- Return rank of component for transform
virtual int rank() const
{
return rank_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,209 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved
Contributor
Martin Beaudoin, Hydro-Quebec, 2009.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneGAMGInterface.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlaneGAMGInterface, 0);
addToRunTimeSelectionTable
(
GAMGInterface,
mixingPlaneGAMGInterface,
lduInterface
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mixingPlaneGAMGInterface::mixingPlaneGAMGInterface
(
const lduPrimitiveMesh& lduMesh,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
)
:
GAMGInterface(lduMesh),
fineMixingPlaneInterface_
(
refCast<const mixingPlaneLduInterface>(fineInterface)
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mixingPlaneGAMGInterface::~mixingPlaneGAMGInterface()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField> Foam::mixingPlaneGAMGInterface::agglomerateCoeffs
(
const scalarField& fineCoeffs
) const
{
// AMG agglomeration missing
notImplemented("mixingPlaneGAMGInterface::agglomerateCoeffs");
tmp<scalarField> tcoarseCoeffs(new scalarField(size(), 0.0));
scalarField& coarseCoeffs = tcoarseCoeffs();
return tcoarseCoeffs;
}
bool Foam::mixingPlaneGAMGInterface::master() const
{
return fineMixingPlaneInterface_.master();
}
Foam::label Foam::mixingPlaneGAMGInterface::shadowIndex() const
{
return fineMixingPlaneInterface_.shadowIndex();
}
const Foam::mixingPlaneLduInterface&
Foam::mixingPlaneGAMGInterface::shadowInterface() const
{
return refCast<const mixingPlaneLduInterface>
(
ldu().interfaces()[shadowIndex()]
);
}
const Foam::labelListList& Foam::mixingPlaneGAMGInterface::addressing() const
{
FatalErrorIn
(
"const labelListList& mixingPlaneGAMGInterface::addressing() const"
) << "Requested fine addressing at coarse level"
<< abort(FatalError);
return labelListList::null();
}
const Foam::scalarListList& Foam::mixingPlaneGAMGInterface::weights() const
{
FatalErrorIn
(
"const labelListList& mixingPlaneGAMGInterface::weights() const"
) << "Requested fine addressing at coarse level"
<< abort(FatalError);
return scalarListList::null();
}
const Foam::tensorField& Foam::mixingPlaneGAMGInterface::forwardT() const
{
return fineMixingPlaneInterface_.forwardT();
}
const Foam::tensorField& Foam::mixingPlaneGAMGInterface::reverseT() const
{
return fineMixingPlaneInterface_.reverseT();
}
void Foam::mixingPlaneGAMGInterface::initTransfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& interfaceData
) const
{
labelTransferBuffer_ = interfaceData;
}
Foam::tmp<Foam::labelField> Foam::mixingPlaneGAMGInterface::transfer
(
const Pstream::commsTypes,
const unallocLabelList& interfaceData
) const
{
return this->shadowInterface().labelTransferBuffer();
}
void Foam::mixingPlaneGAMGInterface::initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& iF
) const
{
labelTransferBuffer_ = interfaceInternalField(iF);
}
void Foam::mixingPlaneGAMGInterface::initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const scalarField& iF
) const
{
fieldTransferBuffer_ = interfaceInternalField(iF);
}
Foam::tmp<Foam::labelField>
Foam::mixingPlaneGAMGInterface::internalFieldTransfer
(
const Pstream::commsTypes,
const unallocLabelList&
) const
{
return shadowInterface().labelTransferBuffer();
}
Foam::tmp<Foam::scalarField>
Foam::mixingPlaneGAMGInterface::internalFieldTransfer
(
const Pstream::commsTypes,
const scalarField&
) const
{
return shadowInterface().fieldTransferBuffer();
}
// ************************************************************************* //

View file

@ -0,0 +1,195 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::mixingPlaneGAMGInterface
Description
GAMG agglomerated mixingPlane interface.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneGAMGInterface.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneGAMGInterface_H
#define mixingPlaneGAMGInterface_H
#include "GAMGInterface.H"
#include "mixingPlaneLduInterface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneGAMGInterface Declaration
\*---------------------------------------------------------------------------*/
class mixingPlaneGAMGInterface
:
public GAMGInterface,
virtual public mixingPlaneLduInterface
{
// Private data
//- Reference tor the mixingPlaneLduInterface from which this is
// agglomerated
const mixingPlaneLduInterface& fineMixingPlaneInterface_;
// Private Member Functions
//- Disallow default bitwise copy construct
mixingPlaneGAMGInterface(const mixingPlaneGAMGInterface&);
//- Disallow default bitwise assignment
void operator=(const mixingPlaneGAMGInterface&);
// Private static data
//- Processor cluster offset index
static const label procOffset = 1000000;
public:
//- Runtime type information
TypeName("mixingPlane");
// Constructors
//- Construct from fine level interface,
// local and neighbour restrict addressing
mixingPlaneGAMGInterface
(
const lduPrimitiveMesh& lduMesh,
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing
);
// Destructor
virtual ~mixingPlaneGAMGInterface();
// Member Functions
// Agglomeration
//- Agglomerating the given fine-level coefficients and return
virtual tmp<scalarField> agglomerateCoeffs
(
const scalarField& fineCoeffs
) const;
// Interface transfer functions
//- Initialise interface data transfer
virtual void initTransfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& interfaceData
) const;
//- Transfer and return neighbour field
virtual tmp<labelField> transfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& interfaceData
) const;
//- Initialise transfer of internal field adjacent to the interface
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& iF
) const;
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const scalarField& iF
) const;
//- Transfer and return internal field adjacent to the interface
virtual tmp<labelField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const unallocLabelList& iF
) const;
virtual tmp<scalarField> internalFieldTransfer
(
const Pstream::commsTypes commsType,
const scalarField& iF
) const;
//- MixingPlane interface functions
//- Is this the master side?
virtual bool master() const;
//- Return shadow patch index
virtual label shadowIndex() const;
//- Return shadow interface
virtual const mixingPlaneLduInterface& shadowInterface() const;
//- Return addressing
virtual const labelListList& addressing() const;
//- Return weights
virtual const scalarListList& weights() const;
//- Return face transformation tensor
virtual const tensorField& forwardT() const;
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,95 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlanePointPatch.H"
#include "pointBoundaryMesh.H"
#include "pointMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlanePointPatch, 0);
addToRunTimeSelectionTable
(
facePointPatch,
mixingPlanePointPatch,
polyPatch
);
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::mixingPlanePointPatch::initUpdateMesh()
{
facePointPatch::initUpdateMesh();
}
void Foam::mixingPlanePointPatch::updateMesh()
{
facePointPatch::updateMesh();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
//- Construct from components
Foam::mixingPlanePointPatch::mixingPlanePointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
)
:
coupledFacePointPatch(patch, bm),
mixingPlanePolyPatch_(refCast<const mixingPlanePolyPatch>(patch))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mixingPlanePointPatch::~mixingPlanePointPatch()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::mixingPlanePointPatch::coupled() const
{
return true;
}
// ************************************************************************* //

View file

@ -0,0 +1,136 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlanePointPatch
Description
Dummy mixingPlane patch for post-processing. No functionality built in!
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlanePointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlanePointPatch_H
#define mixingPlanePointPatch_H
#include "coupledFacePointPatch.H"
#include "mixingPlanePolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlanePointPatch Declaration
\*---------------------------------------------------------------------------*/
class mixingPlanePointPatch
:
public coupledFacePointPatch
{
// Private data
//- Local reference cast into the cyclic patch
const mixingPlanePolyPatch& mixingPlanePolyPatch_;
// Private Member Functions
//- Disallow default construct as copy
mixingPlanePointPatch(const mixingPlanePointPatch&);
//- Disallow default assignment
void operator=(const mixingPlanePointPatch&);
//- Initialise the calculation of the patch geometry
virtual void initGeometry()
{}
//- Calculate mesh points
virtual void calcGeometry()
{}
//- Correct patches after moving points
virtual void movePoints()
{}
//- Initialise the update of the patch topology
virtual void initUpdateMesh();
//- Update of the patch topology
virtual void updateMesh();
public:
typedef pointBoundaryMesh BoundaryMesh;
//- Runtime type information
TypeName(mixingPlanePolyPatch::typeName_());
// Constructors
//- Construct from components
mixingPlanePointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
);
// Destructor
virtual ~mixingPlanePointPatch();
// Member Functions
// Access
//- Return true because this patch is coupled
virtual bool coupled() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -353,9 +353,13 @@ Foam::label Foam::polyBoundaryMesh::findPatchID(const word& patchName) const
forAll (patches, patchI)
{
if (patches[patchI].name() == patchName)
// Check only if pointer is set. HJ, 28/Jan/2011
if (patches.set(patchI))
{
return patchI;
if (patches[patchI].name() == patchName)
{
return patchI;
}
}
}

View file

@ -464,8 +464,8 @@ Foam::ggiPolyPatch::ggiPolyPatch
)
:
coupledPolyPatch(name, size, start, index, bm),
shadowName_(word::null),
zoneName_(word::null),
shadowName_("_initialize_me_"),
zoneName_("_initialize_me_"),
bridgeOverlap_(false),
shadowIndex_(-1),
zoneIndex_(-1),

View file

@ -0,0 +1,617 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved.
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlanePolyPatch.H"
#include "polyBoundaryMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "demandDrivenData.H"
#include "polyPatchID.H"
#include "polyBoundaryMesh.H"
#include "polyMesh.H"
#include "Time.H"
#include "SubField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(mixingPlanePolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, mixingPlanePolyPatch, word);
addToRunTimeSelectionTable(polyPatch, mixingPlanePolyPatch, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::mixingPlanePolyPatch::calcPatchToPatch() const
{
// Create patch-to-patch interpolation
if (patchToPatchPtr_)
{
FatalErrorIn("void mixingPlanePolyPatch::calcPatchToPatch() const")
<< "Patch to patch interpolation already calculated"
<< abort(FatalError);
}
if (master())
{
// Create dummy interpolation profile
pointField iProfile;
if
(
assemblyType_
== MixingPlaneInterpolationName::USER_DEFINED
)
{
Info<< "Reading interpolation profile from file: "
<< userProfileFile_ << endl;
iProfile = vectorIOField
(
IOobject
(
userProfileFile_,
boundaryMesh().mesh().time().constant(),
boundaryMesh().mesh().time(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
if (iProfile.empty())
{
FatalErrorIn
(
"void mixingPlanePolyPatch::calcPatchToPatch() const"
) << "Empty user-defined mixing plane profile for patch "
<< name() << " read from file " << userProfileFile_
<< abort(FatalError);
}
}
if (debug)
{
Info<< "Creating mixingPlaneInterpolation for patch "
<< name() << " with shadow " << shadowName() << nl
<< "assemblyType = "
<< MixingPlaneInterpolationName::assemblyNames_[assemblyType_]
<< " " << assemblyType_
<< " orientationType = "
<< MixingPlaneInterpolationName::orientationNames_
[orientationType_]
<< " " << orientationType_
<< endl;
}
patchToPatchPtr_ =
new mixingPlaneInterpolation
(
*this,
shadow(),
csPtr_(),
assemblyType_,
orientationType_,
iProfile
);
}
else
{
FatalErrorIn("void mixingPlanePolyPatch::calcPatchToPatch() const")
<< "Attempting to create MixingPlaneInterpolation on a shadow"
<< abort(FatalError);
}
if (debug > 1 && master())
{
Info<< "Writing transformed mixing plane patches as VTK." << nl
<< "Master: " << name()
<< " Slave: " << shadowName()
<< endl;
const polyMesh& mesh = boundaryMesh().mesh();
fileName fvPath(mesh.time().path()/"VTK");
mkDir(fvPath);
patchToPatchPtr_->mixingPlanePatch().writeVTK
(
fvPath/fileName
(
"mixingPlaneRibbon_" + name() + "_" + shadow().name()
)
);
patchToPatchPtr_->transformedMasterPatch().writeVTK
(
fvPath/fileName
(
"mixingPlaneMaster_" + name() + "_" + shadow().name()
)
);
patchToPatchPtr_->transformedShadowPatch().writeVTK
(
fvPath/fileName
(
"mixingPlaneShadow_" + name() + "_" + shadow().name()
)
);
}
}
void Foam::mixingPlanePolyPatch::calcReconFaceCellCentres() const
{
// Create neighbouring face centres using interpolation
if (master())
{
reconFaceCellCentresPtr_ = new vectorField
(
interpolate
(
shadow().faceCellCentres()
- shadow().faceCentres()
)
+ faceCentres()
);
}
else
{
FatalErrorIn
(
"void mixingPlanePolyPatch::calcReconFaceCellCentres() const"
) << "Attempting to create reconFaceCellCentres on a shadow"
<< abort(FatalError);
}
}
void Foam::mixingPlanePolyPatch::clearOut()
{
deleteDemandDrivenData(patchToPatchPtr_);
deleteDemandDrivenData(reconFaceCellCentresPtr_);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::mixingPlanePolyPatch::mixingPlanePolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
)
:
coupledPolyPatch(name, size, start, index, bm),
shadowName_("_initialize_me_"),
csPtr_
(
new coordinateSystem
(
"mixingCS",
vector::zero,
vector(0, 0, 1),
vector(1, 0, 0)
)
),
assemblyType_(mixingPlaneInterpolation::USER_DEFINED),
orientationType_(mixingPlaneInterpolation::UNKNOWN),
userProfileFile_(fileName::null),
shadowIndex_(-1),
patchToPatchPtr_(NULL),
reconFaceCellCentresPtr_(NULL)
{}
Foam::mixingPlanePolyPatch::mixingPlanePolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& shadowName,
const coordinateSystem& cs,
const mixingPlaneInterpolation::assembly assemblyType,
const mixingPlaneInterpolation::orientation orientationType,
const fileName& userProfileFile
)
:
coupledPolyPatch(name, size, start, index, bm),
shadowName_(shadowName),
csPtr_(cs.clone()),
assemblyType_(assemblyType),
orientationType_(orientationType),
userProfileFile_(fileName::null),
shadowIndex_(-1),
patchToPatchPtr_(NULL),
reconFaceCellCentresPtr_(NULL)
{}
Foam::mixingPlanePolyPatch::mixingPlanePolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm
)
:
coupledPolyPatch(name, dict, index, bm),
shadowName_(dict.lookup("shadowPatch")),
csPtr_
(
new coordinateSystem
(
"mixingCS",
vector::zero,
vector(0, 0, 1),
vector(1, 0, 0)
)
),
assemblyType_(mixingPlaneInterpolation::USER_DEFINED),
orientationType_(mixingPlaneInterpolation::UNKNOWN),
userProfileFile_(fileName::null),
shadowIndex_(-1),
patchToPatchPtr_(NULL),
reconFaceCellCentresPtr_(NULL)
{
// When construting from dictionary, only master side information will be
// read and used. This requires special check, because polyBoundaryMesh
// is being filled at this point. See fix in findPatchID.
// HJ, and MB, 28/Jan/2011
// Check if shadow exists. If so, we are on the slave side
polyPatchID shadow(shadowName_, boundaryMesh());
if (!shadow.active())
{
// Master side, read additional data
csPtr_ =
coordinateSystem::New
(
"mixingCS",
dict.subDict("coordinateSystem")
);
assemblyType_ =
MixingPlaneInterpolationName::assemblyNames_.read
(
dict.lookup("assembly")
);
orientationType_ =
MixingPlaneInterpolationName::orientationNames_.read
(
dict.lookup("orientation")
);
if (assemblyType_ == MixingPlaneInterpolationName::USER_DEFINED)
{
if (dict.found("userProfileFile"))
{
dict.lookup("userProfileFile") >> userProfileFile_;
}
else
{
FatalIOErrorIn
(
"mixingPlanePolyPatch::mixingPlanePolyPatch\n"
"(\n"
" const word& name,\n"
" const dictionary& dict,\n"
" const label index,\n"
" const polyBoundaryMesh& bm\n"
")",
dict
) << "Patch: " << name << " : Missing profile entry for "
<< "userDefined profile"
<< abort(FatalIOError);
}
}
}
}
Foam::mixingPlanePolyPatch::mixingPlanePolyPatch
(
const mixingPlanePolyPatch& pp,
const polyBoundaryMesh& bm
)
:
coupledPolyPatch(pp, bm),
shadowName_(pp.shadowName_),
csPtr_(pp.csPtr_->clone()),
assemblyType_(pp.assemblyType_),
orientationType_(pp.orientationType_),
userProfileFile_(pp.userProfileFile_),
shadowIndex_(-1),
patchToPatchPtr_(NULL),
reconFaceCellCentresPtr_(NULL)
{}
//- Construct as copy, resetting the face list and boundary mesh data
Foam::mixingPlanePolyPatch::mixingPlanePolyPatch
(
const mixingPlanePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
)
:
coupledPolyPatch(pp, bm, index, newSize, newStart),
shadowName_(pp.shadowName_),
csPtr_(pp.csPtr_->clone()),
assemblyType_(pp.assemblyType_),
orientationType_(pp.orientationType_),
userProfileFile_(pp.userProfileFile_),
shadowIndex_(-1),
patchToPatchPtr_(NULL),
reconFaceCellCentresPtr_(NULL)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::mixingPlanePolyPatch::~mixingPlanePolyPatch()
{
clearOut();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::label Foam::mixingPlanePolyPatch::shadowIndex() const
{
if (shadowIndex_ == -1 && shadowName_ != Foam::word::null)
{
// Grab shadow patch index
polyPatchID shadow(shadowName_, boundaryMesh());
if (!shadow.active())
{
WarningIn("label mixingPlanePolyPatch::shadowIndex() const")
<< "Shadow patch name " << shadowName_
<< " not found. Please check your MixingPlane definition. "
<< "This may be fine at mesh generation stage."
<< endl;
// Return a large label to indicate "undefined" or slave side
return 99999;
}
shadowIndex_ = shadow.index();
// Check the other side is a mixingPlane
if (!isA<mixingPlanePolyPatch>(boundaryMesh()[shadowIndex_]))
{
FatalErrorIn("label mixingPlanePolyPatch::shadowIndex() const")
<< "Shadow of mixingPlane patch " << name()
<< " named " << shadowName() << " is not a mixingPlane. "
<< "Type: " << boundaryMesh()[shadowIndex_].type() << nl
<< "This is not allowed. Please check your mesh definition."
<< abort(FatalError);
}
// Check for mixingPlane onto self
if (index() == shadowIndex_)
{
FatalErrorIn("label mixingPlanePolyPatch::shadowIndex() const")
<< "mixingPlane patch " << name()
<< " created as its own shadow"
<< abort(FatalError);
}
}
return shadowIndex_;
}
const Foam::mixingPlanePolyPatch& Foam::mixingPlanePolyPatch::shadow() const
{
return refCast<const mixingPlanePolyPatch>(boundaryMesh()[shadowIndex()]);
}
const Foam::coordinateSystem& Foam::mixingPlanePolyPatch::cs() const
{
if (master())
{
return csPtr_();
}
else
{
return shadow().cs();
}
}
const Foam::mixingPlaneInterpolation&
Foam::mixingPlanePolyPatch::patchToPatch() const
{
if (master())
{
if (!patchToPatchPtr_)
{
Info<< "Initializing the mixingPlane interpolator between "
<< "master/shadow patches: "
<< name() << "/" << shadowName()
<< endl;
calcPatchToPatch();
}
return *patchToPatchPtr_;
}
else
{
return shadow().patchToPatch();
}
}
const Foam::vectorField&
Foam::mixingPlanePolyPatch::reconFaceCellCentres() const
{
if (!reconFaceCellCentresPtr_)
{
calcReconFaceCellCentres();
}
return *reconFaceCellCentresPtr_;
}
void Foam::mixingPlanePolyPatch::initGeometry()
{
polyPatch::initGeometry();
}
void Foam::mixingPlanePolyPatch::calcGeometry()
{
// Reconstruct the cell face centres
if (patchToPatchPtr_ && master())
{
// Compute the neighbour face cell center
reconFaceCellCentres();
// Next, identify which cells are located at these locations
// Next, compute the weighting factors in order to properly interpolate
// the field values at those locations. We will be using an inverse
// distance interpolation scheme.
}
calcTransforms();
polyPatch::calcGeometry();
}
void Foam::mixingPlanePolyPatch::initMovePoints(const pointField& p)
{
polyPatch::initMovePoints(p);
}
void Foam::mixingPlanePolyPatch::movePoints(const pointField& p)
{
polyPatch::movePoints(p);
clearOut();
}
void Foam::mixingPlanePolyPatch::initUpdateMesh()
{
polyPatch::initUpdateMesh();
}
void Foam::mixingPlanePolyPatch::updateMesh()
{
polyPatch::updateMesh();
clearOut();
}
void Foam::mixingPlanePolyPatch::calcTransforms()
{
forwardT_.setSize(0);
reverseT_.setSize(0);
separation_.setSize(0);
}
void Foam::mixingPlanePolyPatch::initOrder(const primitivePatch& pp) const
{}
bool Foam::mixingPlanePolyPatch::order
(
const primitivePatch& pp,
labelList& faceMap,
labelList& rotation
) const
{
faceMap.setSize(pp.size(), -1);
rotation.setSize(pp.size(), 0);
// Nothing changes
return false;
}
void Foam::mixingPlanePolyPatch::syncOrder() const
{}
void Foam::mixingPlanePolyPatch::write(Ostream& os) const
{
polyPatch::write(os);
os.writeKeyword("shadowPatch") << shadowName_
<< token::END_STATEMENT << nl;
// Note: only master writes the data
if (master() || shadowIndex_ == -1)
{
// Write coordinate system dictionary. Check by hand. HJ, 26/Jan/2011
os.writeKeyword("coordinateSystem");
csPtr_().writeDict(os, true);
os.writeKeyword("assembly")
<< MixingPlaneInterpolationName::assemblyNames_[assemblyType_]
<< token::END_STATEMENT << nl;
os.writeKeyword("orientation")
<< MixingPlaneInterpolationName::orientationNames_
[orientationType_]
<< token::END_STATEMENT << nl;
if (userProfileFile_ != fileName::null)
{
os.writeKeyword("userProfileFile") << userProfileFile_
<< token::END_STATEMENT << nl;
}
}
}
// ************************************************************************* //

View file

@ -0,0 +1,323 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlanePolyPatch
Description
MixingPlane patch.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlanePolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlanePolyPatch_H
#define mixingPlanePolyPatch_H
#include "coupledPolyPatch.H"
#include "mixingPlaneInterpolation.H"
#include "transform.H"
#include "word.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlanePolyPatch Declaration
\*---------------------------------------------------------------------------*/
class mixingPlanePolyPatch
:
public coupledPolyPatch
{
// Private data
//- Shadow patch name
const word shadowName_;
//- Coordinate system for the mixing plane
autoPtr<coordinateSystem> csPtr_;
//- Type of mixing plane assembly algorithm
MixingPlaneInterpolationName::assembly assemblyType_;
//- Orientation of the mixing plane
// direction = axis in which ribbon width is measured
// span = axis in which ribbon length is measured
MixingPlaneInterpolationName::orientation orientationType_;
//- User-defined interpolation profile file name
fileName userProfileFile_;
// Demand-driven data
//- Shadow patch index. Delayed evaluation for construction
mutable label shadowIndex_;
//- Patch-to-patch interpolation
mutable mixingPlaneInterpolation* patchToPatchPtr_;
//- Reconstructed patch neighbour cell centres
mutable vectorField* reconFaceCellCentresPtr_;
// Private member functions
//- Calculate interpolation
virtual void calcPatchToPatch() const;
//- Calculate reconstructed cell centres
void calcReconFaceCellCentres() const;
//- Force calculation of transformation tensors
virtual void calcTransforms();
//- Clear out
void clearOut();
protected:
// Protected Member functions
//- Initialise the calculation of the patch geometry
virtual void initGeometry();
//- Calculate the patch geometry
virtual void calcGeometry();
//- Initialise the patches for moving points
virtual void initMovePoints(const pointField&);
//- Correct patches after moving points
virtual void movePoints(const pointField&);
//- Initialise the update of the patch topology
virtual void initUpdateMesh();
//- Update of the patch topology
virtual void updateMesh();
public:
//- Runtime type information
TypeName("mixingPlane");
// Constructors
//- Construct from components
mixingPlanePolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
);
//- Construct from components
mixingPlanePolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm,
const word& shadowName,
const coordinateSystem& cs,
const mixingPlaneInterpolation::assembly assemblyType,
const mixingPlaneInterpolation::orientation orientationType,
const fileName& userProfileFile
);
//- Construct from dictionary
mixingPlanePolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh&
);
//- Construct as copy, resetting the boundary mesh
mixingPlanePolyPatch
(
const mixingPlanePolyPatch&,
const polyBoundaryMesh&
);
//- Construct as given the original patch and resetting the
// face list and boundary mesh information
mixingPlanePolyPatch
(
const mixingPlanePolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
);
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new mixingPlanePolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new mixingPlanePolyPatch
(
refCast<const mixingPlanePolyPatch>(*this),
bm,
index,
newSize,
newStart
)
);
}
// Destructor
virtual ~mixingPlanePolyPatch();
// Member functions
//- Return shadow patch name
const word& shadowName() const
{
return shadowName_;
}
//- Return shadow patch index
label shadowIndex() const;
//- Return shadow patch
const mixingPlanePolyPatch& shadow() const;
//- Is this the master side?
bool master() const
{
return index() < shadowIndex();
}
//- Is this the slave side?
bool slave() const
{
return !master();
}
//- Return coordinate system
const coordinateSystem& cs() const;
//- Return reference to patch-to-patch interpolation
// Used only for addressing
const mixingPlaneInterpolation& patchToPatch() const;
//- Interpolate face field: given field on a the shadow side,
// create an interpolated field on this side
template<class Type>
tmp<Field<Type> > interpolate(const Field<Type>& pf) const;
template<class Type>
tmp<Field<Type> > interpolate(const tmp<Field<Type> >& tpf) const;
//- Interpolate face field from average: given field on a the
//- master/slave side, create an interpolated field on the same side
//- using averaged values
template<class Type>
tmp<Field<Type> > circumferentialAverage(const Field<Type>& pf) const;
template<class Type>
tmp<Field<Type> > circumferentialAverage(const tmp<Field<Type> >& tpf) const;
//- Return reconstructed cell centres
const vectorField& reconFaceCellCentres() const;
//- Initialize ordering for primitivePatch. Does not
// refer to *this (except for name() and type() etc.)
virtual void initOrder(const primitivePatch&) const;
//- Return new ordering for primitivePatch.
// Ordering is -faceMap: for every face
// index of the new face -rotation: for every new face the clockwise
// shift of the original face. Return false if nothing changes
// (faceMap is identity, rotation is 0), true otherwise.
virtual bool order
(
const primitivePatch&,
labelList& faceMap,
labelList& rotation
) const;
//- Synchronise communications of ordering for primitivePatch
// Used in cases when no topological change happens locally,
// but is happening on other processors
virtual void syncOrder() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "mixingPlanePolyPatchTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlanePolyPatch.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::mixingPlanePolyPatch::interpolate
(
const Field<Type>& pf
) const
{
if (master())
{
return patchToPatch().slaveToMaster(pf);
}
else
{
return patchToPatch().masterToSlave(pf);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::mixingPlanePolyPatch::interpolate
(
const tmp<Field<Type> >& tpf
) const
{
tmp<Field<Type> > tint = interpolate(tpf());
tpf.clear();
return tint;
}
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::mixingPlanePolyPatch::circumferentialAverage
(
const Field<Type>& pf
) const
{
if (master())
{
return patchToPatch().masterToMaster(pf);
}
else
{
return patchToPatch().slaveToSlave(pf);
}
}
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::mixingPlanePolyPatch::circumferentialAverage
(
const tmp<Field<Type> >& tpf
) const
{
tmp<Field<Type> > tint = circumferentialAverage(tpf());
tpf.clear();
return tint;
}
// ************************************************************************* //

View file

@ -355,8 +355,8 @@ public:
// index. If the point is not found, return -1
label whichPoint(const label gp) const;
//- Given an edge in local point labels, return its
// index in the edge list. If the edge is not found, return -1
//- Given an edge in local point labels, return its index
// in the edge list. If the edge is not found, return -1
label whichEdge(const edge& e) const;
//- Return labels of patch edges in the global edge list using
@ -443,7 +443,7 @@ public:
labelHashSet* setPtr = NULL
) const;
//- Write VTK patch, HJ, 14/Jan/2009
//- Write generic VTK patch, HJ, 14/Jan/2009
static void writeVTK
(
const fileName& name,
@ -451,7 +451,7 @@ public:
const Field<PointType>& points
);
//- Write VTK patch normals, HJ, 14/Jan/2009
//- Write generic VTK patch normals, HJ, 14/Jan/2009
static void writeVTKNormals
(
const fileName& name,
@ -459,6 +459,12 @@ public:
const Field<PointType>& points
);
//- Write VTK patch
void writeVTK(const fileName& name) const;
//- Write VTK patch normals
void writeVTKNormals(const fileName& name) const;
// Edit

View file

@ -497,4 +497,50 @@ writeVTKNormals
}
template
<
class Face,
template<class> class FaceList,
class PointField,
class PointType
>
void
Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
writeVTK
(
const fileName& name
) const
{
PrimitivePatch<Face, FaceList, PointField, PointType>::writeVTK
(
name,
this->localFaces(),
this->localPoints()
);
}
template
<
class Face,
template<class> class FaceList,
class PointField,
class PointType
>
void
Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
writeVTKNormals
(
const fileName& name
) const
{
PrimitivePatch<Face, FaceList, PointField, PointType>::writeVTKNormals
(
name,
this->localFaces(),
this->localPoints()
);
}
// ************************************************************************* //

View file

@ -33,7 +33,7 @@ Description
#ifndef transform_H
#define transform_H
#include "tensor.H"
#include "tensorField.H"
#include "mathematicalConstants.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,6 +56,19 @@ inline tensor rotationTensor
}
inline tmp<tensorField> rotationTensor
(
const vectorField& n1,
const vectorField& n2
)
{
return
(n1 & n2)*I
+ (1 - (n1 & n2))*sqr(n1 ^ n2)/(magSqr(n1 ^ n2) + VSMALL)
+ (n2*n1 - n1*n2);
}
inline label transform(const tensor&, const label i)
{
return i;

View file

@ -23,6 +23,7 @@ $(constraintFvPatches)/processor/processorFvPatch.C
$(constraintFvPatches)/ggi/ggiFvPatch.C
$(constraintFvPatches)/cyclicGgi/cyclicGgiFvPatch.C
$(constraintFvPatches)/overlapGgi/overlapGgiFvPatch.C
$(constraintFvPatches)/mixingPlane/mixingPlaneFvPatch.C
$(constraintFvPatches)/regionCouple/regionCoupleFvPatch.C
derivedFvPatches = $(fvPatches)/derived
@ -110,7 +111,8 @@ $(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
$(constraintFvPatchFields)/ggi/ggiFvPatchFields.C
$(constraintFvPatchFields)/cyclicGgi/cyclicGgiFvPatchFields.C
$(constraintFvPatchFields)/overlapGgi/overlapGgiFvPatchFields.C
$(constraintFvPatchFields)/regionCoupling/regionCouplingFvPatchFields.C
$(constraintFvPatchFields)/mixingPlane/mixingPlaneFvPatchFields.C
$(constraintFvPatchFields)/regionCouple/regionCoupleFvPatchFields.C
derivedFvPatchFields = $(fvPatchFields)/derived
$(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
@ -185,7 +187,12 @@ $(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C
$(constraintFvsPatchFields)/ggi/ggiFvsPatchFields.C
$(constraintFvsPatchFields)/cyclicGgi/cyclicGgiFvsPatchFields.C
$(constraintFvsPatchFields)/overlapGgi/overlapGgiFvsPatchFields.C
<<<<<<< HEAD
$(constraintFvsPatchFields)/regionCoupling/regionCouplingFvsPatchFields.C
=======
$(constraintFvsPatchFields)/mixingPlane/mixingPlaneFvsPatchFields.C
$(constraintFvsPatchFields)/regionCouple/regionCoupleFvsPatchFields.C
>>>>>>> remotes/origin/mixingPlane_RC1
fields/volFields/volFields.C
@ -212,6 +219,9 @@ $(volPointInterpolation)/volPointInterpolation.C
interpolation/pointVolInterpolation/pointVolInterpolation.C
pointVolInterpolation = interpolation/pointVolInterpolation
$(pointVolInterpolation)/pointVolInterpolation.C
surfaceInterpolation = interpolation/surfaceInterpolation
$(surfaceInterpolation)/surfaceInterpolation/surfaceInterpolation.C
$(surfaceInterpolation)/surfaceInterpolationScheme/surfaceInterpolationSchemes.C

View file

@ -0,0 +1,297 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneFvPatchField.H"
#include "volMesh.H"
#include "surfaceMesh.H"
#include "fvsPatchField.H"
#include "volFields.H"
#include "interpolationCellPoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
coupledFvPatchField<Type>(p, iF),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{}
template<class Type>
mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
coupledFvPatchField<Type>(p, iF, dict, false),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{
if (!isType<mixingPlaneFvPatch>(p))
{
FatalIOErrorIn
(
"mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, volMesh>& iF,\n"
" const dictionary& dict\n"
")\n",
dict
) << "patch " << this->patch().index() << " not mixingPlane type. "
<< "Patch type = " << p.type()
<< exit(FatalIOError);
}
if (!dict.found("value"))
{
// Grab the internal value for initialisation.
fvPatchField<Type>::operator=(this->patchInternalField()());
}
}
template<class Type>
mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField
(
const mixingPlaneFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
coupledFvPatchField<Type>(ptf, p, iF, mapper),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{
if (!isType<mixingPlaneFvPatch>(this->patch()))
{
FatalErrorIn
(
"mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField\n"
"(\n"
" const mixingPlaneFvPatchField<Type>& ptf,\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, volMesh>& iF,\n"
" const fvPatchFieldMapper& mapper\n"
")\n"
) << "Field type does not correspond to patch type for patch "
<< this->patch().index() << "." << endl
<< "Field type: " << typeName << endl
<< "Patch type: " << this->patch().type()
<< exit(FatalError);
}
}
template<class Type>
mixingPlaneFvPatchField<Type>::mixingPlaneFvPatchField
(
const mixingPlaneFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
mixingPlaneLduInterfaceField(),
coupledFvPatchField<Type>(ptf, iF),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(ptf.patch()))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Return neighbour field
template<class Type>
tmp<Field<Type> > mixingPlaneFvPatchField<Type>::patchNeighbourField() const
{
if(debug > 1)
{
Info << "mixingPlaneFvPatchField<Type>::patchNeighbourField(): for field: " << this->dimensionedInternalField().name();
Info << " on patch: " << this->patch().name() << endl;
Info << " surface Area: " << gSum(this->patch().magSf()) << endl;
}
const Field<Type>& iField = this->internalField();
// Get shadow face-cells and assemble shadow field
const unallocLabelList& sfc = mixingPlanePatch_.shadow().faceCells();
Field<Type> sField(sfc.size());
forAll (sField, i)
{
sField[i] = iField[sfc[i]];
}
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
Field<Type>& pnf = tpnf();
if (this->size() > 0)
{
pnf = mixingPlanePatch_.interpolate(sField);
}
return tpnf;
}
template<class Type>
void mixingPlaneFvPatchField<Type>::initEvaluate
(
const Pstream::commsTypes commsType
)
{
if(debug)
Info << "Inside mixingPlaneFvPatchField<Type>::initEvaluate: for field: " << this->dimensionedInternalField().name() << endl;
if(this->size() > 0)
{
if (!this->updated())
{
this->updateCoeffs();
}
Field<Type> pf
(
this->patch().weights()*this->patchInternalField()
+ (1.0 - this->patch().weights())*this->patchNeighbourField()
);
Field<Type>::operator=(pf);
}
}
template<class Type>
void mixingPlaneFvPatchField<Type>::evaluate
(
const Pstream::commsTypes
)
{
if(this->size() > 0)
{
if (!this->updated())
{
this->updateCoeffs();
}
}
}
template<class Type>
void mixingPlaneFvPatchField<Type>::initInterfaceMatrixUpdate
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix&,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const
{
if(this->size() > 0)
{
// Get shadow face-cells and assemble shadow field
const unallocLabelList& sfc = mixingPlanePatch_.shadow().faceCells();
scalarField sField(sfc.size());
forAll (sField, i)
{
sField[i] = psiInternal[sfc[i]];
}
scalarField pnf = mixingPlanePatch_.interpolate(sField);
// Multiply the field by coefficients and add into the result
const unallocLabelList& fc = mixingPlanePatch_.faceCells();
forAll(fc, elemI)
{
result[fc[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
}
template<class Type>
void mixingPlaneFvPatchField<Type>::updateInterfaceMatrix
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix&,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes
) const
{}
// Return averaged field on patch
template<class Type>
tmp<Field<Type> > mixingPlaneFvPatchField<Type>::patchCircumferentialAverageField() const
{
// Compute circum average of self
return this->mixingPlanePatch_.circumferentialAverage(*this);
}
// Return the averaged field for patchInternalField
template<class Type>
tmp<Field<Type> > mixingPlaneFvPatchField<Type>::patchInternalField() const
{
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
Field<Type>& pnf = tpnf();
if (this->size() > 0)
{
pnf = this->mixingPlanePatch_.circumferentialAverage(fvPatchField<Type>::patchInternalField());
}
return tpnf;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,232 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvPatchField
Description
MixingPlane interface patch field.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvPatchField_H
#define mixingPlaneFvPatchField_H
#include "coupledFvPatchField.H"
#include "mixingPlaneLduInterfaceField.H"
#include "mixingPlaneFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class mixingPlaneFvPatchField
:
public mixingPlaneLduInterfaceField,
public coupledFvPatchField<Type>
{
// Private data
//- Local reference cast into the mixingPlane patch
const mixingPlaneFvPatch& mixingPlanePatch_;
public:
//- Runtime type information
TypeName(mixingPlaneFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
mixingPlaneFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
mixingPlaneFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given mixingPlaneFvPatchField onto a new patch
mixingPlaneFvPatchField
(
const mixingPlaneFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy setting internal field reference
mixingPlaneFvPatchField
(
const mixingPlaneFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new mixingPlaneFvPatchField<Type>(*this)
);
}
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new mixingPlaneFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Return my average field given internal cell data
virtual tmp<Field<Type> > patchInternalField() const;
//- Return neighbour field given internal cell data
virtual tmp<Field<Type> > patchNeighbourField() const;
//- Initialise the evaluation of the patch field
virtual void initEvaluate(const Pstream::commsTypes commsType);
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType
);
//- Initialise neighbour matrix update
virtual void initInterfaceMatrixUpdate
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix& m,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
const scalarField& psiInternal,
scalarField& result,
const lduMatrix&,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Return patch averaged field given internal cell data
virtual tmp<Field<Type> > patchCircumferentialAverageField() const;
//- Return neighbour averaged field given internal cell data
virtual tmp<Field<Type> > patchNeighbourAveragedField() const
{
// Already averaged from patchNeighbourField
return patchNeighbourField();
}
// MixingPlane coupled interface functions
//- Does the patch field perform the transformation
virtual bool doTransform() const
{
return
!(
mixingPlanePatch_.parallel()
|| pTraits<Type>::rank == 0
);
}
//- Return face transformation tensor
virtual const tensorField& forwardT() const
{
return mixingPlanePatch_.forwardT();
}
//- Return neighbour-cell transformation tensor
virtual const tensorField& reverseT() const
{
return mixingPlanePatch_.reverseT();
}
//- Return rank of component for transform
virtual int rank() const
{
return pTraits<Type>::rank;
}
//- Write
// virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "mixingPlaneFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
MixingPlane patch field, providing coupling
between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(mixingPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvPatchFields
Description
MixingPlane patch field, providing coupling
between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneFvPatchFields.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvPatchFields_H
#define mixingPlaneFvPatchFields_H
#include "mixingPlaneFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(mixingPlane)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,64 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvPatchField
Description
MixingPlane patch field, providing coupling
between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvPatchFieldsFwd_H
#define mixingPlaneFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class mixingPlaneFvPatchField;
makePatchTypeFieldTypedefs(mixingPlane)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
Mixing plane fvs patch
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
\*---------------------------------------------------------------------------*/
#include "mixingPlaneFvsPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF
)
:
coupledFvsPatchField<Type>(p, iF),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{}
template<class Type>
mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
)
:
coupledFvsPatchField<Type>(p, iF, dict, true),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{
if (!isType<mixingPlaneFvPatch>(p))
{
FatalIOErrorIn
(
"mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField\n"
"(\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, surfaceMesh>& iF,\n"
" const dictionary& dict\n"
")\n",
dict
) << "patch " << this->patch().index() << " not mixingPlane type. "
<< "Patch type = " << p.type()
<< exit(FatalIOError);
}
}
template<class Type>
mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField
(
const mixingPlaneFvsPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
coupledFvsPatchField<Type>(ptf, p, iF, mapper),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(p))
{
if (!isType<mixingPlaneFvPatch>(this->patch()))
{
FatalErrorIn
(
"mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField\n"
"(\n"
" const mixingPlaneFvsPatchField<Type>& ptf,\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, surfaceMesh>& iF,\n"
" const fvPatchFieldMapper& mapper\n"
")\n"
) << "Field type does not correspond to patch type for patch "
<< this->patch().index() << "." << endl
<< "Field type: " << typeName << endl
<< "Patch type: " << this->patch().type()
<< exit(FatalError);
}
}
template<class Type>
mixingPlaneFvsPatchField<Type>::mixingPlaneFvsPatchField
(
const mixingPlaneFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
)
:
coupledFvsPatchField<Type>(ptf, iF),
mixingPlanePatch_(refCast<const mixingPlaneFvPatch>(ptf.patch()))
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,145 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvsPatchField
Description
MixingPlane interface patch field.
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneFvsPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvsPatchField_H
#define mixingPlaneFvsPatchField_H
#include "coupledFvsPatchField.H"
#include "mixingPlaneFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixingPlaneFvsPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class mixingPlaneFvsPatchField
:
public coupledFvsPatchField<Type>
{
// Private data
//- Local reference cast into the mixingPlane patch
const mixingPlaneFvPatch& mixingPlanePatch_;
public:
//- Runtime type information
TypeName(mixingPlaneFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
mixingPlaneFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct from patch, internal field and dictionary
mixingPlaneFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const dictionary&
);
//- Construct by mapping given mixingPlaneFvsPatchField onto a
// new patch
mixingPlaneFvsPatchField
(
const mixingPlaneFvsPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy setting internal field reference
mixingPlaneFvsPatchField
(
const mixingPlaneFvsPatchField<Type>&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct and return a clone
virtual tmp<fvsPatchField<Type> > clone() const
{
return tmp<fvsPatchField<Type> >
(
new mixingPlaneFvsPatchField<Type>(*this)
);
}
//- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchField<Type> > clone
(
const DimensionedField<Type, surfaceMesh>& iF
) const
{
return tmp<fvsPatchField<Type> >
(
new mixingPlaneFvsPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "mixingPlaneFvsPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Description
MixingPlane patch field, providing coupling between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#include "mixingPlaneFvsPatchFields.H"
#include "fvsPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFvsPatchFields(mixingPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvsPatchFields
Description
MixingPlane patch field, providing coupling
between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
SourceFiles
mixingPlaneFvsPatchFields.C
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvsPatchFields_H
#define mixingPlaneFvsPatchFields_H
#include "mixingPlaneFvsPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFvsPatchTypeFieldTypedefs(mixingPlane)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,63 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
mixingPlaneFvsPatchField
Description
MixingPlane patch field, providing coupling between arbitrary patches
Author
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
Contributor
Hrvoje Jasak, Wikki Ltd.
\*---------------------------------------------------------------------------*/
#ifndef mixingPlaneFvsPatchFieldsFwd_H
#define mixingPlaneFvsPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class mixingPlaneFvsPatchField;
makeFvsPatchTypeFieldTypedefs(mixingPlane)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

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