Merge branch 'master' into cvm

This commit is contained in:
graham
2011-03-22 12:09:28 +00:00
77 changed files with 149308 additions and 287 deletions

View File

@ -1180,6 +1180,43 @@ void Foam::fvMatrix<Type>::operator*=
}
template<class Type>
void Foam::fvMatrix<Type>::operator*=
(
const volScalarField& vsf
)
{
dimensions_ *= vsf.dimensions();
lduMatrix::operator*=(vsf.field());
source_ *= vsf.field();
forAll(vsf.boundaryField(), patchI)
{
const fvPatchScalarField& psf = vsf.boundaryField()[patchI];
if (psf.coupled())
{
internalCoeffs_[patchI] *= psf.patchInternalField();
boundaryCoeffs_[patchI] *= psf.patchNeighbourField();
}
else
{
internalCoeffs_[patchI] *= psf.patchInternalField();
boundaryCoeffs_[patchI] *= psf;
}
}
if (faceFluxCorrectionPtr_)
{
FatalErrorIn
(
"fvMatrix<Type>::operator*="
"(const DimensionedField<scalar, volMesh>&)"
) << "cannot scale a matrix containing a faceFluxCorrection"
<< abort(FatalError);
}
}
template<class Type>
void Foam::fvMatrix<Type>::operator*=
(

View File

@ -460,6 +460,7 @@ public:
void operator*=(const DimensionedField<scalar, volMesh>&);
void operator*=(const tmp<DimensionedField<scalar, volMesh> >&);
void operator*=(const volScalarField&);
void operator*=(const tmp<volScalarField>&);
void operator*=(const dimensioned<scalar>&);

View File

@ -27,24 +27,6 @@ License
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template<class CloudType>
Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
(
const label globalPatchI
) const
{
forAll(patchIDs_, patchI)
{
if (patchIDs_[patchI] == globalPatchI)
{
return patchI;
}
}
return -1;
}
template<class CloudType>
void Foam::LocalInteraction<CloudType>::readProps()
{
@ -131,7 +113,6 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
:
PatchInteractionModel<CloudType>(dict, cloud, typeName),
patchData_(cloud.mesh(), this->coeffDict()),
patchIDs_(patchData_.size()),
nEscape0_(patchData_.size(), 0),
massEscape0_(patchData_.size(), 0.0),
nStick0_(patchData_.size(), 0),
@ -173,7 +154,6 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
:
PatchInteractionModel<CloudType>(pim),
patchData_(pim.patchData_),
patchIDs_(pim.patchIDs_),
nEscape0_(pim.nEscape0_),
massEscape0_(pim.massEscape0_),
nStick0_(pim.nStick0_),
@ -208,7 +188,7 @@ bool Foam::LocalInteraction<CloudType>::correct
bool& active = p.active();
label patchI = applyToPatch(pp.index());
label patchI = patchData_.applyToPatch(pp.index());
if (patchI >= 0)
{

View File

@ -53,9 +53,6 @@ class LocalInteraction
//- List of participating patches
const patchInteractionDataList patchData_;
//- List of participating patch ids
List<label> patchIDs_;
// Counters for initial particle fates
@ -89,9 +86,6 @@ class LocalInteraction
// Private Member Functions
//- Returns local patchI if patch is in patchIds_ list
label applyToPatch(const label globalPatchI) const;
//- Read interaction properties from file
void readProps();

View File

@ -36,15 +36,12 @@ Foam::label Foam::PatchPostProcessing<CloudType>::applyToPatch
const label globalPatchI
) const
{
label patchI = 0;
forAllConstIter(labelHashSet, patchIDs_, iter)
forAll(patchIDs_, i)
{
if (iter.key() == globalPatchI)
if (patchIDs_[i] == globalPatchI)
{
return patchI;
return i;
}
patchI++;
}
return -1;
@ -105,7 +102,7 @@ void Foam::PatchPostProcessing<CloudType>::write()
);
sort(globalData);
patchOutFile<< "# Time " + parcelType::propHeader << nl;
patchOutFile<< "# Time currentProc " + parcelType::propHeader << nl;
forAll(globalData, dataI)
{
@ -135,6 +132,7 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
const wordList allPatchNames = owner.mesh().boundaryMesh().names();
wordList patchName(this->coeffDict().lookup("patches"));
labelHashSet uniquePatchIDs;
forAllReverse(patchName, i)
{
labelList patchIDs = findStrings(patchName[i], allPatchNames);
@ -152,9 +150,18 @@ Foam::PatchPostProcessing<CloudType>::PatchPostProcessing
<< endl;
}
forAll(patchIDs, j)
uniquePatchIDs.insert(patchIDs);
}
patchIDs_ = uniquePatchIDs.toc();
if (debug)
{
forAll(patchIDs_, i)
{
patchIDs_.insert(patchIDs[j]);
const label patchI = patchIDs_[i];
const word& patchName = owner.mesh().boundaryMesh()[patchI].name();
Info<< "Post-process patch " << patchName << endl;
}
}
@ -195,7 +202,8 @@ void Foam::PatchPostProcessing<CloudType>::postPatch
if (localPatchI != -1 && patchData_[localPatchI].size() < maxStoredParcels_)
{
OStringStream data;
data<< this->owner().time().timeName() << ' ' << p;
data<< this->owner().time().timeName() << ' ' << Pstream::myProcNo()
<< ' ' << p;
patchData_[localPatchI].append(data.str());
}
}

View File

@ -59,7 +59,7 @@ class PatchPostProcessing
label maxStoredParcels_;
//- List of patch indices to post-process
labelHashSet patchIDs_;
labelList patchIDs_;
//- List of output data per patch
List<DynamicList<string> > patchData_;

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
@ -26,7 +26,6 @@ License
#include "treeDataPoint.H"
#include "treeBoundBox.H"
#include "indexedOctree.H"
#include "polyMesh.H"
#include "triangleFuncs.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -42,6 +41,17 @@ Foam::treeDataPoint::treeDataPoint(const pointField& points)
{}
Foam::treeDataPoint::treeDataPoint
(
const pointField& points,
const labelList& pointLabels
)
:
points_(points),
pointLabels_(pointLabels)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::pointField Foam::treeDataPoint::points() const
@ -69,7 +79,8 @@ bool Foam::treeDataPoint::overlaps
const treeBoundBox& cubeBb
) const
{
return cubeBb.contains(points_[index]);
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
return cubeBb.contains(points_[pointI]);
}
@ -88,8 +99,9 @@ void Foam::treeDataPoint::findNearest
forAll(indices, i)
{
const label index = indices[i];
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
const point& pt = points_[index];
const point& pt = points_[pointI];
scalar distSqr = magSqr(pt - sample);
@ -122,8 +134,9 @@ void Foam::treeDataPoint::findNearest
forAll(indices, i)
{
const label index = indices[i];
label pointI = (pointLabels_.size() ? pointLabels_[index] : index);
const point& shapePt = points_[index];
const point& shapePt = points_[pointI];
if (tightest.contains(shapePt))
{

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
@ -30,6 +30,8 @@ Description
Used for searching for nearest point. No bounding boxes around points.
Only overlaps and calcNearest are implemented, rest makes little sense.
Optionally works on subset of points.
SourceFiles
treeDataPoint.C
@ -60,6 +62,9 @@ class treeDataPoint
const pointField& points_;
//- Subset of points to work on (or empty)
const labelList pointLabels_;
public:
// Declare name of the class and its debug switch
@ -68,9 +73,12 @@ public:
// Constructors
//- Construct from components. Holds reference to points!
//- Construct from pointField. Holds reference!
treeDataPoint(const pointField&);
//- Construct from subset of pointField. Holds reference!
treeDataPoint(const pointField&, const labelList&);
// Member Functions
@ -81,6 +89,11 @@ public:
return points_.size();
}
inline const labelList& pointLabels() const
{
return pointLabels_;
}
//- Get representative point cloud for all shapes inside
// (one point per shape)
pointField points() const;

View File

@ -90,7 +90,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("a", dimless/dimLength, 0.0)