diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C index f79068826..a3ccb7589 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMesh.C @@ -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()); diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C index b54b5dd22..876fc47a3 100644 --- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/vtkPV3blockMeshConvert.C @@ -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) diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C index b855990c6..22cdf2db5 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C @@ -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()); diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C index b723b36bc..04cac76d9 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C @@ -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) diff --git a/src/mesh/blockMesh/Make/files b/src/mesh/blockMesh/Make/files index 37bbe7ba1..27bed6559 100644 --- a/src/mesh/blockMesh/Make/files +++ b/src/mesh/blockMesh/Make/files @@ -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 diff --git a/src/mesh/blockMesh/block/block.C b/src/mesh/blockMesh/block/block.C index 3130bcef9..0b345511f 100644 --- a/src/mesh/blockMesh/block/block.C +++ b/src/mesh/blockMesh/block/block.C @@ -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_; } diff --git a/src/mesh/blockMesh/block/block.H b/src/mesh/blockMesh/block/block.H index 3e47a80a6..0f48b975e 100644 --- a/src/mesh/blockMesh/block/block.H +++ b/src/mesh/blockMesh/block/block.H @@ -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(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 operator()(Istream& is) const + { + return autoPtr(new block(points_, edges_, is)); + } + }; + //- Destructor ~block(); diff --git a/src/mesh/blockMesh/block/blockCreate.C b/src/mesh/blockMesh/block/blockCreate.C index b3ce7d3a3..27def57ec 100644 --- a/src/mesh/blockMesh/block/blockCreate.C +++ b/src/mesh/blockMesh/block/blockCreate.C @@ -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(); } diff --git a/src/mesh/blockMesh/block/blockI.H b/src/mesh/blockMesh/block/blockI.H index 2d9136b72..10ac991eb 100644 --- a/src/mesh/blockMesh/block/blockI.H +++ b/src/mesh/blockMesh/block/blockI.H @@ -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) ); } diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C index 1f8c9118c..2433f9448 100644 --- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C +++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C @@ -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