Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
c2debedd
Commit
c2debedd
authored
Jan 24, 2019
by
mattijs
Browse files
ENH: changeDictionary: allow removal of patches (!). Fixes
#1179
.
parent
a0fe0497
Changes
1
Hide whitespace changes
Inline
Side-by-side
applications/utilities/preProcessing/changeDictionary/changeDictionary.C
View file @
c2debedd
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016
-2019
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -628,29 +628,31 @@ int main(int argc, char *argv[])
wordList
doneKeys
(
dictList
.
size
());
label
nEntries
=
fieldDict
.
size
();
nEntries
=
0
;
forAll
(
dictList
,
i
)
{
doneKeys
[
i
]
=
dictList
[
i
].
keyword
();
dictList
.
set
const
entry
*
ePtr
=
fieldDict
.
findEntry
(
i
,
fieldDict
.
lookupEntry
(
doneKeys
[
i
],
keyType
::
REGEX
).
clone
()
doneKeys
[
i
],
keyType
::
REGEX
);
fieldDict
.
remove
(
doneKeys
[
i
]);
// Check that it hasn't been removed from fieldDict
if
(
ePtr
)
{
dictList
.
set
(
nEntries
++
,
ePtr
->
clone
());
fieldDict
.
remove
(
doneKeys
[
i
]);
}
}
// Add remaining entries
label
sz
=
dictList
.
size
();
dictList
.
setSize
(
nEntries
);
for
(
const
entry
&
e
:
fieldDict
)
{
dictList
.
set
(
s
z
++
,
e
.
clone
());
dictList
.
set
(
nEntrie
s
++
,
e
.
clone
());
}
dictList
.
setSize
(
nEntries
);
Info
<<
"Writing modified "
<<
fieldName
<<
endl
;
dictList
.
writeObject
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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