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/>.
Application
DistributionTest
Test-Distribution
Description
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
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,6 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
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
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,6 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test speeds for some HashTable operations
\*---------------------------------------------------------------------------*/

View File

@ -1,3 +1,3 @@
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
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Application
testDataEntry
Description
Tests lagrangian/intermediate/submodels/IO/DataEntry
Tests DataEntry
\*---------------------------------------------------------------------------*/

View File

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

View File

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

View File

@ -1,3 +1,3 @@
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!
surfaceFormat vtk;
// optionally define extra controls for the output formats
formatOptions
{
ensight
{
format ascii;
}
}
// interpolationScheme. choice of
// cell : use cell-centre value only; constant over cells (default)
// cellPoint : use cell-centre and vertex values

View File

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

View File

@ -1,5 +1,13 @@
#!/bin/sh
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
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
# 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
# classes will be put under the same header in the alphabetical index.

View File

@ -2,7 +2,7 @@
</div> <!-- main -->
<div class="footer">
<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>
| OPENFOAM&reg; and OpenCFD&reg; are registered trademarks of OpenCFD Ltd.
</p>

View File

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

View File

@ -57,7 +57,7 @@ foamPV()
# Change directory aliases
# ~~~~~~~~~~~~~~~~~~~~~~~~
alias src='cd $FOAM_SRC'
alias lib='cd $FOAM_LIB'
alias lib='cd $FOAM_LIBBIN'
alias run='cd $FOAM_RUN'
alias foam='cd $WM_PROJECT_DIR'
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
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_TUTORIALS $WM_PROJECT_DIR/tutorials
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
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_TUTORIALS=$WM_PROJECT_DIR/tutorials
export FOAM_UTILITIES=$FOAM_APP/utilities

View File

@ -1,8 +1,6 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
makeOption=libso
[ $# -ge 1 ] && makeOption=$1
[ $# -ge 1 ] && makeOption=$1 || makeOption=libso
wmakeCheckPwd "$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
# 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 OSspecific/$WM_OSTYPE
wmakeLnInclude OSspecific/${WM_OSTYPE:-POSIX}
Pstream/Allwmake $*
OSspecific/$WM_OSTYPE/Allwmake
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake
wmake $makeOption OpenFOAM
wmake $makeOption fileFormats

View File

@ -9,6 +9,7 @@ $(bools)/bool/bool.C
$(bools)/bool/boolIO.C
$(bools)/Switch/Switch.C
$(bools)/Switch/SwitchIO.C
$(bools)/lists/boolList.C
chars = primitives/chars
$(chars)/char/charIO.C
@ -22,10 +23,16 @@ $(ints)/longLong/longLongIO.C
$(ints)/ulong/ulongIO.C
$(ints)/label/label.C
$(ints)/uLabel/uLabel.C
$(ints)/lists/labelIOList.C
$(ints)/lists/labelListIOList.C
primitives/Scalar/doubleScalar/doubleScalar.C
primitives/Scalar/floatScalar/floatScalar.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/SphericalTensor/sphericalTensor/sphericalTensor.C
primitives/SphericalTensor/labelSphericalTensor/labelSphericalTensor.C
@ -33,9 +40,16 @@ primitives/SymmTensor/labelSymmTensor/labelSymmTensor.C
primitives/SymmTensor/symmTensor/symmTensor.C
primitives/Tensor/labelTensor/labelTensor.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/labelVector/labelVector.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/SphericalTensor2D/sphericalTensor2D/sphericalTensor2D.C
@ -47,6 +61,12 @@ primitives/globalIndexAndTransform/vectorTensorTransform/vectorTensorTransform.C
primitives/quaternion/quaternion.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)/string/string.C
$(strings)/string/stringIO.C
@ -56,6 +76,7 @@ $(strings)/fileName/fileName.C
$(strings)/fileName/fileNameIO.C
$(strings)/keyType/keyType.C
$(strings)/wordRe/wordRe.C
$(strings)/lists/hashedWordList.C
primitives/hashes/Hasher/Hasher.C
@ -82,21 +103,6 @@ containers/Lists/ListOps/ListOps.C
containers/LinkedLists/linkTypes/SLListBase/SLListBase.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)/token/tokenIO.C

View File

