Merge branch 'master' into feature/cvMesh

Conflicts:
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C
	src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H
	src/dynamicMesh/polyMeshFilter/polyMeshFilter.C
	src/meshTools/indexedOctree/treeDataPrimitivePatch.C
	src/meshTools/indexedOctree/treeDataTriSurface.C
	src/meshTools/triSurface/triSurfaceSearch/triSurfaceSearch.C
This commit is contained in:
laurence
2013-05-08 12:20:52 +01:00
459 changed files with 195180 additions and 4530 deletions

View File

@ -190,12 +190,13 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::normaliseWeights
wghtSum.setSize(wght.size());
forAll(wght, faceI)
{
scalar s = sum(wght[faceI]);
scalarList& w = wght[faceI];
scalar s = sum(w);
scalar t = s/patchAreas[faceI];
forAll(addr[faceI], i)
forAll(w, i)
{
wght[faceI][i] /= s;
w[i] /= s;
}
wghtSum[faceI] = t;

View File

@ -26,6 +26,7 @@ License
#include "AMIMethod.H"
#include "meshTools.H"
#include "mapDistribute.H"
#include "unitConversion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -209,7 +210,12 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::resetTree()
(
new indexedOctree<treeType>
(
treeType(false, tgtPatch_),
treeType
(
false,
tgtPatch_,
indexedOctree<treeType>::perturbTol()
),
bb, // overall search domain
8, // maxLevel
10, // leaf size
@ -262,6 +268,7 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::appendNbrFaces
) const
{
const labelList& nbrFaces = patch.faceFaces()[faceI];
const pointField& points = patch.points();
// filter out faces already visited from src face neighbours
forAll(nbrFaces, i)
@ -291,7 +298,16 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::appendNbrFaces
if (valid)
{
faceIDs.append(nbrFaceI);
const face& f = patch[faceI];
const face& nbrF = patch[nbrFaceI];
const vector& n = f.normal(points);
const vector& nbrN = nbrF.normal(points);
scalar cosI = mag(nbrN & n);
if (cosI < Foam::cos(degToRad(89.0)))
{
faceIDs.append(nbrFaceI);
}
}
}
}

View File

@ -67,8 +67,8 @@ bool Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::processSourceFace
visitedFaces.append(tgtFaceI);
scalar area = interArea(srcFaceI, tgtFaceI);
// store when intersection area > 0
if (area > 0)
// store when intersection fractional area > tolerance
if (area/this->srcMagSf_[srcFaceI] > faceAreaIntersect::tolerance())
{
srcAddr[srcFaceI].append(tgtFaceI);
srcWght[srcFaceI].append(area);
@ -227,12 +227,9 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea
const face& tgt = this->tgtPatch_[tgtFaceI];
// quick reject if either face has zero area
// Note: do not used stored face areas for target patch
if
(
(this->srcMagSf_[srcFaceI] < ROOTVSMALL)
|| (tgt.mag(tgtPoints) < ROOTVSMALL)
)
// Note: do not use stored face areas for target patch
const scalar tgtMag = tgt.mag(tgtPoints);
if ((this->srcMagSf_[srcFaceI] < ROOTVSMALL) || (tgtMag < ROOTVSMALL))
{
return 0.0;
}
@ -242,13 +239,14 @@ Foam::scalar Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::interArea
// crude resultant norm
vector n(-src.normal(srcPoints));
n /= mag(n);
if (this->reverseTarget_)
{
n -= tgt.normal(tgtPoints);
n -= tgt.normal(tgtPoints)/tgtMag;
}
else
{
n += tgt.normal(tgtPoints);
n += tgt.normal(tgtPoints)/tgtMag;
}
n *= 0.5;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,12 @@ namespace Foam
cyclicAMIGAMGInterfaceField,
lduInterface
);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
cyclicAMIGAMGInterfaceField,
lduInterfaceField
);
}
@ -62,6 +68,20 @@ Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
}
Foam::cyclicAMIGAMGInterfaceField::cyclicAMIGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
)
:
GAMGInterfaceField(GAMGCp, doTransform, rank),
cyclicAMIInterface_(refCast<const cyclicAMIGAMGInterface>(GAMGCp)),
doTransform_(doTransform),
rank_(rank)
{}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::cyclicAMIGAMGInterfaceField::~cyclicAMIGAMGInterfaceField()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,6 +89,14 @@ public:
const lduInterfaceField& fineInterfaceField
);
//- Construct from GAMG interface and fine level interface field
cyclicAMIGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
//- Destructor
virtual ~cyclicAMIGAMGInterfaceField();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,16 +51,14 @@ Foam::cyclicAMIGAMGInterface::cyclicAMIGAMGInterface
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
)
:
GAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing
coarseInterfaces
),
fineCyclicAMIInterface_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -88,7 +88,8 @@ public:
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
);
@ -145,6 +146,17 @@ public:
{
return fineCyclicAMIInterface_.reverseT();
}
// I/O
//- Write to stream
virtual void write(Ostream&) const
{
//TBD. How to serialise the AMI such that we can stream
// cyclicAMIGAMGInterface.
notImplemented("cyclicAMIGAMGInterface::write(Ostream&) const");
}
};

View File

