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
193feb95
Commit
193feb95
authored
Apr 05, 2013
by
andy
Browse files
ENH: Added lookupRe function
parent
f66f9e9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOobjectList/IOobjectList.C
View file @
193feb95
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -148,6 +148,27 @@ Foam::IOobject* Foam::IOobjectList::lookup(const word& name) const
}
Foam
::
IOobjectList
Foam
::
IOobjectList
::
lookupRe
(
const
wordRe
&
name
)
const
{
IOobjectList
objectsOfName
(
size
());
forAllConstIter
(
HashPtrTable
<
IOobject
>
,
*
this
,
iter
)
{
if
(
name
.
match
(
iter
()
->
name
()))
{
if
(
IOobject
::
debug
)
{
Info
<<
"IOobjectList::lookupRe : found "
<<
iter
.
key
()
<<
endl
;
}
objectsOfName
.
insert
(
iter
.
key
(),
new
IOobject
(
*
iter
()));
}
}
return
objectsOfName
;
}
Foam
::
IOobjectList
Foam
::
IOobjectList
::
lookupClass
(
const
word
&
ClassName
)
const
{
IOobjectList
objectsOfClass
(
size
());
...
...
src/OpenFOAM/db/IOobjectList/IOobjectList.H
View file @
193feb95
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -44,7 +44,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class IOobjectList Declaration
Class IOobjectList Declaration
\*---------------------------------------------------------------------------*/
class
IOobjectList
...
...
@@ -91,6 +91,9 @@ public:
//- Lookup a given name and return IOobject ptr if found else NULL
IOobject
*
lookup
(
const
word
&
name
)
const
;
//- Return the list for all IOobects whose name matches name
IOobjectList
lookupRe
(
const
wordRe
&
name
)
const
;
//- Return the list for all IOobjects of a given class
IOobjectList
lookupClass
(
const
word
&
className
)
const
;
...
...
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