blockMesh: rationalizing class and member names

This commit is contained in:
Henry Weller
2016-10-08 19:48:39 +01:00
parent 5d93489fe7
commit 3542700432
40 changed files with 373 additions and 398 deletions

View File

@ -115,7 +115,7 @@ void Foam::vtkPV3blockMesh::updateInfoEdges
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
const blockMesh& blkMesh = *meshPtr_;
const curvedEdgeList& edges = blkMesh.edges();
const blockEdgeList& edges = blkMesh.edges();
const int nEdges = edges.size();
forAll(edges, edgeI)
@ -429,7 +429,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
if (show && meshPtr_)
{
const pointField& cornerPts = meshPtr_->blockPointField();
const pointField& cornerPts = meshPtr_->vertices();
const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size());

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ void Foam::vtkPV3blockMesh::convertMeshBlocks
label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_;
const Foam::pointField& blockPoints = blkMesh.blockPointField();
const Foam::pointField& blockPoints = blkMesh.vertices();
if (debug)
{
@ -148,7 +148,7 @@ void Foam::vtkPV3blockMesh::convertMeshEdges
label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_;
const curvedEdgeList& edges = blkMesh.edges();
const blockEdgeList& edges = blkMesh.edges();
int edgeI = 0;
const scalar scaleFactor = blkMesh.scaleFactor();
@ -256,7 +256,7 @@ void Foam::vtkPV3blockMesh::convertMeshCorners
range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0
const pointField& blockPoints = meshPtr_->blockPointField();
const pointField& blockPoints = meshPtr_->vertices();
const scalar& scaleFactor = meshPtr_->scaleFactor();
if (debug)

View File

@ -115,7 +115,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
arrayRangeEdges_.reset( arraySelection->GetNumberOfArrays() );
const blockMesh& blkMesh = *meshPtr_;
const curvedEdgeList& edges = blkMesh.edges();
const blockEdgeList& edges = blkMesh.edges();
const int nEdges = edges.size();
forAll(edges, edgeI)
@ -429,7 +429,7 @@ void Foam::vtkPVblockMesh::renderPointNumbers
if (show && meshPtr_)
{
const pointField& cornerPts = meshPtr_->blockPointField();
const pointField& cornerPts = meshPtr_->vertices();
const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size());

View File

@ -55,7 +55,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_;
const Foam::pointField& blockPoints = blkMesh.blockPointField();
const Foam::pointField& blockPoints = blkMesh.vertices();
if (debug)
{
@ -148,7 +148,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
label datasetNo = 0; // restart at dataset 0
const blockMesh& blkMesh = *meshPtr_;
const curvedEdgeList& edges = blkMesh.edges();
const blockEdgeList& edges = blkMesh.edges();
int edgeI = 0;
const scalar scaleFactor = blkMesh.scaleFactor();
@ -256,7 +256,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
range.block(blockNo); // set output block
label datasetNo = 0; // restart at dataset 0
const pointField& blockPoints = meshPtr_->blockPointField();
const pointField& blockPoints = meshPtr_->vertices();
const scalar& scaleFactor = meshPtr_->scaleFactor();
if (debug)

View File

@ -1,14 +1,14 @@
curvedEdges/BSpline.C
curvedEdges/CatmullRomSpline.C
curvedEdges/polyLine.C
blockEdges/BSpline.C
blockEdges/CatmullRomSpline.C
blockEdges/polyLine.C
curvedEdges/arcEdge.C
curvedEdges/curvedEdge.C
curvedEdges/lineEdge.C
curvedEdges/polyLineEdge.C
curvedEdges/lineDivide.C
curvedEdges/BSplineEdge.C
curvedEdges/splineEdge.C
blockEdges/arcEdge.C
blockEdges/blockEdge.C
blockEdges/lineEdge.C
blockEdges/polyLineEdge.C
blockEdges/lineDivide.C
blockEdges/BSplineEdge.C
blockEdges/splineEdge.C
gradingDescriptor/gradingDescriptor.C
gradingDescriptor/gradingDescriptors.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,20 +23,19 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "block.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::block::block
(
const pointField& blockPointField,
const curvedEdgeList& edges,
const pointField& vertices,
const blockEdgeList& edges,
Istream& is
)
:
blockDescriptor(blockPointField, edges, is),
vertices_(0),
blockDescriptor(vertices, edges, is),
points_(0),
cells_(0),
boundaryPatches_(0)
{}
@ -45,7 +44,7 @@ Foam::block::block
Foam::block::block(const blockDescriptor& blockDesc)
:
blockDescriptor(blockDesc),
vertices_(0),
points_(0),
cells_(0),
boundaryPatches_(0)
{}
@ -61,12 +60,12 @@ Foam::block::~block()
const Foam::pointField& Foam::block::points() const
{
if (vertices_.empty())
if (points_.empty())
{
createPoints();
}
return vertices_;
return points_;
}

View File

@ -67,8 +67,8 @@ class block
{
// Private data
//- List of vertices
mutable pointField vertices_;
//- List of points
mutable pointField points_;
//- List of cells
mutable labelListList cells_;
@ -101,9 +101,9 @@ public:
//- Construct from components with Istream
block
(
const pointField& blockPointField,
const curvedEdgeList&,
Istream&
const pointField& vertices,
const blockEdgeList& edges,
Istream& is
);
//- Construct from a block definition
@ -116,6 +116,27 @@ public:
return autoPtr<block>(nullptr);
}
//- Class used for the read-construction of
// PtrLists of blocks
class iNew
{
const pointField& points_;
const blockEdgeList& edges_;
public:
iNew(const pointField& points, const blockEdgeList& edges)
:
points_(points),
edges_(edges)
{}
autoPtr<block> operator()(Istream& is) const
{
return autoPtr<block>(new block(points_, edges_, is));
}
};
//- Destructor
~block();

View File

@ -23,7 +23,6 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "block.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -31,9 +30,9 @@ License
void Foam::block::createPoints() const
{
// Set local variables for mesh specification
const label ni = meshDensity().x();
const label nj = meshDensity().y();
const label nk = meshDensity().z();
const label ni = density().x();
const label nj = density().y();
const label nk = density().z();
const point& p000 = blockPoint(0);
const point& p100 = blockPoint(1);
@ -53,8 +52,8 @@ void Foam::block::createPoints() const
//
// Generate vertices
//
vertices_.clear();
vertices_.setSize(nPoints());
points_.clear();
points_.setSize(nPoints());
for (label k = 0; k <= nk; k++)
{
@ -218,14 +217,14 @@ void Foam::block::createPoints() const
// Add the contributions
vertices_[vertexNo] =
points_[vertexNo] =
(
edgex1 + edgex2 + edgex3 + edgex4
+ edgey1 + edgey2 + edgey3 + edgey4
+ edgez1 + edgez2 + edgez3 + edgez4
) / 3.0;
vertices_[vertexNo] +=
points_[vertexNo] +=
(
corx1 + corx2 + corx3 + corx4
+ cory1 + cory2 + cory3 + cory4
@ -239,9 +238,9 @@ void Foam::block::createPoints() const
void Foam::block::createCells() const
{
const label ni = meshDensity().x();
const label nj = meshDensity().y();
const label nk = meshDensity().z();
const label ni = density().x();
const label nj = density().y();
const label nk = density().z();
//
// Generate cells
@ -276,9 +275,9 @@ void Foam::block::createCells() const
void Foam::block::createBoundary() const
{
const label ni = meshDensity().x();
const label nj = meshDensity().y();
const label nk = meshDensity().z();
const label ni = density().x();
const label nj = density().y();
const label nk = density().z();
//
// Generate boundaries on each side of the hex
@ -457,7 +456,7 @@ void Foam::block::createBoundary() const
void Foam::block::clearGeom()
{
vertices_.clear();
points_.clear();
cells_.clear();
boundaryPatches_.clear();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,8 +30,8 @@ inline Foam::label Foam::block::vtxLabel(label i, label j, label k) const
return
(
i
+ j * (meshDensity().x() + 1)
+ k * (meshDensity().x() + 1) * (meshDensity().y() + 1)
+ j * (density().x() + 1)
+ k * (density().x() + 1) * (density().y() + 1)
);
}

View File

@ -38,17 +38,17 @@ void Foam::blockDescriptor::check(const Istream& is)
<< " in block " << *this
<< exit(FatalIOError);
}
else if (blockShape_[pi] >= blockPointField_.size())
else if (blockShape_[pi] >= vertices_.size())
{
FatalIOErrorInFunction(is)
<< "Point label " << blockShape_[pi]
<< " out of range 0.." << blockPointField_.size() - 1
<< " out of range 0.." << vertices_.size() - 1
<< " in block " << *this
<< exit(FatalIOError);
}
}
const point blockCentre(blockShape_.centre(blockPointField_));
const point blockCentre(blockShape_.centre(vertices_));
const faceList faces(blockShape_.faces());
// Check each face is outward-pointing with respect to the block centre
@ -57,8 +57,8 @@ void Foam::blockDescriptor::check(const Istream& is)
forAll(faces, i)
{
point faceCentre(faces[i].centre(blockPointField_));
vector faceNormal(faces[i].normal(blockPointField_));
point faceCentre(faces[i].centre(vertices_));
vector faceNormal(faces[i].normal(vertices_));
if (mag(faceNormal) > SMALL)
{
if (((faceCentre - blockCentre) & faceNormal) > 0)
@ -107,17 +107,17 @@ void Foam::blockDescriptor::check(const Istream& is)
Foam::blockDescriptor::blockDescriptor
(
const cellShape& bshape,
const pointField& blockPointField,
const curvedEdgeList& edges,
const Vector<label>& meshDensity,
const pointField& vertices,
const blockEdgeList& edges,
const Vector<label>& density,
const UList<gradingDescriptors>& expand,
const word& zoneName
)
:
blockPointField_(blockPointField),
curvedEdges_(edges),
vertices_(vertices),
edges_(edges),
blockShape_(bshape),
meshDensity_(meshDensity),
density_(density),
edgePoints_(12),
edgeWeights_(12),
expand_(expand),
@ -137,15 +137,15 @@ Foam::blockDescriptor::blockDescriptor
Foam::blockDescriptor::blockDescriptor
(
const pointField& blockPointField,
const curvedEdgeList& edges,
const pointField& vertices,
const blockEdgeList& edges,
Istream& is
)
:
blockPointField_(blockPointField),
curvedEdges_(edges),
vertices_(vertices),
edges_(edges),
blockShape_(is),
meshDensity_(),
density_(),
edgePoints_(12),
edgeWeights_(12),
expand_
@ -173,7 +173,7 @@ Foam::blockDescriptor::blockDescriptor
// New-style: read a list of 3 values
if (t.pToken() == token::BEGIN_LIST)
{
is >> meshDensity_;
is >> density_;
}
else
{
@ -188,9 +188,9 @@ Foam::blockDescriptor::blockDescriptor
else
{
// Old-style: read three labels
is >> meshDensity_.x()
>> meshDensity_.y()
>> meshDensity_.z();
is >> density_.x()
>> density_.y()
>> density_.z();
}
is >> t;
@ -250,73 +250,6 @@ Foam::blockDescriptor::~blockDescriptor()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::pointField& Foam::blockDescriptor::blockPointField() const
{
return blockPointField_;
}
const Foam::cellShape& Foam::blockDescriptor::blockShape() const
{
return blockShape_;
}
const Foam::List<Foam::List<Foam::point>>&
Foam::blockDescriptor::blockEdgePoints() const
{
return edgePoints_;
}
const Foam::scalarListList& Foam::blockDescriptor::blockEdgeWeights() const
{
return edgeWeights_;
}
const Foam::Vector<Foam::label>& Foam::blockDescriptor::meshDensity() const
{
return meshDensity_;
}
const Foam::word& Foam::blockDescriptor::zoneName() const
{
return zoneName_;
}
Foam::label Foam::blockDescriptor::nPoints() const
{
return
(
(meshDensity_.x() + 1)
* (meshDensity_.y() + 1)
* (meshDensity_.z() + 1)
);
}
Foam::label Foam::blockDescriptor::nCells() const
{
return
(
meshDensity_.x()
* meshDensity_.y()
* meshDensity_.z()
);
}
const Foam::point& Foam::blockDescriptor::blockPoint(const label i) const
{
return blockPointField_[blockShape_[i]];
}
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
@ -341,7 +274,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
os << ' ' << bd.zoneName();
}
os << ' ' << bd.meshDensity()
os << ' ' << bd.density()
<< " simpleGrading (";
@ -374,13 +307,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
}
else
{
forAll(expand, edgeI)
forAll(expand, edgei)
{
if (edgeI)
if (edgei)
{
os << ' ';
}
os << expand[edgeI];
os << expand[edgei];
}
}

View File

@ -55,7 +55,7 @@ SourceFiles
#include "cellShape.H"
#include "pointField.H"
#include "scalarList.H"
#include "curvedEdgeList.H"
#include "blockEdgeList.H"
#include "gradingDescriptors.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -79,16 +79,16 @@ class blockDescriptor
// Private data
//- Reference to point field defining the block mesh
const pointField& blockPointField_;
const pointField& vertices_;
//- Reference to a list of curved edges
const curvedEdgeList& curvedEdges_;
//- Reference to a list of block edges
const blockEdgeList& edges_;
//- Block shape
cellShape blockShape_;
//- The number of cells in the i,j,k directions
Vector<label> meshDensity_;
Vector<label> density_;
//- Block edge points
List<List<point>> edgePoints_;
@ -99,7 +99,7 @@ class blockDescriptor
//- Expansion ratios in all directions
List<gradingDescriptors> expand_;
//- Name of the zone (empty string if none)
//- Name of the zone (empty word if none)
word zoneName_;
@ -112,7 +112,7 @@ class blockDescriptor
void makeBlockEdges();
//- Set the edge points/weights
void setEdge(label edgeI, label start, label end, label dim);
void setEdge(label edgei, label start, label end, label dim);
// Private Member Functions
@ -129,9 +129,9 @@ public:
blockDescriptor
(
const cellShape&,
const pointField& blockPointField,
const curvedEdgeList&,
const Vector<label>& meshDensity,
const pointField& vertices,
const blockEdgeList&,
const Vector<label>& density,
const UList<gradingDescriptors>& expand,
const word& zoneName = ""
);
@ -139,18 +139,11 @@ public:
//- Construct from Istream
blockDescriptor
(
const pointField& blockPointField,
const curvedEdgeList&,
const pointField& vertices,
const blockEdgeList&,
Istream&
);
//- Clone
autoPtr<blockDescriptor> clone() const
{
NotImplemented;
return autoPtr<blockDescriptor>(nullptr);
}
//- Destructor
~blockDescriptor();
@ -160,38 +153,29 @@ public:
// Access
//- Return the number of cells in the i,j,k directions
const Vector<label>& density() const
{
return meshDensity_;
}
//- Reference to point field defining the block mesh
const pointField& blockPointField() const;
//- Return the block shape
const cellShape& blockShape() const;
inline const cellShape& blockShape() const;
//- Return the block points along each edge
const List<List<point>>& blockEdgePoints() const;
inline const List<List<point>>& blockEdgePoints() const;
//- Return the weightings along each edge
const scalarListList& blockEdgeWeights() const;
inline const scalarListList& blockEdgeWeights() const;
//- Return the mesh density (number of cells) in the i,j,k directions
const Vector<label>& meshDensity() const;
inline const Vector<label>& density() const;
//- Return the (optional) zone name
const word& zoneName() const;
inline const word& zoneName() const;
//- Return the number of points
label nPoints() const;
inline label nPoints() const;
//- Return the number of cells
label nCells() const;
inline label nCells() const;
//- Return block point at local label i
const point& blockPoint(const label i) const;
//- Return block point for local label i
inline const point& blockPoint(const label i) const;
// IOstream Operators
@ -206,6 +190,10 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "blockDescriptorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,9 +31,9 @@ License
void Foam::blockDescriptor::makeBlockEdges()
{
const label ni = meshDensity_.x();
const label nj = meshDensity_.y();
const label nk = meshDensity_.z();
const label ni = density_.x();
const label nj = density_.y();
const label nk = density_.z();
// These edges correspond to the "hex" cellModel
@ -59,7 +59,7 @@ void Foam::blockDescriptor::makeBlockEdges()
void Foam::blockDescriptor::setEdge
(
label edgeI,
label edgei,
label start,
label end,
label nDiv
@ -69,14 +69,14 @@ void Foam::blockDescriptor::setEdge
const labelList& blockLabels = blockShape_;
// Get list of points for this block
const pointField blockPoints = blockShape_.points(blockPointField_);
const pointField blockPoints = blockShape_.points(vertices_);
// Set the edge points/weights
// The edge is a straight-line if it is not in the list of curvedEdges
// The edge is a straight-line if it is not in the list of blockEdges
forAll(curvedEdges_, cedgeI)
forAll(edges_, cedgei)
{
const curvedEdge& cedge = curvedEdges_[cedgeI];
const blockEdge& cedge = edges_[cedgei];
int cmp = cedge.compare(blockLabels[start], blockLabels[end]);
@ -87,29 +87,29 @@ void Foam::blockDescriptor::setEdge
// Curve has the same orientation
// Divide the line
lineDivide divEdge(cedge, nDiv, expand_[edgeI]);
lineDivide divEdge(cedge, nDiv, expand_[edgei]);
edgePoints_[edgeI] = divEdge.points();
edgeWeights_[edgeI] = divEdge.lambdaDivisions();
edgePoints_[edgei] = divEdge.points();
edgeWeights_[edgei] = divEdge.lambdaDivisions();
}
else
{
// Curve has the opposite orientation
// Divide the line
lineDivide divEdge(cedge, nDiv, expand_[edgeI].inv());
lineDivide divEdge(cedge, nDiv, expand_[edgei].inv());
const pointField& p = divEdge.points();
const scalarList& d = divEdge.lambdaDivisions();
edgePoints_[edgeI].setSize(p.size());
edgeWeights_[edgeI].setSize(d.size());
edgePoints_[edgei].setSize(p.size());
edgeWeights_[edgei].setSize(d.size());
label pMax = p.size() - 1;
forAll(p, pI)
{
edgePoints_[edgeI][pI] = p[pMax - pI];
edgeWeights_[edgeI][pI] = 1.0 - d[pMax - pI];
edgePoints_[edgei][pI] = p[pMax - pI];
edgeWeights_[edgei][pI] = 1.0 - d[pMax - pI];
}
}
@ -124,11 +124,11 @@ void Foam::blockDescriptor::setEdge
(
lineEdge(blockPoints, start, end),
nDiv,
expand_[edgeI]
expand_[edgei]
);
edgePoints_[edgeI] = divEdge.points();
edgeWeights_[edgeI] = divEdge.lambdaDivisions();
edgePoints_[edgei] = divEdge.points();
edgeWeights_[edgei] = divEdge.lambdaDivisions();
}

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::cellShape& Foam::blockDescriptor::blockShape() const
{
return blockShape_;
}
inline const Foam::List<Foam::List<Foam::point>>&
Foam::blockDescriptor::blockEdgePoints() const
{
return edgePoints_;
}
inline const Foam::scalarListList&
Foam::blockDescriptor::blockEdgeWeights() const
{
return edgeWeights_;
}
inline const Foam::Vector<Foam::label>& Foam::blockDescriptor::density() const
{
return density_;
}
inline const Foam::word& Foam::blockDescriptor::zoneName() const
{
return zoneName_;
}
inline Foam::label Foam::blockDescriptor::nPoints() const
{
return
(
(density_.x() + 1)
* (density_.y() + 1)
* (density_.z() + 1)
);
}
inline Foam::label Foam::blockDescriptor::nCells() const
{
return
(
density_.x()
* density_.y()
* density_.z()
);
}
inline const Foam::point& Foam::blockDescriptor::blockPoint(const label i) const
{
return vertices_[blockShape_[i]];
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ namespace Foam
addToRunTimeSelectionTable
(
curvedEdge,
blockEdge,
BSplineEdge,
Istream
);
@ -52,14 +52,14 @@ Foam::BSplineEdge::BSplineEdge
const pointField& internalPoints
)
:
curvedEdge(points, start, end),
blockEdge(points, start, end),
BSpline(appendEndPoints(points, start, end, internalPoints))
{}
Foam::BSplineEdge::BSplineEdge(const pointField& points, Istream& is)
:
curvedEdge(points, is),
blockEdge(points, is),
BSpline(appendEndPoints(points, start_, end_, pointField(is)))
{
token t(is);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::BSplineEdge
Description
A curvedEdge interface for B-splines.
A blockEdge interface for B-splines.
SourceFiles
BSplineEdge.C
@ -35,7 +35,7 @@ SourceFiles
#ifndef BSplineEdge_H
#define BSplineEdge_H
#include "curvedEdge.H"
#include "blockEdge.H"
#include "BSpline.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
class BSplineEdge
:
public curvedEdge,
public blockEdge,
public BSpline
{
// Private Member Functions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(arcEdge, 0);
addToRunTimeSelectionTable(curvedEdge, arcEdge, Istream);
addToRunTimeSelectionTable(blockEdge, arcEdge, Istream);
}
@ -110,7 +110,7 @@ Foam::arcEdge::arcEdge
const point& pMid
)
:
curvedEdge(points, start, end),
blockEdge(points, start, end),
p1_(points_[start_]),
p2_(pMid),
p3_(points_[end_]),
@ -120,7 +120,7 @@ Foam::arcEdge::arcEdge
Foam::arcEdge::arcEdge(const pointField& points, Istream& is)
:
curvedEdge(points, is),
blockEdge(points, is),
p1_(points_[start_]),
p2_(is),
p3_(points_[end_]),

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ SourceFiles
#ifndef arcEdge_H
#define arcEdge_H
#include "curvedEdge.H"
#include "blockEdge.H"
#include "cylindricalCS.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
class arcEdge
:
public curvedEdge
public blockEdge
{
// Private data

View File

@ -24,20 +24,20 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "curvedEdge.H"
#include "blockEdge.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(curvedEdge, 0);
defineRunTimeSelectionTable(curvedEdge, Istream);
defineTypeNameAndDebug(blockEdge, 0);
defineRunTimeSelectionTable(blockEdge, Istream);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::curvedEdge::curvedEdge
Foam::blockEdge::blockEdge
(
const pointField& points,
const label start,
@ -50,7 +50,7 @@ Foam::curvedEdge::curvedEdge
{}
Foam::curvedEdge::curvedEdge(const pointField& points, Istream& is)
Foam::blockEdge::blockEdge(const pointField& points, Istream& is)
:
points_(points),
start_(readLabel(is)),
@ -58,7 +58,7 @@ Foam::curvedEdge::curvedEdge(const pointField& points, Istream& is)
{}
Foam::curvedEdge::curvedEdge(const curvedEdge& c)
Foam::blockEdge::blockEdge(const blockEdge& c)
:
points_(c.points_),
start_(c.start_),
@ -66,14 +66,14 @@ Foam::curvedEdge::curvedEdge(const curvedEdge& c)
{}
Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::clone() const
Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::clone() const
{
NotImplemented;
return autoPtr<curvedEdge>(nullptr);
return autoPtr<blockEdge>(nullptr);
}
Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::New
Foam::autoPtr<Foam::blockEdge> Foam::blockEdge::New
(
const pointField& points,
Istream& is
@ -81,7 +81,7 @@ Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::New
{
if (debug)
{
InfoInFunction << "Constructing curvedEdge" << endl;
InfoInFunction << "Constructing blockEdge" << endl;
}
const word edgeType(is);
@ -92,20 +92,20 @@ Foam::autoPtr<Foam::curvedEdge> Foam::curvedEdge::New
if (cstrIter == IstreamConstructorTablePtr_->end())
{
FatalErrorInFunction
<< "Unknown curvedEdge type "
<< "Unknown blockEdge type "
<< edgeType << nl << nl
<< "Valid curvedEdge types are" << endl
<< "Valid blockEdge types are" << endl
<< IstreamConstructorTablePtr_->sortedToc()
<< abort(FatalError);
}
return autoPtr<curvedEdge>(cstrIter()(points, is));
return autoPtr<blockEdge>(cstrIter()(points, is));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::pointField Foam::curvedEdge::appendEndPoints
Foam::pointField Foam::blockEdge::appendEndPoints
(
const pointField& points,
const label start,
@ -131,13 +131,13 @@ Foam::pointField Foam::curvedEdge::appendEndPoints
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::curvedEdge::operator=(const curvedEdge&)
void Foam::blockEdge::operator=(const blockEdge&)
{
NotImplemented;
}
Foam::Ostream& Foam::operator<<(Ostream& os, const curvedEdge& p)
Foam::Ostream& Foam::operator<<(Ostream& os, const blockEdge& p)
{
os << p.start_ << tab << p.end_ << endl;

View File

@ -22,19 +22,19 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::curvedEdge
Foam::blockEdge
Description
Define a curved edge that is parameterized for 0<lambda<1
between the start and end point.
SourceFiles
curvedEdge.C
blockEdge.C
\*---------------------------------------------------------------------------*/
#ifndef curvedEdges_H
#define curvedEdges_H
#ifndef blockEdges_H
#define blockEdges_H
#include "edge.H"
#include "pointField.H"
@ -49,16 +49,16 @@ namespace Foam
// Forward declaration of friend functions and operators
class curvedEdge;
class blockEdge;
Ostream& operator<<(Ostream&, const curvedEdge&);
Ostream& operator<<(Ostream&, const blockEdge&);
/*---------------------------------------------------------------------------*\
Class curvedEdge Declaration
Class blockEdge Declaration
\*---------------------------------------------------------------------------*/
class curvedEdge
class blockEdge
{
protected:
@ -84,14 +84,14 @@ protected:
public:
//- Runtime type information
TypeName("curvedEdge");
TypeName("blockEdge");
// Declare run-time constructor selection tables
declareRunTimeSelectionTable
(
autoPtr,
curvedEdge,
blockEdge,
Istream,
(
const pointField& points,
@ -104,7 +104,7 @@ public:
// Constructors
//- Construct from components
curvedEdge
blockEdge
(
const pointField& points,
const label start,
@ -112,19 +112,19 @@ public:
);
//- Construct from Istream setting pointsList
curvedEdge(const pointField&, Istream&);
blockEdge(const pointField&, Istream&);
//- Copy construct
curvedEdge(const curvedEdge&);
blockEdge(const blockEdge&);
//- Clone function
virtual autoPtr<curvedEdge> clone() const;
virtual autoPtr<blockEdge> clone() const;
//- New function which constructs and returns pointer to a curvedEdge
static autoPtr<curvedEdge> New(const pointField&, Istream&);
//- New function which constructs and returns pointer to a blockEdge
static autoPtr<blockEdge> New(const pointField&, Istream&);
//- Class used for the read-construction of
// PtrLists of curvedEdge
// PtrLists of blockEdge
class iNew
{
const pointField& points_;
@ -136,15 +136,15 @@ public:
points_(points)
{}
autoPtr<curvedEdge> operator()(Istream& is) const
autoPtr<blockEdge> operator()(Istream& is) const
{
return curvedEdge::New(points_, is);
return blockEdge::New(points_, is);
}
};
//- Destructor
virtual ~curvedEdge(){}
virtual ~blockEdge(){}
// Member Functions
@ -160,7 +160,7 @@ public:
// - 0: different
// - +1: identical
// - -1: same edge, but different orientation
inline int compare(const curvedEdge&) const;
inline int compare(const blockEdge&) const;
//- Compare the given start and end points with this curve
// Return:
@ -186,12 +186,12 @@ public:
// Member operators
void operator=(const curvedEdge&);
void operator=(const blockEdge&);
// Ostream operator
friend Ostream& operator<<(Ostream&, const curvedEdge&);
friend Ostream& operator<<(Ostream&, const blockEdge&);
};
@ -201,7 +201,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "curvedEdgeI.H"
#include "blockEdgeI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,19 +25,19 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::curvedEdge::start() const
inline Foam::label Foam::blockEdge::start() const
{
return start_;
}
inline Foam::label Foam::curvedEdge::end() const
inline Foam::label Foam::blockEdge::end() const
{
return end_;
}
inline int Foam::curvedEdge::compare(const label start, const label end) const
inline int Foam::blockEdge::compare(const label start, const label end) const
{
if (start_ == start && end_ == end)
{
@ -54,15 +54,15 @@ inline int Foam::curvedEdge::compare(const label start, const label end) const
}
inline int Foam::curvedEdge::compare(const curvedEdge& e) const
inline int Foam::blockEdge::compare(const blockEdge& e) const
{
return Foam::curvedEdge::compare(e.start(), e.end());
return Foam::blockEdge::compare(e.start(), e.end());
}
inline int Foam::curvedEdge::compare(const edge& e) const
inline int Foam::blockEdge::compare(const edge& e) const
{
return Foam::curvedEdge::compare(e.start(), e.end());
return Foam::blockEdge::compare(e.start(), e.end());
}

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,17 +22,17 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::curvedEdgeList
Foam::blockEdgeList
Description
A PtrList of curvedEdges
A PtrList of blockEdges
\*---------------------------------------------------------------------------*/
#ifndef curvedEdgeList_H
#define curvedEdgeList_H
#ifndef blockEdgeList_H
#define blockEdgeList_H
#include "curvedEdge.H"
#include "blockEdge.H"
#include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef PtrList<curvedEdge> curvedEdgeList;
typedef PtrList<blockEdge> blockEdgeList;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,7 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "lineDivide.H"
#include "curvedEdge.H"
#include "blockEdge.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -42,7 +42,7 @@ namespace Foam
Foam::lineDivide::lineDivide
(
const curvedEdge& cedge,
const blockEdge& cedge,
const label nDiv,
const gradingDescriptors& gd
)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ SourceFiles
namespace Foam
{
class curvedEdge;
class blockEdge;
/*---------------------------------------------------------------------------*\
Class lineDivide Declaration
@ -65,7 +65,7 @@ public:
//- Construct from components
lineDivide
(
const curvedEdge&,
const blockEdge&,
const label ndiv,
const gradingDescriptors& gd = gradingDescriptors()
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(lineEdge, 0);
addToRunTimeSelectionTable(curvedEdge, lineEdge, Istream);
addToRunTimeSelectionTable(blockEdge, lineEdge, Istream);
}
@ -45,13 +45,13 @@ Foam::lineEdge::lineEdge
const label end
)
:
curvedEdge(points, start, end)
blockEdge(points, start, end)
{}
Foam::lineEdge::lineEdge(const pointField& points, Istream& is)
:
curvedEdge(points, is)
blockEdge(points, is)
{}

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ SourceFiles
#ifndef lineEdge_H
#define lineEdge_H
#include "curvedEdge.H"
#include "blockEdge.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
class lineEdge
:
public curvedEdge
public blockEdge
{
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,7 +32,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(polyLineEdge, 0);
addToRunTimeSelectionTable(curvedEdge, polyLineEdge, Istream);
addToRunTimeSelectionTable(blockEdge, polyLineEdge, Istream);
}
@ -46,14 +46,14 @@ Foam::polyLineEdge::polyLineEdge
const pointField& otherPoints
)
:
curvedEdge(ps, start, end),
blockEdge(ps, start, end),
polyLine(appendEndPoints(ps, start_, end_, otherPoints))
{}
Foam::polyLineEdge::polyLineEdge(const pointField& ps, Istream& is)
:
curvedEdge(ps, is),
blockEdge(ps, is),
polyLine(appendEndPoints(ps, start_, end_, pointField(is)))
{}

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::polyLineEdge
Description
A curvedEdge defined in terms of a series of straight line segments.
A blockEdge defined in terms of a series of straight line segments.
SourceFiles
polyLineEdge.C
@ -35,7 +35,7 @@ SourceFiles
#ifndef polyLineEdge_H
#define polyLineEdge_H
#include "curvedEdge.H"
#include "blockEdge.H"
#include "polyLine.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
class polyLineEdge
:
public curvedEdge,
public blockEdge,
public polyLine
{
// Private Member Functions

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -35,7 +35,7 @@ namespace Foam
addToRunTimeSelectionTable
(
curvedEdge,
blockEdge,
splineEdge,
Istream
);
@ -52,14 +52,14 @@ Foam::splineEdge::splineEdge
const pointField& internalPoints
)
:
curvedEdge(points, start, end),
blockEdge(points, start, end),
CatmullRomSpline(appendEndPoints(points, start, end, internalPoints))
{}
Foam::splineEdge::splineEdge(const pointField& points, Istream& is)
:
curvedEdge(points, is),
blockEdge(points, is),
CatmullRomSpline(appendEndPoints(points, start_, end_, pointField(is)))
{
token t(is);

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-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,7 +25,7 @@ Class
Foam::splineEdge
Description
A curvedEdge interface for Catmull-Rom splines.
A blockEdge interface for Catmull-Rom splines.
SourceFiles
splineEdge.C
@ -35,7 +35,7 @@ SourceFiles
#ifndef splineEdge_H
#define splineEdge_H
#include "curvedEdge.H"
#include "blockEdge.H"
#include "CatmullRomSpline.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -49,7 +49,7 @@ namespace Foam
class splineEdge
:
public curvedEdge,
public blockEdge,
public CatmullRomSpline
{
// Private Member Functions

View File

@ -40,8 +40,8 @@ namespace Foam
Foam::blockMesh::blockMesh(const IOdictionary& dict, const word& regionName)
:
blockPointField_(dict.lookup("vertices")),
scaleFactor_(1.0),
vertices_(dict.lookup("vertices")),
topologyPtr_(createTopology(dict, regionName))
{
Switch fastMerge(dict.lookupOrDefault<Switch>("fastMerge", false));
@ -73,9 +73,9 @@ void Foam::blockMesh::verbose(const bool on)
}
const Foam::pointField& Foam::blockMesh::blockPointField() const
const Foam::pointField& Foam::blockMesh::vertices() const
{
return blockPointField_;
return vertices_;
}

View File

@ -45,7 +45,7 @@ SourceFiles
#include "blockList.H"
#include "polyMesh.H"
#include "IOdictionary.H"
#include "curvedEdgeList.H"
#include "blockEdgeList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -65,15 +65,15 @@ class blockMesh
//- Switch for verbose output
static bool verboseOutput;
//- Point field defining the block mesh (corners)
pointField blockPointField_;
//- The list of curved edges
curvedEdgeList edges_;
//- The scaling factor to convert to metres
scalar scaleFactor_;
//- Vertices defining the block mesh (corners)
pointField vertices_;
//- The list of curved edges
blockEdgeList edges_;
//- The blocks themselves (the topology) as a polyMesh
polyMesh* topologyPtr_;
@ -166,15 +166,15 @@ public:
// Access
//- Reference to point field defining the block mesh
//- Reference to point field defining the blockMesh
// these points have not been scaled by scaleFactor
const pointField& blockPointField() const;
const pointField& vertices() const;
//- Return the blockMesh topology as a polyMesh
const polyMesh& topology() const;
//- Return the curved edges
const curvedEdgeList& edges() const
const blockEdgeList& edges() const
{
return edges_;
}

View File

@ -23,7 +23,6 @@ License
\*---------------------------------------------------------------------------*/
#include "error.H"
#include "blockMesh.H"
#include "cellModeller.H"
@ -50,7 +49,7 @@ void Foam::blockMesh::createPoints() const
if (verboseOutput)
{
const Vector<label>& density = blocks[blockI].meshDensity();
const Vector<label>& density = blocks[blockI].density();
label v0 = blocks[blockI].vtxLabel(0, 0, 0);
label vi1 = blocks[blockI].vtxLabel(1, 0, 0);

View File

@ -162,18 +162,18 @@ Pair<label> faceNij(const label facei, const block& block)
if (i == 0)
{
fnij.first() = block.meshDensity().y() + 1;
fnij.second() = block.meshDensity().z() + 1;
fnij.first() = block.density().y() + 1;
fnij.second() = block.density().z() + 1;
}
else if (i == 1)
{
fnij.first() = block.meshDensity().x() + 1;
fnij.second() = block.meshDensity().z() + 1;
fnij.first() = block.density().x() + 1;
fnij.second() = block.density().z() + 1;
}
else if (i == 2)
{
fnij.first() = block.meshDensity().x() + 1;
fnij.second() = block.meshDensity().y() + 1;
fnij.first() = block.density().x() + 1;
fnij.second() = block.density().y() + 1;
}
return fnij;
@ -211,15 +211,15 @@ inline label facePoint
case 0:
return block.vtxLabel(0, i, j);
case 1:
return block.vtxLabel(block.meshDensity().x(), i, j);
return block.vtxLabel(block.density().x(), i, j);
case 2:
return block.vtxLabel(i, 0, j);
case 3:
return block.vtxLabel(i, block.meshDensity().y(), j);
return block.vtxLabel(i, block.density().y(), j);
case 4:
return block.vtxLabel(i, j, 0);
case 5:
return block.vtxLabel(i, j, block.meshDensity().z());
return block.vtxLabel(i, j, block.density().z());
default:
return -1;
}
@ -236,9 +236,9 @@ inline label facePointN
{
return block.vtxLabel
(
unsignIndex(i, block.meshDensity().x()),
unsignIndex(j, block.meshDensity().y()),
unsignIndex(k, block.meshDensity().z())
unsignIndex(i, block.density().x()),
unsignIndex(j, block.density().y()),
unsignIndex(k, block.density().z())
);
}
@ -256,15 +256,15 @@ inline label facePointN
case 0:
return facePointN(block, 0, i, j);
case 1:
return facePointN(block, block.meshDensity().x(), i, j);
return facePointN(block, block.density().x(), i, j);
case 2:
return facePointN(block, i, 0, j);
case 3:
return facePointN(block, i, block.meshDensity().y(), j);
return facePointN(block, i, block.density().y(), j);
case 4:
return facePointN(block, i, j, 0);
case 5:
return facePointN(block, i, j, block.meshDensity().z());
return facePointN(block, i, j, block.density().z());
default:
return -1;
}

View File

@ -179,7 +179,7 @@ void Foam::blockMesh::readPatches
(
patchStream,
patchNames[nPatches],
blockPointField_,
vertices_,
tmpBlocksPatches[nPatches]
);
@ -292,7 +292,7 @@ void Foam::blockMesh::readBoundary
(
patchInfo.dict(),
patchNames[patchi],
blockPointField_,
vertices_,
tmpBlocksPatches[patchi]
);
}
@ -351,13 +351,13 @@ Foam::polyMesh* Foam::blockMesh::createTopology
Info<< "Creating block edges" << endl;
}
curvedEdgeList blockEdges
blockEdgeList edges
(
meshDescription.lookup("edges"),
curvedEdge::iNew(blockPointField_)
blockEdge::iNew(vertices_)
);
edges_.transfer(blockEdges);
edges_.transfer(edges);
}
else if (verboseOutput)
{
@ -370,65 +370,13 @@ Foam::polyMesh* Foam::blockMesh::createTopology
{
Info<< "Creating topology blocks" << endl;
}
{
ITstream& is(meshDescription.lookup("blocks"));
// Read number of blocks in mesh
label nBlocks = 0;
token firstToken(is);
if (firstToken.isLabel())
{
nBlocks = firstToken.labelToken();
blocks.setSize(nBlocks);
}
else
{
is.putBack(firstToken);
}
// Read beginning of blocks
is.readBegin("blocks");
nBlocks = 0;
token lastToken(is);
while
blockList blocks
(
!(
lastToken.isPunctuation()
&& lastToken.pToken() == token::END_LIST
)
)
{
if (blocks.size() <= nBlocks)
{
blocks.setSize(nBlocks + 1);
}
is.putBack(lastToken);
blocks.set
(
nBlocks,
new block
(
blockPointField_,
edges_,
is
)
);
nBlocks++;
is >> lastToken;
}
is.putBack(lastToken);
// Read end of blocks
is.readEnd("blocks");
meshDescription.lookup("blocks"),
block::iNew(vertices_, edges_)
);
transfer(blocks);
}
@ -525,7 +473,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
IOobject::NO_WRITE,
false
),
xferCopy(blockPointField_), // Copy these points, do NOT move
xferCopy(vertices_), // Copy these points, do NOT move
tmpBlockCells,
tmpBlocksPatches,
patchNames,
@ -564,7 +512,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology
IOobject::NO_WRITE,
false
),
xferCopy(blockPointField_), // Copy these points, do NOT move
xferCopy(vertices_), // Copy these points, do NOT move
tmpBlockCells,
tmpBlocksPatches,
patchNames,