Merge remote branch 'OpenCFD/master' into olesenm

Conflicts:
	applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C
	applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/createShellMesh.C
	applications/utilities/surface/surfaceCheck/surfaceCheck.C
	src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C
	src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C
	src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C

NOTE: also needed to strip trailing space/lines in various files
This commit is contained in:
Mark Olesen
2010-12-21 10:19:53 +01:00
415 changed files with 11347 additions and 5745 deletions

View File

@ -159,11 +159,6 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
mesh.clearOut();
}
if (meshRefiner_.overwrite())
{
mesh.setInstance(meshRefiner_.oldInstance());
}
faceCombiner.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
@ -324,11 +319,6 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo
mesh.clearOut();
}
if (meshRefiner_.overwrite())
{
mesh.setInstance(meshRefiner_.oldInstance());
}
faceCombiner.updateMesh(map);
// Renumber restore maps
@ -396,11 +386,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRemovePoints
mesh.clearOut();
}
if (meshRefiner_.overwrite())
{
mesh.setInstance(meshRefiner_.oldInstance());
}
pointRemover.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
@ -454,11 +439,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::autoLayerDriver::doRestorePoints
mesh.clearOut();
}
if (meshRefiner_.overwrite())
{
mesh.setInstance(meshRefiner_.oldInstance());
}
pointRemover.updateMesh(map);
meshRefiner_.updateMesh(map, labelList(0));
@ -3100,10 +3080,7 @@ void Foam::autoLayerDriver::addLayers
//?neccesary? Update fields
newMesh.updateMesh(map);
if (meshRefiner_.overwrite())
{
newMesh.setInstance(meshRefiner_.oldInstance());
}
newMesh.setInstance(meshRefiner_.timeName());
// Update numbering on addLayer:
// - cell/point labels to be newMesh.
@ -3229,11 +3206,6 @@ void Foam::autoLayerDriver::addLayers
mesh.clearOut();
}
if (meshRefiner_.overwrite())
{
mesh.setInstance(meshRefiner_.oldInstance());
}
meshRefiner_.updateMesh(map, labelList(0));

View File

