mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support regions for PV3blockMeshReader
This commit is contained in:
@ -148,6 +148,8 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
|
|||||||
reader_(reader),
|
reader_(reader),
|
||||||
dbPtr_(NULL),
|
dbPtr_(NULL),
|
||||||
meshPtr_(NULL),
|
meshPtr_(NULL),
|
||||||
|
meshRegion_(polyMesh::defaultRegion),
|
||||||
|
meshDir_(polyMesh::meshSubDir),
|
||||||
arrayRangeBlocks_("block"),
|
arrayRangeBlocks_("block"),
|
||||||
arrayRangeEdges_("edges"),
|
arrayRangeEdges_("edges"),
|
||||||
arrayRangeCorners_("corners")
|
arrayRangeCorners_("corners")
|
||||||
@ -188,6 +190,28 @@ Foam::vtkPV3blockMesh::vtkPV3blockMesh
|
|||||||
// could be stringent and insist the prefix match the directory name...
|
// could be stringent and insist the prefix match the directory name...
|
||||||
// Note: cannot use fileName::name() due to the embedded '{}'
|
// Note: cannot use fileName::name() due to the embedded '{}'
|
||||||
string caseName(fileName(FileName).lessExt());
|
string caseName(fileName(FileName).lessExt());
|
||||||
|
string::size_type beg = caseName.find_last_of("/{");
|
||||||
|
string::size_type end = caseName.find('}', beg);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
beg != string::npos && caseName[beg] == '{'
|
||||||
|
&& end != string::npos && end == caseName.size()-1
|
||||||
|
)
|
||||||
|
{
|
||||||
|
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
||||||
|
|
||||||
|
// some safety
|
||||||
|
if (meshRegion_.empty())
|
||||||
|
{
|
||||||
|
meshRegion_ = polyMesh::defaultRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (meshRegion_ != polyMesh::defaultRegion)
|
||||||
|
{
|
||||||
|
meshDir_ = meshRegion_/polyMesh::meshSubDir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -313,7 +337,7 @@ void Foam::vtkPV3blockMesh::updateFoamMesh()
|
|||||||
(
|
(
|
||||||
"blockMeshDict",
|
"blockMeshDict",
|
||||||
dbPtr_().constant(),
|
dbPtr_().constant(),
|
||||||
polyMesh::meshSubDir,
|
meshDir_,
|
||||||
dbPtr_(),
|
dbPtr_(),
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
@ -321,7 +345,7 @@ void Foam::vtkPV3blockMesh::updateFoamMesh()
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
meshPtr_ = new blockMesh(meshDict, polyMesh::defaultRegion);
|
meshPtr_ = new blockMesh(meshDict, meshRegion_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -173,6 +173,12 @@ class vtkPV3blockMesh
|
|||||||
//- OpenFOAM mesh
|
//- OpenFOAM mesh
|
||||||
blockMesh* meshPtr_;
|
blockMesh* meshPtr_;
|
||||||
|
|
||||||
|
//- The mesh region
|
||||||
|
word meshRegion_;
|
||||||
|
|
||||||
|
//- The mesh directory for the region
|
||||||
|
fileName meshDir_;
|
||||||
|
|
||||||
//- Selected geometrical parts
|
//- Selected geometrical parts
|
||||||
boolList blockStatus_;
|
boolList blockStatus_;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user