@ -507,13 +507,23 @@ Foam::argList::argList
jobInfo.add("startTime", timeString);
jobInfo.add("userName", userName());
jobInfo.add("foamVersion", word(FOAMversion));
jobInfo.add("foamBuild", Foam::FOAMbuild);
jobInfo.add("code", executable_);
jobInfo.add("argList", argListString);
jobInfo.add("currentDir", cwd());
jobInfo.add("PPID", ppid());
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
int nProcs = 1;
@ -883,9 +893,10 @@ void Foam::argList::printUsage() const
printNotes();
Info<< nl
<<"Using OpenFOAM-" << Foam::FOAMversion
<<" (build: " << Foam::FOAMbuild << ") - see www.OpenFOAM.com"
<< nl << endl;
<<"Using: OpenFOAM-" << Foam::FOAMversion
<< " (see www.OpenFOAM.com)" << nl
<<"Build: " << Foam::FOAMbuild << nl
<< endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -260,6 +260,11 @@ void Foam::LUscalarMatrix::convert
}
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 =
lduMatrices[interface.neighbProcNo_].interfaces_;
@ -269,8 +274,11 @@ void Foam::LUscalarMatrix::convert
{
if
(
neiInterfaces[ninti].neighbProcNo_
== interface.myProcNo_
(
neiInterfaces[ninti].neighbProcNo_
== interface.myProcNo_
)
&& (neiInterfaces[ninti].tag_ == interface.tag_)
)
{
neiInterfacei = ninti;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -149,7 +149,7 @@ Foam::scalar& Foam::Polynomial<PolySize>::logCoeff()
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];
@ -192,7 +192,7 @@ Foam::scalar Foam::Polynomial<PolySize>::integrateLimits
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
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ Description
where 0 \<= i \<= n
- 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() to return a new, intergated coeff polynomial
- increases the size (order)
@ -134,7 +134,7 @@ public:
// Evaluation
//- Return polynomial value
scalar evaluate(const scalar x) const;
scalar value(const scalar x) const;
//- Return integrated polynomial coefficients
// argument becomes zeroth element (constant of integration)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,31 +24,32 @@ License
\*----------------------------------------------------------------------------*/
#include "ensightPart.H"
#include "addToRunTimeSelectionTable.H"
#include "dictionary.H"
#include "ListOps.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(ensightPart, 0);
defineTemplateTypeNameAndDebug(IOPtrList<ensightPart>, 0);
defineRunTimeSelectionTable(ensightPart, istream);
defineTypeNameAndDebug(ensightPart, 0);
defineTemplateTypeNameAndDebug(IOPtrList<ensightPart>, 0);
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
{
forAll(elemLists_, elemI)
{
const labelList& idList = elemLists_[elemI];
const labelUList& idList = elemLists_[elemI];
forAll(idList, i)
{
label id = idList[i];
const label id = idList[i];
if (id >= field.size() || isnan(field[id]))
{
@ -72,7 +73,7 @@ Foam::ensightPart::ensightPart
size_(0),
isCellData_(true),
matId_(0),
meshPtr_(0)
points_(pointField::null())
{}
@ -89,7 +90,7 @@ Foam::ensightPart::ensightPart
size_(0),
isCellData_(true),
matId_(0),
meshPtr_(0)
points_(pointField::null())
{}
@ -97,7 +98,7 @@ Foam::ensightPart::ensightPart
(
label partNumber,
const string& partDescription,
const polyMesh& pMesh
const pointField& points
)
:
number_(partNumber),
@ -107,7 +108,7 @@ Foam::ensightPart::ensightPart
size_(0),
isCellData_(true),
matId_(0),
meshPtr_(&pMesh)
points_(points)
{}
@ -120,7 +121,7 @@ Foam::ensightPart::ensightPart(const ensightPart& part)
size_(part.size_),
isCellData_(part.isCellData_),
matId_(part.matId_),
meshPtr_(part.meshPtr_)
points_(part.points_)
{}
@ -158,31 +159,7 @@ Foam::ensightPart::~ensightPart()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ensightPart::reconstruct(Istream& is)
{
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)
void Foam::ensightPart::renumber(const labelUList& origId)
{
// transform to global values first
if (offset_)

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,22 +24,21 @@ License
\*----------------------------------------------------------------------------*/
#include "ensightPartCells.H"
#include "addToRunTimeSelectionTable.H"
#include "IOstream.H"
#include "IStringStream.H"
#include "dictionary.H"
#include "cellModeller.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(ensightPartCells, 0);
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
defineTypeNameAndDebug(ensightPartCells, 0);
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
}
Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
const Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
(
IStringStream
(
@ -50,7 +49,11 @@ Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
// * * * * * * * * * * * * * 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
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& hex = *(cellModeller::lookup("hex"));
const polyMesh& mesh = *meshPtr_;
const cellShapeList& cellShapes = mesh.cellShapes();
offset_ = 0;
@ -78,13 +80,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
label nHex = 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)
{
label cellId = listI;
@ -115,26 +110,6 @@ void Foam::ensightPartCells::classify(const labelList& idList)
else
{
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
{
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
elemLists_.setSize(elementTypes().size());
elemLists_[tetra4Elements].transfer( tetCells );
elemLists_[pyramid5Elements].transfer( pyramidCells );
elemLists_[penta6Elements].transfer( prismCells );
elemLists_[hexa8Elements].transfer( hexCells );
elemLists_[nfacedElements].transfer( polyCells );
elemLists_[tetra4Elements].transfer(tetCells);
elemLists_[pyramid5Elements].transfer(pyramidCells);
elemLists_[penta6Elements].transfer(prismCells);
elemLists_[hexa8Elements].transfer(hexCells);
elemLists_[nfacedElements].transfer(polyCells);
}
@ -229,57 +181,63 @@ Foam::ensightPartCells::ensightPartCells
const string& partDescription
)
:
ensightPart(partNumber, partDescription)
ensightPart(partNumber, partDescription),
mesh_(*reinterpret_cast<polyMesh*>(0))
{}
Foam::ensightPartCells::ensightPartCells
(
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
(
label partNumber,
const polyMesh& pMesh,
const labelList& idList
const polyMesh& mesh,
const labelUList& idList
)
:
ensightPart(partNumber, "cells", pMesh)
ensightPart(partNumber, "cells", mesh.points()),
mesh_(mesh)
{
classify(idList);
classify(mesh, idList);
}
Foam::ensightPartCells::ensightPartCells
(
label partNumber,
const polyMesh& pMesh,
const polyMesh& mesh,
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)
:
ensightPart(part)
ensightPart(part),
mesh_(part.mesh_)
{}
Foam::ensightPartCells::ensightPartCells(Istream& is)
:
ensightPart()
ensightPart(),
mesh_(*reinterpret_cast<polyMesh*>(0))
{
reconstruct(is);
}
@ -295,25 +253,23 @@ Foam::ensightPartCells::~ensightPartCells()
Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
{
const polyMesh& mesh = *meshPtr_;
localPoints ptList(mesh);
localPoints ptList(points_);
labelList& usedPoints = ptList.list;
label nPoints = 0;
forAll(elemLists_, typeI)
{
const labelList& idList = elemLists_[typeI];
const labelUList& idList = elemLists_[typeI];
// add all points from cells
forAll(idList, i)
{
label id = idList[i] + offset_;
const labelList& cFaces = mesh.cells()[id];
const label id = idList[i] + offset_;
const labelUList& cFaces = mesh_.cells()[id];
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const face& f = mesh_.faces()[cFaces[cFaceI]];
forAll(f, fp)
{
@ -345,42 +301,40 @@ void Foam::ensightPartCells::writeConnectivity
(
ensightGeoFile& os,
const word& key,
const labelList& idList,
const labelList& pointMap
const labelUList& idList,
const labelUList& pointMap
) const
{
os.writeKeyword(key);
os.write(idList.size());
os.newline();
const polyMesh& mesh = *meshPtr_;
// write polyhedral
if (key == "nfaced")
{
const faceList& meshFaces = mesh.faces();
const faceList& meshFaces = mesh_.faces();
// write the number of faces per element
forAll(idList, i)
{
label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id];
const label id = idList[i] + offset_;
const labelUList& cFace = mesh_.cells()[id];
os.write( cFace.size() );
os.write(cFace.size());
os.newline();
}
// write the number of points per element face
forAll(idList, i)
{
label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id];
const label id = idList[i] + offset_;
const labelUList& cFace = mesh_.cells()[id];
forAll(cFace, faceI)
{
const face& cf = meshFaces[cFace[faceI]];
os.write( cf.size() );
os.write(cf.size());
os.newline();
}
}
@ -388,8 +342,8 @@ void Foam::ensightPartCells::writeConnectivity
// write the points describing each element face
forAll(idList, i)
{
label id = idList[i] + offset_;
const labelList& cFace = mesh.cells()[id];
const label id = idList[i] + offset_;
const labelUList& cFace = mesh_.cells()[id];
forAll(cFace, faceI)
{
@ -399,7 +353,7 @@ void Foam::ensightPartCells::writeConnectivity
{
// convert global -> local index
// (note: Ensight indices start with 1)
os.write( pointMap[cf[ptI]] + 1);
os.write(pointMap[cf[ptI]] + 1);
}
os.newline();
}
@ -408,18 +362,18 @@ void Foam::ensightPartCells::writeConnectivity
else
{
// write primitive
const cellShapeList& cellShapes = mesh.cellShapes();
const cellShapeList& cellShapes = mesh_.cellShapes();
forAll(idList, i)
{
label id = idList[i] + offset_;
const label id = idList[i] + offset_;
const cellShape& cellPoints = cellShapes[id];
// convert global -> local index
// (note: Ensight indices start with 1)
forAll(cellPoints, ptI)
{
os.write( pointMap[cellPoints[ptI]] + 1 );
os.write(pointMap[cellPoints[ptI]] + 1);
}
os.newline();
}
@ -429,8 +383,7 @@ void Foam::ensightPartCells::writeConnectivity
void Foam::ensightPartCells::writeGeometry(ensightGeoFile& os) const
{
const polyMesh& mesh = *meshPtr_;
ensightPart::writeGeometry(os, mesh.points());
ensightPart::writeGeometry(os, points_);
}

View File

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

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,41 +61,52 @@ class ensightPartFaces
//- element connectivity
virtual void writeConnectivity
(
ensightGeoFile& os,
ensightGeoFile&,
const word& key,
const labelList& idList,
const labelList& pointMap
const labelUList& idList,
const labelUList& pointMap
) const;
//- write geometry
virtual void writeGeometry(ensightGeoFile& os) const;
protected:
//- addressable ensight element types
enum elemType
{
tria3Elements,
quad4Elements,
nsidedElements
};
//- addressable ensight element types
enum elemType
{
tria3Elements,
quad4Elements,
nsidedElements
};
// Static data members
static List<word> elemTypes_;
//- Divide the shapes, set elemLists.
void binShapes(const faceList& faces);
static const List<word> elemTypes_;
//- Helper: write connectivity
void writeConnectivity
(
ensightGeoFile& os,
const word& key,
const faceList& faces,
const labelList& idList,
const labelList& pointMap
) const;
// 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
void writeConnectivity
(
ensightGeoFile&,
const word& key,
const faceList&,
const labelUList& idList,
const labelUList& pointMap
) const;
public:
@ -108,6 +119,17 @@ public:
//- Construct empty part with number and description
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
ensightPartFaces
(
@ -119,10 +141,13 @@ public:
//- Construct as copy
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&);
//- Construct on freestore from Istream
//- Reconstruct part characteristics on freestore from Istream
static autoPtr<ensightPartFaces> New(Istream& is)
{
return autoPtr<ensightPartFaces>(new ensightPartFaces(is));
@ -135,8 +160,11 @@ public:
// Member Functions
//- write geometry
virtual void writeGeometry(ensightGeoFile&) const;
//- static listing of the element types
virtual List<word> const& elementTypes() const
virtual const List<word>& elementTypes() const
{
return elemTypes_;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,24 +59,71 @@ void Foam::ensightPart::writeFieldList
const labelUList& idList
) const
{
forAll(idList, i)
if (&idList)
{
if (idList[i] >= field.size() || isnan(field[idList[i]]))
forAll(idList, i)
{
os.writeUndef();
}
else
{
os.write(field[idList[i]]);
}
if (idList[i] >= field.size() || isnan(field[idList[i]]))
{
os.writeUndef();
}
else
{
os.write(field[idList[i]]);
}
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 * * * * * * * * * * * * * //
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
{
os << indent << type() << nl
@ -88,7 +135,7 @@ bool Foam::ensightPart::writeSummary(Ostream& os) const
os.writeKeyword("offset") << offset() << token::END_STATEMENT << nl;
os.writeKeyword("size") << size() << token::END_STATEMENT << nl;
os << decrIndent << indent << token::END_BLOCK << nl << endl;
os << decrIndent << indent << token::END_BLOCK << nl << endl;
return true;
}
@ -112,7 +159,7 @@ bool Foam::ensightPart::writeData(Ostream& os) const
}
}
os << decrIndent << indent << token::END_BLOCK << nl << endl;
os << decrIndent << indent << token::END_BLOCK << nl << endl;
return true;
}
@ -127,7 +174,7 @@ void Foam::ensightPart::writeGeometry
if (size())
{
const localPoints ptList = calcLocalPoints();
const labelList& pointMap = ptList.list;
const labelUList& pointMap = ptList.list;
writeHeader(os, true);
@ -136,13 +183,13 @@ void Foam::ensightPart::writeGeometry
os.write(ptList.nPoints);
os.newline();
for (direction cmpt=0; cmpt < vector::nComponents; cmpt++)
for (direction cmpt=0; cmpt < point::nComponents; ++cmpt)
{
forAll(pointMap, ptI)
{
if (pointMap[ptI] > -1)
{
os.write( points[ptI].component(cmpt) );
os.write(points[ptI].component(cmpt));
os.newline();
}
}
@ -169,21 +216,30 @@ void Foam::ensightPart::writeGeometry
void Foam::ensightPart::writeScalarField
(
ensightFile& os,
const List<scalar>& field
const List<scalar>& field,
const bool perNode
) const
{
if (size() && field.size() && (os.allowUndef() || isFieldDefined(field)))
{
writeHeader(os);
forAll(elementTypes(), elemI)
if (perNode)
{
const labelList& idList = elemLists_[elemI];
if (idList.size())
os.writeKeyword("coordinates");
writeFieldList(os, field, labelUList::null());
}
else
{
forAll(elementTypes(), elemI)
{
os.writeKeyword( elementTypes()[elemI] );
writeFieldList(os, field, idList);
const labelUList& idList = elemLists_[elemI];
if (idList.size())
{
os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field, idList);
}
}
}
}
@ -195,23 +251,34 @@ void Foam::ensightPart::writeVectorField
ensightFile& os,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2
const List<scalar>& field2,
const bool perNode
) const
{
if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0)))
{
writeHeader(os);
forAll(elementTypes(), elemI)
if (perNode)
{
const labelList& idList = elemLists_[elemI];
if (idList.size())
os.writeKeyword("coordinates");
writeFieldList(os, field0, labelUList::null());
writeFieldList(os, field1, labelUList::null());
writeFieldList(os, field2, labelUList::null());
}
else
{
forAll(elementTypes(), elemI)
{
os.writeKeyword( elementTypes()[elemI] );
writeFieldList(os, field0, idList);
writeFieldList(os, field1, idList);
writeFieldList(os, field2, idList);
const labelUList& idList = elemLists_[elemI];
if (idList.size())
{
os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field0, idList);
writeFieldList(os, field1, 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
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,33 +30,50 @@ Description
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
template <class Type>
template<class Type>
void Foam::ensightPart::writeField
(
ensightFile& os,
const Field<Type>& field
const Field<Type>& field,
const bool perNode
) const
{
if (size() && field.size())
if (this->size() && field.size())
{
writeHeader(os);
forAll(elementTypes(), elemI)
if (perNode)
{
const labelList& idList = elemLists_[elemI];
if (idList.size())
os.writeKeyword("coordinates");
for
(
direction cmpt=0;
cmpt < pTraits<Type>::nComponents;
++cmpt
)
{
os.writeKeyword( elementTypes()[elemI] );
writeFieldList(os, field.component(cmpt), labelUList::null());
}
}
else
{
forAll(elementTypes(), elemI)
{
const labelUList& idList = elemLists_[elemI];
for
(
direction cmpt=0;
cmpt < pTraits<Type>::nComponents;
cmpt++
)
if (idList.size())
{
writeFieldList(os, field.component(cmpt), idList);
os.writeKeyword(elementTypes()[elemI]);
for
(
direction cmpt=0;
cmpt < pTraits<Type>::nComponents;
++cmpt
)
{
writeFieldList(os, field.component(cmpt), idList);
}
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,11 +27,11 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ensightParts::ensightParts(const polyMesh& pMesh)
Foam::ensightParts::ensightParts(const polyMesh& mesh)
:
partsList_()
{
recalculate(pMesh);
recalculate(mesh);
}
@ -52,15 +52,15 @@ Foam::ensightParts::~ensightParts()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::ensightParts::recalculate(const polyMesh& pMesh)
void Foam::ensightParts::recalculate(const polyMesh& mesh)
{
partsList_.clear();
// extra space for unzoned cells
label nPart =
(
pMesh.cellZones().size()
+ pMesh.boundaryMesh().size()
mesh.cellZones().size()
+ mesh.boundaryMesh().size()
+ 1
);
@ -70,9 +70,9 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
label nZoneCells = 0;
// 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();
if (cZone.size())
@ -80,12 +80,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set
(
nPart,
new ensightPartCells
(
nPart,
pMesh,
cZone
)
new ensightPartCells(nPart, mesh, cZone)
);
nPart++;
@ -100,23 +95,19 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set
(
nPart,
new ensightPartCells
(
nPart,
pMesh
)
new ensightPartCells(nPart, mesh)
);
nPart++;
}
else if (pMesh.nCells() > nZoneCells)
else if (mesh.nCells() > nZoneCells)
{
// 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)
{
@ -140,12 +131,7 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
partsList_.set
(
nPart,
new ensightPartCells
(
nPart,
pMesh,
unzoned
)
new ensightPartCells(nPart, mesh, unzoned)
);
nPart++;
@ -154,20 +140,15 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
// do boundaries, skipping empty and processor patches
forAll(pMesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchI)
{
const polyPatch& pPatch = pMesh.boundaryMesh()[patchI];
if (pPatch.size() && !isA<processorPolyPatch>(pPatch))
const polyPatch& patch = mesh.boundaryMesh()[patchI];
if (patch.size() && !isA<processorPolyPatch>(patch))
{
partsList_.set
(
nPart,
new ensightPartFaces
(
nPart,
pMesh,
pPatch
)
new ensightPartFaces(nPart, mesh, patch)
);
nPart++;
@ -181,8 +162,8 @@ void Foam::ensightParts::recalculate(const polyMesh& pMesh)
void Foam::ensightParts::renumber
(
const labelList& origCellId,
const labelList& origFaceId
const labelUList& origCellId,
const labelUList& origFaceId
)
{
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
Info<< "write geometry part:" << nl << flush;
@ -225,23 +206,21 @@ bool Foam::ensightParts::writeSummary(Ostream& os) const
void Foam::ensightParts::writeData(Ostream& os) const
{
// Write size of list
os << nl << partsList_.size();
// Write beginning of contents
os << nl << token::BEGIN_LIST;
// Begin write list
os << nl << partsList_.size()
<< nl << token::BEGIN_LIST;
// Write list contents
forAll(partsList_, i)
{
os << nl << partsList_[i];
os << nl << partsList_[i];
}
// Write end of contents
os << nl << token::END_LIST << nl;
// End write list
os << nl << token::END_LIST << nl;
// 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,
const List<scalar>& field,
bool useFaceData
const bool useFaceData,
const bool perNode
) const
{
forAll(partsList_, partI)
@ -261,7 +241,7 @@ void Foam::ensightParts::writeScalarField
: 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>& field1,
const List<scalar>& field2,
bool useFaceData
const bool useFaceData,
const bool perNode
) const
{
forAll(partsList_, partI)
@ -285,7 +266,12 @@ void Foam::ensightParts::writeVectorField
: 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
\\ / O peration |
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,7 +29,7 @@ Description
SourceFiles
ensightParts.C
ensightPartsI.H
ensightPartsTemplates.C
\*---------------------------------------------------------------------------*/
@ -89,8 +89,8 @@ public:
//- renumber elements
void renumber
(
const labelList& origCellId,
const labelList& origFaceId
const labelUList& origCellId,
const labelUList& origFaceId
);
//- number of parts
@ -108,27 +108,33 @@ public:
//- write the lists
void writeData(Ostream&) const;
//- write scalar field
//- write (volume) scalar field
// optionally write data for face parts
// optionally write data per node
void writeScalarField
(
ensightFile&,
const List<scalar>& field,
bool useFaceData = false
const bool useFaceData = false,
const bool perNode = false
) const;
//- write vector field components
//- write (volume) vector field components
// optionally write data for face parts
// optionally write data per node
void writeVectorField
(
ensightFile&,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2,
bool useFaceData = false
const bool useFaceData = false,
const bool perNode = false
) const;
//- write generalized field components
template <class Type>
//- write generalized volume field components
template<class Type>
void writeField
(
ensightFile&,
@ -138,11 +144,8 @@ public:
// Friend Operators
friend ensightGeoFile& operator<<
(
ensightGeoFile&,
const ensightParts&
);
//- write geometry
friend ensightGeoFile& operator<<(ensightGeoFile&, const ensightParts&);
};
@ -153,7 +156,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "ensightPartsI.H"
# include "ensightPartsTemplates.C"
#endif
#endif

View File

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

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