@ -756,6 +756,9 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
// Distance to wall
List<pointData> pointWallDist(mesh.nPoints());
// Dummy additional info for PointEdgeWave
int dummyTrackData = 0;
// 1. Calculate distance to points where displacement is specified.
{
@ -783,7 +786,8 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
wallInfo,
pointWallDist,
edgeWallDist,
mesh.globalData().nTotalPoints() // max iterations
mesh.globalData().nTotalPoints(), // max iterations
dummyTrackData
);
}
@ -813,7 +817,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
{
label pointI = e[ep];
if (!pointMedialDist[pointI].valid())
if (!pointMedialDist[pointI].valid(dummyTrackData))
{
maxPoints.append(pointI);
maxInfo.append
@ -857,7 +861,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
{
label pointI = meshPoints[i];
if (!pointMedialDist[pointI].valid())
if (!pointMedialDist[pointI].valid(dummyTrackData))
{
maxPoints.append(pointI);
maxInfo.append
@ -888,7 +892,8 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
pointMedialDist,
edgeMedialDist,
mesh.globalData().nTotalPoints() // max iterations
mesh.globalData().nTotalPoints(), // max iterations
dummyTrackData
);
// Extract medial axis distance as pointScalarField

View File

@ -32,19 +32,20 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const pointData& wDist)
if (os.format() == IOstream::ASCII)
{
return os
<< wDist.origin() << token::SPACE << wDist.distSqr()
<< static_cast<const pointEdgePoint&>(wDist)
<< token::SPACE << wDist.s() << token::SPACE << wDist.v();
}
else
{
return os
<< wDist.origin() << wDist.distSqr() << wDist.s() << wDist.v();
<< static_cast<const pointEdgePoint&>(wDist)
<< wDist.s() << wDist.v();
}
}
Foam::Istream& Foam::operator>>(Istream& is, pointData& wDist)
{
return is >> wDist.origin_ >> wDist.distSqr_ >> wDist.s_ >> wDist.v_;
return is >> static_cast<pointEdgePoint&>(wDist) >> wDist.s_ >> wDist.v_;
}
// ************************************************************************* //

View File

@ -25,10 +25,10 @@ Class
Foam::pointData
Description
Holds information regarding nearest wall point. Used in pointEdgeWave.
(so not standard meshWave)
To be used in wall distance calculation.
Variant of pointEdgePoint with some transported additional data.
WIP - should be templated on data like wallDistData.
Passive vector v_ is not a coordinate (so no enterDomain/leaveDomain
transformation needed)
SourceFiles
pointDataI.H
@ -39,9 +39,7 @@ SourceFiles
#ifndef pointData_H
#define pointData_H
#include "point.H"
#include "label.H"
#include "tensor.H"
#include "pointEdgePoint.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,51 +47,22 @@ SourceFiles
namespace Foam
{
// Class forward declarations
class polyPatch;
class polyMesh;
/*---------------------------------------------------------------------------*\
Class pointData Declaration
\*---------------------------------------------------------------------------*/
class pointData
:
public pointEdgePoint
{
// Private data
//- position of nearest wall center
point origin_;
//- normal distance (squared) from point to origin
scalar distSqr_;
//- additional information.
scalar s_;
//- additional information.
vector v_;
// Private Member Functions
//- Evaluate distance to point. Update distSqr, origin from whomever
// is nearer pt. Return true if w2 is closer to point,
// false otherwise.
inline bool update
(
const point&,
const pointData& w2,
const scalar tol
);
//- Combine current with w2. Update distSqr, origin if w2 has smaller
// quantities and returns true.
inline bool update
(
const pointData& w2,
const scalar tol
);
public:
// Constructors
@ -118,10 +87,6 @@ public:
// Access
inline const point& origin() const;
inline scalar distSqr() const;
inline scalar s() const;
inline const vector& v() const;
@ -129,81 +94,60 @@ public:
// Needed by meshWave
//- Check whether origin has been changed at all or
// still contains original (invalid) value.
inline bool valid() const;
//- Check for identical geometrical data. Used for cyclics checking.
inline bool sameGeometry(const pointData&, const scalar tol)
const;
//- Convert origin to relative vector to leaving point
// (= point coordinate)
inline void leaveDomain
(
const polyPatch& patch,
const label patchPointI,
const point& pos
);
//- Convert relative origin to absolute by adding entering point
inline void enterDomain
(
const polyPatch& patch,
const label patchPointI,
const point& pos
);
//- Apply rotation matrix to origin
inline void transform(const tensor& rotTensor);
template<class TrackingData>
inline void transform
(
const tensor& rotTensor,
TrackingData& td
);
//- Influence of edge on point
template<class TrackingData>
inline bool updatePoint
(
const polyMesh& mesh,
const label pointI,
const label edgeI,
const pointData& edgeInfo,
const scalar tol
const scalar tol,
TrackingData& td
);
//- Influence of different value on same point.
// Merge new and old info.
template<class TrackingData>
inline bool updatePoint
(
const polyMesh& mesh,
const label pointI,
const pointData& newPointInfo,
const scalar tol
const scalar tol,
TrackingData& td
);
//- Influence of different value on same point.
// No information about current position whatsoever.
template<class TrackingData>
inline bool updatePoint
(
const pointData& newPointInfo,
const scalar tol
const scalar tol,
TrackingData& td
);
//- Influence of point on edge.
template<class TrackingData>
inline bool updateEdge
(
const polyMesh& mesh,
const label edgeI,
const label pointI,
const pointData& pointInfo,
const scalar tol
const scalar tol,
TrackingData& td
);
// Member Operators
//Note: Used to determine whether to call update.
inline bool operator==(const pointData&) const;
inline bool operator!=(const pointData&) const;
// IOstream Operators
friend Ostream& operator<<(Ostream&, const pointData&);
@ -211,6 +155,14 @@ public:
};
//- Data associated with pointData as contiguous as pointEdgePoint
template<>
inline bool contiguous<pointData>()
{
return contiguous<pointEdgePoint>();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -26,118 +26,12 @@ License
#include "polyMesh.H"
#include "transform.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Update this with w2 if w2 nearer to pt.
inline bool Foam::pointData::update
(
const point& pt,
const pointData& w2,
const scalar tol
)
{
scalar dist2 = magSqr(pt - w2.origin());
if (!valid())
{
distSqr_ = dist2;
origin_ = w2.origin();
s_ = w2.s();
v_ = w2.v();
return true;
}
// if (v_ != w2.v())
// {
// return false;
// }
scalar diff = distSqr_ - dist2;
if (diff < 0)
{
// already nearer to pt
return false;
}
if ((diff < SMALL) || ((distSqr_ > SMALL) && (diff/distSqr_ < tol)))
{
// don't propagate small changes
return false;
}
else
{
// update with new values
distSqr_ = dist2;
origin_ = w2.origin();
s_ = w2.s();
v_ = w2.v();
return true;
}
}
// Update this with w2 (information on same point)
inline bool Foam::pointData::update
(
const pointData& w2,
const scalar tol
)
{
if (!valid())
{
// current not yet set so use any value
distSqr_ = w2.distSqr();
origin_ = w2.origin();
s_ = w2.s();
v_ = w2.v();
return true;
}
// if (v_ != w2.v())
// {
// return false;
// }
scalar diff = distSqr_ - w2.distSqr();
if (diff < 0)
{
// already nearer to pt
return false;
}
if ((diff < SMALL) || ((distSqr_ > SMALL) && (diff/distSqr_ < tol)))
{
// don't propagate small changes
return false;
}
else
{
// update with new values
distSqr_ = w2.distSqr();
origin_ = w2.origin();
s_ = w2.s();
v_ = w2.v();
return true;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Null constructor
inline Foam::pointData::pointData()
:
origin_(point::max),
distSqr_(GREAT),
pointEdgePoint(),
s_(GREAT),
v_(point::max)
{}
@ -152,8 +46,7 @@ inline Foam::pointData::pointData
const vector& v
)
:
origin_(origin),
distSqr_(distSqr),
pointEdgePoint(origin, distSqr),
s_(s),
v_(v)
{}
@ -162,8 +55,7 @@ inline Foam::pointData::pointData
// Construct as copy
inline Foam::pointData::pointData(const pointData& wpt)
:
origin_(wpt.origin()),
distSqr_(wpt.distSqr()),
pointEdgePoint(wpt),
s_(wpt.s()),
v_(wpt.v())
{}
@ -171,18 +63,6 @@ inline Foam::pointData::pointData(const pointData& wpt)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::point& Foam::pointData::origin() const
{
return origin_;
}
inline Foam::scalar Foam::pointData::distSqr() const
{
return distSqr_;
}
inline Foam::scalar Foam::pointData::s() const
{
return s_;
@ -195,157 +75,143 @@ inline const Foam::vector& Foam::pointData::v() const
}
inline bool Foam::pointData::valid() const
{
return origin_ != point::max;
}
// Checks for cyclic points
inline bool Foam::pointData::sameGeometry
template <class TrackingData>
inline void Foam::pointData::transform
(
const pointData& w2,
const scalar tol
) const
{
scalar diff = Foam::mag(distSqr() - w2.distSqr());
if (diff < SMALL)
{
return true;
}
else
{
if ((distSqr() > SMALL) && ((diff/distSqr()) < tol))
{
return true;
}
else
{
return false;
}
}
}
inline void Foam::pointData::leaveDomain
(
const polyPatch& patch,
const label patchPointI,
const point& coord
const tensor& rotTensor,
TrackingData& td
)
{
origin_ -= coord;
}
inline void Foam::pointData::transform(const tensor& rotTensor)
{
origin_ = Foam::transform(rotTensor, origin_);
}
// Update absolute geometric quantities. Note that distance (distSqr_)
// is not affected by leaving/entering domain.
inline void Foam::pointData::enterDomain
(
const polyPatch& patch,
const label patchPointI,
const point& coord
)
{
// back to absolute form
origin_ += coord;
pointEdgePoint::transform(rotTensor, td);
v_ = Foam::transform(rotTensor, v_);
}
// Update this with information from connected edge
template <class TrackingData>
inline bool Foam::pointData::updatePoint
(
const polyMesh& mesh,
const label pointI,
const label edgeI,
const pointData& edgeInfo,
const scalar tol
const scalar tol,
TrackingData& td
)
{
return
update
if
(
pointEdgePoint::updatePoint
(
mesh.points()[pointI],
mesh,
pointI,
edgeI,
edgeInfo,
tol
);
tol,
td
)
)
{
s_ = edgeInfo.s_;
v_ = edgeInfo.v_;
return true;
}
else
{
return false;
}
}
// Update this with new information on same point
template <class TrackingData>
inline bool Foam::pointData::updatePoint
(
const polyMesh& mesh,
const label pointI,
const pointData& newPointInfo,
const scalar tol
const scalar tol,
TrackingData& td
)
{
return
update
if
(
pointEdgePoint::updatePoint
(
mesh.points()[pointI],
mesh,
pointI,
newPointInfo,
tol
);
tol,
td
)
)
{
s_ = newPointInfo.s_;
v_ = newPointInfo.v_;
return true;
}
else
{
return false;
}
}
// Update this with new information on same point. No extra information.
template <class TrackingData>
inline bool Foam::pointData::updatePoint
(
const pointData& newPointInfo,
const scalar tol
const scalar tol,
TrackingData& td
)
{
return update(newPointInfo, tol);
if (pointEdgePoint::updatePoint(newPointInfo, tol, td))
{
s_ = newPointInfo.s_;
v_ = newPointInfo.v_;
return true;
}
else
{
return false;
}
}
// Update this with information from connected point
template <class TrackingData>
inline bool Foam::pointData::updateEdge
(
const polyMesh& mesh,
const label edgeI,
const label pointI,
const pointData& pointInfo,
const scalar tol
const scalar tol,
TrackingData& td
)
{
const pointField& points = mesh.points();
const edge& e = mesh.edges()[edgeI];
const point edgeMid(0.5*(points[e[0]] + points[e[1]]));
return
update
if
(
pointEdgePoint::updateEdge
(
edgeMid,
mesh,
edgeI,
pointI,
pointInfo,
tol
);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
inline bool Foam::pointData::operator==(const pointData& rhs) const
{
return origin() == rhs.origin();
}
inline bool Foam::pointData::operator!=(const pointData& rhs) const
{
return !(*this == rhs);
tol,
td
)
)
{
s_ = pointInfo.s_;
v_ = pointInfo.v_;
return true;
}
else
{
return false;
}
}

View File

@ -481,11 +481,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemoveCells
mesh_.clearOut();
}
if (overwrite_)
{
mesh_.setInstance(oldInstance_);
}
// Update local mesh data
cellRemover.updateMesh(map);
@ -1903,9 +1898,14 @@ void Foam::meshRefinement::distribute(const mapDistributePolyMesh& map)
pointMap.clear();
}
}
// If necessary reset the instance
mesh_.setInstance(timeName());
setInstance(mesh_.facesInstance());
}
// Update local data for a mesh change
void Foam::meshRefinement::updateMesh
(
const mapPolyMesh& map,
@ -2027,6 +2027,10 @@ void Foam::meshRefinement::updateMesh
data.transfer(newFaceData);
}
}
// If necessary reset the instance
mesh_.setInstance(timeName());
setInstance(mesh_.facesInstance());
}
@ -2137,7 +2141,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const
IOobject
(
"cellLevel",
timeName(),
mesh_.time().timeName(),// Dump to current time, not to mesh inst
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
@ -2165,7 +2169,7 @@ void Foam::meshRefinement::dumpRefinementLevel() const
IOobject
(
"pointLevel",
timeName(),
mesh_.time().timeName(),// Dump to current time, not to mesh inst
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,

View File

@ -517,11 +517,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::createBaffles
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
//- Redo the intersections on the newly create baffle faces. Note that
// this changes also the cell centre positions.
faceSet baffledFacesSet(mesh_, "baffledFacesSet", 2*nBaffles);
@ -965,11 +960,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeBaffles
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
// Update intersections. Recalculate intersections on merged faces since
// this seems to give problems? Note: should not be nessecary since
// baffles preserve intersections from when they were created.
@ -2249,11 +2239,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::dupNonManifoldPoints()
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
// Update intersections. Is mapping only (no faces created, positions stay
// same) so no need to recalculate intersections.
updateMesh(map, labelList(0));
@ -2783,11 +2768,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
// Print some stats (note: zones are synchronised)
if (mesh_.cellZones().size() > 0)
{

View File

@ -103,11 +103,6 @@ Foam::label Foam::meshRefinement::mergePatchFaces
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
faceCombiner.updateMesh(map);
// Get the kept faces that need to be recalculated.
@ -203,11 +198,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::mergeEdges
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
pointRemover.updateMesh(map);
// Get the kept faces that need to be recalculated.

View File

@ -1236,11 +1236,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::refine
mesh_.clearOut();
}
if (overwrite())
{
mesh_.setInstance(oldInstance());
}
// Update intersection info
updateMesh(map, getChangedFaces(map, cellsToRefine));