mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
80
applications/test/DynamicField/DynamicFieldTest.C
Normal file
80
applications/test/DynamicField/DynamicFieldTest.C
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
3
applications/test/DynamicField/Make/files
Normal file
3
applications/test/DynamicField/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
DynamicFieldTest.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/DynamicFieldTest
|
||||
2
applications/test/DynamicField/Make/options
Normal file
2
applications/test/DynamicField/Make/options
Normal file
@ -0,0 +1,2 @@
|
||||
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
|
||||
/* EXE_LIBS = -lfiniteVolume */
|
||||
@ -657,6 +657,16 @@ void readCells
|
||||
<< " tet :" << nTet << 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
|
||||
<< "Zone\tSize" << endl;
|
||||
|
||||
@ -63,7 +63,7 @@ primitives/random/Random.C
|
||||
containers/HashTables/HashTable/HashTableName.C
|
||||
containers/HashTables/StaticHashTable/StaticHashTableName.C
|
||||
containers/Lists/SortableList/ParSortableListName.C
|
||||
containers/Lists/PackedList/PackedListCore.C
|
||||
containers/Lists/PackedList/PackedListName.C
|
||||
containers/Lists/ListOps/ListOps.C
|
||||
containers/LinkedLists/linkTypes/SLListBase/SLListBase.C
|
||||
containers/LinkedLists/linkTypes/DLListBase/DLListBase.C
|
||||
|
||||
@ -22,8 +22,6 @@ 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 "PackedList.H"
|
||||
@ -298,6 +298,7 @@ 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());
|
||||
|
||||
@ -81,30 +81,43 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Start of procI+1 data
|
||||
inline const labelList& offsets() const;
|
||||
////- Start of procI+1 data
|
||||
//inline const labelList& offsets() const;
|
||||
|
||||
//- my local size
|
||||
inline label localSize() const;
|
||||
|
||||
//- Global sum of localSizes
|
||||
inline label size() const;
|
||||
// Queries relating to my processor
|
||||
|
||||
//- From local to global
|
||||
inline label toGlobal(const label i) const;
|
||||
//- my local size
|
||||
inline label localSize() const;
|
||||
|
||||
//- Is on local processor
|
||||
inline bool isLocal(const label i) const;
|
||||
//- From local to global
|
||||
inline label toGlobal(const label i) const;
|
||||
|
||||
//- From global to local on procI
|
||||
inline label toLocal(const label procI, const label i) const;
|
||||
//- Is on local processor
|
||||
inline bool isLocal(const label i) const;
|
||||
|
||||
//- From global to local on current processor.
|
||||
// FatalError if not on local processor.
|
||||
inline label toLocal(const label i) const;
|
||||
//- From global to local on current processor.
|
||||
// FatalError if not on local processor.
|
||||
inline label toLocal(const label i) const;
|
||||
|
||||
|
||||
// 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;
|
||||
|
||||
//- Start of procI data
|
||||
inline label offset(const label procI) const;
|
||||
|
||||
//- Size of procI data
|
||||
inline label localSize(const label procI) const;
|
||||
|
||||
//- Which processor does global come from?
|
||||
inline label whichProcID(const label i) const;
|
||||
|
||||
|
||||
// IOstream Operators
|
||||
|
||||
@ -28,20 +28,32 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * 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
|
||||
{
|
||||
return
|
||||
(
|
||||
Pstream::myProcNo() == 0
|
||||
? offsets_[Pstream::myProcNo()]
|
||||
: offsets_[Pstream::myProcNo()] - offsets_[Pstream::myProcNo()-1]
|
||||
);
|
||||
return localSize(Pstream::myProcNo());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -162,6 +162,13 @@ void Foam::FreeStream<CloudType>::inflow()
|
||||
|
||||
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
|
||||
(
|
||||
cloud.maxwellianMostProbableSpeed
|
||||
|
||||
@ -354,8 +354,7 @@ public:
|
||||
//- Range of global indices that can be returned.
|
||||
virtual label globalSize() const
|
||||
{
|
||||
const labelList& offsets = globalTris().offsets();
|
||||
return offsets[offsets.size()-1];
|
||||
return globalTris().size();
|
||||
}
|
||||
|
||||
virtual void findNearest
|
||||
|
||||
@ -26,7 +26,8 @@ Class
|
||||
Foam::searchableSurfaceCollection
|
||||
|
||||
Description
|
||||
Union of transformed searchableSurfaces
|
||||
Set of transformed searchableSurfaces. Does not do boolean operations.
|
||||
So when meshing might find parts 'inside'.
|
||||
|
||||
SourceFiles
|
||||
searchableSurfaceCollection.C
|
||||
|
||||
Reference in New Issue
Block a user