mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://graham@hunt//home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -206,8 +206,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const word csName = args["from"];
|
const word csName = args["from"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -from " << csName << nl
|
<< "Cannot find -from " << csName << nl
|
||||||
@ -215,15 +215,15 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
fromCsys.reset(new coordinateSystem(csLst[csId]));
|
fromCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("to"))
|
if (args.optionFound("to"))
|
||||||
{
|
{
|
||||||
const word csName = args["to"];
|
const word csName = args["to"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -to " << csName << nl
|
<< "Cannot find -to " << csName << nl
|
||||||
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
toCsys.reset(new coordinateSystem(csLst[csId]));
|
toCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -195,8 +195,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const word csName = args["from"];
|
const word csName = args["from"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -from " << csName << nl
|
<< "Cannot find -from " << csName << nl
|
||||||
@ -204,15 +204,15 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
fromCsys.reset(new coordinateSystem(csLst[csId]));
|
fromCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("to"))
|
if (args.optionFound("to"))
|
||||||
{
|
{
|
||||||
const word csName = args["to"];
|
const word csName = args["to"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -to " << csName << nl
|
<< "Cannot find -to " << csName << nl
|
||||||
@ -220,7 +220,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
toCsys.reset(new coordinateSystem(csLst[csId]));
|
toCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -208,8 +208,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const word csName = args["from"];
|
const word csName = args["from"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -from " << csName << nl
|
<< "Cannot find -from " << csName << nl
|
||||||
@ -217,15 +217,15 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
fromCsys.reset(new coordinateSystem(csLst[csId]));
|
fromCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("to"))
|
if (args.optionFound("to"))
|
||||||
{
|
{
|
||||||
const word csName = args["to"];
|
const word csName = args["to"];
|
||||||
|
|
||||||
label csId = csLst.find(csName);
|
const label csIndex = csLst.findIndex(csName);
|
||||||
if (csId < 0)
|
if (csIndex < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot find -to " << csName << nl
|
<< "Cannot find -to " << csName << nl
|
||||||
@ -233,7 +233,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
toCsys.reset(new coordinateSystem(csLst[csId]));
|
toCsys.reset(new coordinateSystem(csLst[csIndex]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -200,6 +200,34 @@ checkLineLengthNonComments()
|
|||||||
dieOnBadFiles "Limit code to 80 columns before pushing"
|
dieOnBadFiles "Limit code to 80 columns before pushing"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# limit line length to 80-columns, except #directive lines
|
||||||
|
#
|
||||||
|
checkLineLengthNonDirective()
|
||||||
|
{
|
||||||
|
badFiles=$(
|
||||||
|
for f in $fileList
|
||||||
|
do
|
||||||
|
# limit to *.[CH] files
|
||||||
|
case "$f" in
|
||||||
|
(*.[CH])
|
||||||
|
# parse line numbers from this (strip comment lines):
|
||||||
|
# path/fileName:<lineNr>: contents
|
||||||
|
lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
|
||||||
|
sed -n \
|
||||||
|
-e '\@^[^:]*:[^:]*: *#.*@b' \
|
||||||
|
-e 's@^[^:]*:\([0-9]*\):.*@\1@p' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)
|
||||||
|
[ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
|
dieOnBadFiles "Limit code to 80 columns before pushing"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# do all checks
|
# do all checks
|
||||||
@ -215,7 +243,7 @@ checkIllegalCode
|
|||||||
checkCopyright
|
checkCopyright
|
||||||
|
|
||||||
# ensure code conforms to 80 columns max
|
# ensure code conforms to 80 columns max
|
||||||
checkLineLength
|
checkLineLengthNonDirective
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
11
debian/changelog
vendored
11
debian/changelog
vendored
@ -1,11 +0,0 @@
|
|||||||
openfoam170 (0-1ubuntu1) lucid; urgency=low
|
|
||||||
|
|
||||||
* some change
|
|
||||||
|
|
||||||
-- opencfd <opencfd@hunt-vm64> Wed, 14 Jul 2010 10:44:35 +0100
|
|
||||||
|
|
||||||
openfoam170 (0-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial release
|
|
||||||
|
|
||||||
-- OpenCFD Ltd. <patches@opencfd.co.uk> Mon, 14 Jun 2010 16:50:46 +0100
|
|
||||||
1
debian/compat
vendored
1
debian/compat
vendored
@ -1 +0,0 @@
|
|||||||
7
|
|
||||||
19
debian/control
vendored
19
debian/control
vendored
@ -1,19 +0,0 @@
|
|||||||
Source: openfoam170
|
|
||||||
Section: optional
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: OpenCFD Ltd. <patches@opencfd.co.uk>
|
|
||||||
Build-Depends: debhelper (>= 7), quilt
|
|
||||||
Standards-Version: 3.8.4
|
|
||||||
Homepage: http://www.openfoam.com
|
|
||||||
|
|
||||||
Package: openfoam170
|
|
||||||
Architecture: any
|
|
||||||
Depends: csh,g++,${shlibs:Depends}, ${misc:Depends},binutils-dev,flex,libscotch-dev,libopenmpi-dev,libxt-dev,openmpi-bin
|
|
||||||
Description: OpenFOAM
|
|
||||||
OpenFOAM is a free, open source CFD software package produced by a
|
|
||||||
commercial company, OpenCFD Ltd. It has a large user base across
|
|
||||||
most areas of engineering and science, from both commercial and academic
|
|
||||||
organisations. OpenFOAM has an extensive range of features to solve
|
|
||||||
anything from complex fluid flows involving chemical reactions, turbulence
|
|
||||||
and heat transfer, to solid dynamics and electromagnetics.
|
|
||||||
|
|
||||||
30
debian/copyright
vendored
30
debian/copyright
vendored
@ -1,30 +0,0 @@
|
|||||||
This work was packaged for Debian by:
|
|
||||||
|
|
||||||
OpenCFD Ltd. <patches@opencfd.co.uk> on Mon, 14 Jun 2010 16:50:46 +0100
|
|
||||||
|
|
||||||
Copyright:
|
|
||||||
|
|
||||||
Copyright (C) 1991-2010 OpenCFD Ltd.
|
|
||||||
|
|
||||||
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/>.
|
|
||||||
|
|
||||||
The Debian packaging is:
|
|
||||||
|
|
||||||
Copyright (C) 2010 OpenCFD Ltd. <patches@opencfd.co.uk>
|
|
||||||
|
|
||||||
and is licensed under the GPL version 3
|
|
||||||
0
debian/docs
vendored
0
debian/docs
vendored
48
debian/postinst
vendored
48
debian/postinst
vendored
@ -1,48 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# postinst script for OpenFOAM
|
|
||||||
#
|
|
||||||
# see: dh_installdeb(1)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# summary of how this script can be called:
|
|
||||||
# * <postinst> `configure' <most-recently-configured-version>
|
|
||||||
# * <old-postinst> `abort-upgrade' <new version>
|
|
||||||
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
|
|
||||||
# <new-version>
|
|
||||||
# * <postinst> `abort-remove'
|
|
||||||
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
|
|
||||||
# <failed-install-package> <version> `removing'
|
|
||||||
# <conflicting-package> <version>
|
|
||||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
|
||||||
# the debian-policy package
|
|
||||||
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
configure)
|
|
||||||
#echo "** postinst called with $*"
|
|
||||||
echo ""
|
|
||||||
echo "** To use OpenFOAM please add"
|
|
||||||
echo "**"
|
|
||||||
echo "** . /opt/openfoam170/etc/bashrc"
|
|
||||||
echo "**"
|
|
||||||
echo "** To your ~/.bashrc"
|
|
||||||
echo ""
|
|
||||||
;;
|
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "postinst called with unknown argument \`$1'" >&2
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# dh_installdeb will replace this with shell code automatically
|
|
||||||
# generated by other debhelper scripts.
|
|
||||||
|
|
||||||
#DEBHELPER#
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
109
debian/rules
vendored
109
debian/rules
vendored
@ -1,109 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
#-*- makefile -*-
|
|
||||||
# After debian/rules from less package
|
|
||||||
|
|
||||||
include /usr/share/quilt/quilt.make
|
|
||||||
|
|
||||||
# Uncomment this to turn on verbose mode.
|
|
||||||
export DH_VERBOSE=1
|
|
||||||
|
|
||||||
# This is the debhelper compatibility version to use.
|
|
||||||
|
|
||||||
#DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
|
||||||
#DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
|
||||||
#ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
|
|
||||||
#CONFARGS= --host=$(DEB_HOST_GNU_TYPE)
|
|
||||||
#endif
|
|
||||||
#
|
|
||||||
#CFLAGS = -Wall -g #-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
|
||||||
#
|
|
||||||
#ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
|
||||||
#CFLAGS += -O0
|
|
||||||
#else
|
|
||||||
#CFLAGS += -O2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DEB_BUILD_ARCH_BITS = $(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)
|
|
||||||
foamArch=
|
|
||||||
ifeq ($(DEB_BUILD_ARCH_BITS),64)
|
|
||||||
foamArch=linux64GccDPOpt
|
|
||||||
else
|
|
||||||
foamArch=linuxGccDPOpt
|
|
||||||
endif
|
|
||||||
|
|
||||||
packageName = $(shell dh_listpackages)
|
|
||||||
installDir = debian/$(packageName)/opt/$(packageName)
|
|
||||||
paraviewInstallDir = /opt/paraviewopenfoam380
|
|
||||||
|
|
||||||
DEB_DH_SHLIBDEPS_ARGS=-L$(installDir)/lib/$(foamArch)
|
|
||||||
|
|
||||||
build: patch build-stamp
|
|
||||||
build-stamp:
|
|
||||||
dh_testdir
|
|
||||||
|
|
||||||
# Add here commands to compile the package.
|
|
||||||
#./Allwmake
|
|
||||||
|
|
||||||
touch build-stamp
|
|
||||||
|
|
||||||
clean: unpatch
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
rm -f build-stamp
|
|
||||||
|
|
||||||
# Add here commands to clean up after the build process.
|
|
||||||
#./Allwclean
|
|
||||||
#set
|
|
||||||
|
|
||||||
dh_clean
|
|
||||||
|
|
||||||
install: build
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
dh_prep
|
|
||||||
dh_installdirs
|
|
||||||
|
|
||||||
# Install source files into debian/.
|
|
||||||
install -d $(installDir)
|
|
||||||
tar cf - `bin/foamSourceFiles .` | (cd $(installDir); tar xfp -)
|
|
||||||
(cd $(installDir); bin/tools/foamConfigurePaths --foamInstall /opt --projectName $(packageName) --paraviewInstall $(paraviewInstallDir) )
|
|
||||||
|
|
||||||
# Install binary files into debian/.
|
|
||||||
tar cf - `bin/foamBinDirs . $(foamArch)` | (cd $(installDir); tar xfp -)
|
|
||||||
|
|
||||||
# Build architecture-independent files here.
|
|
||||||
binary-indep: build install
|
|
||||||
# We have nothing to do by default.
|
|
||||||
|
|
||||||
# Build architecture-dependent files here.
|
|
||||||
binary-arch: build install
|
|
||||||
dh_testdir
|
|
||||||
dh_testroot
|
|
||||||
dh_installdebconf
|
|
||||||
dh_installdocs
|
|
||||||
dh_installexamples
|
|
||||||
dh_installmenu
|
|
||||||
# dh_installemacsen
|
|
||||||
# dh_installinit
|
|
||||||
dh_installmime
|
|
||||||
dh_installcron
|
|
||||||
#dh_installman debian/lesspipe.1
|
|
||||||
#dh_undocumented
|
|
||||||
dh_installchangelogs
|
|
||||||
#dh_link
|
|
||||||
#dh_strip
|
|
||||||
dh_compress
|
|
||||||
dh_fixperms
|
|
||||||
dh_makeshlibs
|
|
||||||
dh_installdeb
|
|
||||||
# dh_perl
|
|
||||||
dh_shlibdeps -- --ignore-missing-info #We depend on vtk libs without info
|
|
||||||
dh_gencontrol
|
|
||||||
dh_md5sums
|
|
||||||
dh_builddeb
|
|
||||||
|
|
||||||
source diff:
|
|
||||||
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
|
|
||||||
|
|
||||||
binary: binary-indep binary-arch
|
|
||||||
.PHONY: build clean binary-indep binary-arch binary
|
|
||||||
@ -26,6 +26,7 @@ License
|
|||||||
#include "ZoneMesh.H"
|
#include "ZoneMesh.H"
|
||||||
#include "entry.H"
|
#include "entry.H"
|
||||||
#include "demandDrivenData.H"
|
#include "demandDrivenData.H"
|
||||||
|
#include "stringListOps.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -241,6 +242,66 @@ Foam::wordList Foam::ZoneMesh<ZoneType, MeshType>::names() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType, class MeshType>
|
||||||
|
Foam::labelList Foam::ZoneMesh<ZoneType, MeshType>::findIndices
|
||||||
|
(
|
||||||
|
const keyType& key
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
labelList indices;
|
||||||
|
if (key.isPattern())
|
||||||
|
{
|
||||||
|
indices = findStrings(key, this->names());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
indices.setSize(this->size());
|
||||||
|
label nFound = 0;
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
if (key == operator[](i).name())
|
||||||
|
{
|
||||||
|
indices[nFound++] = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
indices.setSize(nFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
return indices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class ZoneType, class MeshType>
|
||||||
|
Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findIndex
|
||||||
|
(
|
||||||
|
const keyType& key
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (key.isPattern())
|
||||||
|
{
|
||||||
|
labelList indices = this->findIndices(key);
|
||||||
|
// return first element
|
||||||
|
if (!indices.empty())
|
||||||
|
{
|
||||||
|
return indices[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
if (key == operator[](i).name())
|
||||||
|
{
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// not found
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ZoneType, class MeshType>
|
template<class ZoneType, class MeshType>
|
||||||
Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findZoneID
|
Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findZoneID
|
||||||
(
|
(
|
||||||
@ -265,7 +326,7 @@ Foam::label Foam::ZoneMesh<ZoneType, MeshType>::findZoneID
|
|||||||
<< "List of available zone names: " << names() << endl;
|
<< "List of available zone names: " << names() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A dummy return to keep the compiler happy
|
// not found
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -121,8 +121,8 @@ public:
|
|||||||
// Return -1 if the object is not in the zone
|
// Return -1 if the object is not in the zone
|
||||||
const Map<label>& zoneMap() const;
|
const Map<label>& zoneMap() const;
|
||||||
|
|
||||||
//- Given a global object index, return the zone it is in. If
|
//- Given a global object index, return the zone it is in.
|
||||||
//object does not belong to any zones, return -1
|
// If object does not belong to any zones, return -1
|
||||||
label whichZone(const label objectIndex) const;
|
label whichZone(const label objectIndex) const;
|
||||||
|
|
||||||
//- Return a list of zone types
|
//- Return a list of zone types
|
||||||
@ -134,6 +134,12 @@ public:
|
|||||||
//- Find zone index given a name
|
//- Find zone index given a name
|
||||||
label findZoneID(const word& zoneName) const;
|
label findZoneID(const word& zoneName) const;
|
||||||
|
|
||||||
|
//- Return zone indices for all matches
|
||||||
|
labelList findIndices(const keyType&) const;
|
||||||
|
|
||||||
|
//- Return zone index for the first match, return -1 if not found
|
||||||
|
label findIndex(const keyType&) const;
|
||||||
|
|
||||||
//- Clear addressing
|
//- Clear addressing
|
||||||
void clearAddressing();
|
void clearAddressing();
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ Foam::porousZone::porousZone
|
|||||||
key_(key),
|
key_(key),
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
dict_(dict),
|
dict_(dict),
|
||||||
cellZoneIds_(0),
|
cellZoneIds_(mesh_.cellZones().findIndices(key_)),
|
||||||
coordSys_(dict, mesh),
|
coordSys_(dict, mesh),
|
||||||
porosity_(1),
|
porosity_(1),
|
||||||
intensity_(0),
|
intensity_(0),
|
||||||
@ -83,24 +83,6 @@ Foam::porousZone::porousZone
|
|||||||
{
|
{
|
||||||
Info<< "Creating porous zone: " << key_ << endl;
|
Info<< "Creating porous zone: " << key_ << endl;
|
||||||
|
|
||||||
if (key_.isPattern())
|
|
||||||
{
|
|
||||||
cellZoneIds_ = findStrings
|
|
||||||
(
|
|
||||||
key_,
|
|
||||||
mesh_.cellZones().names()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const label zoneId = mesh_.cellZones().findZoneID(key_);
|
|
||||||
if (zoneId != -1)
|
|
||||||
{
|
|
||||||
cellZoneIds_.setSize(1);
|
|
||||||
cellZoneIds_[0] = zoneId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool foundZone = !cellZoneIds_.empty();
|
bool foundZone = !cellZoneIds_.empty();
|
||||||
reduce(foundZone, orOp<bool>());
|
reduce(foundZone, orOp<bool>());
|
||||||
|
|
||||||
|
|||||||
@ -142,17 +142,17 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
keyType key(entryPtr->stream());
|
keyType key(entryPtr->stream());
|
||||||
|
|
||||||
const coordinateSystems& lst = coordinateSystems::New(obr);
|
const coordinateSystems& lst = coordinateSystems::New(obr);
|
||||||
const label id = lst.find(key);
|
const label index = lst.findIndex(key);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "coordinateSystem::coordinateSystem"
|
Info<< "coordinateSystem::coordinateSystem"
|
||||||
"(const dictionary&, const objectRegistry&):"
|
"(const dictionary&, const objectRegistry&):"
|
||||||
<< nl << "using global coordinate system: "
|
<< nl << "using global coordinate system: "
|
||||||
<< key << "=" << id << endl;
|
<< key << "=" << index << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id < 0)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorIn
|
||||||
(
|
(
|
||||||
@ -165,7 +165,7 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
|
|
||||||
// copy coordinateSystem, but assign the name as the typeName
|
// copy coordinateSystem, but assign the name as the typeName
|
||||||
// to avoid strange things in writeDict()
|
// to avoid strange things in writeDict()
|
||||||
operator=(lst[id]);
|
operator=(lst[index]);
|
||||||
name_ = typeName_();
|
name_ = typeName_();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -100,13 +100,44 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New
|
|||||||
|
|
||||||
Foam::label Foam::coordinateSystems::find(const keyType& key) const
|
Foam::label Foam::coordinateSystems::find(const keyType& key) const
|
||||||
{
|
{
|
||||||
|
return findIndex(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::labelList Foam::coordinateSystems::findIndices(const keyType& key) const
|
||||||
|
{
|
||||||
|
labelList indices;
|
||||||
if (key.isPattern())
|
if (key.isPattern())
|
||||||
{
|
{
|
||||||
labelList allFound = findAll(key);
|
indices = findStrings(key, toc());
|
||||||
// return first element
|
}
|
||||||
if (!allFound.empty())
|
else
|
||||||
{
|
{
|
||||||
return allFound[0];
|
indices.setSize(size());
|
||||||
|
label nFound = 0;
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
if (key == operator[](i).name())
|
||||||
|
{
|
||||||
|
indices[nFound++] = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
indices.setSize(nFound);
|
||||||
|
}
|
||||||
|
|
||||||
|
return indices;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::label Foam::coordinateSystems::findIndex(const keyType& key) const
|
||||||
|
{
|
||||||
|
if (key.isPattern())
|
||||||
|
{
|
||||||
|
labelList indices = findIndices(key);
|
||||||
|
// return first element
|
||||||
|
if (!indices.empty())
|
||||||
|
{
|
||||||
|
return indices[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -124,34 +155,9 @@ Foam::label Foam::coordinateSystems::find(const keyType& key) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::labelList Foam::coordinateSystems::findAll(const keyType& key) const
|
|
||||||
{
|
|
||||||
labelList allFound;
|
|
||||||
if (key.isPattern())
|
|
||||||
{
|
|
||||||
allFound = findStrings(key, toc());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
allFound.setSize(size());
|
|
||||||
label nFound = 0;
|
|
||||||
forAll(*this, i)
|
|
||||||
{
|
|
||||||
if (key == operator[](i).name())
|
|
||||||
{
|
|
||||||
allFound[nFound++] = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
allFound.setSize(nFound);
|
|
||||||
}
|
|
||||||
|
|
||||||
return allFound;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Foam::coordinateSystems::found(const keyType& key) const
|
bool Foam::coordinateSystems::found(const keyType& key) const
|
||||||
{
|
{
|
||||||
return find(key) >= 0;
|
return findIndex(key) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -97,11 +97,15 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Find and return index for the first match, returns -1 if not found
|
|
||||||
label find(const keyType& key) const;
|
|
||||||
|
|
||||||
//- Find and return indices for all matches
|
//- Find and return indices for all matches
|
||||||
labelList findAll(const keyType& key) const;
|
labelList findIndices(const keyType& key) const;
|
||||||
|
|
||||||
|
//- Find and return index for the first match, return -1 if not found
|
||||||
|
label findIndex(const keyType& key) const;
|
||||||
|
|
||||||
|
//- Find and return index for the first match, returns -1 if not found
|
||||||
|
// @deprecated use findIndex() instead (deprecated Jul 2010)
|
||||||
|
label find(const keyType& key) const;
|
||||||
|
|
||||||
//- Search for given key
|
//- Search for given key
|
||||||
bool found(const keyType& key) const;
|
bool found(const keyType& key) const;
|
||||||
|
|||||||
@ -91,7 +91,7 @@ void Foam::fileFormats::STARCDsurfaceFormatCore::writeCase
|
|||||||
|
|
||||||
forAll(zoneLst, zoneI)
|
forAll(zoneLst, zoneI)
|
||||||
{
|
{
|
||||||
os << "ctable " << zoneI + 1 << " shell" << nl
|
os << "ctable " << zoneI + 1 << " shell" << " ,,,,,," << nl
|
||||||
<< "ctname " << zoneI + 1 << " "
|
<< "ctname " << zoneI + 1 << " "
|
||||||
<< zoneLst[zoneI].name() << nl;
|
<< zoneLst[zoneI].name() << nl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
|
|
||||||
application=`getApplication`
|
application=`getApplication`
|
||||||
|
|
||||||
compileApplication ../../buoyantPisoFoam/hotRoom/setHotRoom
|
compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication setHotRoom
|
runApplication setHotRoom
|
||||||
runApplication $application
|
runApplication $application
|
||||||
|
|||||||
@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # run from this directory
|
|||||||
|
|
||||||
application=`getApplication`
|
application=`getApplication`
|
||||||
|
|
||||||
compileApplication ../../buoyantPisoFoam/hotRoom/setHotRoom
|
compileApplication ../../buoyantPimpleFoam/hotRoom/setHotRoom
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
runApplication setHotRoom
|
runApplication setHotRoom
|
||||||
runApplication $application
|
runApplication $application
|
||||||
|
|||||||
Reference in New Issue
Block a user