mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -71,6 +71,27 @@ void Foam::dynamicCode::checkSecurity
|
||||
<< "using dlopen)"
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
|
||||
if (!allowSystemOperations)
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
title,
|
||||
dict
|
||||
) << "Loading a shared library using case-supplied code is not"
|
||||
<< " enabled by default" << nl
|
||||
<< "because of security issues. If you trust the code you can"
|
||||
<< " enable this" << nl
|
||||
<< "facility be adding to the InfoSwitches setting in the system"
|
||||
<< " controlDict:" << nl << nl
|
||||
<< " allowSystemOperations 1" << nl << nl
|
||||
<< "The system controlDict is either" << nl << nl
|
||||
<< " ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict" << nl << nl
|
||||
<< "or" << nl << nl
|
||||
<< " $WM_PROJECT_DIR/etc/controlDict" << nl
|
||||
<< endl
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -400,26 +421,6 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const
|
||||
Info<< "Creating new library in " << this->libRelPath() << endl;
|
||||
}
|
||||
|
||||
if (!allowSystemOperations)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"dynamicCode::copyOrCreateFiles() const"
|
||||
) << "Loading a shared library using case-supplied code is not"
|
||||
<< " enabled by default" << nl
|
||||
<< "because of security issues. If you trust the code you can"
|
||||
<< " enable this" << nl
|
||||
<< "facility be adding to the InfoSwitches setting in the system"
|
||||
<< " controlDict:" << nl << nl
|
||||
<< " allowSystemOperations 1" << nl << nl
|
||||
<< "The system controlDict is either" << nl << nl
|
||||
<< " ~/.OpenFOAM/$WM_PROJECT_VERSION/controlDict" << nl << nl
|
||||
<< "or" << nl << nl
|
||||
<< " $WM_PROJECT_DIR/etc/controlDict" << nl
|
||||
<< endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const label nFiles = compileFiles_.size() + copyFiles_.size();
|
||||
|
||||
DynamicList<fileName> resolvedFiles(nFiles);
|
||||
|
||||
@ -414,11 +414,11 @@ Foam::argList::argList
|
||||
(
|
||||
(
|
||||
validOptions.found(optionName)
|
||||
&& validOptions[optionName] != ""
|
||||
&& !validOptions[optionName].empty()
|
||||
)
|
||||
|| (
|
||||
validParOptions.found(optionName)
|
||||
&& validParOptions[optionName] != ""
|
||||
&& !validParOptions[optionName].empty()
|
||||
)
|
||||
)
|
||||
{
|
||||
@ -833,6 +833,116 @@ Foam::argList::~argList()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::argList::setOption(const word& opt, const string& param)
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
// only allow valid options
|
||||
if (validOptions.found(opt))
|
||||
{
|
||||
// some options are to be protected
|
||||
if
|
||||
(
|
||||
opt == "case"
|
||||
|| opt == "parallel"
|
||||
|| opt == "roots"
|
||||
)
|
||||
{
|
||||
FatalError
|
||||
<<"used argList::setOption on a protected option: '"
|
||||
<< opt << "'" << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
if (validOptions[opt].empty())
|
||||
{
|
||||
// bool option
|
||||
if (!param.empty())
|
||||
{
|
||||
// disallow change of type
|
||||
FatalError
|
||||
<<"used argList::setOption to change bool to non-bool: '"
|
||||
<< opt << "'" << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// did not previously exist
|
||||
changed = !options_.found(opt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// non-bool option
|
||||
if (param.empty())
|
||||
{
|
||||
// disallow change of type
|
||||
FatalError
|
||||
<<"used argList::setOption to change non-bool to bool: '"
|
||||
<< opt << "'" << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
else
|
||||
{
|
||||
// existing value needs changing, or did not previously exist
|
||||
changed = options_.found(opt) ? options_[opt] != param : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError
|
||||
<<"used argList::setOption on an invalid option: '"
|
||||
<< opt << "'" << nl << "allowed are the following:"
|
||||
<< validOptions << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
// set/change the option as required
|
||||
if (changed)
|
||||
{
|
||||
options_.set(opt, param);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::argList::unsetOption(const word& opt)
|
||||
{
|
||||
// only allow valid options
|
||||
if (validOptions.found(opt))
|
||||
{
|
||||
// some options are to be protected
|
||||
if
|
||||
(
|
||||
opt == "case"
|
||||
|| opt == "parallel"
|
||||
|| opt == "roots"
|
||||
)
|
||||
{
|
||||
FatalError
|
||||
<<"used argList::unsetOption on a protected option: '"
|
||||
<< opt << "'" << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
// remove the option, return true if state changed
|
||||
return options_.erase(opt);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalError
|
||||
<<"used argList::unsetOption on an invalid option: '"
|
||||
<< opt << "'" << nl << "allowed are the following:"
|
||||
<< validOptions << endl;
|
||||
FatalError.exit();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::argList::printNotes() const
|
||||
{
|
||||
// output notes directly - no automatic text wrapping
|
||||
|
||||
@ -334,6 +334,19 @@ public:
|
||||
static void noParallel();
|
||||
|
||||
|
||||
//- Set option directly (use with caution)
|
||||
// An option with an empty param is a bool option.
|
||||
// Not all valid options can also be set: eg, -case, -roots, ...
|
||||
// Return true if the existing option value needed changing,
|
||||
// or if the option did not previously exist.
|
||||
bool setOption(const word& opt, const string& param = "");
|
||||
|
||||
//- Unset option directly (use with caution)
|
||||
// Not all valid options can also be unset: eg, -case, -roots ...
|
||||
// Return true if the option existed before being unset.
|
||||
bool unsetOption(const word& opt);
|
||||
|
||||
|
||||
// Print
|
||||
|
||||
//- Print notes (if any)
|
||||
|
||||
@ -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
|
||||
@ -124,7 +124,7 @@ bool Foam::matchPoints
|
||||
{
|
||||
label faceI = pts1MagSqr.indices()[j];
|
||||
|
||||
Pout<< "Compared coord:" << pts1[faceI]
|
||||
Pout<< " Compared coord:" << pts1[faceI]
|
||||
<< " with difference to point "
|
||||
<< mag(pts1[faceI] - pts0[face0I]) << endl;
|
||||
}
|
||||
|
||||
@ -57,6 +57,30 @@ Foam::label Foam::globalPoints::countPatchPoints
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::globalPoints::findSamePoint
|
||||
(
|
||||
const labelPairList& allInfo,
|
||||
const labelPair& info
|
||||
) const
|
||||
{
|
||||
const label procI = globalIndexAndTransform::processor(info);
|
||||
const label index = globalIndexAndTransform::index(info);
|
||||
|
||||
forAll(allInfo, i)
|
||||
{
|
||||
if
|
||||
(
|
||||
globalIndexAndTransform::processor(allInfo[i]) == procI
|
||||
&& globalIndexAndTransform::index(allInfo[i]) == index
|
||||
)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Foam::labelPairList Foam::globalPoints::addSendTransform
|
||||
(
|
||||
const label patchI,
|
||||
@ -67,6 +91,15 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
|
||||
|
||||
forAll(info, i)
|
||||
{
|
||||
//Pout<< " adding send transform to" << nl
|
||||
// << " proc:" << globalIndexAndTransform::processor(info[i])
|
||||
// << nl
|
||||
// << " index:" << globalIndexAndTransform::index(info[i]) << nl
|
||||
// << " trafo:"
|
||||
// << globalTransforms_.decodeTransformIndex
|
||||
// (globalIndexAndTransform::transformIndex(info[i]))
|
||||
// << endl;
|
||||
|
||||
sendInfo[i] = globalIndexAndTransform::encode
|
||||
(
|
||||
globalIndexAndTransform::processor(info[i]),
|
||||
@ -129,72 +162,63 @@ bool Foam::globalPoints::mergeInfo
|
||||
{
|
||||
bool anyChanged = false;
|
||||
|
||||
// Extend to make space for the nbrInfo (trimmed later)
|
||||
labelPairList newInfo(myInfo);
|
||||
label newI = newInfo.size();
|
||||
newInfo.setSize(newI + nbrInfo.size());
|
||||
|
||||
forAll(nbrInfo, i)
|
||||
{
|
||||
const labelPair& info = nbrInfo[i];
|
||||
label nbrProcI = globalIndexAndTransform::processor(info);
|
||||
label nbrIndex = globalIndexAndTransform::index(info);
|
||||
label nbrTransform = globalIndexAndTransform::transformIndex(info);
|
||||
|
||||
// Check if already have information about nbr point. There are two
|
||||
// possibilities:
|
||||
// - information found about same point but different transform.
|
||||
// Combine transforms
|
||||
// - information not found.
|
||||
|
||||
label myIndex = -1;
|
||||
forAll(myInfo, myI)
|
||||
{
|
||||
if (myInfo[myI] == info)
|
||||
{
|
||||
// Fully identical. We already have nbrInfo.
|
||||
myIndex = myI;
|
||||
}
|
||||
else if
|
||||
(
|
||||
globalIndexAndTransform::processor(myInfo[myI]) == nbrProcI
|
||||
&& globalIndexAndTransform::index(myInfo[myI]) == nbrIndex
|
||||
)
|
||||
{
|
||||
// Only differing is the transform.
|
||||
label myTransform = globalIndexAndTransform::transformIndex
|
||||
(
|
||||
myInfo[myI]
|
||||
);
|
||||
label index = findSamePoint(myInfo, nbrInfo[i]);
|
||||
|
||||
// Combine mine and nbr transform
|
||||
label t = globalTransforms_.mergeTransformIndex
|
||||
(
|
||||
nbrTransform,
|
||||
myTransform
|
||||
);
|
||||
myIndex = myI;
|
||||
|
||||
if (t != myTransform)
|
||||
{
|
||||
// Same point but different transformation
|
||||
newInfo[myI] = globalIndexAndTransform::encode
|
||||
(
|
||||
nbrProcI,
|
||||
nbrIndex,
|
||||
t
|
||||
);
|
||||
anyChanged = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (myIndex == -1)
|
||||
if (index == -1)
|
||||
{
|
||||
// New point
|
||||
newInfo[newI++] = nbrInfo[i];
|
||||
anyChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Same point. So we already have a connection between localPointI
|
||||
// and the nbrIndex. Two situations:
|
||||
// - same transform
|
||||
// - one transform takes two steps, the other just a single.
|
||||
if (myInfo[index] == nbrInfo[i])
|
||||
{
|
||||
// Everything same (so also transform). Nothing changed.
|
||||
}
|
||||
else
|
||||
{
|
||||
label myTransform = globalIndexAndTransform::transformIndex
|
||||
(
|
||||
myInfo[index]
|
||||
);
|
||||
label nbrTransform = globalIndexAndTransform::transformIndex
|
||||
(
|
||||
nbrInfo[i]
|
||||
);
|
||||
|
||||
// Different transform. See which is 'simplest'.
|
||||
label minTransform = globalTransforms_.minimumTransformIndex
|
||||
(
|
||||
myTransform,
|
||||
nbrTransform
|
||||
);
|
||||
|
||||
if (minTransform != myTransform)
|
||||
{
|
||||
// Use nbr info.
|
||||
newInfo[index] = nbrInfo[i];
|
||||
anyChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newInfo.setSize(newI);
|
||||
@ -327,7 +351,7 @@ void Foam::globalPoints::printProcPoints
|
||||
label index = globalIndexAndTransform::index(pointInfo[i]);
|
||||
label trafoI = globalIndexAndTransform::transformIndex(pointInfo[i]);
|
||||
|
||||
Pout<< "proc:" << procI;
|
||||
Pout<< " proc:" << procI;
|
||||
Pout<< " localpoint:";
|
||||
Pout<< index;
|
||||
Pout<< " through transform:"
|
||||
@ -386,6 +410,10 @@ void Foam::globalPoints::initOwnPoints
|
||||
)
|
||||
);
|
||||
|
||||
//Pout<< "For point "<< pp.points()[meshPointI]
|
||||
// << " inserting info " << knownInfo
|
||||
// << endl;
|
||||
|
||||
// Update changedpoints info.
|
||||
if (storeInitialInfo(knownInfo, localPointI))
|
||||
{
|
||||
@ -613,80 +641,59 @@ void Foam::globalPoints::receivePatchPoints
|
||||
label meshPointA = meshPoints[i];
|
||||
label meshPointB = coupledMeshPoints[i];
|
||||
|
||||
//Pout<< "Connection between point " << meshPointA
|
||||
// << " at " << mesh_.points()[meshPointA]
|
||||
// << " and " << meshPointB
|
||||
// << " at " << mesh_.points()[meshPointB] << endl;
|
||||
|
||||
label localA = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointA
|
||||
);
|
||||
label localB = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointB
|
||||
);
|
||||
|
||||
|
||||
// Do we have information on pointA?
|
||||
Map<label>::iterator procPointA =
|
||||
meshToProcPoint_.find(localA);
|
||||
|
||||
labelPairList infoA;
|
||||
if (procPointA != meshToProcPoint_.end())
|
||||
if (meshPointA != meshPointB)
|
||||
{
|
||||
infoA = addSendTransform
|
||||
//Pout<< "Connection between point " << meshPointA
|
||||
// << " at " << mesh_.points()[meshPointA]
|
||||
// << " and " << meshPointB
|
||||
// << " at " << mesh_.points()[meshPointB] << endl;
|
||||
|
||||
label localA = meshToLocalPoint
|
||||
(
|
||||
cycPatch.index(),
|
||||
procPoints_[procPointA()]
|
||||
meshToPatchPoint,
|
||||
meshPointA
|
||||
);
|
||||
}
|
||||
|
||||
// Same for info on pointB
|
||||
Map<label>::iterator procPointB =
|
||||
meshToProcPoint_.find(localB);
|
||||
|
||||
labelPairList infoB;
|
||||
if (procPointB != meshToProcPoint_.end())
|
||||
{
|
||||
infoB = addSendTransform
|
||||
label localB = meshToLocalPoint
|
||||
(
|
||||
cycPatch.neighbPatchID(),
|
||||
procPoints_[procPointB()]
|
||||
meshToPatchPoint,
|
||||
meshPointB
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (infoA.size())
|
||||
{
|
||||
if (mergeInfo(infoA, localB))
|
||||
// Do we have information on pointA?
|
||||
Map<label>::iterator procPointA =
|
||||
meshToProcPoint_.find(localA);
|
||||
|
||||
if (procPointA != meshToProcPoint_.end())
|
||||
{
|
||||
//Pout<< " Combined info at point "
|
||||
// << mesh_.points()[meshPointB]
|
||||
// << " now " << endl;
|
||||
//printProcPoints
|
||||
//(
|
||||
// patchToMeshPoint,
|
||||
// procPoints_[meshToProcPoint_[localB]]
|
||||
//);
|
||||
changedPoints.insert(localB);
|
||||
const labelPairList infoA = addSendTransform
|
||||
(
|
||||
cycPatch.index(),
|
||||
procPoints_[procPointA()]
|
||||
);
|
||||
|
||||
if (mergeInfo(infoA, localB))
|
||||
{
|
||||
changedPoints.insert(localB);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (infoB.size())
|
||||
{
|
||||
if (mergeInfo(infoB, localA))
|
||||
|
||||
// Same for info on pointB
|
||||
Map<label>::iterator procPointB =
|
||||
meshToProcPoint_.find(localB);
|
||||
|
||||
if (procPointB != meshToProcPoint_.end())
|
||||
{
|
||||
//Pout<< " Combined info at point "
|
||||
// << mesh_.points()[meshPointA]
|
||||
// << " now " << endl;
|
||||
//printProcPoints
|
||||
//(
|
||||
// patchToMeshPoint,
|
||||
// procPoints_[meshToProcPoint_[localA]]
|
||||
//);
|
||||
changedPoints.insert(localA);
|
||||
const labelPairList infoB = addSendTransform
|
||||
(
|
||||
cycPatch.neighbPatchID(),
|
||||
procPoints_[procPointB()]
|
||||
);
|
||||
|
||||
if (mergeInfo(infoB, localA))
|
||||
{
|
||||
changedPoints.insert(localA);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -842,6 +849,9 @@ void Foam::globalPoints::calculateSharedPoints
|
||||
{
|
||||
Pout<< "globalPoints::calculateSharedPoints(..) : "
|
||||
<< "doing processor to processor communication to get sharedPoints"
|
||||
<< endl
|
||||
<< " keepAllPoints :" << keepAllPoints << endl
|
||||
<< " mergeSeparated:" << mergeSeparated << endl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -948,7 +958,7 @@ void Foam::globalPoints::calculateSharedPoints
|
||||
// printProcPoints(patchToMeshPoint, pointInfo);
|
||||
// Pout<< endl;
|
||||
//}
|
||||
//
|
||||
|
||||
|
||||
// Remove direct neighbours from point equivalences.
|
||||
if (!keepAllPoints)
|
||||
|
||||
@ -143,6 +143,13 @@ class globalPoints
|
||||
// information is collected.
|
||||
static label countPatchPoints(const polyBoundaryMesh&);
|
||||
|
||||
//- Find index of same processor+index
|
||||
label findSamePoint
|
||||
(
|
||||
const labelPairList& allInfo,
|
||||
const labelPair& info
|
||||
) const;
|
||||
|
||||
labelPairList addSendTransform
|
||||
(
|
||||
const label patchI,
|
||||
|
||||
@ -136,7 +136,19 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
|
||||
if (isA<coupledPolyPatch>(pp))
|
||||
// Note: special check for unordered cyclics. These are in fact
|
||||
// transform bcs and should probably be split off.
|
||||
if
|
||||
(
|
||||
isA<coupledPolyPatch>(pp)
|
||||
&& !(
|
||||
isA<cyclicPolyPatch>(pp)
|
||||
&& (
|
||||
refCast<const cyclicPolyPatch>(pp).transform()
|
||||
== cyclicPolyPatch::NOORDERING
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>(pp);
|
||||
|
||||
@ -164,21 +176,19 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
||||
) == 0
|
||||
)
|
||||
{
|
||||
if (nextTrans == 6)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::globalIndexAndTransform::"
|
||||
"determineTransforms()"
|
||||
) << "More than six unsigned transforms"
|
||||
<< " detected:" << nl << transforms_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
transforms_[nextTrans] = transform;
|
||||
maxTol[nextTrans++] = cpp.matchTolerance();
|
||||
}
|
||||
|
||||
if (nextTrans > 6)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::globalIndexAndTransform::"
|
||||
"determineTransforms()"
|
||||
)
|
||||
<< "More than six unsigned transforms detected:"
|
||||
<< nl << transforms_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -206,21 +216,19 @@ void Foam::globalIndexAndTransform::determineTransforms()
|
||||
) == 0
|
||||
)
|
||||
{
|
||||
if (nextTrans == 6)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::globalIndexAndTransform::"
|
||||
"determineTransforms()"
|
||||
) << "More than six unsigned transforms"
|
||||
<< " detected:" << nl << transforms_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
transforms_[nextTrans] = transform;
|
||||
maxTol[nextTrans++] = cpp.matchTolerance();
|
||||
}
|
||||
|
||||
if (nextTrans > 6)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"void Foam::globalIndexAndTransform::"
|
||||
"determineTransforms()"
|
||||
)
|
||||
<< "More than six unsigned transforms detected:"
|
||||
<< nl << transforms_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -363,7 +371,19 @@ void Foam::globalIndexAndTransform::determinePatchTransformSign()
|
||||
|
||||
// Pout<< nl << patchI << " " << pp.name() << endl;
|
||||
|
||||
if (isA<coupledPolyPatch>(pp))
|
||||
// Note: special check for unordered cyclics. These are in fact
|
||||
// transform bcs and should probably be split off.
|
||||
if
|
||||
(
|
||||
isA<coupledPolyPatch>(pp)
|
||||
&& !(
|
||||
isA<cyclicPolyPatch>(pp)
|
||||
&& (
|
||||
refCast<const cyclicPolyPatch>(pp).transform()
|
||||
== cyclicPolyPatch::NOORDERING
|
||||
)
|
||||
)
|
||||
)
|
||||
{
|
||||
const coupledPolyPatch& cpp =
|
||||
refCast<const coupledPolyPatch>(pp);
|
||||
@ -480,26 +500,28 @@ Foam::globalIndexAndTransform::globalIndexAndTransform
|
||||
|
||||
determinePatchTransformSign();
|
||||
|
||||
if (debug && transforms_.size() > 1)
|
||||
if (debug && transforms_.size() > 0)
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
Info<< "Determined global transforms :" << endl;
|
||||
Info<< "\t\ttranslation\trotation" << endl;
|
||||
forAll(transforms_, i)
|
||||
{
|
||||
Info<< '\t' << i << '\t';
|
||||
if (transforms_[i].hasR())
|
||||
const vectorTensorTransform& trafo = transforms_[i];
|
||||
if (trafo.hasR())
|
||||
{
|
||||
Info<< transforms_[i].t() << '\t' << transforms_[i].R();
|
||||
Info<< trafo.t() << '\t' << trafo.R();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< transforms_[i].t() << '\t' << "---";
|
||||
Info<< trafo.t() << '\t' << "---";
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
Info<< "\tpatch\ttransform\tsign" << endl;
|
||||
forAll(patchTransformSign_, patchI)
|
||||
@ -513,6 +535,26 @@ Foam::globalIndexAndTransform::globalIndexAndTransform
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
|
||||
Info<< "Permutations of transformations:" << endl
|
||||
<< "\t\ttranslation\trotation" << endl;
|
||||
forAll(transformPermutations_, i)
|
||||
{
|
||||
Info<< '\t' << i << '\t';
|
||||
const vectorTensorTransform& trafo = transformPermutations_[i];
|
||||
if (trafo.hasR())
|
||||
{
|
||||
Info<< trafo.t() << '\t' << trafo.R();
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< trafo.t() << '\t' << "---";
|
||||
}
|
||||
Info<< endl;
|
||||
}
|
||||
Info<< "nullTransformIndex:" << nullTransformIndex() << endl
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -267,85 +267,47 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::globalIndexAndTransform::mergeTransformIndex
|
||||
(
|
||||
const label transformIndex0,
|
||||
const label transformIndex1
|
||||
) const
|
||||
{
|
||||
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
|
||||
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
|
||||
|
||||
forAll(permutation0, i)
|
||||
{
|
||||
if (permutation0[i] == 0)
|
||||
{
|
||||
// Take over whatever sign 1 has
|
||||
permutation0[i] = permutation1[i];
|
||||
}
|
||||
else if (permutation1[i] != 0 && permutation0[i] != permutation1[i])
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::label "
|
||||
"Foam::globalIndexAndTransform::addToTransformIndex\n"
|
||||
"(\n"
|
||||
"const label,\n"
|
||||
"const label\n"
|
||||
") const\n"
|
||||
) << "More than one patch accessing the same transform "
|
||||
<< "but not of the same sign." << endl
|
||||
<< "Trying to combine two transforms " << transformIndex0
|
||||
<< " with signs " << permutation0
|
||||
<< " and " << transformIndex1
|
||||
<< " with signs " << permutation1
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
return encodeTransformIndex(permutation0);
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::globalIndexAndTransform::minimumTransformIndex
|
||||
(
|
||||
const label transformIndex0,
|
||||
const label transformIndex1
|
||||
) const
|
||||
{
|
||||
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
|
||||
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
|
||||
if (transformIndex0 == transformIndex1)
|
||||
{
|
||||
return transformIndex0;
|
||||
}
|
||||
|
||||
|
||||
// Count number of transforms
|
||||
FixedList<label, 3> permutation0 = decodeTransformIndex(transformIndex0);
|
||||
label n0 = 0;
|
||||
forAll(permutation0, i)
|
||||
{
|
||||
if (permutation0[i] == 0)
|
||||
if (permutation0[i] != 0)
|
||||
{
|
||||
// 0 wins.
|
||||
}
|
||||
else if (permutation1[i] == 0)
|
||||
{
|
||||
// 0 wins.
|
||||
permutation0[i] = permutation1[i];
|
||||
}
|
||||
else if (permutation0[i] != permutation1[i])
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::label "
|
||||
"Foam::globalIndexAndTransform::minimumTransformIndex\n"
|
||||
"(\n"
|
||||
"const label,\n"
|
||||
"const label\n"
|
||||
") const\n"
|
||||
) << "More than one patch accessing the same transform "
|
||||
<< "but not of the same sign." << endl
|
||||
<< "Trying to combine two transforms " << transformIndex0
|
||||
<< " with signs " << permutation0
|
||||
<< " and " << transformIndex1
|
||||
<< " with signs " << permutation1
|
||||
<< exit(FatalError);
|
||||
n0++;
|
||||
}
|
||||
}
|
||||
return encodeTransformIndex(permutation0);
|
||||
|
||||
FixedList<label, 3> permutation1 = decodeTransformIndex(transformIndex1);
|
||||
label n1 = 0;
|
||||
forAll(permutation1, i)
|
||||
{
|
||||
if (permutation1[i] != 0)
|
||||
{
|
||||
n1++;
|
||||
}
|
||||
}
|
||||
|
||||
if (n0 <= n1)
|
||||
{
|
||||
return transformIndex0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return transformIndex1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -40,6 +40,48 @@ Foam::dynamicFvMesh::dynamicFvMesh(const IOobject& io)
|
||||
{}
|
||||
|
||||
|
||||
Foam::dynamicFvMesh::dynamicFvMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const Xfer<pointField>& points,
|
||||
const Xfer<faceList>& faces,
|
||||
const Xfer<labelList>& allOwner,
|
||||
const Xfer<labelList>& allNeighbour,
|
||||
const bool syncPar
|
||||
)
|
||||
:
|
||||
fvMesh
|
||||
(
|
||||
io,
|
||||
points,
|
||||
faces,
|
||||
allOwner,
|
||||
allNeighbour,
|
||||
syncPar
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
Foam::dynamicFvMesh::dynamicFvMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const Xfer<pointField>& points,
|
||||
const Xfer<faceList>& faces,
|
||||
const Xfer<cellList>& cells,
|
||||
const bool syncPar
|
||||
)
|
||||
:
|
||||
fvMesh
|
||||
(
|
||||
io,
|
||||
points,
|
||||
faces,
|
||||
cells,
|
||||
syncPar
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::dynamicFvMesh::~dynamicFvMesh()
|
||||
|
||||
@ -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
|
||||
@ -85,6 +85,29 @@ public:
|
||||
//- Construct from objectRegistry, and read/write options
|
||||
explicit dynamicFvMesh(const IOobject& io);
|
||||
|
||||
//- Construct from components without boundary.
|
||||
// Boundary is added using addFvPatches() member function
|
||||
dynamicFvMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const Xfer<pointField>& points,
|
||||
const Xfer<faceList>& faces,
|
||||
const Xfer<labelList>& allOwner,
|
||||
const Xfer<labelList>& allNeighbour,
|
||||
const bool syncPar = true
|
||||
);
|
||||
|
||||
//- Construct without boundary from cells rather than owner/neighbour.
|
||||
// Boundary is added using addPatches() member function
|
||||
dynamicFvMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
const Xfer<pointField>& points,
|
||||
const Xfer<faceList>& faces,
|
||||
const Xfer<cellList>& cells,
|
||||
const bool syncPar = true
|
||||
);
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
|
||||
@ -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
|
||||
@ -149,6 +149,7 @@ Foam::octree<Type>::octree
|
||||
// - has some guaranteed maximum size (maxShapeRatio)
|
||||
|
||||
label oldNLeaves = -1; // make test below pass first time.
|
||||
label oldNNodes = -1;
|
||||
deepestLevel_ = 1;
|
||||
while
|
||||
(
|
||||
@ -169,11 +170,11 @@ Foam::octree<Type>::octree
|
||||
break;
|
||||
}
|
||||
|
||||
if (oldNLeaves == nLeaves())
|
||||
if ((oldNLeaves == nLeaves()) && (oldNNodes == nNodes()))
|
||||
{
|
||||
if (debug & 1)
|
||||
{
|
||||
Pout<< "octree : exiting since nLeaves does not change"
|
||||
Pout<< "octree : exiting since nLeaves and nNodes do not change"
|
||||
<< endl;
|
||||
}
|
||||
break;
|
||||
@ -185,6 +186,7 @@ Foam::octree<Type>::octree
|
||||
}
|
||||
|
||||
oldNLeaves = nLeaves();
|
||||
oldNNodes = nNodes();
|
||||
|
||||
topNode_->redistribute
|
||||
(
|
||||
|
||||
@ -3,13 +3,13 @@ cd ${0%/*} || exit 1 # run from this directory
|
||||
makeType=${1:-libso}
|
||||
|
||||
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
|
||||
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc`
|
||||
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config/scotch.sh`
|
||||
then
|
||||
. $settings
|
||||
echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
|
||||
else
|
||||
echo
|
||||
echo "Error: no apps/scotch/bashrc settings"
|
||||
echo "Error: no config/scotch.sh settings"
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
@ -399,7 +399,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU)
|
||||
*max
|
||||
(
|
||||
dimensionedScalar("zero",dimensionSet(0, 0, -2, 0, 0), 0.0),
|
||||
zetaTilda2_*kappa_*S2*(L/Lvk2(S2))
|
||||
zetaTilda2_*kappa_*S2*sqr(L/Lvk2(S2))
|
||||
- 2.0/alphaPhi_*k_*grad_omega_k
|
||||
)
|
||||
);
|
||||
|
||||
@ -27,22 +27,12 @@ Class
|
||||
Description
|
||||
kOmegaSSTSAS LES turbulence model for incompressible flows
|
||||
|
||||
References:
|
||||
Evaluation of the SST-SAS model: Channel flow, asymmetric diffuser and axi-
|
||||
symmetric hill
|
||||
European Conference on Computational Fluid Dynamics
|
||||
ECCOMAS CFD 2006
|
||||
Lars Davison
|
||||
|
||||
A Scale-Adaptive Simulation Model using Two-Equation Models
|
||||
AIAA 2005-1095
|
||||
F. R. Menter and Y. Egorov
|
||||
|
||||
DESider A European Effort on Hybrid RANS-LES Modelling:
|
||||
Results of the European-Union Funded Project, 2004 - 2007
|
||||
(Notes on Numerical Fluid Mechanics and Multidisciplinary Design).
|
||||
Chapter 8 Formulation of the Scale-Adaptive Simulation (SAS) Model during
|
||||
the DESIDER Project.
|
||||
the DESIDER Project. Published in Springer-Verlag Berlin Heidelberg 2009.
|
||||
F. R. Menter and Y. Egorov.
|
||||
|
||||
SourceFiles
|
||||
|
||||
Reference in New Issue
Block a user