mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -203,7 +203,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
// Grab zone ID. If a point is not in a zone, it will return -1
|
||||
zoneID = pz.whichZone(pointI);
|
||||
|
||||
if (zoneID > 0)
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
// Translate zone ID into the new index
|
||||
zoneID = pointZoneIndices[zoneID];
|
||||
@ -240,7 +240,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
// Grab zone ID. If a cell is not in a zone, it will return -1
|
||||
zoneID = cz.whichZone(cellI);
|
||||
|
||||
if (zoneID > 0)
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
// Translate zone ID into the new index
|
||||
zoneID = cellZoneIndices[zoneID];
|
||||
@ -343,7 +343,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
newZone = fz.whichZone(faceI);
|
||||
newZoneFlip = false;
|
||||
|
||||
if (newZone > -1)
|
||||
if (newZone >= 0)
|
||||
{
|
||||
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(faceI)];
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-DFULLDEBUG -g -O0 \
|
||||
/* -DFULLDEBUG -g -O0 */ \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
|
||||
@ -108,6 +108,7 @@ label getBand(const labelList& owner, const labelList& neighbour)
|
||||
// Calculate band of matrix
|
||||
void getBand
|
||||
(
|
||||
const bool calculateIntersect,
|
||||
const label nCells,
|
||||
const labelList& owner,
|
||||
const labelList& neighbour,
|
||||
@ -129,17 +130,22 @@ void getBand
|
||||
cellBandwidth[nei] = max(cellBandwidth[nei], diff);
|
||||
}
|
||||
|
||||
bandwidth = max(cellBandwidth);
|
||||
profile = sum(1.0*cellBandwidth);
|
||||
|
||||
sumSqrIntersect = 0.0;
|
||||
if (calculateIntersect)
|
||||
{
|
||||
forAll(nIntersect, cellI)
|
||||
{
|
||||
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
|
||||
{
|
||||
nIntersect[colI]++;
|
||||
nIntersect[colI] += 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
bandwidth = max(cellBandwidth);
|
||||
profile = sum(cellBandwidth);
|
||||
sumSqrIntersect = sum(Foam::sqr(nIntersect));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -565,6 +571,11 @@ int main(int argc, char *argv[])
|
||||
"dict",
|
||||
"renumber according to system/renumberMeshDict"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"frontWidth",
|
||||
"calculate the rms of the frontwidth"
|
||||
);
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
@ -582,7 +593,7 @@ int main(int argc, char *argv[])
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
const bool readDict = args.optionFound("dict");
|
||||
|
||||
const bool doFrontWidth = args.optionFound("frontWidth");
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
label band;
|
||||
@ -590,6 +601,7 @@ int main(int argc, char *argv[])
|
||||
scalar sumSqrIntersect;
|
||||
getBand
|
||||
(
|
||||
doFrontWidth,
|
||||
mesh.nCells(),
|
||||
mesh.faceOwner(),
|
||||
mesh.faceNeighbour(),
|
||||
@ -1028,6 +1040,7 @@ int main(int argc, char *argv[])
|
||||
scalar sumSqrIntersect;
|
||||
getBand
|
||||
(
|
||||
doFrontWidth,
|
||||
mesh.nCells(),
|
||||
mesh.faceOwner(),
|
||||
mesh.faceNeighbour(),
|
||||
|
||||
@ -41,6 +41,7 @@ method CuthillMcKee;
|
||||
//method manual;
|
||||
//method random;
|
||||
//method spring;
|
||||
//method boundaryFirst;
|
||||
|
||||
//CuthillMcKeeCoeffs
|
||||
//{
|
||||
|
||||
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -221,10 +221,31 @@ void Foam::Time::setControls()
|
||||
timeIndex_ = startTimeIndex_;
|
||||
}
|
||||
|
||||
scalar timeValue;
|
||||
if (timeDict.readIfPresent("value", timeValue))
|
||||
|
||||
// Check if values stored in time dictionary are consistent
|
||||
|
||||
// 1. Based on time name
|
||||
bool checkValue = true;
|
||||
|
||||
string storedTimeName;
|
||||
if (timeDict.readIfPresent("name", storedTimeName))
|
||||
{
|
||||
word storedTimeName(timeName(timeValue));
|
||||
if (storedTimeName == timeName())
|
||||
{
|
||||
// Same time. No need to check stored value
|
||||
checkValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Based on time value
|
||||
// (consistent up to the current time writing precision so it won't
|
||||
// trigger if we just change the write precision)
|
||||
if (checkValue)
|
||||
{
|
||||
scalar storedTimeValue;
|
||||
if (timeDict.readIfPresent("value", storedTimeValue))
|
||||
{
|
||||
word storedTimeName(timeName(storedTimeValue));
|
||||
|
||||
if (storedTimeName != timeName())
|
||||
{
|
||||
@ -233,10 +254,12 @@ void Foam::Time::setControls()
|
||||
<< " differs from actual time " << timeName() << '.' << nl
|
||||
<< " This may cause unexpected database behaviour."
|
||||
<< " If you are not interested" << nl
|
||||
<< " in preserving time state delete the time dictionary."
|
||||
<< " in preserving time state delete"
|
||||
<< " the time dictionary."
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -293,12 +293,14 @@ bool Foam::Time::writeObject
|
||||
{
|
||||
if (outputTime())
|
||||
{
|
||||
const word tmName(timeName());
|
||||
|
||||
IOdictionary timeDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"time",
|
||||
timeName(),
|
||||
tmName,
|
||||
"uniform",
|
||||
*this,
|
||||
IOobject::NO_READ,
|
||||
@ -308,6 +310,7 @@ bool Foam::Time::writeObject
|
||||
);
|
||||
|
||||
timeDict.add("value", value());
|
||||
timeDict.add("name", string(tmName));
|
||||
timeDict.add("index", timeIndex_);
|
||||
timeDict.add("deltaT", deltaT_);
|
||||
timeDict.add("deltaT0", deltaT0_);
|
||||
@ -317,7 +320,7 @@ bool Foam::Time::writeObject
|
||||
|
||||
if (writeOK && purgeWrite_)
|
||||
{
|
||||
previousOutputTimes_.push(timeName());
|
||||
previousOutputTimes_.push(tmName);
|
||||
|
||||
while (previousOutputTimes_.size() > purgeWrite_)
|
||||
{
|
||||
|
||||
@ -46,6 +46,7 @@ SourceFiles
|
||||
#include "Random.H"
|
||||
#include "FixedList.H"
|
||||
#include "UList.H"
|
||||
#include "triPointRef.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -196,6 +197,8 @@ public:
|
||||
|
||||
inline const Point& d() const;
|
||||
|
||||
//- Return i-th face
|
||||
inline triPointRef tri(const label faceI) const;
|
||||
|
||||
// Properties
|
||||
|
||||
@ -242,7 +245,8 @@ public:
|
||||
List<scalar>& bary
|
||||
) const;
|
||||
|
||||
//- Return nearest point to p on tetrahedron
|
||||
//- Return nearest point to p on tetrahedron. Is p itself
|
||||
// if inside.
|
||||
inline pointHit nearestPoint(const point& p) const;
|
||||
|
||||
//- Return true if point is inside tetrahedron
|
||||
|
||||
@ -97,6 +97,41 @@ inline const Point& Foam::tetrahedron<Point, PointRef>::d() const
|
||||
}
|
||||
|
||||
|
||||
template<class Point, class PointRef>
|
||||
inline Foam::triPointRef Foam::tetrahedron<Point, PointRef>::tri
|
||||
(
|
||||
const label faceI
|
||||
) const
|
||||
{
|
||||
// Warning. Ordering of faces needs to be the same for a tetrahedron
|
||||
// class, a tetrahedron cell shape model and a tetCell
|
||||
|
||||
if (faceI == 0)
|
||||
{
|
||||
return triPointRef(b_, c_, d_);
|
||||
}
|
||||
else if (faceI == 1)
|
||||
{
|
||||
return triPointRef(a_, d_, c_);
|
||||
}
|
||||
else if (faceI == 2)
|
||||
{
|
||||
return triPointRef(a_, b_, d_);
|
||||
}
|
||||
else if (faceI == 3)
|
||||
{
|
||||
return triPointRef(a_, c_, b_);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("tetrahedron::tri(const label faceI) const")
|
||||
<< "index out of range 0 -> 3. faceI = " << faceI
|
||||
<< abort(FatalError);
|
||||
return triPointRef(b_, c_, d_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Point, class PointRef>
|
||||
inline Foam::vector Foam::tetrahedron<Point, PointRef>::Sa() const
|
||||
{
|
||||
|
||||
@ -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-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -93,6 +93,7 @@ Foam::engineTime::engineTime
|
||||
|
||||
startTime_ = degToTime(startTime_);
|
||||
value() = degToTime(value());
|
||||
deltaTSave_ = deltaT_;
|
||||
deltaT0_ = deltaT_;
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,7 @@ public:
|
||||
|
||||
//- Return the order in which cells need to be visited, i.e.
|
||||
// from ordered back to original cell label.
|
||||
// Use the mesh connectivity (if needed)
|
||||
// This is only defined for geometric renumberMethods.
|
||||
virtual labelList renumber(const pointField&) const;
|
||||
|
||||
//- Return the order in which cells need to be visited, i.e.
|
||||
|
||||
Reference in New Issue
Block a user