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:
@ -1655,6 +1655,9 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
|
||||
|
||||
// Remove any demand-driven fields ('S', 'V' etc)
|
||||
mesh.clearOut();
|
||||
|
||||
|
||||
if (cellRegion.nRegions() == 1)
|
||||
{
|
||||
|
||||
@ -53,9 +53,24 @@ dimensionedScalar dimensionedConstant
|
||||
{
|
||||
dictionary& dict = dimensionedConstants();
|
||||
|
||||
const word unitSet(dict.lookup("unitSet"));
|
||||
// Check that the entries exist.
|
||||
// Note: should make FatalError robust instead!
|
||||
|
||||
dictionary& unitDict(dict.subDict(unitSet + "Coeffs"));
|
||||
if (!dict.found("unitSet"))
|
||||
{
|
||||
std::cerr<< "Cannot find unitSet in dictionary " << dict.name()
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
const word unitSetCoeffs(word(dict.lookup("unitSet")) + "Coeffs");
|
||||
|
||||
if (!dict.found(unitSetCoeffs))
|
||||
{
|
||||
std::cerr<< "Cannot find " << unitSetCoeffs << " in dictionary "
|
||||
<< dict.name() << std::endl;
|
||||
}
|
||||
|
||||
dictionary& unitDict = dict.subDict(unitSetCoeffs);
|
||||
|
||||
dictionary& groupDict = unitDict.subDict(group);
|
||||
|
||||
|
||||
@ -198,9 +198,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
label high = values.size();
|
||||
|
||||
// Safeguards to avoid infinite loop.
|
||||
label lowPrev = -1;
|
||||
label midPrev = -1;
|
||||
label highPrev = -1;
|
||||
scalar midValuePrev = VGREAT;
|
||||
|
||||
while (true)
|
||||
{
|
||||
@ -208,10 +206,10 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "low:" << low << " lowValue:" << lowValue
|
||||
Pout<< " low:" << low << " lowValue:" << lowValue
|
||||
<< " high:" << high << " highValue:" << highValue
|
||||
<< " mid:" << mid << " midValue:" << midValue << nl
|
||||
<< "globalSize:" << size << " wantedSize:" << wantedSize
|
||||
<< " mid:" << mid << " midValue:" << midValue << endl
|
||||
<< " globalSize:" << size << " wantedSize:" << wantedSize
|
||||
<< " sizeTol:" << sizeTol << endl;
|
||||
}
|
||||
|
||||
@ -235,10 +233,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
mid = findLower(values, midValue, low, high);
|
||||
|
||||
// Safeguard if same as previous.
|
||||
bool hasNotChanged =
|
||||
(mid == midPrev)
|
||||
&& (low == lowPrev)
|
||||
&& (high == highPrev);
|
||||
bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL);
|
||||
|
||||
if (returnReduce(hasNotChanged, andOp<bool>()))
|
||||
{
|
||||
@ -248,9 +243,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
break;
|
||||
}
|
||||
|
||||
midPrev = mid;
|
||||
lowPrev = low;
|
||||
highPrev = high;
|
||||
midValuePrev = midValue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,9 +273,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
label high = values.size();
|
||||
|
||||
// Safeguards to avoid infinite loop.
|
||||
label lowPrev = -1;
|
||||
label midPrev = -1;
|
||||
label highPrev = -1;
|
||||
scalar midValuePrev = VGREAT;
|
||||
|
||||
while (true)
|
||||
{
|
||||
@ -294,10 +285,10 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "low:" << low << " lowValue:" << lowValue
|
||||
Pout<< " low:" << low << " lowValue:" << lowValue
|
||||
<< " high:" << high << " highValue:" << highValue
|
||||
<< " mid:" << mid << " midValue:" << midValue << nl
|
||||
<< "globalSize:" << weightedSize
|
||||
<< " mid:" << mid << " midValue:" << midValue << endl
|
||||
<< " globalSize:" << weightedSize
|
||||
<< " wantedSize:" << wantedSize
|
||||
<< " sizeTol:" << sizeTol << endl;
|
||||
}
|
||||
@ -322,10 +313,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
mid = findLower(values, midValue, low, high);
|
||||
|
||||
// Safeguard if same as previous.
|
||||
bool hasNotChanged =
|
||||
(mid == midPrev)
|
||||
&& (low == lowPrev)
|
||||
&& (high == highPrev);
|
||||
bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL);
|
||||
|
||||
if (returnReduce(hasNotChanged, andOp<bool>()))
|
||||
{
|
||||
@ -335,9 +323,7 @@ void Foam::hierarchGeomDecomp::findBinary
|
||||
break;
|
||||
}
|
||||
|
||||
midPrev = mid;
|
||||
lowPrev = low;
|
||||
highPrev = high;
|
||||
midValuePrev = midValue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -460,11 +446,11 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "For component " << compI << ", bin " << bin
|
||||
<< " copying" << nl
|
||||
<< " copying" << endl
|
||||
<< "from " << leftCoord << " at local index "
|
||||
<< leftIndex << nl
|
||||
<< leftIndex << endl
|
||||
<< "to " << rightCoord << " localSize:"
|
||||
<< localSize << nl
|
||||
<< localSize << endl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -643,11 +629,11 @@ void Foam::hierarchGeomDecomp::sortComponent
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "For component " << compI << ", bin " << bin
|
||||
<< " copying" << nl
|
||||
<< " copying" << endl
|
||||
<< "from " << leftCoord << " at local index "
|
||||
<< leftIndex << nl
|
||||
<< leftIndex << endl
|
||||
<< "to " << rightCoord << " localSize:"
|
||||
<< localSize << nl
|
||||
<< localSize << endl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -788,7 +774,6 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose
|
||||
|
||||
pointField rotatedPoints = rotDelta_ & points;
|
||||
|
||||
|
||||
// Calculate tolerance of cell distribution. For large cases finding
|
||||
// distibution to the cell exact would cause too many iterations so allow
|
||||
// some slack.
|
||||
|
||||
@ -628,7 +628,7 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
DynamicList<label> ef;
|
||||
|
||||
// Precalculate mesh edges for pp.edges.
|
||||
labelList meshEdges(calcMeshEdges(mesh_, pp));
|
||||
const labelList meshEdges(pp.meshEdges(mesh_.edges(), mesh_.pointEdges()));
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -1547,30 +1547,4 @@ void Foam::addPatchCellLayer::updateMesh
|
||||
}
|
||||
|
||||
|
||||
Foam::labelList Foam::addPatchCellLayer::calcMeshEdges
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const indirectPrimitivePatch& pp
|
||||
)
|
||||
{
|
||||
labelList meshEdges(pp.nEdges());
|
||||
|
||||
forAll(meshEdges, patchEdgeI)
|
||||
{
|
||||
const edge& e = pp.edges()[patchEdgeI];
|
||||
|
||||
label v0 = pp.meshPoints()[e[0]];
|
||||
label v1 = pp.meshPoints()[e[1]];
|
||||
meshEdges[patchEdgeI] = meshTools::findEdge
|
||||
(
|
||||
mesh.edges(),
|
||||
mesh.pointEdges()[v0],
|
||||
v0,
|
||||
v1
|
||||
);
|
||||
}
|
||||
return meshEdges;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -354,15 +354,6 @@ public:
|
||||
const labelList& faceMap, // new to old patch faces
|
||||
const labelList& pointMap // new to old patch points
|
||||
);
|
||||
|
||||
// Helper
|
||||
|
||||
//- Per patch edge the corresponding mesh edge
|
||||
static labelList calcMeshEdges
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const indirectPrimitivePatch&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user