Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2012-02-24 10:12:47 +00:00
10 changed files with 117 additions and 37 deletions

View File

@ -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)];

View File

@ -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 \

View File

@ -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);
}
forAll(nIntersect, cellI)
{
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
{
nIntersect[colI]++;
}
}
bandwidth = max(cellBandwidth);
profile = sum(cellBandwidth);
sumSqrIntersect = sum(Foam::sqr(nIntersect));
profile = sum(1.0*cellBandwidth);
sumSqrIntersect = 0.0;
if (calculateIntersect)
{
forAll(nIntersect, cellI)
{
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
{
nIntersect[colI] += 1.0;
}
}
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(),

View File

@ -41,6 +41,7 @@ method CuthillMcKee;
//method manual;
//method random;
//method spring;
//method boundaryFirst;
//CuthillMcKeeCoeffs
//{

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-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -221,20 +221,43 @@ void Foam::Time::setControls()
timeIndex_ = startTimeIndex_;
}
scalar timeValue;
if (timeDict.readIfPresent("value", timeValue))
{
word storedTimeName(timeName(timeValue));
if (storedTimeName != timeName())
// Check if values stored in time dictionary are consistent
// 1. Based on time name
bool checkValue = true;
string storedTimeName;
if (timeDict.readIfPresent("name", storedTimeName))
{
if (storedTimeName == timeName())
{
IOWarningIn("Time::setControls()", timeDict)
<< "Time read from time dictionary " << storedTimeName
<< " 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."
<< endl;
// 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())
{
IOWarningIn("Time::setControls()", timeDict)
<< "Time read from time dictionary " << storedTimeName
<< " 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."
<< endl;
}
}
}
}

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-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_)
{

View File

@ -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

View File

@ -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
{

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-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,9 +91,10 @@ Foam::engineTime::engineTime
timeAdjustment();
startTime_ = degToTime(startTime_);
value() = degToTime(value());
deltaT0_ = deltaT_;
startTime_ = degToTime(startTime_);
value() = degToTime(value());
deltaTSave_ = deltaT_;
deltaT0_ = deltaT_;
}

View File

@ -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.