Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev

This commit is contained in:
henry
2009-06-23 20:44:29 +01:00
12 changed files with 157 additions and 31 deletions

View File

@ -0,0 +1,80 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/
#include "DynamicField.H"
#include "IOstreams.H"
#include "labelField.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
{
DynamicField<label> dl(10);
Pout<< "null construct dl:" << dl << endl;
dl.append(3);
dl.append(2);
dl.append(1);
Pout<< "appending : dl:" << dl << endl;
}
{
DynamicField<label> dl(IStringStream("(1 2 3)")());
Pout<< "reading : dl:" << dl << endl;
}
{
labelField lf(3);
lf[0] = 1;
lf[1] = 2;
lf[2] = 3;
DynamicField<label> dl;
dl = lf;
Pout<< "assigning from labelField : dl:" << dl << endl;
}
{
labelField lf(3);
lf[0] = 1;
lf[1] = 2;
lf[2] = 3;
DynamicField<label> dl(lf);
Pout<< "constructing from labelField dl:" << dl << endl;
}
Info<< "\nEnd\n";
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
DynamicFieldTest.C
EXE = $(FOAM_USER_APPBIN)/DynamicFieldTest

View File

@ -0,0 +1,2 @@
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
/* EXE_LIBS = -lfiniteVolume */

View File

@ -657,6 +657,16 @@ void readCells
<< " tet :" << nTet << endl << " tet :" << nTet << endl
<< endl; << endl;
if (cells.size() == 0)
{
FatalErrorIn("readCells(..)")
<< "No cells read from file " << inFile.name() << nl
<< "Does your file specify any 3D elements (hex=" << MSHHEX
<< ", prism=" << MSHPRISM << ", pyramid=" << MSHPYR
<< ", tet=" << MSHTET << ")?" << nl
<< "Perhaps you have not exported the 3D elements?"
<< exit(FatalError);
}
Info<< "CellZones:" << nl Info<< "CellZones:" << nl
<< "Zone\tSize" << endl; << "Zone\tSize" << endl;

View File

@ -63,7 +63,7 @@ primitives/random/Random.C
containers/HashTables/HashTable/HashTableName.C containers/HashTables/HashTable/HashTableName.C
containers/HashTables/StaticHashTable/StaticHashTableName.C containers/HashTables/StaticHashTable/StaticHashTableName.C
containers/Lists/SortableList/ParSortableListName.C containers/Lists/SortableList/ParSortableListName.C
containers/Lists/PackedList/PackedListCore.C containers/Lists/PackedList/PackedListName.C
containers/Lists/ListOps/ListOps.C 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

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "PackedList.H" #include "PackedList.H"

View File

@ -298,6 +298,7 @@ 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());

View File

@ -81,31 +81,44 @@ public:
// Member Functions // Member Functions
//- Start of procI+1 data ////- Start of procI+1 data
inline const labelList& offsets() const; //inline const labelList& offsets() const;
// Queries relating to my processor
//- my local size //- my local size
inline label localSize() const; inline label localSize() const;
//- Global sum of localSizes
inline label size() const;
//- From local to global //- From local to global
inline label toGlobal(const label i) const; inline label toGlobal(const label i) const;
//- Is on local processor //- Is on local processor
inline bool isLocal(const label i) const; inline bool isLocal(const label i) const;
//- From global to local on procI
inline label toLocal(const label procI, const label i) const;
//- From global to local on current processor. //- From global to local on current processor.
// FatalError if not on local processor. // FatalError if not on local processor.
inline label toLocal(const label i) const; inline label toLocal(const label i) const;
//- Which processor does global come from?
// Global queries
//- Global sum of localSizes
inline label size() const;
//- From global to local on procI
inline label toLocal(const label procI, const label i) const;
//- Which processor does global come from? Binary search.
inline label whichProcID(const label i) const; inline label whichProcID(const label i) const;
//- Start of procI data
inline label offset(const label procI) const;
//- Size of procI data
inline label localSize(const label procI) const;
// IOstream Operators // IOstream Operators

View File

@ -28,20 +28,32 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::labelList& Foam::globalIndex::offsets() const //inline const Foam::labelList& Foam::globalIndex::offsets() const
//{
// return offsets_;
//}
inline Foam::label Foam::globalIndex::offset(const label procI) const
{ {
return offsets_; return (procI == 0 ? 0 : offsets_[procI-1]);
}
inline Foam::label Foam::globalIndex::localSize(const label procI) const
{
return
(
procI == 0
? offsets_[procI]
: offsets_[procI] - offsets_[procI-1]
);
} }
inline Foam::label Foam::globalIndex::localSize() const inline Foam::label Foam::globalIndex::localSize() const
{ {
return return localSize(Pstream::myProcNo());
(
Pstream::myProcNo() == 0
? offsets_[Pstream::myProcNo()]
: offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1]
);
} }

View File

@ -162,6 +162,13 @@ void Foam::FreeStream<CloudType>::inflow()
scalar mass = cloud.constProps(typeId).mass(); scalar mass = cloud.constProps(typeId).mass();
if (min(boundaryT[patchI]) < SMALL)
{
FatalErrorIn ("Foam::FreeStream<CloudType>::inflow()")
<< "Zero boundary temperature detected, check boundaryT condition." << nl
<< nl << abort(FatalError);
}
scalarField mostProbableSpeed scalarField mostProbableSpeed
( (
cloud.maxwellianMostProbableSpeed cloud.maxwellianMostProbableSpeed

View File

@ -354,8 +354,7 @@ public:
//- Range of global indices that can be returned. //- Range of global indices that can be returned.
virtual label globalSize() const virtual label globalSize() const
{ {
const labelList& offsets = globalTris().offsets(); return globalTris().size();
return offsets[offsets.size()-1];
} }
virtual void findNearest virtual void findNearest

View File

@ -26,7 +26,8 @@ Class
Foam::searchableSurfaceCollection Foam::searchableSurfaceCollection
Description Description
Union of transformed searchableSurfaces Set of transformed searchableSurfaces. Does not do boolean operations.
So when meshing might find parts 'inside'.
SourceFiles SourceFiles
searchableSurfaceCollection.C searchableSurfaceCollection.C