OpenFOAM: API Guide
v2112
The open source CFD toolbox
cleanMeshDirectory.H
Go to the documentation of this file.
1
/*---------------------------------------------------------------------------*\
2
========= |
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
\\ / O peration |
5
\\ / A nd | www.openfoam.com
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
Copyright (C) 2020-2022 OpenCFD Ltd.
9
-------------------------------------------------------------------------------
10
License
11
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
12
13
Description
14
Removal of polyMesh directory
15
16
\*---------------------------------------------------------------------------*/
17
18
{
19
// Shadows enclosing parameter (dictName)
20
const
word blockMeshDictName(
"blockMeshDict"
);
21
const
word&
regionDir
= polyMesh::regionName(
regionName
);
22
23
const
fileName
polyMeshPath
24
(
25
runTime
.path()/meshInstance/
regionDir
/polyMesh::meshSubDir
26
);
27
28
if
(
exists
(
polyMeshPath
))
29
{
30
if
(exists(
polyMeshPath
/blockMeshDictName))
31
{
32
Info<<
"Not deleting polyMesh directory "
33
<<
runTime
.relativePath(
polyMeshPath
) << nl
34
<<
" because it contains "
<< blockMeshDictName << endl;
35
}
36
else
37
{
38
Info<<
"Deleting polyMesh directory "
39
<<
runTime
.relativePath(
polyMeshPath
) << endl;
40
rmDir(
polyMeshPath
);
41
}
42
}
43
}
44
45
46
// ************************************************************************* //
regionDir
const word & regionDir
Definition:
cleanMeshDirectory.H:30
polyMeshPath
const fileName polyMeshPath(runTime.path()/meshInstance/regionDir/polyMesh::meshSubDir)
runTime
engineTime & runTime
Definition:
createEngineTime.H:13
regionName
Foam::word regionName(Foam::polyMesh::defaultRegion)
Foam::exists
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
Definition:
MSwindows.C:633
applications
utilities
mesh
generation
PDRblockMesh
cleanMeshDirectory.H
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.