ENH: Removing IO from IOdictionaries.

This commit is contained in:
graham 2010-09-28 18:41:47 +01:00
parent e4e4d85286
commit d8d8ee60dc
6 changed files with 32 additions and 11 deletions

View File

@ -49,7 +49,7 @@ int main(int argc, char *argv[])
"cvMeshDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);

View File

@ -33,7 +33,7 @@ License
Foam::conformalVoronoiMesh::conformalVoronoiMesh
(
const Time& runTime,
const IOdictionary& cvMeshDict
const dictionary& cvMeshDict
)
:
HTriangulation(),
@ -519,7 +519,28 @@ void Foam::conformalVoronoiMesh::insertFlatEdgePointGroup
const pointIndexHit& edHit
)
{
Info<< "NOT INSERTING FLAT EDGE POINT GROUP, NOT IMPLEMENTED" << endl;
const point& edgePt = edHit.hitPoint();
scalar ppDist = pointPairDistance(edgePt);
const vectorField& feNormals = feMesh.normals();
const labelList& edNormalIs = feMesh.edgeNormals()[edHit.index()];
// As this is a flat edge, there are two normals by definition
const vector& nA = feNormals[edNormalIs[0]];
const vector& nB = feNormals[edNormalIs[1]];
// Average normal to remove any bias to one side, although as this
// is a flat edge, the normals should be essentially the same
vector n = 0.5*(nA + nB);
// Direction along the surface to the control point, sense of edge
// direction not important, as +s and -s can be used because this
// is a flat edge
vector s = 2.0*ppDist*(feMesh.edgeDirections()[edHit.index()] ^ n);
insertPointPair(ppDist, edgePt + s, n);
insertPointPair(ppDist, edgePt - s, n);
}

View File

@ -657,7 +657,7 @@ public:
conformalVoronoiMesh
(
const Time& runTime,
const IOdictionary& cvMeshDict
const dictionary& cvMeshDict
);

View File

@ -31,7 +31,7 @@ License
Foam::cvControls::cvControls
(
const conformalVoronoiMesh& cvMesh,
const IOdictionary& cvMeshDict
const dictionary& cvMeshDict
)
:
cvMesh_(cvMesh),

View File

@ -35,7 +35,7 @@ SourceFiles
#ifndef cvControls_H
#define cvControls_H
#include "IOdictionary.H"
#include "dictionary.H"
#include "Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -58,7 +58,7 @@ class cvControls
const conformalVoronoiMesh& cvMesh_;
//- Reference to the cvMeshDict
const IOdictionary& cvMeshDict_;
const dictionary& cvMeshDict_;
// General parameters
@ -282,11 +282,11 @@ public:
// Constructors
//- Construct from references to conformalVoronoiMesh and IOdictionary
//- Construct from references to conformalVoronoiMesh and dictionary
cvControls
(
const conformalVoronoiMesh& cvMesh,
const IOdictionary& cvMeshDict
const dictionary& cvMeshDict
);
@ -299,7 +299,7 @@ public:
// Access
//- Return the cvMeshDict
inline const IOdictionary& cvMeshDict() const;
inline const dictionary& cvMeshDict() const;
//- Return the span
inline scalar span() const;

View File

@ -25,7 +25,7 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::IOdictionary& Foam::cvControls::cvMeshDict() const
inline const Foam::dictionary& Foam::cvControls::cvMeshDict() const
{
return cvMeshDict_;
}