Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2011-02-01 16:00:44 +00:00
155 changed files with 2383 additions and 2464 deletions

View File

@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application Application
DistributionTest Test-Distribution
Description Description
Test the Distribution class Test the Distribution class

View File

@ -1,3 +1,3 @@
hashTableTest2.C Test-HashTable2.C
EXE = $(FOAM_USER_APPBIN)/hashTableTest2 EXE = $(FOAM_USER_APPBIN)/Test-HashTable2

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,6 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Miscellaneous tests for HashTable
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
hashTableTest3.C Test-HashTable3.C
EXE = $(FOAM_USER_APPBIN)/hashTableTest3 EXE = $(FOAM_USER_APPBIN)/Test-HashTable3

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,6 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description Description
Test speeds for some HashTable operations Test speeds for some HashTable operations
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
Test-namedEnum.C Test-namedEnum.C
EXE = $(FOAM_USER_APPBIN)/NamedEnum EXE = $(FOAM_USER_APPBIN)/Test-NamedEnum

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Application
testDataEntry testDataEntry
Description Description
Tests lagrangian/intermediate/submodels/IO/DataEntry Tests DataEntry
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
Test-dimensionedType.C Test-dimensionedType.C
EXE = $(FOAM_USER_APPBIN)/dimensionedType EXE = $(FOAM_USER_APPBIN)/Test-dimensionedType

View File

@ -1,2 +1,2 @@
Test-pTraits.C Test-pTraits.C
EXE = $(FOAM_USER_APPBIN)/pTraits EXE = $(FOAM_USER_APPBIN)/Test-pTraits

View File

@ -1,3 +1,3 @@
Test-simpleMatrix.C Test-simpleMatrix.C
EXE = $(FOAM_USER_APPBIN)/simpleMatrix EXE = $(FOAM_USER_APPBIN)/Test-simpleMatrix

View File

@ -38,6 +38,16 @@ setFormat raw;
// but without any values! // but without any values!
surfaceFormat vtk; surfaceFormat vtk;
// optionally define extra controls for the output formats
formatOptions
{
ensight
{
format ascii;
}
}
// interpolationScheme. choice of // interpolationScheme. choice of
// cell : use cell-centre value only; constant over cells (default) // cell : use cell-centre value only; constant over cells (default)
// cellPoint : use cell-centre and vertex values // cellPoint : use cell-centre and vertex values

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -311,8 +311,9 @@ void rewriteField
{ {
IOWarningIn("rewriteField(..)", patchDict) IOWarningIn("rewriteField(..)", patchDict)
<< "Cyclic patch " << patchName << "Cyclic patch " << patchName
<< " has value entry. Please remove this and rerun." << " has value entry. This will be removed."
<< endl; << endl;
patchDict.remove("value");
} }

View File

@ -1,5 +1,13 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ -d "$WM_PROJECT_DIR" ] || {
echo "Error: WM_PROJECT_DIR directory does not exist"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
exit 1
}
set -x set -x
rm -rf latex man rm -rf latex man

View File

@ -760,7 +760,7 @@ ALPHABETICAL_INDEX = YES
# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20]) # in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 4 COLS_IN_ALPHA_INDEX = 1
# In case all classes in a project start with a common prefix, all # In case all classes in a project start with a common prefix, all
# classes will be put under the same header in the alphabetical index. # classes will be put under the same header in the alphabetical index.

View File

@ -2,7 +2,7 @@
</div> <!-- main --> </div> <!-- main -->
<div class="footer"> <div class="footer">
<p> <p>
Copyright&nbsp;&copy;&nbsp;2000-2010&nbsp; Copyright&nbsp;&copy;&nbsp;2004-2011&nbsp;
<a href="http://www.openfoam.com/about">OpenCFD Limited</a> <a href="http://www.openfoam.com/about">OpenCFD Limited</a>
| OPENFOAM&reg; and OpenCFD&reg; are registered trademarks of OpenCFD Ltd. | OPENFOAM&reg; and OpenCFD&reg; are registered trademarks of OpenCFD Ltd.
</p> </p>

View File

@ -52,7 +52,7 @@ alias foamPV 'source `$WM_PROJECT_DIR/etc/apps/paraview3/cshrc` ParaView_VERSION
# Change directory aliases # Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
alias src 'cd $FOAM_SRC' alias src 'cd $FOAM_SRC'
alias lib 'cd $FOAM_LIB' alias lib 'cd $FOAM_LIBBIN'
alias run 'cd $FOAM_RUN' alias run 'cd $FOAM_RUN'
alias foam 'cd $WM_PROJECT_DIR' alias foam 'cd $WM_PROJECT_DIR'
alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT' alias foamsrc 'cd $FOAM_SRC/$WM_PROJECT'

View File

@ -57,7 +57,7 @@ foamPV()
# Change directory aliases # Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~
alias src='cd $FOAM_SRC' alias src='cd $FOAM_SRC'
alias lib='cd $FOAM_LIB' alias lib='cd $FOAM_LIBBIN'
alias run='cd $FOAM_RUN' alias run='cd $FOAM_RUN'
alias foam='cd $WM_PROJECT_DIR' alias foam='cd $WM_PROJECT_DIR'
alias foamsrc='cd $FOAM_SRC/$WM_PROJECT' alias foamsrc='cd $FOAM_SRC/$WM_PROJECT'

View File

@ -65,7 +65,7 @@ setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience # convenience
setenv FOAM_APP $WM_PROJECT_DIR/applications setenv FOAM_APP $WM_PROJECT_DIR/applications
setenv FOAM_LIB $WM_PROJECT_DIR/lib #setenv FOAM_LIB $WM_PROJECT_DIR/lib
setenv FOAM_SRC $WM_PROJECT_DIR/src setenv FOAM_SRC $WM_PROJECT_DIR/src
setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
setenv FOAM_UTILITIES $FOAM_APP/utilities setenv FOAM_UTILITIES $FOAM_APP/utilities

View File

@ -88,7 +88,7 @@ export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib
# convenience # convenience
export FOAM_APP=$WM_PROJECT_DIR/applications export FOAM_APP=$WM_PROJECT_DIR/applications
export FOAM_LIB=$WM_PROJECT_DIR/lib #export FOAM_LIB=$WM_PROJECT_DIR/lib
export FOAM_SRC=$WM_PROJECT_DIR/src export FOAM_SRC=$WM_PROJECT_DIR/src
export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
export FOAM_UTILITIES=$FOAM_APP/utilities export FOAM_UTILITIES=$FOAM_APP/utilities

View File

