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
HPCAPPs
OpenFOAM-GPU-v2.0
Commits
55e5a777
Commit
55e5a777
authored
Oct 17, 2024
by
shunbo
Browse files
initial commit
parents
Changes
677
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1131 additions
and
0 deletions
+1131
-0
OpenFOAM-v2112/applications/test/OListStream/Test-OListStream.C
...AM-v2112/applications/test/OListStream/Test-OListStream.C
+232
-0
OpenFOAM-v2112/applications/test/OSspecific/Make/files
OpenFOAM-v2112/applications/test/OSspecific/Make/files
+3
-0
OpenFOAM-v2112/applications/test/OSspecific/Make/options
OpenFOAM-v2112/applications/test/OSspecific/Make/options
+2
-0
OpenFOAM-v2112/applications/test/OSspecific/Test-OSspecific.C
...FOAM-v2112/applications/test/OSspecific/Test-OSspecific.C
+61
-0
OpenFOAM-v2112/applications/test/OStringStream/Make/files
OpenFOAM-v2112/applications/test/OStringStream/Make/files
+3
-0
OpenFOAM-v2112/applications/test/OStringStream/Make/options
OpenFOAM-v2112/applications/test/OStringStream/Make/options
+2
-0
OpenFOAM-v2112/applications/test/OStringStream/Test-OStringStream.C
...2112/applications/test/OStringStream/Test-OStringStream.C
+69
-0
OpenFOAM-v2112/applications/test/OTstream/Make/files
OpenFOAM-v2112/applications/test/OTstream/Make/files
+3
-0
OpenFOAM-v2112/applications/test/OTstream/Make/options
OpenFOAM-v2112/applications/test/OTstream/Make/options
+2
-0
OpenFOAM-v2112/applications/test/OTstream/Test-OTstream.C
OpenFOAM-v2112/applications/test/OTstream/Test-OTstream.C
+142
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/files
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/files
+3
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/options
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/options
+6
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/Test-PDRblockMesh.C
...-v2112/applications/test/PDRblockMesh/Test-PDRblockMesh.C
+243
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/PDRblockMeshDict
...plications/test/PDRblockMesh/box0/system/PDRblockMeshDict
+78
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/controlDict
...12/applications/test/PDRblockMesh/box0/system/controlDict
+51
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/fvSchemes
...2112/applications/test/PDRblockMesh/box0/system/fvSchemes
+37
-0
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/fvSolution
...112/applications/test/PDRblockMesh/box0/system/fvSolution
+18
-0
OpenFOAM-v2112/applications/test/PackedList/Make/files
OpenFOAM-v2112/applications/test/PackedList/Make/files
+3
-0
OpenFOAM-v2112/applications/test/PackedList/Make/options
OpenFOAM-v2112/applications/test/PackedList/Make/options
+6
-0
OpenFOAM-v2112/applications/test/PackedList/Test-PackedList.C
...FOAM-v2112/applications/test/PackedList/Test-PackedList.C
+167
-0
No files found.
Too many changes to show.
To preserve performance only
677 of 677+
files are displayed.
Plain diff
Email patch
OpenFOAM-v2112/applications/test/OListStream/Test-OListStream.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2017-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "ListStream.H"
#include "wordList.H"
#include "IOstreams.H"
#include "argList.H"
using
namespace
Foam
;
Ostream
&
toString
(
Ostream
&
os
,
const
UList
<
char
>&
list
)
{
os
<<
'"'
;
for
(
const
char
c
:
list
)
{
os
<<
c
;
}
os
<<
'"'
;
return
os
;
}
template
<
class
BufType
>
void
printInfo
(
const
BufType
&
buf
)
{
Info
<<
nl
<<
"========================="
<<
endl
;
buf
.
print
(
Info
);
toString
(
Info
,
buf
.
list
());
Info
<<
nl
<<
"========================="
<<
endl
;
}
void
printTokens
(
Istream
&
is
)
{
label
count
=
0
;
token
t
;
while
(
is
.
good
())
{
is
>>
t
;
if
(
t
.
good
())
{
++
count
;
Info
<<
"token: "
<<
t
<<
endl
;
}
}
Info
<<
count
<<
" tokens"
<<
endl
;
}
// Generate some dictionary-like content
template
<
class
OS
>
void
outputDict
(
OS
&
os
)
{
os
.
beginBlock
(
"testDict"
);
os
.
writeEntry
(
"bool"
,
"false"
);
os
.
writeEntry
(
"scalar"
,
3
.
14159
);
os
.
endBlock
();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
// Buffer storage
DynamicList
<
char
>
storage
(
16
);
OListStream
obuf
(
std
::
move
(
storage
));
obuf
.
setBlockSize
(
100
);
printInfo
(
obuf
);
// Fill with some content
for
(
label
i
=
0
;
i
<
50
;
++
i
)
{
obuf
<<
1002
<<
" "
<<
"abcd"
<<
" "
<<
"def"
<<
" "
<<
3
.
14159
<<
";
\n
"
;
}
printInfo
(
obuf
);
obuf
.
rewind
();
printInfo
(
obuf
);
for
(
label
i
=
0
;
i
<
10
;
++
i
)
{
obuf
<<
"item"
<<
i
<<
"
\n
"
;
}
printInfo
(
obuf
);
obuf
.
shrink
();
Info
<<
"after shrink"
<<
nl
;
printInfo
(
obuf
);
// Add some more
for
(
label
i
=
10
;
i
<
15
;
++
i
)
{
obuf
<<
"more"
<<
i
<<
nl
;
}
Info
<<
"appended more"
<<
nl
;
printInfo
(
obuf
);
// Overwrite at some position
obuf
.
stdStream
().
rdbuf
()
->
pubseekpos
(
0
.
60
*
obuf
.
size
());
obuf
<<
"<"
<<
nl
<<
"OVERWRITE"
<<
nl
;
Info
<<
"after overwrite"
<<
nl
;
printInfo
(
obuf
);
Info
<<
"transfer contents to a List or IListStream"
<<
nl
;
IListStream
ibuf
;
// Reclaim data storage from OListStream -> IListStream
{
List
<
char
>
data
;
obuf
.
swap
(
data
);
ibuf
.
swap
(
data
);
}
Info
<<
"original:"
;
printInfo
(
obuf
);
Info
<<
"new input:"
<<
nl
;
printInfo
(
ibuf
);
printTokens
(
ibuf
);
// Create from other storage types
DynamicList
<
char
>
written
;
Info
<<
nl
;
{
Info
<<
"create std::move(List)"
<<
endl
;
List
<
char
>
list
(
16
,
'A'
);
Info
<<
"input:"
;
toString
(
Info
,
list
)
<<
endl
;
OListStream
buf1
(
std
::
move
(
list
));
Info
<<
"orig:"
;
toString
(
Info
,
list
)
<<
endl
;
printInfo
(
buf1
);
for
(
label
i
=
0
;
i
<
26
;
++
i
)
{
buf1
<<
char
(
'A'
+
i
);
}
for
(
label
i
=
0
;
i
<
26
;
++
i
)
{
buf1
<<
char
(
'a'
+
i
);
}
Info
<<
"orig:"
;
toString
(
Info
,
list
)
<<
endl
;
printInfo
(
buf1
);
// Move back to written
buf1
.
swap
(
written
);
printInfo
(
buf1
);
}
Info
<<
"'captured' content "
;
toString
(
Info
,
written
);
Info
<<
nl
<<
"content size="
<<
written
.
size
()
<<
" capacity="
<<
written
.
capacity
()
<<
nl
;
Info
<<
nl
<<
"Test dictionary"
<<
nl
;
{
OListStream
os1
;
outputDict
(
os1
);
Info
<<
"Regular"
<<
nl
;
printInfo
(
os1
);
}
{
OListStream
os2
;
os2
.
indentSize
(
0
);
outputDict
(
os2
);
Info
<<
"Compact"
<<
nl
;
printInfo
(
os2
);
}
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/OSspecific/Make/files
0 → 100644
View file @
55e5a777
Test-OSspecific.C
EXE = $(FOAM_USER_APPBIN)/Test-OSspecific
OpenFOAM-v2112/applications/test/OSspecific/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
OpenFOAM-v2112/applications/test/OSspecific/Test-OSspecific.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Report some basic os-specific values
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
Info
<<
"Report some basic OS-specific values"
<<
nl
;
Info
<<
nl
<<
"host : "
<<
hostName
()
<<
nl
<<
"user : "
<<
userName
()
<<
nl
<<
"home : "
<<
home
()
<<
nl
;
Info
<<
nl
<<
"cwd : "
<<
cwd
()
<<
nl
<<
"cwd -P : "
<<
cwd
(
false
)
<<
nl
<<
"cwd -L : "
<<
cwd
(
true
)
<<
nl
;
Info
<<
nl
<<
"libs : "
<<
dlLoaded
()
<<
nl
;
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/OStringStream/Make/files
0 → 100644
View file @
55e5a777
Test-OStringStream.C
EXE = $(FOAM_USER_APPBIN)/Test-OStringStream
OpenFOAM-v2112/applications/test/OStringStream/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
OpenFOAM-v2112/applications/test/OStringStream/Test-OStringStream.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "IOstreams.H"
#include "StringStream.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
Info
<<
"Begin test OStringStream"
<<
endl
;
OStringStream
os
;
os
<<
"output with some values "
<<
1
<<
" entry"
<<
endl
;
Info
<<
"contains:"
<<
nl
<<
os
.
str
()
<<
endl
;
os
.
rewind
();
Info
<<
"after rewind:"
<<
nl
<<
os
.
str
()
<<
endl
;
os
<<
"####"
;
Info
<<
"overwrite with short string:"
<<
nl
<<
os
.
str
()
<<
endl
;
os
.
reset
();
os
<<
"%%%% reset"
;
Info
<<
"after reset:"
<<
nl
<<
os
.
str
()
<<
endl
;
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/OTstream/Make/files
0 → 100644
View file @
55e5a777
Test-OTstream.C
EXE = $(FOAM_USER_APPBIN)/Test-OTstream
OpenFOAM-v2112/applications/test/OTstream/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/OTstream/Test-OTstream.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
\*---------------------------------------------------------------------------*/
#include "ITstream.H"
#include "OTstream.H"
#include "primitiveFields.H"
#include "argList.H"
using
namespace
Foam
;
void
printTokens
(
const
UList
<
token
>&
toks
)
{
label
count
=
0
;
for
(
const
token
&
t
:
toks
)
{
Info
<<
"token: "
<<
t
.
info
()
<<
nl
;
++
count
;
}
Info
<<
count
<<
" tokens"
<<
nl
<<
endl
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
// Test fields
{
scalarField
fld1
({
1
,
2
,
3
,
4
});
OTstream
os
;
fld1
.
writeEntry
(
"field"
,
os
);
Info
<<
"Field: "
<<
fld1
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
{
scalarField
fld1
(
10
,
scalar
(
5
));
OTstream
os
;
fld1
.
writeEntry
(
"field"
,
os
);
Info
<<
"Field: "
<<
fld1
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
{
vector
val
(
1
,
2
,
3
);
OTstream
os
;
os
<<
val
;
Info
<<
"Value: "
<<
val
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
{
bool
val
(
true
);
OTstream
os
;
os
<<
val
;
Info
<<
"Value: "
<<
val
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
{
tensorField
fld1
(
1
,
tensor
::
I
);
OTstream
os
;
fld1
.
writeEntry
(
"field"
,
os
);
Info
<<
"Field: "
<<
fld1
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
{
labelList
fld1
(
identity
(
5
));
OTstream
os
;
fld1
.
writeEntry
(
"field"
,
os
);
Info
<<
"Field: "
<<
fld1
<<
nl
<<
"Tokens: "
<<
flatOutput
(
os
)
<<
nl
;
printTokens
(
os
);
}
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/files
0 → 100644
View file @
55e5a777
Test-PDRblockMesh.C
EXE = $(FOAM_USER_APPBIN)/Test-PDRblockMesh
OpenFOAM-v2112/applications/test/PDRblockMesh/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-DFULLDEBUG \
-I$(LIB_SRC)/mesh/blockMesh/lnInclude
EXE_LIBS = \
-lblockMesh
OpenFOAM-v2112/applications/test/PDRblockMesh/Test-PDRblockMesh.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Test accessors for PDRblock
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "PDRblock.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noParallel
();
argList
::
noFunctionObjects
();
argList
::
addOption
(
"dict"
,
"file"
,
"Alternative PDRblockMeshDict"
);
#include "setRootCase.H"
#include "createTime.H"
const
word
dictName
(
"PDRblockMeshDict"
);
#include "setSystemRunTimeDictionaryIO.H"
Info
<<
"Reading "
<<
dictIO
.
name
()
<<
nl
<<
endl
;
IOdictionary
meshDict
(
dictIO
);
PDRblock
mesh
(
meshDict
,
true
);
// Write summary
Info
<<
"----------------"
<<
nl
<<
"Mesh Information"
<<
nl
<<
"----------------"
<<
nl
<<
" "
<<
"bounds: "
<<
mesh
.
bounds
()
<<
nl
<<
" "
<<
"nPoints: "
<<
mesh
.
nPoints
()
<<
" "
<<
(
mesh
.
sizes
()
+
labelVector
::
one
)
<<
nl
<<
" "
<<
"nCells: "
<<
mesh
.
nCells
()
<<
" "
<<
mesh
.
sizes
()
<<
nl
<<
" "
<<
"nFaces: "
<<
mesh
.
nFaces
()
<<
nl
<<
" "
<<
"nInternalFaces: "
<<
mesh
.
nInternalFaces
()
<<
nl
;
Info
<<
"----------------"
<<
nl
<<
"Addressing"
<<
nl
<<
"----------------"
<<
nl
<<
" "
<<
"volume: "
<<
mesh
.
bounds
().
volume
()
<<
nl
<<
" "
<<
"avg-vol: "
<<
(
mesh
.
bounds
().
volume
()
/
mesh
.
nCells
())
<<
nl
;
Info
<<
nl
<<
"Check sizes: "
<<
mesh
.
bounds
().
span
()
<<
nl
;
for
(
direction
cmpt
=
0
;
cmpt
<
vector
::
nComponents
;
++
cmpt
)
{
// Three different ways of getting the same information
// not all are equally efficient
scalar
totalWidth
=
0
;
// Using location
forAll
(
mesh
.
grid
()[
cmpt
],
i
)
{
totalWidth
+=
mesh
.
grid
()[
cmpt
].
width
(
i
);
}
Info
<<
vector
::
componentNames
[
cmpt
]
<<
" min/max "
<<
minMax
(
mesh
.
grid
()[
cmpt
])
<<
' '
<<
mesh
.
grid
()[
cmpt
].
first
()
<<
' '
<<
mesh
.
grid
()[
cmpt
].
last
()
<<
" "
<<
mesh
.
grid
()[
cmpt
].
size
()
<<
" cells"
<<
nl
;
// Use global (i,j,k) accessors, with mid-mesh for other directions
const
label
nx
=
mesh
.
sizes
().
x
()
/
(
cmpt
==
vector
::
X
?
1
:
2
);
const
label
ny
=
mesh
.
sizes
().
y
()
/
(
cmpt
==
vector
::
Y
?
1
:
2
);
const
label
nz
=
mesh
.
sizes
().
z
()
/
(
cmpt
==
vector
::
Z
?
1
:
2
);
scalar
totalSpan
=
0
;
scalar
totalDelta
=
0
;
switch
(
cmpt
)
{
case
vector
:
:
X
:
{
for
(
label
i
=
0
;
i
<
nx
;
++
i
)
{
totalSpan
+=
mesh
.
span
(
i
,
ny
,
nz
).
x
();
totalDelta
+=
mesh
.
dx
(
i
);
}
}
break
;
case
vector
:
:
Y
:
{
for
(
label
j
=
0
;
j
<
ny
;
++
j
)
{
totalSpan
+=
mesh
.
span
(
nx
,
j
,
nz
).
y
();
totalDelta
+=
mesh
.
dy
(
j
);
}
}
break
;
case
vector
:
:
Z
:
{
for
(
label
k
=
0
;
k
<
nz
;
++
k
)
{
totalSpan
+=
mesh
.
span
(
nx
,
ny
,
k
).
z
();
totalDelta
+=
mesh
.
dz
(
k
);
}
}
break
;
}
Info
<<
" width = "
<<
totalWidth
<<
" delta = "
<<
totalDelta
<<
" span = "
<<
totalSpan
<<
nl
;
}
{
const
labelVector
mid
=
mesh
.
sizes
()
/
2
;
Info
<<
nl
<<
"Mid-mesh information at "
<<
mid
<<
nl
<<
" centre = "
<<
mesh
.
C
(
mid
)
<<
nl
<<
" volume = "
<<
mesh
.
V
(
mid
)
<<
nl
<<
" length = "
<<
mesh
.
width
(
mid
)
<<
nl
;
}
// Test findCell
{
Info
<<
nl
<<
"findCell:"
<<
nl
;
for
(
const
point
&
pt
:
{
mesh
.
bounds
().
centre
(),
mesh
.
bounds
().
min
()
-
0
.
1
*
mesh
.
bounds
().
span
(),
mesh
.
bounds
().
max
()
+
0
.
1
*
mesh
.
bounds
().
span
()
}
)
{
labelVector
ijk
=
mesh
.
findCell
(
pt
);
Info
<<
" "
<<
pt
<<
" = "
<<
ijk
;
if
(
cmptMin
(
ijk
)
<
0
)
Info
<<
" [not found]"
;
Info
<<
nl
;
}
}
Info
<<
nl
;
// Fatal with FULLDEBUG
{
const
bool
oldThrowingError
=
FatalError
.
throwing
(
true
);
const
label
nx
=
mesh
.
sizes
().
x
();
const
label
ny
=
mesh
.
sizes
().
y
();
const
label
nz
=
mesh
.
sizes
().
z
();
// Here we get error in x-y-z order
try
{
mesh
.
checkIndex
(
nx
,
ny
,
nz
);
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
nl
<<
"Expected: Caught accesor error
\n
"
<<
err
.
message
().
c_str
()
<<
nl
;
}
// No order for the error since it is called parameter-wise
try
{
Info
<<
"centre at mesh(nx, ny, nz) = "
<<
mesh
.
C
(
mesh
.
sizes
())
<<
nl
;
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
nl
<<
"Expected: Caught accesor error
\n
"
<<
err
.
message
().
c_str
()
<<
nl
;
}
// Sizing error
try
{
mesh
.
checkSizes
(
labelVector
(
nx
+
1
,
ny
,
nz
));
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
nl
<<
"Expected: Caught sizing error
\n
"
<<
err
.
message
().
c_str
()
<<
nl
;
}
try
{
mesh
.
checkSizes
(
labelMax
/
4
);
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
nl
<<
"Expected: Caught sizing error
\n
"
<<
err
.
message
().
c_str
()
<<
nl
;
}
FatalError
.
throwing
(
oldThrowingError
);
}
Info
<<
"
\n
End
\n
"
<<
nl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/PDRblockMeshDict
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object PDRblockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Point scaling (optional)
scale 1.0;
x
{
points ( -13.28 -0.10 6.0 19.19 );
nCells ( 10 12 10 );
ratios ( -5.16 1 5.16 );
}
y
{
points ( -12.98 0 5.50 18.48 );
nCells ( 10 11 10 );
ratios ( -5.16 1 5.16 );
}
z
{
points ( 0.00 4.80 17.26 );
nCells ( 10 10 );
ratios ( 1 5.16 );
}
defaultPatch
{
name walls;
type wall;
}
// Faces: 0=x-min, 1=x-max, 2=y-min, 3=y-max, 4=z-min, 5=z-max
boundary
(
outer
{
type patch;
faces ( 0 1 2 3 5 );
}
mergingFaces
{
type wall;
faces ();
}
blockedFaces
{
type wall;
faces ();
}
ground
{
type wall;
faces ( 4 );
}
);
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/controlDict
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs (blockMesh);
application PDRblockMesh;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0;
deltaT 0;
writeControl timeStep;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 8;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/fvSchemes
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{}
gradSchemes
{}
divSchemes
{}
laplacianSchemes
{}
interpolationSchemes
{}
snGradSchemes
{}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PDRblockMesh/box0/system/fvSolution
0 → 100644
View file @
55e5a777
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2112 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
OpenFOAM-v2112/applications/test/PackedList/Make/files
0 → 100644
View file @
55e5a777
Test-PackedList.C
EXE = $(FOAM_USER_APPBIN)/Test-PackedList
OpenFOAM-v2112/applications/test/PackedList/Make/options
0 → 100644
View file @
55e5a777
/*
check for consistent behaviour with non-optimized code
*/
EXE_INC = \
-DFULLDEBUG -g -O0
OpenFOAM-v2112/applications/test/PackedList/Test-PackedList.C
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
Copyright (C) 2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "uLabel.H"
#include "IOobject.H"
#include "IOstreams.H"
#include "IFstream.H"
#include "bitSet.H"
#include <climits>
using
namespace
Foam
;
template
<
unsigned
Width
>
inline
void
reportInfo
()
{
const
unsigned
offset
=
PackedList
<
Width
>::
elem_per_block
;
unsigned
useSHL
=
((
1u
<<
(
Width
*
offset
))
-
1
);
unsigned
useSHR
=
(
~
0u
>>
(
sizeof
(
unsigned
)
*
CHAR_BIT
-
Width
*
offset
));
Info
<<
nl
<<
"PackedList<"
<<
Width
<<
">"
<<
nl
<<
" max_value: "
<<
PackedList
<
Width
>::
max_value
<<
nl
<<
" packing: "
<<
PackedList
<
Width
>::
elem_per_block
<<
nl
<<
" utilization: "
<<
(
Width
*
offset
)
<<
nl
;
Info
<<
" Masking:"
<<
nl
<<
" shift << "
<<
unsigned
(
Width
*
offset
)
<<
nl
<<
" shift >> "
<<
unsigned
((
sizeof
(
unsigned
)
*
CHAR_BIT
)
-
Width
*
offset
)
<<
nl
;
hex
(
Info
);
Info
<<
" maskLower: "
<<
PackedList
<
Width
>::
mask_lower
(
PackedList
<
Width
>::
elem_per_block
)
<<
nl
<<
" useSHL: "
<<
useSHL
<<
nl
<<
" useSHR: "
<<
useSHR
<<
nl
;
if
(
useSHL
!=
useSHR
)
{
Info
<<
"WARNING: different results for SHL and SHR"
<<
nl
;
}
Info
<<
nl
;
dec
(
Info
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noParallel
();
argList
::
addArgument
(
"file .. fileN"
);
argList
::
addBoolOption
(
"mask"
,
"report information about the bit masks"
);
argList
::
addBoolOption
(
"count"
,
"test the count() method"
);
argList
::
addBoolOption
(
"info"
,
"print an ascii representation of the storage"
);
argList
args
(
argc
,
argv
,
false
,
true
);
if
(
args
.
found
(
"mask"
))
{
Info
<<
"bit width: "
<<
unsigned
(
sizeof
(
unsigned
)
*
CHAR_BIT
)
<<
endl
;
reportInfo
<
1
>
();
reportInfo
<
2
>
();
reportInfo
<
3
>
();
reportInfo
<
4
>
();
reportInfo
<
5
>
();
reportInfo
<
6
>
();
reportInfo
<
7
>
();
reportInfo
<
8
>
();
reportInfo
<
9
>
();
reportInfo
<
10
>
();
reportInfo
<
11
>
();
reportInfo
<
12
>
();
reportInfo
<
13
>
();
reportInfo
<
14
>
();
reportInfo
<
15
>
();
reportInfo
<
16
>
();
return
0
;
}
else
if
(
args
.
size
()
<=
1
)
{
args
.
printUsage
();
}
for
(
label
argi
=
1
;
argi
<
args
.
size
();
++
argi
)
{
const
auto
srcFile
=
args
.
get
<
fileName
>
(
argi
);
Info
<<
nl
<<
"reading "
<<
srcFile
<<
nl
;
IFstream
ifs
(
srcFile
);
List
<
label
>
rawLst
(
ifs
);
bitSet
packLst
(
rawLst
);
Info
<<
"size: "
<<
packLst
.
size
()
<<
nl
;
if
(
args
.
found
(
"count"
))
{
unsigned
int
rawCount
=
0
;
forAll
(
rawLst
,
elemI
)
{
if
(
rawLst
[
elemI
])
{
rawCount
++
;
}
}
Info
<<
"raw count: "
<<
rawCount
<<
nl
<<
"packed count: "
<<
packLst
.
count
()
<<
nl
;
}
if
(
args
.
found
(
"info"
))
{
Info
<<
packLst
.
info
();
}
Info
<<
nl
;
IOobject
::
writeDivider
(
Info
);
}
return
0
;
}
// ************************************************************************* //
Prev
1
…
10
11
12
13
14
15
16
17
18
…
34
Next
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