mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: minor blockMesh improvements
- avoid potential ambiguities in naming of mesh faces/edges vs. block faces/edges - additional methods characterizing the number of faces (internal, boundary, total) associated with a blockDescriptor - cellLabel() accessor and checkIndex() methods - restore demand-driven behaviour of block, cache the calculated cells and refactor generation of block boundary faces to improve potential reuse.
This commit is contained in:
committed by
Andrew Heather
parent
fe445ac516
commit
48e3590bc8
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -32,19 +32,12 @@ License
|
|||||||
|
|
||||||
void Foam::blockDescriptor::check(const Istream& is)
|
void Foam::blockDescriptor::check(const Istream& is)
|
||||||
{
|
{
|
||||||
forAll(blockShape_, pi)
|
for (const label pointi : blockShape_)
|
||||||
{
|
{
|
||||||
if (blockShape_[pi] < 0)
|
if (pointi < 0 || pointi >= vertices_.size())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(is)
|
FatalIOErrorInFunction(is)
|
||||||
<< "Negative point label " << blockShape_[pi]
|
<< "Point label " << pointi
|
||||||
<< " in block " << *this
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
else if (blockShape_[pi] >= vertices_.size())
|
|
||||||
{
|
|
||||||
FatalIOErrorInFunction(is)
|
|
||||||
<< "Point label " << blockShape_[pi]
|
|
||||||
<< " out of range 0.." << vertices_.size() - 1
|
<< " out of range 0.." << vertices_.size() - 1
|
||||||
<< " in block " << *this
|
<< " in block " << *this
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
@ -108,22 +101,22 @@ void Foam::blockDescriptor::check(const Istream& is)
|
|||||||
|
|
||||||
void Foam::blockDescriptor::findCurvedFaces()
|
void Foam::blockDescriptor::findCurvedFaces()
|
||||||
{
|
{
|
||||||
const faceList blockFaces(blockShape().faces());
|
const faceList shapeFaces(blockShape().faces());
|
||||||
|
|
||||||
forAll(blockFaces, blockFacei)
|
forAll(shapeFaces, shapeFacei)
|
||||||
{
|
{
|
||||||
forAll(faces_, facei)
|
forAll(blockFaces_, facei)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
face::sameVertices
|
face::sameVertices
|
||||||
(
|
(
|
||||||
faces_[facei].vertices(),
|
blockFaces_[facei].vertices(),
|
||||||
blockFaces[blockFacei]
|
shapeFaces[shapeFacei]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
curvedFaces_[blockFacei] = facei;
|
curvedFaces_[shapeFacei] = facei;
|
||||||
nCurvedFaces_++;
|
nCurvedFaces_++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -146,8 +139,8 @@ Foam::blockDescriptor::blockDescriptor
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
vertices_(vertices),
|
vertices_(vertices),
|
||||||
edges_(edges),
|
blockEdges_(edges),
|
||||||
faces_(faces),
|
blockFaces_(faces),
|
||||||
blockShape_(bshape),
|
blockShape_(bshape),
|
||||||
density_(density),
|
density_(density),
|
||||||
expand_(expand),
|
expand_(expand),
|
||||||
@ -155,7 +148,11 @@ Foam::blockDescriptor::blockDescriptor
|
|||||||
curvedFaces_(-1),
|
curvedFaces_(-1),
|
||||||
nCurvedFaces_(0)
|
nCurvedFaces_(0)
|
||||||
{
|
{
|
||||||
if (expand_.size() != 12)
|
if (expand_.empty())
|
||||||
|
{
|
||||||
|
expand_.resize(12, gradingDescriptors());
|
||||||
|
}
|
||||||
|
else if (expand_.size() != 12)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unknown definition of expansion ratios"
|
<< "Unknown definition of expansion ratios"
|
||||||
@ -177,9 +174,9 @@ Foam::blockDescriptor::blockDescriptor
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
vertices_(vertices),
|
vertices_(vertices),
|
||||||
edges_(edges),
|
blockEdges_(edges),
|
||||||
faces_(faces),
|
blockFaces_(faces),
|
||||||
density_(),
|
density_(0, 0, 0),
|
||||||
expand_(12, gradingDescriptors()),
|
expand_(12, gradingDescriptors()),
|
||||||
zoneName_(),
|
zoneName_(),
|
||||||
curvedFaces_(-1),
|
curvedFaces_(-1),
|
||||||
@ -351,7 +348,7 @@ void Foam::blockDescriptor::correctFacePoints
|
|||||||
{
|
{
|
||||||
if (curvedFaces_[blockFacei] != -1)
|
if (curvedFaces_[blockFacei] != -1)
|
||||||
{
|
{
|
||||||
faces_[curvedFaces_[blockFacei]].project
|
blockFaces_[curvedFaces_[blockFacei]].project
|
||||||
(
|
(
|
||||||
*this,
|
*this,
|
||||||
blockFacei,
|
blockFacei,
|
||||||
@ -381,7 +378,7 @@ void Foam::blockDescriptor::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
|
||||||
{
|
{
|
||||||
@ -390,13 +387,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
|
|||||||
|
|
||||||
os << bshape.model().name() << " (";
|
os << bshape.model().name() << " (";
|
||||||
|
|
||||||
forAll(blockLabels, labelI)
|
forAll(blockLabels, labeli)
|
||||||
{
|
{
|
||||||
if (labelI)
|
if (labeli)
|
||||||
{
|
{
|
||||||
os << ' ';
|
os << ' ';
|
||||||
}
|
}
|
||||||
os << blockLabels[labelI];
|
os << blockLabels[labeli];
|
||||||
}
|
}
|
||||||
os << ')';
|
os << ')';
|
||||||
|
|
||||||
@ -409,7 +406,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
|
|||||||
<< " simpleGrading (";
|
<< " simpleGrading (";
|
||||||
|
|
||||||
|
|
||||||
const List<gradingDescriptors>& expand = bd.expand_;
|
const List<gradingDescriptors>& expand = bd.grading();
|
||||||
|
|
||||||
// Can we use a compact notation?
|
// Can we use a compact notation?
|
||||||
if
|
if
|
||||||
@ -455,4 +452,23 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::Ostream& Foam::operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const InfoProxy<blockDescriptor>& iproxy
|
||||||
|
)
|
||||||
|
{
|
||||||
|
const blockDescriptor& bd = iproxy.t_;
|
||||||
|
|
||||||
|
os << "Dimensions:" << bd.density()
|
||||||
|
<< " nPoints:" << bd.nPoints()
|
||||||
|
<< " nCells:" << bd.nCells()
|
||||||
|
<< " nFaces:" << bd.nFaces()
|
||||||
|
<< " nInternalFaces:" << bd.nInternalFaces()
|
||||||
|
<< nl;
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
@ -63,35 +63,29 @@ SourceFiles
|
|||||||
#include "blockEdgeList.H"
|
#include "blockEdgeList.H"
|
||||||
#include "blockFaceList.H"
|
#include "blockFaceList.H"
|
||||||
#include "gradingDescriptors.H"
|
#include "gradingDescriptors.H"
|
||||||
|
#include "InfoProxy.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
class blockDescriptor;
|
|
||||||
Ostream& operator<<(Ostream&, const blockDescriptor&);
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class blockDescriptor Declaration
|
Class blockDescriptor Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class blockDescriptor
|
class blockDescriptor
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
//- Reference to point field defining the block mesh
|
//- Reference to point field defining the block mesh
|
||||||
const pointField& vertices_;
|
const pointField& vertices_;
|
||||||
|
|
||||||
//- Reference to a list of block edges
|
//- Reference to a list of block edges
|
||||||
const blockEdgeList& edges_;
|
const blockEdgeList& blockEdges_;
|
||||||
|
|
||||||
//- Reference to the list of curved faces
|
//- Reference to the list of curved faces
|
||||||
const blockFaceList& faces_;
|
const blockFaceList& blockFaces_;
|
||||||
|
|
||||||
//- Block shape
|
//- Block shape
|
||||||
cellShape blockShape_;
|
cellShape blockShape_;
|
||||||
@ -131,9 +125,6 @@ class blockDescriptor
|
|||||||
|
|
||||||
void findCurvedFaces();
|
void findCurvedFaces();
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy assignment
|
//- No copy assignment
|
||||||
void operator=(const blockDescriptor&) = delete;
|
void operator=(const blockDescriptor&) = delete;
|
||||||
|
|
||||||
@ -145,10 +136,10 @@ public:
|
|||||||
//- Construct from components. Optional cellSet/zone name.
|
//- Construct from components. Optional cellSet/zone name.
|
||||||
blockDescriptor
|
blockDescriptor
|
||||||
(
|
(
|
||||||
const cellShape&,
|
const cellShape& bshape,
|
||||||
const pointField& vertices,
|
const pointField& vertices,
|
||||||
const blockEdgeList&,
|
const blockEdgeList& edges,
|
||||||
const blockFaceList&,
|
const blockFaceList& faces,
|
||||||
const Vector<label>& density,
|
const Vector<label>& density,
|
||||||
const UList<gradingDescriptors>& expand,
|
const UList<gradingDescriptors>& expand,
|
||||||
const word& zoneName = ""
|
const word& zoneName = ""
|
||||||
@ -160,9 +151,9 @@ public:
|
|||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
const pointField& vertices,
|
const pointField& vertices,
|
||||||
const blockEdgeList&,
|
const blockEdgeList& edges,
|
||||||
const blockFaceList&,
|
const blockFaceList& faces,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -172,7 +163,7 @@ public:
|
|||||||
inline const pointField& vertices() const;
|
inline const pointField& vertices() const;
|
||||||
|
|
||||||
//- Return reference to the list of curved faces
|
//- Return reference to the list of curved faces
|
||||||
inline const blockFaceList& faces() const;
|
inline const blockFaceList& blockFaces() const;
|
||||||
|
|
||||||
//- Return the block shape
|
//- Return the block shape
|
||||||
inline const cellShape& blockShape() const;
|
inline const cellShape& blockShape() const;
|
||||||
@ -180,15 +171,27 @@ public:
|
|||||||
//- Return the mesh density (number of cells) in the i,j,k directions
|
//- Return the mesh density (number of cells) in the i,j,k directions
|
||||||
inline const Vector<label>& density() const;
|
inline const Vector<label>& density() const;
|
||||||
|
|
||||||
|
//- Expansion ratios in all directions
|
||||||
|
const List<gradingDescriptors>& grading() const;
|
||||||
|
|
||||||
//- Return the (optional) zone name
|
//- Return the (optional) zone name
|
||||||
inline const word& zoneName() const;
|
inline const word& zoneName() const;
|
||||||
|
|
||||||
//- Return the number of points
|
//- The number of meshed points described: (nx+1) * (ny+1) * (nz+1)
|
||||||
inline label nPoints() const;
|
inline label nPoints() const;
|
||||||
|
|
||||||
//- Return the number of cells
|
//- The number of meshed cells described: (nx * ny * nz)
|
||||||
inline label nCells() const;
|
inline label nCells() const;
|
||||||
|
|
||||||
|
//- The number of meshed faces described
|
||||||
|
inline label nFaces() const;
|
||||||
|
|
||||||
|
//- The number of meshed internal faces described
|
||||||
|
inline label nInternalFaces() const;
|
||||||
|
|
||||||
|
//- The number of meshed internal faces described
|
||||||
|
inline label nBoundaryFaces() const;
|
||||||
|
|
||||||
//- Curved-face labels for each block-face (-1 for flat faces)
|
//- Curved-face labels for each block-face (-1 for flat faces)
|
||||||
inline const FixedList<label, 6>& curvedFaces() const;
|
inline const FixedList<label, 6>& curvedFaces() const;
|
||||||
|
|
||||||
@ -198,6 +201,22 @@ public:
|
|||||||
//- Return block point for local label i
|
//- Return block point for local label i
|
||||||
inline const point& blockPoint(const label i) const;
|
inline const point& blockPoint(const label i) const;
|
||||||
|
|
||||||
|
//- Check indices are within valid range ni,nj,nk
|
||||||
|
inline void checkIndex
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j,
|
||||||
|
const label k
|
||||||
|
) const;
|
||||||
|
|
||||||
|
//- Cell label offset for a particular i,j,k position
|
||||||
|
inline label cellLabel
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j,
|
||||||
|
const label k
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Vertex label offset for a particular i,j,k position
|
//- Vertex label offset for a particular i,j,k position
|
||||||
inline label pointLabel
|
inline label pointLabel
|
||||||
(
|
(
|
||||||
@ -246,13 +265,21 @@ public:
|
|||||||
//- Write block index with dictionary lookup
|
//- Write block index with dictionary lookup
|
||||||
static void write(Ostream&, const label blocki, const dictionary&);
|
static void write(Ostream&, const label blocki, const dictionary&);
|
||||||
|
|
||||||
|
//- Return info proxy
|
||||||
// IOstream Operators
|
inline InfoProxy<blockDescriptor> info() const
|
||||||
|
{
|
||||||
friend Ostream& operator<<(Ostream&, const blockDescriptor&);
|
return *this;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Output Operator
|
||||||
|
Ostream& operator<<(Ostream& os, const blockDescriptor& bd);
|
||||||
|
|
||||||
|
//- Info output
|
||||||
|
Ostream& operator<<(Ostream& os, const InfoProxy<blockDescriptor>& info);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -50,10 +50,8 @@ Foam::label Foam::blockDescriptor::edgePointsWeights
|
|||||||
// Set the edge points/weights
|
// Set the edge points/weights
|
||||||
// The edge is a straight-line if it is not in the list of blockEdges
|
// The edge is a straight-line if it is not in the list of blockEdges
|
||||||
|
|
||||||
forAll(edges_, cedgei)
|
for (const blockEdge& cedge : blockEdges_)
|
||||||
{
|
{
|
||||||
const blockEdge& cedge = edges_[cedgei];
|
|
||||||
|
|
||||||
const int cmp = cedge.compare(blockLabels[start], blockLabels[end]);
|
const int cmp = cedge.compare(blockLabels[start], blockLabels[end]);
|
||||||
|
|
||||||
if (cmp)
|
if (cmp)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -33,9 +33,9 @@ inline const Foam::pointField& Foam::blockDescriptor::vertices() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::blockFaceList& Foam::blockDescriptor::faces() const
|
inline const Foam::blockFaceList& Foam::blockDescriptor::blockFaces() const
|
||||||
{
|
{
|
||||||
return faces_;
|
return blockFaces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -51,6 +51,13 @@ inline const Foam::Vector<Foam::label>& Foam::blockDescriptor::density() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::List<Foam::gradingDescriptors>&
|
||||||
|
Foam::blockDescriptor::grading() const
|
||||||
|
{
|
||||||
|
return expand_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::word& Foam::blockDescriptor::zoneName() const
|
inline const Foam::word& Foam::blockDescriptor::zoneName() const
|
||||||
{
|
{
|
||||||
return zoneName_;
|
return zoneName_;
|
||||||
@ -79,6 +86,39 @@ inline Foam::label Foam::blockDescriptor::nCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label Foam::blockDescriptor::nFaces() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
((density_.x() + 1) * density_.y() * density_.z())
|
||||||
|
+ ((density_.y() + 1) * density_.z() * density_.x())
|
||||||
|
+ ((density_.z() + 1) * density_.x() * density_.y())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label Foam::blockDescriptor::nInternalFaces() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
((density_.x() - 1) * density_.y() * density_.z())
|
||||||
|
+ ((density_.y() - 1) * density_.z() * density_.x())
|
||||||
|
+ ((density_.z() - 1) * density_.x() * density_.y())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label Foam::blockDescriptor::nBoundaryFaces() const
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
(2 * density_.y() * density_.z())
|
||||||
|
+ (2 * density_.z() * density_.x())
|
||||||
|
+ (2 * density_.x() * density_.y())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::FixedList<Foam::label, 6>&
|
inline const Foam::FixedList<Foam::label, 6>&
|
||||||
Foam::blockDescriptor::curvedFaces() const
|
Foam::blockDescriptor::curvedFaces() const
|
||||||
{
|
{
|
||||||
@ -98,6 +138,46 @@ inline const Foam::point& Foam::blockDescriptor::blockPoint(const label i) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline void Foam::blockDescriptor::checkIndex
|
||||||
|
(
|
||||||
|
const label i, const label j, const label k
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
if (i < 0 || i >= density_.x())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "index " << i << " out of range [0," << density_.x() << "]"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
if (j < 0 || j >= density_.y())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "index " << j << " out of range [0," << density_.y() << "]"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
if (k < 0 || k >= density_.z())
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "index " << k << " out of range [0," << density_.z() << "]"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline Foam::label Foam::blockDescriptor::cellLabel
|
||||||
|
(
|
||||||
|
const label i,
|
||||||
|
const label j,
|
||||||
|
const label k
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
#ifdef FULLDEBUG
|
||||||
|
checkIndex(i, j, k);
|
||||||
|
#endif
|
||||||
|
return (i + j*density_.x() + k*density_.x()*density_.y());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::label Foam::blockDescriptor::pointLabel
|
inline Foam::label Foam::blockDescriptor::pointLabel
|
||||||
(
|
(
|
||||||
const label i,
|
const label i,
|
||||||
@ -105,12 +185,10 @@ inline Foam::label Foam::blockDescriptor::pointLabel
|
|||||||
const label k
|
const label k
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return
|
#ifdef FULLDEBUG
|
||||||
(
|
checkIndex(i, j, k);
|
||||||
i
|
#endif
|
||||||
+ j*(density_.x() + 1)
|
return (i + j*(density_.x()+1) + k*(density_.x()+1)*(density_.y()+1));
|
||||||
+ k*(density_.x() + 1)*(density_.y() + 1)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -123,6 +201,7 @@ inline Foam::label Foam::blockDescriptor::facePointLabel
|
|||||||
{
|
{
|
||||||
if (facei == 0 || facei == 1)
|
if (facei == 0 || facei == 1)
|
||||||
{
|
{
|
||||||
|
// x-min, x-max
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
i
|
i
|
||||||
@ -131,6 +210,7 @@ inline Foam::label Foam::blockDescriptor::facePointLabel
|
|||||||
}
|
}
|
||||||
else if (facei == 2 || facei == 3)
|
else if (facei == 2 || facei == 3)
|
||||||
{
|
{
|
||||||
|
// y-min, y-max
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
i
|
i
|
||||||
@ -139,6 +219,7 @@ inline Foam::label Foam::blockDescriptor::facePointLabel
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// z-min, z-max
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
i
|
i
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2014-2016 OpenFOAM Foundation
|
| Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
@ -86,12 +86,6 @@ Foam::blockEdges::BSplineEdge::BSplineEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blockEdges::BSplineEdge::~BSplineEdge()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::point Foam::blockEdges::BSplineEdge::position(const scalar mu) const
|
Foam::point Foam::blockEdges::BSplineEdge::position(const scalar mu) const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2014-2016 OpenFOAM Foundation
|
| Copyright (C) 2014-2016 OpenFOAM Foundation
|
||||||
@ -94,7 +94,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~BSplineEdge();
|
virtual ~BSplineEdge() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -68,12 +68,6 @@ Foam::blockEdges::bezier::bezier
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blockEdges::bezier::~bezier()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::point Foam::blockEdges::bezier::position(const scalar lambda) const
|
Foam::point Foam::blockEdges::bezier::position(const scalar lambda) const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -104,8 +104,8 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~bezier();
|
virtual ~bezier() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -66,12 +66,6 @@ Foam::blockEdges::lineEdge::lineEdge
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blockEdges::lineEdge::~lineEdge()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::point Foam::blockEdges::lineEdge::position(const scalar lambda) const
|
Foam::point Foam::blockEdges::lineEdge::position(const scalar lambda) const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -74,12 +74,12 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
const pointField&,
|
const pointField&,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~lineEdge();
|
virtual ~lineEdge() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -69,12 +69,6 @@ Foam::blockEdges::polyLineEdge::polyLineEdge
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blockEdges::polyLineEdge::~polyLineEdge()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::point Foam::blockEdges::polyLineEdge::position(const scalar lambda) const
|
Foam::point Foam::blockEdges::polyLineEdge::position(const scalar lambda) const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -89,12 +89,12 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
const pointField&,
|
const pointField&,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~polyLineEdge();
|
virtual ~polyLineEdge() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -55,7 +55,7 @@ class projectCurveEdge
|
|||||||
:
|
:
|
||||||
public blockEdge
|
public blockEdge
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
const searchableSurfaces& geometry_;
|
const searchableSurfaces& geometry_;
|
||||||
|
|
||||||
@ -87,13 +87,12 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~projectCurveEdge()
|
virtual ~projectCurveEdge() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -55,7 +55,7 @@ class projectEdge
|
|||||||
:
|
:
|
||||||
public blockEdge
|
public blockEdge
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
const searchableSurfaces& geometry_;
|
const searchableSurfaces& geometry_;
|
||||||
|
|
||||||
@ -90,13 +90,12 @@ public:
|
|||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~projectEdge()
|
virtual ~projectEdge() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -86,12 +86,6 @@ Foam::blockEdges::splineEdge::splineEdge
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::blockEdges::splineEdge::~splineEdge()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::point Foam::blockEdges::splineEdge::position(const scalar mu) const
|
Foam::point Foam::blockEdges::splineEdge::position(const scalar mu) const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -94,7 +94,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~splineEdge();
|
virtual ~splineEdge() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -79,10 +79,7 @@ Foam::autoPtr<Foam::blockFace> Foam::blockFace::New
|
|||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
DebugInFunction << "Constructing blockFace" << endl;
|
||||||
{
|
|
||||||
InfoInFunction << "Constructing blockFace" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const word faceType(is);
|
const word faceType(is);
|
||||||
|
|
||||||
@ -112,7 +109,7 @@ void Foam::blockFace::write(Ostream& os, const dictionary& d) const
|
|||||||
// Write contents
|
// Write contents
|
||||||
forAll(vertices_, i)
|
forAll(vertices_, i)
|
||||||
{
|
{
|
||||||
if (i > 0) os << token::SPACE;
|
if (i) os << token::SPACE;
|
||||||
blockVertex::write(os, vertices_[i], d);
|
blockVertex::write(os, vertices_[i], d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -44,8 +44,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward declarations
|
||||||
|
|
||||||
class blockDescriptor;
|
class blockDescriptor;
|
||||||
class blockFace;
|
class blockFace;
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ public:
|
|||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Clone function
|
//- Clone function
|
||||||
@ -138,8 +137,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~blockFace()
|
virtual ~blockFace() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -52,13 +52,13 @@ const Foam::searchableSurface& Foam::blockFaces::projectFace::lookupSurface
|
|||||||
Istream& is
|
Istream& is
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
word name(is);
|
const word name(is);
|
||||||
|
|
||||||
forAll(geometry, i)
|
for (const searchableSurface& geom : geometry)
|
||||||
{
|
{
|
||||||
if (geometry[i].name() == name)
|
if (geom.name() == name)
|
||||||
{
|
{
|
||||||
return geometry[i];
|
return geom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -55,7 +55,7 @@ class projectFace
|
|||||||
:
|
:
|
||||||
public blockFace
|
public blockFace
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
//- The surface onto which the points are projected
|
//- The surface onto which the points are projected
|
||||||
const searchableSurface& surface_;
|
const searchableSurface& surface_;
|
||||||
@ -106,13 +106,12 @@ public:
|
|||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~projectFace()
|
virtual ~projectFace() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -79,8 +79,7 @@ void Foam::blockMesh::check(const polyMesh& bm, const dictionary& dict) const
|
|||||||
{
|
{
|
||||||
Info<< " Curved edge ";
|
Info<< " Curved edge ";
|
||||||
edges_[cei].write(Info, dict);
|
edges_[cei].write(Info, dict);
|
||||||
Info<< " does not correspond to a block edge."
|
Info<< " does not correspond to a block edge." << endl;
|
||||||
<< endl;
|
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -105,11 +105,11 @@ void Foam::blockMesh::createCells() const
|
|||||||
|
|
||||||
cells_.setSize(nCells_);
|
cells_.setSize(nCells_);
|
||||||
|
|
||||||
label cellLabel = 0;
|
label celli = 0;
|
||||||
|
|
||||||
forAll(blocks, blocki)
|
forAll(blocks, blocki)
|
||||||
{
|
{
|
||||||
const List<FixedList<label, 8>> blockCells(blocks[blocki].cells());
|
const List<FixedList<label, 8>>& blockCells = blocks[blocki].cells();
|
||||||
|
|
||||||
forAll(blockCells, blockCelli)
|
forAll(blockCells, blockCelli)
|
||||||
{
|
{
|
||||||
@ -126,9 +126,9 @@ void Foam::blockMesh::createCells() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct collapsed cell and add to list
|
// Construct collapsed cell and add to list
|
||||||
cells_[cellLabel] = cellShape(hex, cellPoints, true);
|
cells_[celli] = cellShape(hex, cellPoints, true);
|
||||||
|
|
||||||
cellLabel++;
|
++celli;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015-2016 OpenFOAM Foundation
|
| Copyright (C) 2015-2016 OpenFOAM Foundation
|
||||||
@ -87,6 +87,7 @@ void genFaceFaceRotMap()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the direction map for the merge-faces
|
// Return the direction map for the merge-faces
|
||||||
Pair<int> faceMap
|
Pair<int> faceMap
|
||||||
(
|
(
|
||||||
@ -113,6 +114,7 @@ Pair<int> faceMap
|
|||||||
return Pair<int>(0, 0);
|
return Pair<int>(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Set the block and face indices for all the merge faces
|
// Set the block and face indices for all the merge faces
|
||||||
void setBlockFaceCorrespondence
|
void setBlockFaceCorrespondence
|
||||||
(
|
(
|
||||||
@ -155,6 +157,7 @@ void setBlockFaceCorrespondence
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the number of divisions in each direction for the face
|
// Return the number of divisions in each direction for the face
|
||||||
Pair<label> faceNij(const label facei, const block& block)
|
Pair<label> faceNij(const label facei, const block& block)
|
||||||
{
|
{
|
||||||
@ -181,24 +184,28 @@ Pair<label> faceNij(const label facei, const block& block)
|
|||||||
return fnij;
|
return fnij;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Sign the index corresponding to the map
|
// Sign the index corresponding to the map
|
||||||
inline label signIndex(const int map, const label i)
|
inline label signIndex(const int map, const label i)
|
||||||
{
|
{
|
||||||
return map < 0 ? -i-1 : i;
|
return map < 0 ? -i-1 : i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reverse a signed index with the number of divisions
|
// Reverse a signed index with the number of divisions
|
||||||
inline label unsignIndex(const label i, const label ni)
|
inline label unsignIndex(const label i, const label ni)
|
||||||
{
|
{
|
||||||
return i >= 0 ? i : ni + i + 1;
|
return i >= 0 ? i : ni + i + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the mapped index
|
// Return the mapped index
|
||||||
inline label mapij(const int map, const label i, const label j)
|
inline label mapij(const int map, const label i, const label j)
|
||||||
{
|
{
|
||||||
return signIndex(map, mag(map) == 1 ? i : j);
|
return signIndex(map, mag(map) == 1 ? i : j);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the face point index
|
// Return the face point index
|
||||||
inline label facePoint
|
inline label facePoint
|
||||||
(
|
(
|
||||||
@ -227,6 +234,7 @@ inline label facePoint
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the neighbour face point from the signed indices
|
// Return the neighbour face point from the signed indices
|
||||||
inline label facePointN
|
inline label facePointN
|
||||||
(
|
(
|
||||||
@ -244,6 +252,7 @@ inline label facePointN
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the neighbour face point from the mapped indices
|
// Return the neighbour face point from the mapped indices
|
||||||
inline label facePointN
|
inline label facePointN
|
||||||
(
|
(
|
||||||
@ -272,6 +281,7 @@ inline label facePointN
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Return the neighbour face point using the map
|
// Return the neighbour face point using the map
|
||||||
inline label facePointN
|
inline label facePointN
|
||||||
(
|
(
|
||||||
@ -285,7 +295,7 @@ inline label facePointN
|
|||||||
return facePointN(facei, block, mapij(fmap[0], i, j), mapij(fmap[1], i, j));
|
return facePointN(facei, block, mapij(fmap[0], i, j), mapij(fmap[1], i, j));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // End namespace Foam
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -358,17 +368,11 @@ void Foam::blockMesh::calcMergeInfoFast()
|
|||||||
mergeBlockN
|
mergeBlockN
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
DebugInfo << endl;
|
||||||
{
|
|
||||||
Info<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
forAll(topoInternalFaces, topoFacei)
|
forAll(topoInternalFaces, topoFacei)
|
||||||
{
|
{
|
||||||
if (debug)
|
DebugInfo << "Processing face " << topoFacei << endl;
|
||||||
{
|
|
||||||
Info<< "Processing face " << topoFacei << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
label blockPi = mergeBlockP[topoFacei].first();
|
label blockPi = mergeBlockP[topoFacei].first();
|
||||||
label blockPfacei = mergeBlockP[topoFacei].second();
|
label blockPfacei = mergeBlockP[topoFacei].second();
|
||||||
@ -387,13 +391,11 @@ void Foam::blockMesh::calcMergeInfoFast()
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (debug)
|
DebugInfo
|
||||||
{
|
<< " Face map for faces "
|
||||||
Info<< " Face map for faces "
|
<< blocks[blockPi].blockShape().faces()[blockPfacei] << " "
|
||||||
<< blocks[blockPi].blockShape().faces()[blockPfacei] << " "
|
<< blocks[blockNi].blockShape().faces()[blockNfacei] << ": "
|
||||||
<< blocks[blockNi].blockShape().faces()[blockNfacei] << ": "
|
<< fmap << endl;
|
||||||
<< fmap << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const pointField& blockPpoints = blocks[blockPi].points();
|
const pointField& blockPpoints = blocks[blockPi].points();
|
||||||
const pointField& blockNpoints = blocks[blockNi].points();
|
const pointField& blockNpoints = blocks[blockNi].points();
|
||||||
@ -482,11 +484,9 @@ void Foam::blockMesh::calcMergeInfoFast()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
DebugInfo
|
||||||
{
|
<< " Max distance between merge points: "
|
||||||
Info<< " Max distance between merge points: "
|
<< sqrt(maxSqrDist) << endl;
|
||||||
<< sqrt(maxSqrDist) << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -81,19 +81,12 @@ void Foam::blockMesh::checkPatchLabels
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
forAll(f, fp)
|
for (const label pointi : f)
|
||||||
{
|
{
|
||||||
if (f[fp] < 0)
|
if (pointi < 0 || pointi >= points.size())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(source)
|
FatalIOErrorInFunction(source)
|
||||||
<< "Negative point label " << f[fp] << nl
|
<< "Point label " << pointi
|
||||||
<< " on patch " << patchName << ", face " << facei
|
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
|
||||||
else if (f[fp] >= points.size())
|
|
||||||
{
|
|
||||||
FatalIOErrorInFunction(source)
|
|
||||||
<< "Point label " << f[fp]
|
|
||||||
<< " out of range 0.." << points.size() - 1 << nl
|
<< " out of range 0.." << points.size() - 1 << nl
|
||||||
<< " on patch " << patchName << ", face " << facei
|
<< " on patch " << patchName << ", face " << facei
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -50,7 +50,6 @@ namespace Foam
|
|||||||
|
|
||||||
class blockVertex
|
class blockVertex
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -116,8 +115,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~blockVertex()
|
virtual ~blockVertex() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -56,7 +56,7 @@ class namedVertex
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected member data
|
// Protected Member Data
|
||||||
|
|
||||||
//- The dictionary variable name for the vertex number
|
//- The dictionary variable name for the vertex number
|
||||||
word name_;
|
word name_;
|
||||||
@ -76,16 +76,15 @@ public:
|
|||||||
//- Construct from Istream setting pointsList
|
//- Construct from Istream setting pointsList
|
||||||
namedVertex
|
namedVertex
|
||||||
(
|
(
|
||||||
const dictionary&,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~namedVertex()
|
virtual ~namedVertex() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -72,16 +72,15 @@ public:
|
|||||||
//- Construct from Istream setting pointsList
|
//- Construct from Istream setting pointsList
|
||||||
pointVertex
|
pointVertex
|
||||||
(
|
(
|
||||||
const dictionary&,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~pointVertex()
|
virtual ~pointVertex() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -83,16 +83,15 @@ public:
|
|||||||
//- Construct from Istream setting pointsList
|
//- Construct from Istream setting pointsList
|
||||||
projectVertex
|
projectVertex
|
||||||
(
|
(
|
||||||
const dictionary&,
|
const dictionary& dict,
|
||||||
const label index,
|
const label index,
|
||||||
const searchableSurfaces& geometry,
|
const searchableSurfaces& geometry,
|
||||||
Istream&
|
Istream& is
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~projectVertex()
|
virtual ~projectVertex() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -48,11 +48,11 @@ Foam::block::block
|
|||||||
const word& zoneName
|
const word& zoneName
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
blockDescriptor(bshape, vertices, edges, faces, density, expand, zoneName)
|
blockDescriptor(bshape, vertices, edges, faces, density, expand, zoneName),
|
||||||
{
|
points_(),
|
||||||
createPoints();
|
blockCells_(),
|
||||||
createBoundary();
|
blockPatches_()
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::block::block
|
Foam::block::block
|
||||||
@ -65,22 +65,24 @@ Foam::block::block
|
|||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
blockDescriptor(dict, index, vertices, edges, faces, is)
|
blockDescriptor(dict, index, vertices, edges, faces, is),
|
||||||
{
|
points_(),
|
||||||
createPoints();
|
blockCells_(),
|
||||||
createBoundary();
|
blockPatches_()
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
Foam::block::block(const blockDescriptor& blockDesc)
|
Foam::block::block(const blockDescriptor& blockDesc)
|
||||||
:
|
:
|
||||||
blockDescriptor(blockDesc)
|
blockDescriptor(blockDesc),
|
||||||
{
|
points_(),
|
||||||
createPoints();
|
blockCells_(),
|
||||||
createBoundary();
|
blockPatches_()
|
||||||
}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::block> Foam::block::New
|
Foam::autoPtr<Foam::block> Foam::block::New
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
@ -91,10 +93,7 @@ Foam::autoPtr<Foam::block> Foam::block::New
|
|||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
DebugInFunction << "Constructing block" << endl;
|
||||||
{
|
|
||||||
InfoInFunction << "Constructing block" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const word blockOrCellShapeType(is);
|
const word blockOrCellShapeType(is);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -31,7 +31,8 @@ Description
|
|||||||
cells in each direction and an expansion ratio.
|
cells in each direction and an expansion ratio.
|
||||||
|
|
||||||
Note
|
Note
|
||||||
The vertices and cells for filling the block are demand-driven.
|
The vertices, cells, boundary patches for filling the block are
|
||||||
|
demand-driven.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
block.C
|
block.C
|
||||||
@ -43,8 +44,7 @@ SourceFiles
|
|||||||
#define block_H
|
#define block_H
|
||||||
|
|
||||||
#include "pointField.H"
|
#include "pointField.H"
|
||||||
#include "labelList.H"
|
#include "faceList.H"
|
||||||
|
|
||||||
#include "blockDescriptor.H"
|
#include "blockDescriptor.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -52,13 +52,6 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class Istream;
|
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
class block;
|
|
||||||
Ostream& operator<<(Ostream&, const block&);
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class block Declaration
|
Class block Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
@ -67,23 +60,38 @@ class block
|
|||||||
:
|
:
|
||||||
public blockDescriptor
|
public blockDescriptor
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
//- List of points
|
//- List of points
|
||||||
pointField points_;
|
pointField points_;
|
||||||
|
|
||||||
|
//- The cells (hex)
|
||||||
|
List<FixedList<label, 8>> blockCells_;
|
||||||
|
|
||||||
//- Boundary patches
|
//- Boundary patches
|
||||||
FixedList<List<FixedList<label, 4>>, 6> boundaryPatches_;
|
FixedList<List<FixedList<label, 4>>, 6> blockPatches_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Creates vertices for cells filling the block
|
//- Create vertices for cells filling the block
|
||||||
void createPoints();
|
void createPoints();
|
||||||
|
|
||||||
//- Creates boundary patch faces for the block
|
//- Create cells
|
||||||
|
void createCells();
|
||||||
|
|
||||||
|
//- Create boundary patch faces for the block
|
||||||
void createBoundary();
|
void createBoundary();
|
||||||
|
|
||||||
|
//- Add boundary faces to output list at iterator location
|
||||||
|
template<class OutputIterator>
|
||||||
|
OutputIterator addBoundaryFaces
|
||||||
|
(
|
||||||
|
const int shapeFacei,
|
||||||
|
OutputIterator iter
|
||||||
|
) const;
|
||||||
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
block(const block&) = delete;
|
block(const block&) = delete;
|
||||||
|
|
||||||
@ -142,7 +150,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from a block definition
|
//- Construct from a block definition
|
||||||
block(const blockDescriptor&);
|
block(const blockDescriptor& blockDesc);
|
||||||
|
|
||||||
//- Clone
|
//- Clone
|
||||||
autoPtr<block> clone() const
|
autoPtr<block> clone() const
|
||||||
@ -197,30 +205,29 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~block()
|
virtual ~block() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return the points for filling the block
|
//- The points for filling the block
|
||||||
inline const pointField& points() const;
|
inline const pointField& points() const;
|
||||||
|
|
||||||
//- Return the cells for filling the block
|
//- The cells for filling the block
|
||||||
List<FixedList<label, 8>> cells() const;
|
inline const List<FixedList<label, 8>>& cells() const;
|
||||||
|
|
||||||
//- Return the boundary patch faces for the block
|
//- The boundary patch faces for the block
|
||||||
inline const FixedList<List<FixedList<label, 4>>, 6>&
|
inline const FixedList<List<FixedList<label, 4>>, 6>&
|
||||||
boundaryPatches() const;
|
boundaryPatches() const;
|
||||||
|
|
||||||
|
|
||||||
// Ostream Operator
|
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const block&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//- Ostream Operator
|
||||||
|
Ostream& operator<<(Ostream& os, const block& blk);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -66,7 +66,7 @@ void Foam::block::createPoints()
|
|||||||
scalarList w[12];
|
scalarList w[12];
|
||||||
label nCurvedEdges = edgesPointsWeights(p, w);
|
label nCurvedEdges = edgesPointsWeights(p, w);
|
||||||
|
|
||||||
points_.setSize(nPoints());
|
points_.resize(nPoints());
|
||||||
|
|
||||||
points_[pointLabel(0, 0, 0)] = p000;
|
points_[pointLabel(0, 0, 0)] = p000;
|
||||||
points_[pointLabel(ni, 0, 0)] = p100;
|
points_[pointLabel(ni, 0, 0)] = p100;
|
||||||
@ -190,11 +190,11 @@ void Foam::block::createPoints()
|
|||||||
FixedList<pointField, 6> facePoints(this->facePoints(points_));
|
FixedList<pointField, 6> facePoints(this->facePoints(points_));
|
||||||
correctFacePoints(facePoints);
|
correctFacePoints(facePoints);
|
||||||
|
|
||||||
// Loop over points and apply the correction from the from the i-faces
|
// Loop over points and apply the correction from the i-faces
|
||||||
for (label ii=0; ii<=ni; ii++)
|
for (label ii=0; ii<=ni; ii++)
|
||||||
{
|
{
|
||||||
// Process the points on the curved faces last
|
// Process the points on the curved faces last
|
||||||
label i = (ii + 1)%(ni + 1);
|
const label i = (ii + 1)%(ni + 1);
|
||||||
|
|
||||||
for (label j=0; j<=nj; j++)
|
for (label j=0; j<=nj; j++)
|
||||||
{
|
{
|
||||||
@ -242,11 +242,11 @@ void Foam::block::createPoints()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over points and apply the correction from the from the j-faces
|
// Loop over points and apply the correction from the j-faces
|
||||||
for (label jj=0; jj<=nj; jj++)
|
for (label jj=0; jj<=nj; jj++)
|
||||||
{
|
{
|
||||||
// Process the points on the curved faces last
|
// Process the points on the curved faces last
|
||||||
label j = (jj + 1)%(nj + 1);
|
const label j = (jj + 1)%(nj + 1);
|
||||||
|
|
||||||
for (label i=0; i<=ni; i++)
|
for (label i=0; i<=ni; i++)
|
||||||
{
|
{
|
||||||
@ -294,11 +294,11 @@ void Foam::block::createPoints()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over points and apply the correction from the from the k-faces
|
// Loop over points and apply the correction from the k-faces
|
||||||
for (label kk=0; kk<=nk; kk++)
|
for (label kk=0; kk<=nk; kk++)
|
||||||
{
|
{
|
||||||
// Process the points on the curved faces last
|
// Process the points on the curved faces last
|
||||||
label k = (kk + 1)%(nk + 1);
|
const label k = (kk + 1)%(nk + 1);
|
||||||
|
|
||||||
for (label i=0; i<=ni; i++)
|
for (label i=0; i<=ni; i++)
|
||||||
{
|
{
|
||||||
@ -348,163 +348,213 @@ void Foam::block::createPoints()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::List<Foam::FixedList<Foam::label, 8>> Foam::block::cells() const
|
void Foam::block::createCells()
|
||||||
{
|
{
|
||||||
const label ni = density().x();
|
const label ni = density().x();
|
||||||
const label nj = density().y();
|
const label nj = density().y();
|
||||||
const label nk = density().z();
|
const label nk = density().z();
|
||||||
|
|
||||||
List<FixedList<label, 8>> cells(nCells());
|
blockCells_.resize(nCells()); // (ni*nj*nk)
|
||||||
|
|
||||||
label celli = 0;
|
label celli = 0;
|
||||||
|
|
||||||
for (label k=0; k<nk; k++)
|
for (label k=0; k<nk; ++k)
|
||||||
{
|
{
|
||||||
for (label j=0; j<nj; j++)
|
for (label j=0; j<nj; ++j)
|
||||||
{
|
{
|
||||||
for (label i=0; i<ni; i++)
|
for (label i=0; i<ni; ++i)
|
||||||
{
|
{
|
||||||
cells[celli][0] = pointLabel(i, j, k);
|
blockCells_[celli][0] = pointLabel(i, j, k);
|
||||||
cells[celli][1] = pointLabel(i+1, j, k);
|
blockCells_[celli][1] = pointLabel(i+1, j, k);
|
||||||
cells[celli][2] = pointLabel(i+1, j+1, k);
|
blockCells_[celli][2] = pointLabel(i+1, j+1, k);
|
||||||
cells[celli][3] = pointLabel(i, j+1, k);
|
blockCells_[celli][3] = pointLabel(i, j+1, k);
|
||||||
cells[celli][4] = pointLabel(i, j, k+1);
|
blockCells_[celli][4] = pointLabel(i, j, k+1);
|
||||||
cells[celli][5] = pointLabel(i+1, j, k+1);
|
blockCells_[celli][5] = pointLabel(i+1, j, k+1);
|
||||||
cells[celli][6] = pointLabel(i+1, j+1, k+1);
|
blockCells_[celli][6] = pointLabel(i+1, j+1, k+1);
|
||||||
cells[celli][7] = pointLabel(i, j+1, k+1);
|
blockCells_[celli][7] = pointLabel(i, j+1, k+1);
|
||||||
|
|
||||||
celli++;
|
++celli;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return cells;
|
|
||||||
|
template<class OutputIterator>
|
||||||
|
OutputIterator Foam::block::addBoundaryFaces
|
||||||
|
(
|
||||||
|
const int shapeFacei,
|
||||||
|
OutputIterator iter
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const label ni = density().x();
|
||||||
|
const label nj = density().y();
|
||||||
|
const label nk = density().z();
|
||||||
|
|
||||||
|
switch (shapeFacei)
|
||||||
|
{
|
||||||
|
// Face 0 == x-min
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
for (label k=0; k<nk; ++k)
|
||||||
|
{
|
||||||
|
for (label j=0; j<nj; ++j)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(0, j, k);
|
||||||
|
f[1] = pointLabel(0, j, k+1);
|
||||||
|
f[2] = pointLabel(0, j+1, k+1);
|
||||||
|
f[3] = pointLabel(0, j+1, k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Face 1 == x-max
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
for (label k=0; k<nk; ++k)
|
||||||
|
{
|
||||||
|
for (label j=0; j<nj; ++j)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(ni, j, k);
|
||||||
|
f[1] = pointLabel(ni, j+1, k);
|
||||||
|
f[2] = pointLabel(ni, j+1, k+1);
|
||||||
|
f[3] = pointLabel(ni, j, k+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Face 2 == y-min
|
||||||
|
case 2:
|
||||||
|
{
|
||||||
|
for (label i=0; i<ni; ++i)
|
||||||
|
{
|
||||||
|
for (label k=0; k<nk; ++k)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(i, 0, k);
|
||||||
|
f[1] = pointLabel(i+1, 0, k);
|
||||||
|
f[2] = pointLabel(i+1, 0, k+1);
|
||||||
|
f[3] = pointLabel(i, 0, k+1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Face 3 == y-max
|
||||||
|
case 3:
|
||||||
|
{
|
||||||
|
for (label i=0; i<ni; ++i)
|
||||||
|
{
|
||||||
|
for (label k=0; k<nk; ++k)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(i, nj, k);
|
||||||
|
f[1] = pointLabel(i, nj, k+1);
|
||||||
|
f[2] = pointLabel(i+1, nj, k+1);
|
||||||
|
f[3] = pointLabel(i+1, nj, k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Face 4 == z-min
|
||||||
|
case 4:
|
||||||
|
{
|
||||||
|
for (label i=0; i<ni; ++i)
|
||||||
|
{
|
||||||
|
for (label j=0; j<nj; ++j)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(i, j, 0);
|
||||||
|
f[1] = pointLabel(i, j+1, 0);
|
||||||
|
f[2] = pointLabel(i+1, j+1, 0);
|
||||||
|
f[3] = pointLabel(i+1, j, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
// Face 5 == z-max
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
for (label i=0; i<ni; ++i)
|
||||||
|
{
|
||||||
|
for (label j=0; j<nj; ++j)
|
||||||
|
{
|
||||||
|
auto& f = *iter;
|
||||||
|
++iter;
|
||||||
|
f.resize(4);
|
||||||
|
|
||||||
|
f[0] = pointLabel(i, j, nk);
|
||||||
|
f[1] = pointLabel(i+1, j, nk);
|
||||||
|
f[2] = pointLabel(i+1, j+1, nk);
|
||||||
|
f[3] = pointLabel(i, j+1, nk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return iter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::block::createBoundary()
|
void Foam::block::createBoundary()
|
||||||
{
|
{
|
||||||
const label ni = density().x();
|
const label countx = (density().y() * density().z());
|
||||||
const label nj = density().y();
|
const label county = (density().z() * density().x());
|
||||||
const label nk = density().z();
|
const label countz = (density().x() * density().y());
|
||||||
|
|
||||||
label patchi = 0;
|
int patchi = 0;
|
||||||
label facei = 0;
|
|
||||||
|
|
||||||
// x-direction
|
// 0 == x-min
|
||||||
|
blockPatches_[patchi].resize(countx);
|
||||||
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
|
++patchi;
|
||||||
|
|
||||||
// x-min
|
// 1 == x-max
|
||||||
boundaryPatches_[patchi].setSize(nj*nk);
|
blockPatches_[patchi].resize(countx);
|
||||||
for (label k=0; k<nk; k++)
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
{
|
++patchi;
|
||||||
for (label j=0; j<nj; j++)
|
|
||||||
{
|
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(0, j, k);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(0, j, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(0, j+1, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(0, j+1, k);
|
|
||||||
|
|
||||||
facei++;
|
// 2 == y-min
|
||||||
}
|
blockPatches_[patchi].resize(county);
|
||||||
}
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
|
++patchi;
|
||||||
|
|
||||||
// x-max
|
// 3 == y-max
|
||||||
patchi++;
|
blockPatches_[patchi].resize(county);
|
||||||
facei = 0;
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
|
++patchi;
|
||||||
|
|
||||||
boundaryPatches_[patchi].setSize(nj*nk);
|
// 4 == z-min
|
||||||
|
blockPatches_[patchi].resize(countz);
|
||||||
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
|
++patchi;
|
||||||
|
|
||||||
for (label k=0; k<nk; k++)
|
// 5 == z-max
|
||||||
{
|
blockPatches_[patchi].resize(countz);
|
||||||
for (label j=0; j<nj; j++)
|
addBoundaryFaces(patchi, blockPatches_[patchi].begin());
|
||||||
{
|
++patchi;
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(ni, j, k);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(ni, j+1, k);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(ni, j+1, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(ni, j, k+1);
|
|
||||||
|
|
||||||
facei++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// y-direction
|
|
||||||
|
|
||||||
// y-min
|
|
||||||
patchi++;
|
|
||||||
facei = 0;
|
|
||||||
|
|
||||||
boundaryPatches_[patchi].setSize(ni*nk);
|
|
||||||
for (label i=0; i<ni; i++)
|
|
||||||
{
|
|
||||||
for (label k=0; k<nk; k++)
|
|
||||||
{
|
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(i, 0, k);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(i+1, 0, k);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(i+1, 0, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(i, 0, k+1);
|
|
||||||
|
|
||||||
facei++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// y-max
|
|
||||||
patchi++;
|
|
||||||
facei = 0;
|
|
||||||
|
|
||||||
boundaryPatches_[patchi].setSize(ni*nk);
|
|
||||||
|
|
||||||
for (label i=0; i<ni; i++)
|
|
||||||
{
|
|
||||||
for (label k=0; k<nk; k++)
|
|
||||||
{
|
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(i, nj, k);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(i, nj, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(i+1, nj, k+1);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(i+1, nj, k);
|
|
||||||
|
|
||||||
facei++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// z-direction
|
|
||||||
|
|
||||||
// z-min
|
|
||||||
patchi++;
|
|
||||||
facei = 0;
|
|
||||||
|
|
||||||
boundaryPatches_[patchi].setSize(ni*nj);
|
|
||||||
|
|
||||||
for (label i=0; i<ni; i++)
|
|
||||||
{
|
|
||||||
for (label j=0; j<nj; j++)
|
|
||||||
{
|
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(i, j, 0);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(i, j+1, 0);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(i+1, j+1, 0);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(i+1, j, 0);
|
|
||||||
|
|
||||||
facei++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// z-max
|
|
||||||
patchi++;
|
|
||||||
facei = 0;
|
|
||||||
|
|
||||||
boundaryPatches_[patchi].setSize(ni*nj);
|
|
||||||
|
|
||||||
for (label i=0; i<ni; i++)
|
|
||||||
{
|
|
||||||
for (label j=0; j<nj; j++)
|
|
||||||
{
|
|
||||||
boundaryPatches_[patchi][facei][0] = pointLabel(i, j, nk);
|
|
||||||
boundaryPatches_[patchi][facei][1] = pointLabel(i+1, j, nk);
|
|
||||||
boundaryPatches_[patchi][facei][2] = pointLabel(i+1, j+1, nk);
|
|
||||||
boundaryPatches_[patchi][facei][3] = pointLabel(i, j+1, nk);
|
|
||||||
|
|
||||||
facei++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
@ -29,14 +29,36 @@ License
|
|||||||
|
|
||||||
inline const Foam::pointField& Foam::block::points() const
|
inline const Foam::pointField& Foam::block::points() const
|
||||||
{
|
{
|
||||||
|
if (points_.empty())
|
||||||
|
{
|
||||||
|
const_cast<block&>(*this).createPoints();
|
||||||
|
}
|
||||||
|
|
||||||
return points_;
|
return points_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::List<Foam::FixedList<Foam::label, 8>>&
|
||||||
|
Foam::block::cells() const
|
||||||
|
{
|
||||||
|
if (blockCells_.empty())
|
||||||
|
{
|
||||||
|
const_cast<block&>(*this).createCells();
|
||||||
|
}
|
||||||
|
|
||||||
|
return blockCells_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::FixedList<Foam::List<Foam::FixedList<Foam::label, 4>>, 6>&
|
inline const Foam::FixedList<Foam::List<Foam::FixedList<Foam::label, 4>>, 6>&
|
||||||
Foam::block::boundaryPatches() const
|
Foam::block::boundaryPatches() const
|
||||||
{
|
{
|
||||||
return boundaryPatches_;
|
if (blockPatches_.empty())
|
||||||
|
{
|
||||||
|
const_cast<block&>(*this).createBoundary();
|
||||||
|
}
|
||||||
|
|
||||||
|
return blockPatches_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -34,7 +34,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
namespace blocks
|
namespace blocks
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(namedBlock, 0);
|
defineTypeName(namedBlock);
|
||||||
addToRunTimeSelectionTable(block, namedBlock, Istream);
|
addToRunTimeSelectionTable(block, namedBlock, Istream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -57,6 +57,7 @@ Foam::blocks::namedBlock::namedBlock
|
|||||||
{
|
{
|
||||||
dictionary& d = const_cast<dictionary&>(dict);
|
dictionary& d = const_cast<dictionary&>(dict);
|
||||||
dictionary* varDictPtr = d.findDict("namedBlocks");
|
dictionary* varDictPtr = d.findDict("namedBlocks");
|
||||||
|
|
||||||
if (varDictPtr)
|
if (varDictPtr)
|
||||||
{
|
{
|
||||||
varDictPtr->add(*this, index);
|
varDictPtr->add(*this, index);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2016 OpenFOAM Foundation
|
| Copyright (C) 2016 OpenFOAM Foundation
|
||||||
@ -58,12 +58,12 @@ class namedBlock
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("name");
|
TypeNameNoDebug("name");
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from Istream setting pointsList
|
//- Construct from Istream setting points list
|
||||||
namedBlock
|
namedBlock
|
||||||
(
|
(
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
@ -76,8 +76,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~namedBlock()
|
virtual ~namedBlock() = default;
|
||||||
{}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015 OpenFOAM Foundation
|
| Copyright (C) 2015 OpenFOAM Foundation
|
||||||
@ -57,8 +57,8 @@ Foam::gradingDescriptor::gradingDescriptor
|
|||||||
const scalar expansionRatio
|
const scalar expansionRatio
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
blockFraction_(1.0),
|
blockFraction_(1),
|
||||||
nDivFraction_(1.0),
|
nDivFraction_(1),
|
||||||
expansionRatio_(expansionRatio)
|
expansionRatio_(expansionRatio)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -69,12 +69,6 @@ Foam::gradingDescriptor::gradingDescriptor(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::gradingDescriptor::~gradingDescriptor()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::gradingDescriptor Foam::gradingDescriptor::inv() const
|
Foam::gradingDescriptor Foam::gradingDescriptor::inv() const
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015 OpenFOAM Foundation
|
| Copyright (C) 2015 OpenFOAM Foundation
|
||||||
@ -68,7 +68,7 @@ Ostream& operator<<(Ostream&, const gradingDescriptor&);
|
|||||||
|
|
||||||
class gradingDescriptor
|
class gradingDescriptor
|
||||||
{
|
{
|
||||||
// Private data
|
// Private Data
|
||||||
|
|
||||||
scalar blockFraction_;
|
scalar blockFraction_;
|
||||||
scalar nDivFraction_;
|
scalar nDivFraction_;
|
||||||
@ -94,46 +94,42 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from expansionRatio
|
//- Construct from expansionRatio
|
||||||
gradingDescriptor
|
explicit gradingDescriptor(const scalar expansionRatio);
|
||||||
(
|
|
||||||
const scalar expansionRatio
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
gradingDescriptor(Istream&);
|
explicit gradingDescriptor(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~gradingDescriptor();
|
~gradingDescriptor() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
scalar blockFraction() const
|
scalar blockFraction() const
|
||||||
{
|
{
|
||||||
return blockFraction_;
|
return blockFraction_;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar nDivFraction() const
|
scalar nDivFraction() const
|
||||||
{
|
{
|
||||||
return nDivFraction_;
|
return nDivFraction_;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar expansionRatio() const
|
scalar expansionRatio() const
|
||||||
{
|
{
|
||||||
return expansionRatio_;
|
return expansionRatio_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
// Member functions
|
|
||||||
|
|
||||||
//- Return the inverse gradingDescriptor with 1/expansionRatio
|
//- Return the inverse gradingDescriptor with 1/expansionRatio
|
||||||
gradingDescriptor inv() const;
|
gradingDescriptor inv() const;
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
// Member Operators
|
||||||
|
|
||||||
bool operator==(const gradingDescriptor&) const;
|
bool operator==(const gradingDescriptor&) const;
|
||||||
bool operator!=(const gradingDescriptor&) const;
|
bool operator!=(const gradingDescriptor&) const;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd |
|
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2015 OpenFOAM Foundation
|
| Copyright (C) 2015 OpenFOAM Foundation
|
||||||
@ -31,7 +31,7 @@ License
|
|||||||
|
|
||||||
Foam::gradingDescriptors::gradingDescriptors()
|
Foam::gradingDescriptors::gradingDescriptors()
|
||||||
:
|
:
|
||||||
List<gradingDescriptor>(1, gradingDescriptor())
|
gradingDescriptors(gradingDescriptor())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,12 +46,11 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
class Istream;
|
// Forward declarations
|
||||||
class Ostream;
|
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
|
||||||
class gradingDescriptors;
|
class gradingDescriptors;
|
||||||
Istream& operator>>(Istream&, gradingDescriptors&);
|
|
||||||
|
class Istream;
|
||||||
|
Istream& operator>>(Istream& is, gradingDescriptors& gd);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class gradingDescriptors Declaration
|
Class gradingDescriptors Declaration
|
||||||
@ -61,7 +60,6 @@ class gradingDescriptors
|
|||||||
:
|
:
|
||||||
public List<gradingDescriptor>
|
public List<gradingDescriptor>
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -73,7 +71,7 @@ public:
|
|||||||
gradingDescriptors(const gradingDescriptor& gd);
|
gradingDescriptors(const gradingDescriptor& gd);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member Functions
|
||||||
|
|
||||||
//- Return the inverse gradingDescriptors with 1/expansionRatio
|
//- Return the inverse gradingDescriptors with 1/expansionRatio
|
||||||
gradingDescriptors inv() const;
|
gradingDescriptors inv() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user