@ -1,8 +1,6 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
makeOption=libso
[ $# -ge 1 ] && makeOption=$1
wmakeCheckPwd "$WM_PROJECT_DIR/src" || { wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
echo "Error: Current directory is not \$WM_PROJECT_DIR/src" echo "Error: Current directory is not \$WM_PROJECT_DIR/src"
@ -20,13 +18,13 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
set -x set -x
# update OpenFOAM version strings if required # update OpenFOAM version strings if required
wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/$WM_OPTIONS/global.? 2>/dev/null wmakePrintBuild -check || /bin/rm -f OpenFOAM/Make/*/global.? 2>/dev/null
wmakeLnInclude OpenFOAM wmakeLnInclude OpenFOAM
wmakeLnInclude OSspecific/$WM_OSTYPE wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
Pstream/Allwmake $* Pstream/Allwmake $*
OSspecific/$WM_OSTYPE/Allwmake OSspecific/${WM_OSTYPE:-POSIX}/Allwmake
wmake $makeOption OpenFOAM wmake $makeOption OpenFOAM
wmake $makeOption fileFormats wmake $makeOption fileFormats

View File

@ -9,6 +9,7 @@ $(bools)/bool/bool.C
$(bools)/bool/boolIO.C $(bools)/bool/boolIO.C
$(bools)/Switch/Switch.C $(bools)/Switch/Switch.C
$(bools)/Switch/SwitchIO.C $(bools)/Switch/SwitchIO.C
$(bools)/lists/boolList.C
chars = primitives/chars chars = primitives/chars
$(chars)/char/charIO.C $(chars)/char/charIO.C
@ -22,10 +23,16 @@ $(ints)/longLong/longLongIO.C
$(ints)/ulong/ulongIO.C $(ints)/ulong/ulongIO.C
$(ints)/label/label.C $(ints)/label/label.C
$(ints)/uLabel/uLabel.C $(ints)/uLabel/uLabel.C
$(ints)/lists/labelIOList.C
$(ints)/lists/labelListIOList.C
primitives/Scalar/doubleScalar/doubleScalar.C primitives/Scalar/doubleScalar/doubleScalar.C
primitives/Scalar/floatScalar/floatScalar.C primitives/Scalar/floatScalar/floatScalar.C
primitives/Scalar/scalar/scalar.C primitives/Scalar/scalar/scalar.C
primitives/Scalar/lists/scalarList.C
primitives/Scalar/lists/scalarIOList.C
primitives/Scalar/lists/scalarListIOList.C
primitives/DiagTensor/diagTensor/diagTensor.C primitives/DiagTensor/diagTensor/diagTensor.C
primitives/SphericalTensor/sphericalTensor/sphericalTensor.C primitives/SphericalTensor/sphericalTensor/sphericalTensor.C
primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C
@ -33,9 +40,16 @@ primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C
primitives/SymmTensor/symmTensor/symmTensor.C primitives/SymmTensor/symmTensor/symmTensor.C
primitives/Tensor/labelTensor/labelTensor.C primitives/Tensor/labelTensor/labelTensor.C
primitives/Tensor/tensor/tensor.C primitives/Tensor/tensor/tensor.C
primitives/Tensor/lists/sphericalTensorList.C
primitives/Tensor/lists/symmTensorList.C
primitives/Tensor/lists/tensorList.C
primitives/Vector/complexVector/complexVector.C primitives/Vector/complexVector/complexVector.C
primitives/Vector/labelVector/labelVector.C primitives/Vector/labelVector/labelVector.C
primitives/Vector/vector/vector.C primitives/Vector/vector/vector.C
primitives/Vector/lists/vectorList.C
primitives/Vector/lists/vectorIOList.C
primitives/Vector/lists/vectorListIOList.C
primitives/Tensor2D/tensor2D/tensor2D.C primitives/Tensor2D/tensor2D/tensor2D.C
primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C primitives/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
@ -47,6 +61,12 @@ primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C
primitives/quaternion/quaternion.C primitives/quaternion/quaternion.C
primitives/septernion/septernion.C primitives/septernion/septernion.C
/* functions, data entries */
primitives/functions/DataEntry/makeDataEntries.C
primitives/functions/DataEntry/polynomial/polynomial.C
primitives/functions/DataEntry/polynomial/polynomialIO.C
strings = primitives/strings strings = primitives/strings
$(strings)/string/string.C $(strings)/string/string.C
$(strings)/string/stringIO.C $(strings)/string/stringIO.C
@ -56,6 +76,7 @@ $(strings)/fileName/fileName.C
$(strings)/fileName/fileNameIO.C $(strings)/fileName/fileNameIO.C
$(strings)/keyType/keyType.C $(strings)/keyType/keyType.C
$(strings)/wordRe/wordRe.C $(strings)/wordRe/wordRe.C
$(strings)/lists/hashedWordList.C
primitives/hashes/Hasher/Hasher.C primitives/hashes/Hasher/Hasher.C
@ -82,21 +103,6 @@ containers/Lists/ListOps/ListOps.C
containers/LinkedLists/linkTypes/SLListBase/SLListBase.C containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
containers/LinkedLists/linkTypes/DLListBase/DLListBase.C containers/LinkedLists/linkTypes/DLListBase/DLListBase.C
primitiveLists = primitives/Lists
$(primitiveLists)/boolList.C
$(primitiveLists)/labelIOList.C
$(primitiveLists)/labelListIOList.C
$(primitiveLists)/scalarList.C
$(primitiveLists)/scalarIOList.C
$(primitiveLists)/scalarListIOList.C
$(primitiveLists)/vectorList.C
$(primitiveLists)/vectorIOList.C
$(primitiveLists)/vectorListIOList.C
$(primitiveLists)/sphericalTensorList.C
$(primitiveLists)/symmTensorList.C
$(primitiveLists)/tensorList.C
$(primitiveLists)/hashedWordList.C
Streams = db/IOstreams Streams = db/IOstreams
$(Streams)/token/tokenIO.C $(Streams)/token/tokenIO.C

View File

@ -507,13 +507,23 @@ Foam::argList::argList
jobInfo.add("startTime", timeString); jobInfo.add("startTime", timeString);
jobInfo.add("userName", userName()); jobInfo.add("userName", userName());
jobInfo.add("foamVersion", word(FOAMversion)); jobInfo.add("foamVersion", word(FOAMversion));
jobInfo.add("foamBuild", Foam::FOAMbuild);
jobInfo.add("code", executable_); jobInfo.add("code", executable_);
jobInfo.add("argList", argListString); jobInfo.add("argList", argListString);
jobInfo.add("currentDir", cwd()); jobInfo.add("currentDir", cwd());
jobInfo.add("PPID", ppid()); jobInfo.add("PPID", ppid());
jobInfo.add("PGID", pgid()); jobInfo.add("PGID", pgid());
// add build information - only use the first word
{
std::string build(Foam::FOAMbuild);
std::string::size_type found = build.find(' ');
if (found != std::string::npos)
{
build.resize(found);
}
jobInfo.add("foamBuild", build);
}
// Case is a single processor run unless it is running parallel // Case is a single processor run unless it is running parallel
int nProcs = 1; int nProcs = 1;
@ -883,9 +893,10 @@ void Foam::argList::printUsage() const
printNotes(); printNotes();
Info<< nl Info<< nl
<<"Using OpenFOAM-" << Foam::FOAMversion <<"Using: OpenFOAM-" << Foam::FOAMversion
<<" (build: " << Foam::FOAMbuild << ") - see www.OpenFOAM.com" << " (see www.OpenFOAM.com)" << nl
<< nl << endl; <<"Build: " << Foam::FOAMbuild << nl
<< endl;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -260,6 +260,11 @@ void Foam::LUscalarMatrix::convert
} }
else if (interface.myProcNo_ < interface.neighbProcNo_) else if (interface.myProcNo_ < interface.neighbProcNo_)
{ {
// Interface to neighbour proc. Find on neighbour proc the
// corresponding interface. The problem is that there can
// be multiple interfaces between two processors (from
// processorCyclics) so also compare the communication tag
const PtrList<procLduInterface>& neiInterfaces = const PtrList<procLduInterface>& neiInterfaces =
lduMatrices[interface.neighbProcNo_].interfaces_; lduMatrices[interface.neighbProcNo_].interfaces_;
@ -268,10 +273,13 @@ void Foam::LUscalarMatrix::convert
forAll(neiInterfaces, ninti) forAll(neiInterfaces, ninti)
{ {
if if
(
( (
neiInterfaces[ninti].neighbProcNo_ neiInterfaces[ninti].neighbProcNo_
== interface.myProcNo_ == interface.myProcNo_
) )
&& (neiInterfaces[ninti].tag_ == interface.tag_)
)
{ {
neiInterfacei = ninti; neiInterfacei = ninti;
break; break;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -39,7 +39,8 @@ Foam::procLduInterface::procLduInterface
faceCells_(interface.interface().faceCells()), faceCells_(interface.interface().faceCells()),
coeffs_(coeffs), coeffs_(coeffs),
myProcNo_(-1), myProcNo_(-1),
neighbProcNo_(-1) neighbProcNo_(-1),
tag_(-1)
{ {
if (isA<processorLduInterface>(interface.interface())) if (isA<processorLduInterface>(interface.interface()))
{ {
@ -48,6 +49,7 @@ Foam::procLduInterface::procLduInterface
myProcNo_ = pldui.myProcNo(); myProcNo_ = pldui.myProcNo();
neighbProcNo_ = pldui.neighbProcNo(); neighbProcNo_ = pldui.neighbProcNo();
tag_ = pldui.tag();
} }
else if (isA<cyclicLduInterface>(interface.interface())) else if (isA<cyclicLduInterface>(interface.interface()))
{ {
@ -70,7 +72,8 @@ Foam::procLduInterface::procLduInterface(Istream& is)
faceCells_(is), faceCells_(is),
coeffs_(is), coeffs_(is),
myProcNo_(readLabel(is)), myProcNo_(readLabel(is)),
neighbProcNo_(readLabel(is)) neighbProcNo_(readLabel(is)),
tag_(readLabel(is))
{} {}
@ -81,7 +84,8 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const procLduInterface& cldui)
os << cldui.faceCells_ os << cldui.faceCells_
<< cldui.coeffs_ << cldui.coeffs_
<< cldui.myProcNo_ << cldui.myProcNo_
<< cldui.neighbProcNo_; << cldui.neighbProcNo_
<< cldui.tag_;
return os; return os;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -57,6 +57,7 @@ class procLduInterface
scalarField coeffs_; scalarField coeffs_;
label myProcNo_; label myProcNo_;
label neighbProcNo_; label neighbProcNo_;
label tag_;
// Private Member Functions // Private Member Functions

View File

@ -29,6 +29,7 @@ License
#include "globalIndex.H" #include "globalIndex.H"
#include "globalIndexAndTransform.H" #include "globalIndexAndTransform.H"
#include "transformField.H" #include "transformField.H"
#include "ListOps.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -1104,6 +1105,12 @@ Foam::mapDistribute::mapDistribute(const Xfer<mapDistribute>& map)
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
Foam::label Foam::mapDistribute::whichTransform(const label index) const
{
return findLower(transformStart_, index+1);
}
void Foam::mapDistribute::transfer(mapDistribute& rhs) void Foam::mapDistribute::transfer(mapDistribute& rhs)
{ {
constructSize_ = rhs.constructSize_; constructSize_ = rhs.constructSize_;

View File

@ -385,6 +385,9 @@ public:
return transformStart_; return transformStart_;
} }
//- Find transform from transformElements
label whichTransform(const label index) const;
//- Calculate a schedule. See above. //- Calculate a schedule. See above.
static List<labelPair> schedule static List<labelPair> schedule
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -149,7 +149,7 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
template<int PolySize> template<int PolySize>
Foam::scalar Foam::Polynomial<PolySize>::evaluate(const scalar x) const Foam::scalar Foam::Polynomial<PolySize>::value(const scalar x) const
{ {
scalar y = this->v_[0]; scalar y = this->v_[0];
@ -192,7 +192,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
intPolyType poly = this->integrate(); intPolyType poly = this->integrate();
return poly.evaluate(x2) - poly.evaluate(x1); return poly.value(x2) - poly.value(x1);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -32,7 +32,7 @@ Description
where 0 \<= i \<= n where 0 \<= i \<= n
- integer powers, starting at zero - integer powers, starting at zero
- evaluate(x) to evaluate the poly for a given value - value(x) to evaluate the poly for a given value
- integrate(x1, x2) between two scalar values - integrate(x1, x2) between two scalar values
- integrate() to return a new, intergated coeff polynomial - integrate() to return a new, intergated coeff polynomial
- increases the size (order) - increases the size (order)
@ -134,7 +134,7 @@ public:
// Evaluation // Evaluation
//- Return polynomial value //- Return polynomial value
scalar evaluate(const scalar x) const; scalar value(const scalar x) const;
//- Return integrated polynomial coefficients //- Return integrated polynomial coefficients
// argument becomes zeroth element (constant of integration) // argument becomes zeroth element (constant of integration)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2010-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -1,10 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
set -x set -x
makeOption=libso
[ $# -ge 1 ] && makeOption=$1
wmake $makeOption dummy wmake $makeOption dummy
case "$WM_MPLIB" in case "$WM_MPLIB" in
@ -12,6 +10,7 @@ case "$WM_MPLIB" in
set +x set +x
echo echo
echo "Note: ignore spurious warnings about missing mpicxx.h headers" echo "Note: ignore spurious warnings about missing mpicxx.h headers"
echo
set -x set -x
# force compilation into qualified directory # force compilation into qualified directory
WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeOption mpi WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeOption mpi

View File

@ -1,10 +1,8 @@
#!/bin/sh #!/bin/sh
cd ${0%/*} || exit 1 # run from this directory cd ${0%/*} || exit 1 # run from this directory
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
set -x set -x
makeOption=libso
[ $# -ge 1 ] && makeOption=$1
wmake $makeOption wmake $makeOption
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -4,7 +4,6 @@ ensight/part/ensightPart.C
ensight/part/ensightPartIO.C ensight/part/ensightPartIO.C
ensight/part/ensightPartCells.C ensight/part/ensightPartCells.C
ensight/part/ensightPartFaces.C ensight/part/ensightPartFaces.C
ensight/part/ensightPartNonMeshFaces.C
ensight/part/ensightParts.C ensight/part/ensightParts.C
meshTables/boundaryRegion.C meshTables/boundaryRegion.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,9 +24,9 @@ License
\*----------------------------------------------------------------------------*/ \*----------------------------------------------------------------------------*/
#include "ensightPart.H" #include "ensightPart.H"
#include "addToRunTimeSelectionTable.H"
#include "dictionary.H" #include "dictionary.H"
#include "ListOps.H" #include "ListOps.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -36,19 +36,20 @@ namespace Foam
defineRunTimeSelectionTable(ensightPart, istream); defineRunTimeSelectionTable(ensightPart, istream);
} }
Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0); const Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const
{ {
forAll(elemLists_, elemI) forAll(elemLists_, elemI)
{ {
const labelList& idList = elemLists_[elemI]; const labelUList& idList = elemLists_[elemI];
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i]; const label id = idList[i];
if (id >= field.size() || isnan(field[id])) if (id >= field.size() || isnan(field[id]))
{ {
@ -72,7 +73,7 @@ Foam::ensightPart::ensightPart
size_(0), size_(0),
isCellData_(true), isCellData_(true),
matId_(0), matId_(0),
meshPtr_(0) points_(pointField::null())
{} {}
@ -89,7 +90,7 @@ Foam::ensightPart::ensightPart
size_(0), size_(0),
isCellData_(true), isCellData_(true),
matId_(0), matId_(0),
meshPtr_(0) points_(pointField::null())
{} {}
@ -97,7 +98,7 @@ Foam::ensightPart::ensightPart
( (
label partNumber, label partNumber,
const string& partDescription, const string& partDescription,
const polyMesh& pMesh const pointField& points
) )
: :
number_(partNumber), number_(partNumber),
@ -107,7 +108,7 @@ Foam::ensightPart::ensightPart
size_(0), size_(0),
isCellData_(true), isCellData_(true),
matId_(0), matId_(0),
meshPtr_(&pMesh) points_(points)
{} {}
@ -120,7 +121,7 @@ Foam::ensightPart::ensightPart(const ensightPart& part)
size_(part.size_), size_(part.size_),
isCellData_(part.isCellData_), isCellData_(part.isCellData_),
matId_(part.matId_), matId_(part.matId_),
meshPtr_(part.meshPtr_) points_(part.points_)
{} {}
@ -158,31 +159,7 @@ Foam::ensightPart::~ensightPart()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ensightPart::reconstruct(Istream& is) void Foam::ensightPart::renumber(const labelUList& origId)
{
dictionary dict(is);
dict.lookup("id") >> number_;
dict.lookup("name") >> name_;
dict.readIfPresent("offset", offset_);
// populate elemLists_
elemLists_.setSize(elementTypes().size());
forAll(elementTypes(), elemI)
{
word key(elementTypes()[elemI]);
elemLists_[elemI].clear();
dict.readIfPresent(key, elemLists_[elemI]);
size_ += elemLists_[elemI].size();
}
is.check("ensightPart::reconstruct(Istream&)");
}
void Foam::ensightPart::renumber(labelList const& origId)
{ {
// transform to global values first // transform to global values first
if (offset_) if (offset_)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ Description
SourceFiles SourceFiles
ensightPart.C ensightPart.C
ensightPartIO.C ensightPartIO.C
ensightPartI.H ensightPartTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -60,7 +60,7 @@ class ensightPart
// Private data // Private data
// Static data members // Static data members
static List<word> elemTypes_; static const List<word> elemTypes_;
protected: protected:
@ -88,8 +88,8 @@ protected:
//- material id (numeric) //- material id (numeric)
label matId_; label matId_;
//- mesh reference used //- pointField referenced
const polyMesh* meshPtr_; const pointField& points_;
// Protected Classes // Protected Classes
@ -104,25 +104,27 @@ protected:
//- map global to local indices //- map global to local indices
labelList list; labelList list;
// null constructor //- null constructor
localPoints() localPoints()
: :
nPoints(0), nPoints(0),
list(0) list(0)
{} {}
// construct for mesh points //- construct for mesh points
localPoints(const polyMesh& pMesh) localPoints(const pointField& pts)
: :
nPoints(0), nPoints(0),
list(pMesh.points().size(), -1) list(pts.size(), -1)
{} {}
}; };
// Protected Member Functions // Protected Member Functions
//- reconstruct contents from Istream //- Reconstruct part characteristics (eg, element types) from Istream
// A part reconstructed in this manner can be used when writing fields,
// but cannot be used to write a new geometry
void reconstruct(Istream&); void reconstruct(Istream&);
//- check for fully defined fields //- check for fully defined fields
@ -132,6 +134,7 @@ protected:
void writeHeader(ensightFile&, bool withDescription=false) const; void writeHeader(ensightFile&, bool withDescription=false) const;
//- write a scalar field for idList //- write a scalar field for idList
// A null reference for idList writes the perNode values
void writeFieldList void writeFieldList
( (
ensightFile& os, ensightFile& os,
@ -148,10 +151,10 @@ protected:
//- write connectivities //- write connectivities
virtual void writeConnectivity virtual void writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile&,
const word& key, const word& key,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const ) const
{} {}
@ -170,12 +173,12 @@ public:
//- Construct empty part with number and description //- Construct empty part with number and description
ensightPart(label partNumber, const string& partDescription); ensightPart(label partNumber, const string& partDescription);
//- Construct empty part with number and description //- Construct part with number, description and points reference
ensightPart ensightPart
( (
label partNumber, label partNumber,
const string& partDescription, const string& partDescription,
const polyMesh& pMesh const pointField& points
); );
//- Construct as copy //- Construct as copy
@ -202,8 +205,9 @@ public:
return autoPtr<ensightPart>(new ensightPart(*this)); return autoPtr<ensightPart>(new ensightPart(*this));
}; };
//- Construct on freestore from Istream //- Reconstruct part characteristics on freestore from Istream
static autoPtr<ensightPart> New(Istream& is); // @sa reconstruct
static autoPtr<ensightPart> New(Istream&);
//- Destructor //- Destructor
@ -212,7 +216,7 @@ public:
// Static members // Static members
virtual List<word> const& elementTypes() const virtual const List<word>& elementTypes() const
{ {
return elemTypes_; return elemTypes_;
} }
@ -256,12 +260,13 @@ public:
return matId_; return matId_;
} }
//- non-const access //- non-const access to part name or description
void name(const string& value) void name(const string& value)
{ {
name_ = value; name_ = value;
} }
//- non-const access to material id
void materialId(const label value) void materialId(const label value)
{ {
matId_ = value; matId_ = value;
@ -283,7 +288,7 @@ public:
// Edit // Edit
//- renumber elements //- renumber elements
void renumber(labelList const&); void renumber(const labelUList&);
//- write summary information about the object //- write summary information about the object
bool writeSummary(Ostream&) const; bool writeSummary(Ostream&) const;
@ -296,31 +301,37 @@ public:
{} {}
//- Helper: write geometry given the pointField //- Helper: write geometry given the pointField
void writeGeometry(ensightGeoFile&, const pointField& points) const; void writeGeometry(ensightGeoFile&, const pointField&) const;
//- write scalar field //- write scalar field
// optionally write data per node
void writeScalarField void writeScalarField
( (
ensightFile&, ensightFile&,
const List<scalar>& field const List<scalar>& field,
const bool perNode = false
) const; ) const;
//- write vector field components //- write vector field components
// optionally write data per node
void writeVectorField void writeVectorField
( (
ensightFile&, ensightFile&,
const List<scalar>& field0, const List<scalar>& field0,
const List<scalar>& field1, const List<scalar>& field1,
const List<scalar>& field2 const List<scalar>& field2,
const bool perNode = false
) const; ) const;
//- write generalized field components //- write generalized field components
template <class Type> // optionally write data per node
template<class Type>
void writeField void writeField
( (
ensightFile&, ensightFile&,
const Field<Type>& const Field<Type>&,
const bool perNode = false
) const; ) const;
@ -339,11 +350,8 @@ public:
friend Ostream& operator<<(Ostream&, const ensightPart&); friend Ostream& operator<<(Ostream&, const ensightPart&);
//- write geometry //- write geometry
friend ensightGeoFile& operator<< friend ensightGeoFile& operator<<(ensightGeoFile&, const ensightPart&);
(
ensightGeoFile&,
const ensightPart&
);
}; };
@ -354,7 +362,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ensightPartI.H" # include "ensightPartTemplates.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,12 +24,11 @@ License
\*----------------------------------------------------------------------------*/ \*----------------------------------------------------------------------------*/
#include "ensightPartCells.H" #include "ensightPartCells.H"
#include "addToRunTimeSelectionTable.H"
#include "IOstream.H" #include "IOstream.H"
#include "IStringStream.H" #include "IStringStream.H"
#include "dictionary.H" #include "dictionary.H"
#include "cellModeller.H" #include "cellModeller.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -39,7 +38,7 @@ namespace Foam
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream); addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
} }
Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_ const Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
( (
IStringStream IStringStream
( (
@ -50,7 +49,11 @@ Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ensightPartCells::classify(const labelList& idList) void Foam::ensightPartCells::classify
(
const polyMesh& mesh,
const labelUList& idList
)
{ {
// References to cell shape models // References to cell shape models
const cellModel& tet = *(cellModeller::lookup("tet")); const cellModel& tet = *(cellModeller::lookup("tet"));
@ -58,7 +61,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
const cellModel& prism = *(cellModeller::lookup("prism")); const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& hex = *(cellModeller::lookup("hex")); const cellModel& hex = *(cellModeller::lookup("hex"));
const polyMesh& mesh = *meshPtr_;
const cellShapeList& cellShapes = mesh.cellShapes(); const cellShapeList& cellShapes = mesh.cellShapes();
offset_ = 0; offset_ = 0;
@ -78,13 +80,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
label nHex = 0; label nHex = 0;
label nPoly = 0; label nPoly = 0;
// TODO: allow tet-decomposition of polyhedral cells
#if 0
label nTetDecomp = 0;
label nPyrDecomp = 0;
#endif
for (label listI = 0; listI < size_; ++listI) for (label listI = 0; listI < size_; ++listI)
{ {
label cellId = listI; label cellId = listI;
@ -115,26 +110,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
else else
{ {
nPoly++; nPoly++;
// TODO: allow tet-decomposition of polyhedral cells
#if 0
const cell& cFaces = mesh.cells()[cellI];
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
label nQuads = 0;
label nTris = 0;
f.nTrianglesQuads(mesh.points(), nTris, nQuads);
nTetDecomp += nTris;
nPyrDecomp += nQuads;
}
nAddCells--;
nAddPoints++;
#endif
} }
} }
@ -183,29 +158,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
else else
{ {
polyCells[nPoly++] = cellId; polyCells[nPoly++] = cellId;
// TODO: allow tet-decomposition of polyhedral cells
#if 0
// Mapping from additional point to cell
addPointCellLabels_[api] = cellId;
const cell& cFaces = mesh.cells()[cellId];
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
label nQuads = 0;
label nTris = 0;
f.nTrianglesQuads(mesh.points(), nTris, nQuads);
nTetDecomp += nTris;
nPyrDecomp += nQuads;
}
nAddCells--;
nAddPoints++;
#endif
} }
} }
@ -213,11 +165,11 @@ void Foam::ensightPartCells::classify(const labelList& idList)
// MUST match with elementTypes // MUST match with elementTypes
elemLists_.setSize(elementTypes().size()); elemLists_.setSize(elementTypes().size());
elemLists_[tetra4Elements].transfer( tetCells ); elemLists_[tetra4Elements].transfer(tetCells);
elemLists_[pyramid5Elements].transfer( pyramidCells ); elemLists_[pyramid5Elements].transfer(pyramidCells);
elemLists_[penta6Elements].transfer( prismCells ); elemLists_[penta6Elements].transfer(prismCells);
elemLists_[hexa8Elements].transfer( hexCells ); elemLists_[hexa8Elements].transfer(hexCells);
elemLists_[nfacedElements].transfer( polyCells ); elemLists_[nfacedElements].transfer(polyCells);
} }
@ -229,57 +181,63 @@ Foam::ensightPartCells::ensightPartCells
const string& partDescription const string& partDescription
) )
: :
ensightPart(partNumber, partDescription) ensightPart(partNumber, partDescription),
mesh_(*reinterpret_cast<polyMesh*>(0))
{} {}
Foam::ensightPartCells::ensightPartCells Foam::ensightPartCells::ensightPartCells
( (
label partNumber, label partNumber,
const polyMesh& pMesh const polyMesh& mesh
) )
: :
ensightPart(partNumber, "cells", pMesh) ensightPart(partNumber, "cells", mesh.points()),
mesh_(mesh)
{ {
classify(); classify(mesh);
} }
Foam::ensightPartCells::ensightPartCells Foam::ensightPartCells::ensightPartCells
( (
label partNumber, label partNumber,
const polyMesh& pMesh, const polyMesh& mesh,
const labelList& idList const labelUList& idList
) )
: :
ensightPart(partNumber, "cells", pMesh) ensightPart(partNumber, "cells", mesh.points()),
mesh_(mesh)
{ {
classify(idList); classify(mesh, idList);
} }
Foam::ensightPartCells::ensightPartCells Foam::ensightPartCells::ensightPartCells
( (
label partNumber, label partNumber,
const polyMesh& pMesh, const polyMesh& mesh,
const cellZone& cZone const cellZone& cZone
) )
: :
ensightPart(partNumber, cZone.name(), pMesh) ensightPart(partNumber, cZone.name(), mesh.points()),
mesh_(mesh)
{ {
classify(cZone); classify(mesh, cZone);
} }
Foam::ensightPartCells::ensightPartCells(const ensightPartCells& part) Foam::ensightPartCells::ensightPartCells(const ensightPartCells& part)
: :
ensightPart(part) ensightPart(part),
mesh_(part.mesh_)
{} {}
Foam::ensightPartCells::ensightPartCells(Istream& is) Foam::ensightPartCells::ensightPartCells(Istream& is)
: :
ensightPart() ensightPart(),
mesh_(*reinterpret_cast<polyMesh*>(0))
{ {
reconstruct(is); reconstruct(is);
} }
@ -295,25 +253,23 @@ Foam::ensightPartCells::~ensightPartCells()
Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
{ {
const polyMesh& mesh = *meshPtr_; localPoints ptList(points_);
localPoints ptList(mesh);
labelList& usedPoints = ptList.list; labelList& usedPoints = ptList.list;
label nPoints = 0; label nPoints = 0;
forAll(elemLists_, typeI) forAll(elemLists_, typeI)
{ {
const labelList& idList = elemLists_[typeI]; const labelUList& idList = elemLists_[typeI];
// add all points from cells // add all points from cells
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const labelList& cFaces = mesh.cells()[id]; const labelUList& cFaces = mesh_.cells()[id];
forAll(cFaces, cFaceI) forAll(cFaces, cFaceI)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh_.faces()[cFaces[cFaceI]];
forAll(f, fp) forAll(f, fp)
{ {
@ -345,42 +301,40 @@ void Foam::ensightPartCells::writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile& os,
const word& key, const word& key,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const ) const
{ {
os.writeKeyword(key); os.writeKeyword(key);
os.write(idList.size()); os.write(idList.size());
os.newline(); os.newline();
const polyMesh& mesh = *meshPtr_;
// write polyhedral // write polyhedral
if (key == "nfaced") if (key == "nfaced")
{ {
const faceList& meshFaces = mesh.faces(); const faceList& meshFaces = mesh_.faces();
// write the number of faces per element // write the number of faces per element
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id]; const labelUList& cFace = mesh_.cells()[id];
os.write( cFace.size() ); os.write(cFace.size());
os.newline(); os.newline();
} }
// write the number of points per element face // write the number of points per element face
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id]; const labelUList& cFace = mesh_.cells()[id];
forAll(cFace, faceI) forAll(cFace, faceI)
{ {
const face& cf = meshFaces[cFace[faceI]]; const face& cf = meshFaces[cFace[faceI]];
os.write( cf.size() ); os.write(cf.size());
os.newline(); os.newline();
} }
} }
@ -388,8 +342,8 @@ void Foam::ensightPartCells::writeConnectivity
// write the points describing each element face // write the points describing each element face
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id]; const labelUList& cFace = mesh_.cells()[id];
forAll(cFace, faceI) forAll(cFace, faceI)
{ {
@ -399,7 +353,7 @@ void Foam::ensightPartCells::writeConnectivity
{ {
// convert global -> local index // convert global -> local index
// (note: Ensight indices start with 1) // (note: Ensight indices start with 1)
os.write( pointMap[cf[ptI]] + 1); os.write(pointMap[cf[ptI]] + 1);
} }
os.newline(); os.newline();
} }
@ -408,18 +362,18 @@ void Foam::ensightPartCells::writeConnectivity
else else
{ {
// write primitive // write primitive
const cellShapeList& cellShapes = mesh.cellShapes(); const cellShapeList& cellShapes = mesh_.cellShapes();
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const cellShape& cellPoints = cellShapes[id]; const cellShape& cellPoints = cellShapes[id];
// convert global -> local index // convert global -> local index
// (note: Ensight indices start with 1) // (note: Ensight indices start with 1)
forAll(cellPoints, ptI) forAll(cellPoints, ptI)
{ {
os.write( pointMap[cellPoints[ptI]] + 1 ); os.write(pointMap[cellPoints[ptI]] + 1);
} }
os.newline(); os.newline();
} }
@ -429,8 +383,7 @@ void Foam::ensightPartCells::writeConnectivity
void Foam::ensightPartCells::writeGeometry(ensightGeoFile& os) const void Foam::ensightPartCells::writeGeometry(ensightGeoFile& os) const
{ {
const polyMesh& mesh = *meshPtr_; ensightPart::writeGeometry(os, points_);
ensightPart::writeGeometry(os, mesh.points());
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,8 +56,12 @@ class ensightPartCells
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const ensightPartCells&); void operator=(const ensightPartCells&);
//- classify the cell types //- Classify the cell types, set elemLists.
void classify(const labelList& idLabels = labelList::null()); void classify
(
const polyMesh&,
const labelUList& idLabels = labelUList::null()
);
//- track points used //- track points used
virtual localPoints calcLocalPoints() const; virtual localPoints calcLocalPoints() const;
@ -68,19 +72,16 @@ class ensightPartCells
//- element connectivity //- element connectivity
virtual void writeConnectivity virtual void writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile&,
const word& key, const word& key,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const; ) const;
//- write geometry
virtual void writeGeometry(ensightGeoFile& os) const;
protected: protected:
//- addressable Ensight element types //- addressable ensight element types
enum elemType enum elemType
{ {
tetra4Elements, tetra4Elements,
@ -90,8 +91,16 @@ protected:
nfacedElements nfacedElements
}; };
// Static data members // Static data members
static List<word> elemTypes_;
static const List<word> elemTypes_;
// Protected data
//- mesh referenced
const polyMesh& mesh_;
public: public:
@ -112,7 +121,7 @@ public:
( (
label partNumber, label partNumber,
const polyMesh&, const polyMesh&,
const labelList& const labelUList&
); );
//- Construct from polyMesh and cellZone //- Construct from polyMesh and cellZone
@ -126,10 +135,13 @@ public:
//- Construct as copy //- Construct as copy
ensightPartCells(const ensightPartCells&); ensightPartCells(const ensightPartCells&);
//- Construct from Istream //- Reconstruct part characteristics (eg, element types) from Istream
// A part reconstructed in this manner can be used when writing fields,
// but cannot be used to write a new geometry
// @sa Foam::ensightPart::reconstruct
ensightPartCells(Istream&); ensightPartCells(Istream&);
//- Construct on freestore from Istream //- Reconstruct part characteristics on freestore from Istream
static autoPtr<ensightPartCells> New(Istream& is) static autoPtr<ensightPartCells> New(Istream& is)
{ {
return autoPtr<ensightPartCells>(new ensightPartCells(is)); return autoPtr<ensightPartCells>(new ensightPartCells(is));
@ -142,8 +154,11 @@ public:
// Member Functions // Member Functions
//- write geometry
virtual void writeGeometry(ensightGeoFile&) const;
//- static listing of the element types //- static listing of the element types
virtual List<word> const& elementTypes() const virtual const List<word>& elementTypes() const
{ {
return elemTypes_; return elemTypes_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,10 +24,10 @@ License
\*----------------------------------------------------------------------------*/ \*----------------------------------------------------------------------------*/
#include "ensightPartFaces.H" #include "ensightPartFaces.H"
#include "addToRunTimeSelectionTable.H"
#include "IOstreams.H" #include "IOstreams.H"
#include "IStringStream.H" #include "IStringStream.H"
#include "dictionary.H" #include "dictionary.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -38,7 +38,7 @@ namespace Foam
} }
Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_ const Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
( (
IStringStream IStringStream
( (
@ -49,7 +49,7 @@ Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::ensightPartFaces::binShapes(const faceList& faces) void Foam::ensightPartFaces::classify(const faceList& faces)
{ {
// count the shapes // count the shapes
label nTri = 0; label nTri = 0;
@ -107,9 +107,9 @@ void Foam::ensightPartFaces::binShapes(const faceList& faces)
// MUST match with elementTypes // MUST match with elementTypes
elemLists_.setSize(elementTypes().size()); elemLists_.setSize(elementTypes().size());
elemLists_[tria3Elements].transfer( triCells ); elemLists_[tria3Elements].transfer(triCells);
elemLists_[quad4Elements].transfer( quadCells ); elemLists_[quad4Elements].transfer(quadCells);
elemLists_[nsidedElements].transfer( polygonCells ); elemLists_[nsidedElements].transfer(polygonCells);
size_ = faces.size(); size_ = faces.size();
} }
@ -123,7 +123,9 @@ Foam::ensightPartFaces::ensightPartFaces
const string& partDescription const string& partDescription
) )
: :
ensightPart(partNumber, partDescription) ensightPart(partNumber, partDescription),
faces_(faceList::null()),
contiguousPoints_(false)
{ {
isCellData_ = false; isCellData_ = false;
offset_ = 0; offset_ = 0;
@ -134,29 +136,57 @@ Foam::ensightPartFaces::ensightPartFaces
Foam::ensightPartFaces::ensightPartFaces Foam::ensightPartFaces::ensightPartFaces
( (
label partNumber, label partNumber,
const polyMesh& pMesh, const string& partDescription,
const polyPatch& pPatch const pointField& points,
const faceList& faces,
const bool contiguousPoints
) )
: :
ensightPart(partNumber, pPatch.name(), pMesh) ensightPart(partNumber, partDescription, points),
faces_(faces),
contiguousPoints_(contiguousPoints)
{ {
isCellData_ = false; isCellData_ = false;
offset_ = pPatch.start(); offset_ = 0;
size_ = 0;
// count the shapes // classify the face shapes
binShapes(pPatch); classify(faces);
}
Foam::ensightPartFaces::ensightPartFaces
(
label partNumber,
const polyMesh& mesh,
const polyPatch& patch
)
:
ensightPart(partNumber, patch.name(), mesh.points()),
faces_(mesh.faces()),
contiguousPoints_(false)
{
isCellData_ = false;
offset_ = patch.start();
// classify the face shapes
classify(patch);
} }
Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces& part) Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces& part)
: :
ensightPart(part) ensightPart(part),
faces_(part.faces_),
contiguousPoints_(part.contiguousPoints_)
{} {}
Foam::ensightPartFaces::ensightPartFaces(Istream& is) Foam::ensightPartFaces::ensightPartFaces(Istream& is)
: :
ensightPart() ensightPart(),
faces_(faceList::null()),
contiguousPoints_(false)
{ {
isCellData_ = false; isCellData_ = false;
reconstruct(is); reconstruct(is);
@ -173,21 +203,27 @@ Foam::ensightPartFaces::~ensightPartFaces()
Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
{ {
const polyMesh& mesh = *meshPtr_; if (contiguousPoints_)
{
localPoints ptList;
ptList.list = identity(points_.size());
ptList.nPoints = points_.size();
return ptList;
}
localPoints ptList(mesh); localPoints ptList(points_);
labelList& usedPoints = ptList.list; labelList& usedPoints = ptList.list;
label nPoints = 0; label nPoints = 0;
forAll(elemLists_, typeI) forAll(elemLists_, typeI)
{ {
const labelList& idList = elemLists_[typeI]; const labelUList& idList = elemLists_[typeI];
// add all points from faces // add all points from faces
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const face& f = mesh.faces()[id]; const face& f = faces_[id];
forAll(f, fp) forAll(f, fp)
{ {
@ -219,8 +255,8 @@ void Foam::ensightPartFaces::writeConnectivity
ensightGeoFile& os, ensightGeoFile& os,
const word& key, const word& key,
const faceList& faces, const faceList& faces,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const ) const
{ {
os.writeKeyword(key); os.writeKeyword(key);
@ -233,10 +269,10 @@ void Foam::ensightPartFaces::writeConnectivity
// write the number of points per face // write the number of points per face
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const face& f = faces[id]; const face& f = faces[id];
os.write( f.size() ); os.write(f.size());
os.newline(); os.newline();
} }
} }
@ -244,14 +280,14 @@ void Foam::ensightPartFaces::writeConnectivity
// write the points describing the face // write the points describing the face
forAll(idList, i) forAll(idList, i)
{ {
label id = idList[i] + offset_; const label id = idList[i] + offset_;
const face& f = faces[id]; const face& f = faces[id];
// convert global -> local index // convert global -> local index
// (note: Ensight indices start with 1) // (note: Ensight indices start with 1)
forAll(f, fp) forAll(f, fp)
{ {
os.write( pointMap[f[fp]] + 1 ); os.write(pointMap[f[fp]] + 1);
} }
os.newline(); os.newline();
} }
@ -262,15 +298,15 @@ void Foam::ensightPartFaces::writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile& os,
const word& key, const word& key,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const ) const
{ {
writeConnectivity writeConnectivity
( (
os, os,
key, key,
meshPtr_->faces(), faces_,
idList, idList,
pointMap pointMap
); );
@ -279,9 +315,7 @@ void Foam::ensightPartFaces::writeConnectivity
void Foam::ensightPartFaces::writeGeometry(ensightGeoFile& os) const void Foam::ensightPartFaces::writeGeometry(ensightGeoFile& os) const
{ {
const polyMesh& mesh = *meshPtr_; ensightPart::writeGeometry(os, points_);
const pointField& points = mesh.points();
ensightPart::writeGeometry(os, points);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,15 +61,12 @@ class ensightPartFaces
//- element connectivity //- element connectivity
virtual void writeConnectivity virtual void writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile&,
const word& key, const word& key,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const; ) const;
//- write geometry
virtual void writeGeometry(ensightGeoFile& os) const;
protected: protected:
@ -81,20 +78,34 @@ protected:
nsidedElements nsidedElements
}; };
// Static data members
static List<word> elemTypes_;
//- Divide the shapes, set elemLists. // Static data members
void binShapes(const faceList& faces);
static const List<word> elemTypes_;
// Protected data
//- faces referenced
const faceList& faces_;
//- Can skip local point renumbering when points are contiguous
const bool contiguousPoints_;
// Protected Member Functions
//- Classify the face shapes, set elemLists.
void classify(const faceList&);
//- Helper: write connectivity //- Helper: write connectivity
void writeConnectivity void writeConnectivity
( (
ensightGeoFile& os, ensightGeoFile&,
const word& key, const word& key,
const faceList& faces, const faceList&,
const labelList& idList, const labelUList& idList,
const labelList& pointMap const labelUList& pointMap
) const; ) const;
@ -108,6 +119,17 @@ public:
//- Construct empty part with number and description //- Construct empty part with number and description
ensightPartFaces(label partNumber, const string& partDescription); ensightPartFaces(label partNumber, const string& partDescription);
//- Construct part with number, description, points and faces
// Can skip local point renumbering when points are contiguous
ensightPartFaces
(
label partNumber,
const string& partDescription,
const pointField&,
const faceList&,
const bool contiguousPoints = false
);
//- Construct from polyMesh and polyPatch //- Construct from polyMesh and polyPatch
ensightPartFaces ensightPartFaces
( (
@ -119,10 +141,13 @@ public:
//- Construct as copy //- Construct as copy
ensightPartFaces(const ensightPartFaces&); ensightPartFaces(const ensightPartFaces&);
//- Construct from Istream //- Reconstruct part characteristics (eg, element types) from Istream
// A part reconstructed in this manner can be used when writing fields,
// but cannot be used to write a new geometry
// @sa Foam::ensightPart::reconstruct
ensightPartFaces(Istream&); ensightPartFaces(Istream&);
//- Construct on freestore from Istream //- Reconstruct part characteristics on freestore from Istream
static autoPtr<ensightPartFaces> New(Istream& is) static autoPtr<ensightPartFaces> New(Istream& is)
{ {
return autoPtr<ensightPartFaces>(new ensightPartFaces(is)); return autoPtr<ensightPartFaces>(new ensightPartFaces(is));
@ -135,8 +160,11 @@ public:
// Member Functions // Member Functions
//- write geometry
virtual void writeGeometry(ensightGeoFile&) const;
//- static listing of the element types //- static listing of the element types
virtual List<word> const& elementTypes() const virtual const List<word>& elementTypes() const
{ {
return elemTypes_; return elemTypes_;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -59,6 +59,8 @@ void Foam::ensightPart::writeFieldList
const labelUList& idList const labelUList& idList
) const ) const
{ {
if (&idList)
{
forAll(idList, i) forAll(idList, i)
{ {
if (idList[i] >= field.size() || isnan(field[idList[i]])) if (idList[i] >= field.size() || isnan(field[idList[i]]))
@ -72,11 +74,56 @@ void Foam::ensightPart::writeFieldList
os.newline(); os.newline();
} }
}
else
{
// no idList => perNode
forAll(field, i)
{
if (isnan(field[i]))
{
os.writeUndef();
}
else
{
os.write(field[i]);
}
os.newline();
}
}
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ensightPart::reconstruct(Istream& is)
{
dictionary dict(is);
dict.lookup("id") >> number_;
dict.lookup("name") >> name_;
offset_ = 0;
dict.readIfPresent("offset", offset_);
// populate elemLists_
elemLists_.setSize(elementTypes().size());
forAll(elementTypes(), elemI)
{
word key(elementTypes()[elemI]);
elemLists_[elemI].clear();
dict.readIfPresent(key, elemLists_[elemI]);
size_ += elemLists_[elemI].size();
}
is.check("ensightPart::reconstruct(Istream&)");
}
bool Foam::ensightPart::writeSummary(Ostream& os) const bool Foam::ensightPart::writeSummary(Ostream& os) const
{ {
os << indent << type() << nl os << indent << type() << nl
@ -127,7 +174,7 @@ void Foam::ensightPart::writeGeometry
if (size()) if (size())
{ {
const localPoints ptList = calcLocalPoints(); const localPoints ptList = calcLocalPoints();
const labelList& pointMap = ptList.list; const labelUList& pointMap = ptList.list;
writeHeader(os, true); writeHeader(os, true);
@ -136,13 +183,13 @@ void Foam::ensightPart::writeGeometry
os.write(ptList.nPoints); os.write(ptList.nPoints);
os.newline(); os.newline();
for (direction cmpt=0; cmpt < vector::nComponents; cmpt++) for (direction cmpt=0; cmpt < point::nComponents; ++cmpt)
{ {
forAll(pointMap, ptI) forAll(pointMap, ptI)
{ {
if (pointMap[ptI] > -1) if (pointMap[ptI] > -1)
{ {
os.write( points[ptI].component(cmpt) ); os.write(points[ptI].component(cmpt));
os.newline(); os.newline();
} }
} }
@ -169,24 +216,33 @@ void Foam::ensightPart::writeGeometry
void Foam::ensightPart::writeScalarField void Foam::ensightPart::writeScalarField
( (
ensightFile& os, ensightFile& os,
const List<scalar>& field const List<scalar>& field,
const bool perNode
) const ) const
{ {
if (size() && field.size() && (os.allowUndef() || isFieldDefined(field))) if (size() && field.size() && (os.allowUndef() || isFieldDefined(field)))
{ {
writeHeader(os); writeHeader(os);
if (perNode)
{
os.writeKeyword("coordinates");
writeFieldList(os, field, labelUList::null());
}
else
{
forAll(elementTypes(), elemI) forAll(elementTypes(), elemI)
{ {
const labelList& idList = elemLists_[elemI]; const labelUList& idList = elemLists_[elemI];
if (idList.size()) if (idList.size())
{ {
os.writeKeyword( elementTypes()[elemI] ); os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field, idList); writeFieldList(os, field, idList);
} }
} }
} }
}
} }
@ -195,26 +251,37 @@ void Foam::ensightPart::writeVectorField
ensightFile& os, ensightFile& os,
const List<scalar>& field0, const List<scalar>& field0,
const List<scalar>& field1, const List<scalar>& field1,
const List<scalar>& field2 const List<scalar>& field2,
const bool perNode
) const ) const
{ {
if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0))) if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0)))
{ {
writeHeader(os); writeHeader(os);
if (perNode)
{
os.writeKeyword("coordinates");
writeFieldList(os, field0, labelUList::null());
writeFieldList(os, field1, labelUList::null());
writeFieldList(os, field2, labelUList::null());
}
else
{
forAll(elementTypes(), elemI) forAll(elementTypes(), elemI)
{ {
const labelList& idList = elemLists_[elemI]; const labelUList& idList = elemLists_[elemI];
if (idList.size()) if (idList.size())
{ {
os.writeKeyword( elementTypes()[elemI] ); os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field0, idList); writeFieldList(os, field0, idList);
writeFieldList(os, field1, idList); writeFieldList(os, field1, idList);
writeFieldList(os, field2, idList); writeFieldList(os, field2, idList);
} }
} }
} }
}
} }

View File

@ -1,122 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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/>.
\*---------------------------------------------------------------------------*/
#include "ensightPartNonMeshFaces.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(ensightPartNonMeshFaces, 0);
addToRunTimeSelectionTable(ensightPart, ensightPartNonMeshFaces, istream);
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::ensightPart::localPoints
Foam::ensightPartNonMeshFaces::calcLocalPoints() const
{
localPoints ptList;
ptList.list = identity(points_.size());
ptList.nPoints = points_.size();
return ptList;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces
(
label partNumber,
const string& partDescription,
const faceList& faces,
const pointField& points
)
:
ensightPartFaces(partNumber, partDescription),
faces_(faces),
points_(points)
{
binShapes(faces);
}
//- Construct as copy
Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces
(
const ensightPartNonMeshFaces& part
)
:
ensightPartFaces(part),
faces_(part.faces_),
points_(part.points_)
{}
//- Construct from Istream
Foam::ensightPartNonMeshFaces::ensightPartNonMeshFaces(Istream& is)
:
ensightPartFaces(is),
faces_(is),
points_(is)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::ensightPartNonMeshFaces::~ensightPartNonMeshFaces()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::ensightPartNonMeshFaces::writeConnectivity
(
ensightGeoFile& os,
const word& key,
const labelList& idList,
const labelList& pointMap
) const
{
ensightPartFaces::writeConnectivity
(
os,
key,
faces_,
idList,
pointMap
);
}
void Foam::ensightPartNonMeshFaces::writeGeometry(ensightGeoFile& os) const
{
ensightPart::writeGeometry(os, points_);
}
// ************************************************************************* //

View File

@ -1,131 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 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/>.
Class
Foam::ensightPartNonMeshFaces
Description
An implementation of ensightPart to work on self-contained faces and points
(without a mesh).
SourceFiles
ensightPartNonMeshFaces.C
\*---------------------------------------------------------------------------*/
#ifndef ensightPartNonMeshFaces_H
#define ensightPartNonMeshFaces_H
#include "ensightPartFaces.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ensightPartNonMeshFaces Declaration
\*---------------------------------------------------------------------------*/
class ensightPartNonMeshFaces
:
public ensightPartFaces
{
// Private data
//- faces (reference)
const faceList& faces_;
//- points (reference)
const pointField& points_;
// Private Member Functions
//- Disallow default bitwise assignment
void operator=(const ensightPartNonMeshFaces&);
//- track points used
virtual localPoints calcLocalPoints() const;
public:
//- Runtime type information
TypeName("ensightNonMeshFaces");
// Constructors
//- Construct from faces and points
ensightPartNonMeshFaces
(
label partNumber,
const string& partDescription,
const faceList& faces,
const pointField& points
);
//- Construct as copy
ensightPartNonMeshFaces(const ensightPartNonMeshFaces& part);
//- Construct from Istream
ensightPartNonMeshFaces(Istream& is);
//- Construct on freestore from Istream
static autoPtr<ensightPartNonMeshFaces> New(Istream& is)
{
return autoPtr<ensightPartNonMeshFaces>
(
new ensightPartNonMeshFaces(is)
);
}
//- Destructor
virtual ~ensightPartNonMeshFaces();
// Member Functions
//- element connectivity
virtual void writeConnectivity
(
ensightGeoFile& os,
const word& key,
const labelList& idList,
const labelList& pointMap
) const;
virtual void writeGeometry(ensightGeoFile& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,30 +30,46 @@ Description
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template <class Type> template<class Type>
void Foam::ensightPart::writeField void Foam::ensightPart::writeField
( (
ensightFile& os, ensightFile& os,
const Field<Type>& field const Field<Type>& field,
const bool perNode
) const ) const
{ {
if (size() && field.size()) if (this->size() && field.size())
{ {
writeHeader(os); writeHeader(os);
if (perNode)
{
os.writeKeyword("coordinates");
for
(
direction cmpt=0;
cmpt < pTraits<Type>::nComponents;
++cmpt
)
{
writeFieldList(os, field.component(cmpt), labelUList::null());
}
}
else
{
forAll(elementTypes(), elemI) forAll(elementTypes(), elemI)
{ {
const labelList& idList = elemLists_[elemI]; const labelUList& idList = elemLists_[elemI];
if (idList.size()) if (idList.size())
{ {
os.writeKeyword( elementTypes()[elemI] ); os.writeKeyword(elementTypes()[elemI]);
for for
( (
direction cmpt=0; direction cmpt=0;
cmpt < pTraits<Type>::nComponents; cmpt < pTraits<Type>::nComponents;
cmpt++ ++cmpt
) )
{ {
writeFieldList(os, field.component(cmpt), idList); writeFieldList(os, field.component(cmpt), idList);
@ -61,6 +77,7 @@ void Foam::ensightPart::writeField
} }
} }
} }
}
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -27,11 +27,11 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ensightParts::ensightParts(const polyMesh& pMesh) Foam::ensightParts::ensightParts(const polyMesh& mesh)
: :
partsList_() partsList_()
{ {
recalculate(pMesh); recalculate(mesh);
} }
@ -52,15 +52,15 @@ Foam::ensightParts::~ensightParts()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ensightParts::recalculate(const polyMesh& pMesh) void Foam::ensightParts::recalculate(const polyMesh& mesh)
{ {
partsList_.clear(); partsList_.clear();
// extra space for unzoned cells // extra space for unzoned cells
label nPart = label nPart =
( (
pMesh.cellZones().size() mesh.cellZones().size()
+ pMesh.boundaryMesh().size() + mesh.boundaryMesh().size()
+ 1 + 1
); );
@ -70,9 +70,9 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
label nZoneCells = 0; label nZoneCells = 0;
// do cell zones // do cell zones
forAll(pMesh.cellZones(), zoneI) forAll(mesh.cellZones(), zoneI)
{ {
const cellZone& cZone = pMesh.cellZones()[zoneI]; const cellZone& cZone = mesh.cellZones()[zoneI];
nZoneCells += cZone.size(); nZoneCells += cZone.size();
if (cZone.size()) if (cZone.size())
@ -80,12 +80,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set partsList_.set
( (
nPart, nPart,
new ensightPartCells new ensightPartCells(nPart, mesh, cZone)
(
nPart,
pMesh,
cZone
)
); );
nPart++; nPart++;
@ -100,23 +95,19 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set partsList_.set
( (
nPart, nPart,
new ensightPartCells new ensightPartCells(nPart, mesh)
(
nPart,
pMesh
)
); );
nPart++; nPart++;
} }
else if (pMesh.nCells() > nZoneCells) else if (mesh.nCells() > nZoneCells)
{ {
// determine which cells are not in a cellZone // determine which cells are not in a cellZone
labelList unzoned(pMesh.nCells(), -1); labelList unzoned(mesh.nCells(), -1);
forAll(pMesh.cellZones(), zoneI) forAll(mesh.cellZones(), zoneI)
{ {
const labelList& idList = pMesh.cellZones()[zoneI]; const labelUList& idList = mesh.cellZones()[zoneI];
forAll(idList, i) forAll(idList, i)
{ {
@ -140,12 +131,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set partsList_.set
( (
nPart, nPart,
new ensightPartCells new ensightPartCells(nPart, mesh, unzoned)
(
nPart,
pMesh,
unzoned
)
); );
nPart++; nPart++;
@ -154,20 +140,15 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
// do boundaries, skipping empty and processor patches // do boundaries, skipping empty and processor patches
forAll(pMesh.boundaryMesh(), patchI) forAll(mesh.boundaryMesh(), patchI)
{ {
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI]; const polyPatch& patch = mesh.boundaryMesh()[patchI];
if (pPatch.size() && !isA<processorPolyPatch>(pPatch)) if (patch.size() && !isA<processorPolyPatch>(patch))
{ {
partsList_.set partsList_.set
( (
nPart, nPart,
new ensightPartFaces new ensightPartFaces(nPart, mesh, patch)
(
nPart,
pMesh,
pPatch
)
); );
nPart++; nPart++;
@ -181,8 +162,8 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
void Foam::ensightParts::renumber void Foam::ensightParts::renumber
( (
const labelList& origCellId, const labelUList& origCellId,
const labelList& origFaceId const labelUList& origFaceId
) )
{ {
forAll(partsList_, partI) forAll(partsList_, partI)
@ -199,7 +180,7 @@ void Foam::ensightParts::renumber
} }
void Foam::ensightParts::writeGeometry( ensightGeoFile& os) const void Foam::ensightParts::writeGeometry(ensightGeoFile& os) const
{ {
// with some feedback // with some feedback
Info<< "write geometry part:" << nl << flush; Info<< "write geometry part:" << nl << flush;
@ -225,11 +206,9 @@ bool Foam::ensightParts::writeSummary(Ostream& os) const
void Foam::ensightParts::writeData(Ostream& os) const void Foam::ensightParts::writeData(Ostream& os) const
{ {
// Write size of list // Begin write list
os << nl << partsList_.size(); os << nl << partsList_.size()
<< nl << token::BEGIN_LIST;
// Write beginning of contents
os << nl << token::BEGIN_LIST;
// Write list contents // Write list contents
forAll(partsList_, i) forAll(partsList_, i)
@ -237,11 +216,11 @@ void Foam::ensightParts::writeData(Ostream& os) const
os << nl << partsList_[i]; os << nl << partsList_[i];
} }
// Write end of contents // End write list
os << nl << token::END_LIST << nl; os << nl << token::END_LIST << nl;
// Check state of IOstream // Check state of IOstream
os.check("Ostream& operator<<(Ostream&, const PtrList&)"); os.check("ensightParts::writeData(Ostream&)");
} }
@ -249,7 +228,8 @@ void Foam::ensightParts::writeScalarField
( (
ensightFile& os, ensightFile& os,
const List<scalar>& field, const List<scalar>& field,
bool useFaceData const bool useFaceData,
const bool perNode
) const ) const
{ {
forAll(partsList_, partI) forAll(partsList_, partI)
@ -261,7 +241,7 @@ void Foam::ensightParts::writeScalarField
: partsList_[partI].isCellData() : partsList_[partI].isCellData()
) )
{ {
partsList_[partI].writeScalarField(os,field); partsList_[partI].writeScalarField(os, field, perNode);
} }
} }
} }
@ -273,7 +253,8 @@ void Foam::ensightParts::writeVectorField
const List<scalar>& field0, const List<scalar>& field0,
const List<scalar>& field1, const List<scalar>& field1,
const List<scalar>& field2, const List<scalar>& field2,
bool useFaceData const bool useFaceData,
const bool perNode
) const ) const
{ {
forAll(partsList_, partI) forAll(partsList_, partI)
@ -285,7 +266,12 @@ void Foam::ensightParts::writeVectorField
: partsList_[partI].isCellData() : partsList_[partI].isCellData()
) )
{ {
partsList_[partI].writeVectorField(os, field0, field1, field2); partsList_[partI].writeVectorField
(
os,
field0, field1, field2,
perNode
);
} }
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,7 +29,7 @@ Description
SourceFiles SourceFiles
ensightParts.C ensightParts.C
ensightPartsI.H ensightPartsTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -89,8 +89,8 @@ public:
//- renumber elements //- renumber elements
void renumber void renumber
( (
const labelList& origCellId, const labelUList& origCellId,
const labelList& origFaceId const labelUList& origFaceId
); );
//- number of parts //- number of parts
@ -108,27 +108,33 @@ public:
//- write the lists //- write the lists
void writeData(Ostream&) const; void writeData(Ostream&) const;
//- write scalar field //- write (volume) scalar field
// optionally write data for face parts
// optionally write data per node
void writeScalarField void writeScalarField
( (
ensightFile&, ensightFile&,
const List<scalar>& field, const List<scalar>& field,
bool useFaceData = false const bool useFaceData = false,
const bool perNode = false
) const; ) const;
//- write vector field components //- write (volume) vector field components
// optionally write data for face parts
// optionally write data per node
void writeVectorField void writeVectorField
( (
ensightFile&, ensightFile&,
const List<scalar>& field0, const List<scalar>& field0,
const List<scalar>& field1, const List<scalar>& field1,
const List<scalar>& field2, const List<scalar>& field2,
bool useFaceData = false const bool useFaceData = false,
const bool perNode = false
) const; ) const;
//- write generalized field components //- write generalized volume field components
template <class Type> template<class Type>
void writeField void writeField
( (
ensightFile&, ensightFile&,
@ -138,11 +144,8 @@ public:
// Friend Operators // Friend Operators
friend ensightGeoFile& operator<< //- write geometry
( friend ensightGeoFile& operator<<(ensightGeoFile&, const ensightParts&);
ensightGeoFile&,
const ensightParts&
);
}; };
@ -153,7 +156,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
# include "ensightPartsI.H" # include "ensightPartsTemplates.C"
#endif #endif
#endif #endif

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,7 +30,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template <class Type> template<class Type>
void Foam::ensightParts::writeField void Foam::ensightParts::writeField
( (
ensightFile& os, ensightFile& os,

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