@ -183,7 +183,11 @@ void Foam::treeDataPoint::findNearestOp::operator()
const treeDataPoint& shape = tree_.shapes();
// Best so far
scalar nearestDistSqr = magSqr(linePoint - nearestPoint);
scalar nearestDistSqr = GREAT;
if (minIndex >= 0)
{
nearestDistSqr = magSqr(linePoint - nearestPoint);
}
forAll(indices, i)
{

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,12 @@ namespace Foam
regionCoupledGAMGInterfaceField,
lduInterface
);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledGAMGInterfaceField,
lduInterfaceField
);
}
@ -57,6 +63,21 @@ Foam::regionCoupledGAMGInterfaceField::regionCoupledGAMGInterfaceField
{}
Foam::regionCoupledGAMGInterfaceField::regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
)
:
GAMGInterfaceField(GAMGCp, doTransform, rank),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledGAMGInterface>(GAMGCp)
)
{}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::regionCoupledGAMGInterfaceField::~regionCoupledGAMGInterfaceField()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,6 +85,13 @@ public:
const lduInterfaceField& fineInterfaceField
);
//- Construct from GAMG interface and fine level interface field
regionCoupledGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
//- Destructor
virtual ~regionCoupledGAMGInterfaceField();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,6 +38,12 @@ namespace Foam
regionCoupledWallGAMGInterfaceField,
lduInterface
);
addToRunTimeSelectionTable
(
GAMGInterfaceField,
regionCoupledWallGAMGInterfaceField,
lduInterfaceField
);
}
@ -57,6 +63,21 @@ Foam::regionCoupledWallGAMGInterfaceField::regionCoupledWallGAMGInterfaceField
{}
Foam::regionCoupledWallGAMGInterfaceField::regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
)
:
GAMGInterfaceField(GAMGCp, doTransform, rank),
regionCoupledGAMGInterface_
(
refCast<const regionCoupledWallGAMGInterface>(GAMGCp)
)
{}
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
Foam::regionCoupledWallGAMGInterfaceField::~regionCoupledWallGAMGInterfaceField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -85,6 +85,14 @@ public:
const lduInterfaceField& fineInterfaceField
);
//- Construct from GAMG interface and fine level interface field
regionCoupledWallGAMGInterfaceField
(
const GAMGInterface& GAMGCp,
const bool doTransform,
const int rank
);
//- Destructor
virtual ~regionCoupledWallGAMGInterfaceField();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,17 +38,14 @@ Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
)
:
GAMGInterface
(
index,
coarseInterfaces,
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing,
fineLevelIndex
coarseInterfaces
),
fineRegionCoupledLduInterface_
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -86,7 +86,8 @@ public:
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,8 @@ Foam::regionCoupledGAMGInterface::regionCoupledGAMGInterface
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
)
:
regionCoupledBaseGAMGInterface
@ -59,7 +60,8 @@ Foam::regionCoupledGAMGInterface::regionCoupledGAMGInterface
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing,
fineLevelIndex
fineLevelIndex,
coarseComm
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,7 +76,8 @@ public:
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
);
@ -84,6 +85,18 @@ public:
virtual ~regionCoupledGAMGInterface();
// I/O
//- Write to stream
virtual void write(Ostream&) const
{
//TBD. How to serialise the AMI such that we can stream
// regionCoupledGAMGInterface.
notImplemented
(
"regionCoupledGAMGInterface::write(Ostream&) const"
);
}
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -49,7 +49,8 @@ Foam::regionCoupledWallGAMGInterface::regionCoupledWallGAMGInterface
const lduInterface& fineInterface,
const labelField& localRestrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
)
:
regionCoupledBaseGAMGInterface
@ -59,7 +60,8 @@ Foam::regionCoupledWallGAMGInterface::regionCoupledWallGAMGInterface
fineInterface,
localRestrictAddressing,
neighbourRestrictAddressing,
fineLevelIndex
fineLevelIndex,
coarseComm
)
{}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,13 +78,28 @@ public:
const lduInterface& fineInterface,
const labelField& restrictAddressing,
const labelField& neighbourRestrictAddressing,
const label fineLevelIndex
const label fineLevelIndex,
const label coarseComm
);
//- Destructor
virtual ~regionCoupledWallGAMGInterface();
// I/O
//- Write to stream
virtual void write(Ostream&) const
{
//TBD. How to serialise the AMI such that we can stream
// regionCoupledWallGAMGInterface.
notImplemented
(
"regionCoupledWallGAMGInterface::write(Ostream&) const"
);
}
};

View File

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

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -65,7 +65,7 @@ private:
// Private Member Data
//- gap size in meter
//- gap size in metre
const scalar gap_;
//- Underlying geometry (size 1)

View File

@ -133,7 +133,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const
scalar maxComp = -GREAT;
label maxCells = 0;
scalar maxVol = 0;
//scalar maxVol = 0;
scalar minComp = GREAT;
{
const boundBox& bb = mesh_.bounds();
@ -158,7 +158,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const
PackedBoolList maxSelected(mesh_.nCells());
maxCells = selectCells(maxComp, maskSet, maxSelected);
maxVol = volumeOfSet(maxSelected);
//maxVol = volumeOfSet(maxSelected);
// Check that maxPoint indeed selects all cells
if (maxCells != nTotCells)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -269,7 +269,7 @@ void Foam::topoSet::writeDebug
boundBox bb(pointField(coords, toc()), true);
os << "Set bounding box: min = "
<< bb.min() << " max = " << bb.max() << " meters. " << endl << endl;
<< bb.min() << " max = " << bb.max() << " metres. " << endl << endl;
label n = 0;