Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
54ac451b
Commit
54ac451b
authored
Dec 17, 2018
by
Mark Olesen
Browse files
ENH: add -dict option for mirrorMesh
parent
c4ec4121
Changes
8
Hide whitespace changes
Inline
Side-by-side
applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.C
View file @
54ac451b
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017
-2018
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -31,24 +31,37 @@ License
Foam
::
mirrorFvMesh
::
mirrorFvMesh
(
const
IOobject
&
io
)
:
fvMesh
(
io
),
mirrorMeshDict_
mirrorFvMesh
(
IOobject
io
,
IOdictionary
(
"mirrorMeshDict"
,
time
().
system
(),
*
this
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
IOobject
(
"mirrorMeshDict"
,
io
.
time
().
system
(),
io
.
time
(),
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
)
)
)
{}
Foam
::
mirrorFvMesh
::
mirrorFvMesh
(
const
IOobject
&
io
,
const
IOdictionary
&
mirrorDict
)
:
fvMesh
(
io
)
{
plane
mirrorPlane
(
mirror
Mesh
Dict
_
);
plane
mirrorPlane
(
mirrorDict
);
const
scalar
planeTolerance
(
mirror
Mesh
Dict
_
.
get
<
scalar
>
(
"planeTolerance"
)
mirrorDict
.
get
<
scalar
>
(
"planeTolerance"
)
);
const
pointField
&
oldPoints
=
points
();
...
...
@@ -57,6 +70,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
const
label
nOldInternalFaces
=
nInternalFaces
();
const
polyPatchList
&
oldPatches
=
boundaryMesh
();
Info
<<
"Mirroring mesh at origin:"
<<
mirrorPlane
.
origin
()
<<
" normal:"
<<
mirrorPlane
.
normal
()
<<
nl
;
// Mirror the points
Info
<<
"Mirroring points. Old points: "
<<
oldPoints
.
size
();
...
...
@@ -66,15 +82,15 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
labelList
mirrorPointLookup
(
oldPoints
.
size
(),
-
1
);
// Grab the old points
for
All
(
oldPoints
,
p
oint
i
)
for
(
const
point
&
pt
:
oldP
oint
s
)
{
newPoints
[
nNewPoints
]
=
oldPoints
[
pointi
]
;
nNewPoints
++
;
newPoints
[
nNewPoints
]
=
pt
;
++
nNewPoints
;
}
forAll
(
oldPoints
,
pointi
)
{
scalar
alpha
=
const
scalar
alpha
=
mirrorPlane
.
normalIntersect
(
oldPoints
[
pointi
],
...
...
@@ -121,7 +137,6 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
}
Info
<<
"Mirroring faces. Old faces: "
<<
oldFaces
.
size
();
// Algorithm:
...
...
@@ -325,7 +340,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
Info
<<
"Mirroring patches. Old patches: "
<<
boundary
().
size
()
<<
" New patches: "
<<
boundary
().
size
()
<<
endl
;
Info
<<
"Mirroring cells.
Old cells: "
<<
oldCells
.
size
()
Info
<<
"Mirroring cells. Old cells: "
<<
oldCells
.
size
()
<<
" New cells: "
<<
2
*
oldCells
.
size
()
<<
endl
;
cellList
newCells
(
2
*
oldCells
.
size
());
...
...
applications/utilities/mesh/manipulation/mirrorMesh/mirrorFvMesh.H
View file @
54ac451b
...
...
@@ -51,9 +51,6 @@ class mirrorFvMesh
{
// Private data
//- Mirror dictionary
IOdictionary
mirrorMeshDict_
;
//- Mirrored mesh
autoPtr
<
fvMesh
>
mirrorMeshPtr_
;
...
...
@@ -77,8 +74,11 @@ public:
// Constructors
//- Construct from IOobject
mirrorFvMesh
(
const
IOobject
&
io
);
//- Construct from IOobject, using system mirrorMeshDict
explicit
mirrorFvMesh
(
const
IOobject
&
io
);
//- Construct from IOobject and specified mirrorMeshDict
mirrorFvMesh
(
const
IOobject
&
io
,
const
IOdictionary
&
mirrorDict
);
//- Destructor
...
...
applications/utilities/mesh/manipulation/mirrorMesh/mirrorMesh.C
View file @
54ac451b
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation |
Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -49,12 +49,25 @@ int main(int argc, char *argv[])
"Mirrors a mesh around a given plane."
);
#include "addDictOption.H"
// Adjust the help text
argList
::
addUsage
(
"dict"
,
"Specify alternative mirrorMeshDict"
);
argList
::
setAdvanced
(
"decomposeParDict"
);
#include "addOverwriteOption.H"
#include "setRootCase.H"
#include "createTime.H"
const
bool
overwrite
=
args
.
found
(
"overwrite"
);
const
word
dictName
(
"mirrorMeshDict"
);
#include "setSystemRunTimeDictionaryIO.H"
Info
<<
"Reading "
<<
dictName
<<
"
\n
"
<<
endl
;
const
IOdictionary
mirrorDict
(
dictIO
);
mirrorFvMesh
mesh
(
IOobject
...
...
@@ -62,7 +75,8 @@ int main(int argc, char *argv[])
mirrorFvMesh
::
defaultRegion
,
runTime
.
constant
(),
runTime
)
),
mirrorDict
);
hexRef8Data
refData
...
...
etc/config.sh/completion_cache
View file @
54ac451b
...
...
@@ -138,7 +138,7 @@ _of_complete_cache_[mergeOrSplitBaffles]="-case -decomposeParDict -dict -fileHan
_of_complete_cache_[mergeSurfacePatches]
=
"-case -fileHandler -output -patchIdRange -patchIds -patchNames | -keep -noFunctionObjects -doc -doc-source -help"
_of_complete_cache_[meshToFPMA]
=
"-case -decomposeParDict -fileHandler | -noFunctionObjects -parallel -doc -doc-source -help"
_of_complete_cache_[mhdFoam]
=
"-case -decomposeParDict -fileHandler | -dry-run -dry-run-write -listFunctionObjects -listRegisteredSwitches -listScalarBCs -listSwitches -listUnsetSwitches -listVectorBCs -noFunctionObjects -parallel -postProcess -doc -doc-source -help"
_of_complete_cache_[mirrorMesh]
=
"-case -decomposeParDict -fileHandler | -noFunctionObjects -overwrite -parallel -doc -doc-source -help"
_of_complete_cache_[mirrorMesh]
=
"-case
-dict
-decomposeParDict -fileHandler | -noFunctionObjects -overwrite -parallel -doc -doc-source -help"
_of_complete_cache_[mixtureAdiabaticFlameT]
=
"-case -fileHandler | -doc -doc-source -help"
_of_complete_cache_[modifyMesh]
=
"-case -decomposeParDict -dict -fileHandler | -overwrite -parallel -doc -doc-source -help"
_of_complete_cache_[moveDynamicMesh]
=
"-case -decomposeParDict -fileHandler -region | -checkAMI -noFunctionObjects -parallel -doc -doc-source -help"
...
...
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/Allrun.pre
View file @
54ac451b
...
...
@@ -5,13 +5,8 @@ cd ${0%/*} || exit 1 # Run from this directory
runApplication blockMesh
runApplication transformPoints
-scale
'(1.6666 1 1)'
runApplication changeDictionary
-instance
system
-dict
system/changeDictionaryDict.X
runApplication mirrorMesh
-overwrite
rm
-f
log.mirrorMesh
rm
-f
log.changeDictionary
runApplication changeDictionary
-instance
system
-dict
system/changeDictionaryDict.Y
runApplication mirrorMesh
-overwrite
runApplication
-s
xplane mirrorMesh
-dict
system/mirrorMeshDict.X
-overwrite
runApplication
-s
yplane mirrorMesh
-dict
system/mirrorMeshDict.Y
-overwrite
restore0Dir
...
...
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/system/mirrorMeshDict
View file @
54ac451b
...
...
@@ -10,7 +10,6 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
location "system";
object mirrorMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -20,10 +19,9 @@ planeType pointAndNormal;
pointAndNormalDict
{
point (0 0 0);
normal (0 -1
0
);
normal (0
0
-1);
}
planeTolerance 1e-06;
planeTolerance 1e-6;
// ************************************************************************* //
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/system/
changeDictionary
Dict.X
→
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/system/
mirrorMesh
Dict.X
View file @
54ac451b
...
...
@@ -10,17 +10,18 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
object
changeDictionary
Dict;
object
mirrorMesh
Dict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
mirrorMeshDict
planeType pointAndNormal;
pointAndNormalDict
{
pointAndNormalDict
{
point (0 0 0);
normal (-1 0 0);
}
point (0 0 0);
normal (-1 0 0);
}
planeTolerance 1e-6;
// ************************************************************************* //
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/system/
changeDictionary
Dict.Y
→
tutorials/incompressible/pimpleFoam/RAS/ellipsekkLOmega/system/
mirrorMesh
Dict.Y
View file @
54ac451b
...
...
@@ -10,17 +10,18 @@ FoamFile
version 2.0;
format ascii;
class dictionary;
object
changeDictionary
Dict;
object
mirrorMesh
Dict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
mirrorMeshDict
planeType pointAndNormal;
pointAndNormalDict
{
pointAndNormalDict
{
point (0 0 0);
normal (0 -1 0);
}
point (0 0 0);
normal (0 -1 0);
}
planeTolerance 1e-6;
// ************************************************************************* //
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment