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
959 additions
and
0 deletions
+959
-0
OpenFOAM-v2112/applications/test/boolList/Test-boolList.C
OpenFOAM-v2112/applications/test/boolList/Test-boolList.C
+180
-0
OpenFOAM-v2112/applications/test/boolList/bitSetOrBoolList.H
OpenFOAM-v2112/applications/test/boolList/bitSetOrBoolList.H
+102
-0
OpenFOAM-v2112/applications/test/boolList/disabledBoolList.H
OpenFOAM-v2112/applications/test/boolList/disabledBoolList.H
+73
-0
OpenFOAM-v2112/applications/test/boolVector/Make/files
OpenFOAM-v2112/applications/test/boolVector/Make/files
+3
-0
OpenFOAM-v2112/applications/test/boolVector/Make/options
OpenFOAM-v2112/applications/test/boolVector/Make/options
+2
-0
OpenFOAM-v2112/applications/test/boolVector/Test-boolVector.C
...FOAM-v2112/applications/test/boolVector/Test-boolVector.C
+89
-0
OpenFOAM-v2112/applications/test/boundBox/Make/files
OpenFOAM-v2112/applications/test/boundBox/Make/files
+3
-0
OpenFOAM-v2112/applications/test/boundBox/Make/options
OpenFOAM-v2112/applications/test/boundBox/Make/options
+7
-0
OpenFOAM-v2112/applications/test/boundBox/Test-boundBox.C
OpenFOAM-v2112/applications/test/boundBox/Test-boundBox.C
+154
-0
OpenFOAM-v2112/applications/test/callback/Make/files
OpenFOAM-v2112/applications/test/callback/Make/files
+3
-0
OpenFOAM-v2112/applications/test/callback/Make/options
OpenFOAM-v2112/applications/test/callback/Make/options
+2
-0
OpenFOAM-v2112/applications/test/callback/Test-callback.C
OpenFOAM-v2112/applications/test/callback/Test-callback.C
+131
-0
OpenFOAM-v2112/applications/test/cellModels/Make/files
OpenFOAM-v2112/applications/test/cellModels/Make/files
+3
-0
OpenFOAM-v2112/applications/test/cellModels/Make/options
OpenFOAM-v2112/applications/test/cellModels/Make/options
+2
-0
OpenFOAM-v2112/applications/test/cellModels/Test-cellModels.C
...FOAM-v2112/applications/test/cellModels/Test-cellModels.C
+99
-0
OpenFOAM-v2112/applications/test/charList/Make/files
OpenFOAM-v2112/applications/test/charList/Make/files
+3
-0
OpenFOAM-v2112/applications/test/charList/Make/options
OpenFOAM-v2112/applications/test/charList/Make/options
+2
-0
OpenFOAM-v2112/applications/test/charList/Test-charList.C
OpenFOAM-v2112/applications/test/charList/Test-charList.C
+87
-0
OpenFOAM-v2112/applications/test/checkDecomposePar/Make/files
...FOAM-v2112/applications/test/checkDecomposePar/Make/files
+3
-0
OpenFOAM-v2112/applications/test/checkDecomposePar/Make/options
...AM-v2112/applications/test/checkDecomposePar/Make/options
+11
-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/boolList/Test-boolList.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) 2020 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
Test-boolList
Description
Test specialized boolList functionality
\*---------------------------------------------------------------------------*/
#include "uLabel.H"
#include "boolList.H"
#include "bitSet.H"
#include "BitOps.H"
#include "FlatOutput.H"
#include "bitSetOrBoolList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using
namespace
Foam
;
labelList
sortedToc
(
const
UList
<
bool
>&
bools
)
{
label
count
=
0
;
for
(
const
bool
val
:
bools
)
{
if
(
val
)
++
count
;
}
labelList
indices
(
count
);
count
=
0
;
forAll
(
bools
,
i
)
{
if
(
bools
[
i
])
{
indices
[
count
++
]
=
i
;
}
}
indices
.
resize
(
count
);
return
indices
;
}
inline
Ostream
&
info
(
const
UList
<
bool
>&
bools
)
{
Info
<<
"size="
<<
bools
.
size
()
<<
" count="
<<
BitOps
::
count
(
bools
)
<<
" !count="
<<
BitOps
::
count
(
bools
,
false
)
<<
" all:"
<<
BitOps
::
all
(
bools
)
<<
" any:"
<<
BitOps
::
any
(
bools
)
<<
" none:"
<<
BitOps
::
none
(
bools
)
<<
nl
;
return
Info
;
}
inline
Ostream
&
report
(
const
UList
<
bool
>&
bitset
,
bool
showBits
=
false
,
bool
debugOutput
=
false
)
{
info
(
bitset
);
Info
<<
"values: "
<<
flatOutput
(
sortedToc
(
bitset
))
<<
nl
;
return
Info
;
}
inline
Ostream
&
report
(
const
UList
<
bool
>&
bools
)
{
info
(
bools
);
return
Info
;
}
inline
bool
compare
(
const
UList
<
bool
>&
bitset
,
const
std
::
string
&
expected
)
{
std
::
string
has
;
has
.
reserve
(
bitset
.
size
());
forAll
(
bitset
,
i
)
{
has
+=
(
bitset
[
i
]
?
'1'
:
'.'
);
}
if
(
has
==
expected
)
{
Info
<<
"pass: "
<<
has
<<
nl
;
return
true
;
}
Info
<<
"fail: "
<<
has
<<
nl
;
Info
<<
"expect: "
<<
expected
<<
nl
;
return
false
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
boolList
list1
(
22
,
false
);
// Set every third one on
forAll
(
list1
,
i
)
{
list1
[
i
]
=
!
(
i
%
3
);
}
Info
<<
"
\n
alternating bit pattern
\n
"
;
compare
(
list1
,
"1..1..1..1..1..1..1..1"
);
BitOps
::
unset
(
list1
,
labelRange
(
13
,
20
));
// In range
Info
<<
"
\n
after clear [13,..]
\n
"
;
compare
(
list1
,
"1..1..1..1..1........."
);
BitOps
::
unset
(
list1
,
labelRange
(
40
,
20
));
// out of range
Info
<<
"
\n
after clear [40,..]
\n
"
;
compare
(
list1
,
"1..1..1..1..1........."
);
BitOps
::
set
(
list1
,
labelRange
(
13
,
5
));
// In range
Info
<<
"
\n
after set [13,5]
\n
"
;
compare
(
list1
,
"1..1..1..1..111111...."
);
{
boolList
list2
(
5
,
true
);
list2
.
unset
(
2
);
Info
<<
"Test wrapper idea"
<<
nl
;
bitSetOrBoolList
wrapper
(
list2
);
if
(
wrapper
.
test
(
1
))
{
Info
<<
"1 is on"
<<
nl
;
}
if
(
!
wrapper
.
test
(
2
))
{
Info
<<
"2 is off"
<<
nl
;
}
}
Info
<<
"
\n
Done"
<<
nl
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/boolList/bitSetOrBoolList.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 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/>.
Class
Foam::bitSetOrBoolList
Description
Simple wrapper for handling test() on bitSet or boolList
without a templating layer or lambda expresssion.
\*---------------------------------------------------------------------------*/
#ifndef bitSetOrBoolList_H
#define bitSetOrBoolList_H
#include "bitSet.H"
#include "boolList.H"
/*---------------------------------------------------------------------------*\
Class bitSetOrBoolList Declaration
\*---------------------------------------------------------------------------*/
namespace
Foam
{
class
bitSetOrBoolList
{
const
bitSet
&
bits_
;
const
boolList
&
bools_
;
public:
// Constructors
//- Construct with a bitSet reference
explicit
bitSetOrBoolList
(
const
bitSet
&
select
)
:
bits_
(
select
),
bools_
(
boolList
::
null
())
{}
//- Construct with a boolList reference
explicit
bitSetOrBoolList
(
const
boolList
&
select
)
:
bits_
(
bitSet
::
null
()),
bools_
(
select
)
{}
// Member Functions
//- Is empty
bool
empty
()
const
{
return
bits_
.
empty
()
&&
bools_
.
empty
();
}
//- Size
label
size
()
const
{
return
bits_
.
size
()
+
bools_
.
size
();
}
//- Test function
bool
test
(
const
label
i
)
const
{
return
bits_
.
test
(
i
)
||
bools_
.
test
(
i
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/test/boolList/disabledBoolList.H
0 → 100644
View file @
55e5a777
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 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/>.
Class
Foam::disabledBoolList
Description
A trivial structure to use as a boolList replacement when testing
compilation without using the [] accessors.
Example,
\code
const disableBoolList blockedFace;
...
if (blockedFace.test(facei)) ... // Good
if (blockedFace[facei]) ... // Compile error
\endcode
\*---------------------------------------------------------------------------*/
#ifndef disabledBoolList_H
#define disabledBoolList_H
/*---------------------------------------------------------------------------*\
Class disabledBoolList Declaration
\*---------------------------------------------------------------------------*/
namespace
Foam
{
struct
disabledBoolList
{
bool
empty
()
const
{
return
true
;
}
int
size
()
const
{
return
0
;
}
bool
test
(
int
)
const
{
return
true
;
}
void
set
(
bool
)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
OpenFOAM-v2112/applications/test/boolVector/Make/files
0 → 100644
View file @
55e5a777
Test-boolVector.C
EXE = $(FOAM_USER_APPBIN)/Test-boolVector
OpenFOAM-v2112/applications/test/boolVector/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/boolVector/Test-boolVector.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) 2020 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
Test-boolVector
Description
Some simple tests for boolVector
\*---------------------------------------------------------------------------*/
#include "boolVector.H"
#include "IOstreams.H"
#include "Switch.H"
using
namespace
Foam
;
void
print
(
const
boolVector
&
v
)
{
Info
<<
v
<<
" any:"
<<
Switch
::
name
(
v
.
any
())
<<
" all:"
<<
Switch
::
name
(
v
.
all
())
<<
" none:"
<<
Switch
::
name
(
v
.
none
())
<<
" count:"
<<
v
.
count
()
<<
nl
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
Info
<<
"boolVector"
<<
nl
<<
" size = "
<<
boolVector
::
size
()
<<
nl
<<
" contiguous = "
<<
is_contiguous
<
boolVector
>::
value
<<
nl
<<
nl
;
{
boolVector
vec
;
Info
<<
"null: "
<<
vec
<<
nl
;
}
Info
<<
"false: "
<<
boolVector
(
false
)
<<
nl
;
Info
<<
"true: "
<<
boolVector
(
true
)
<<
nl
;
Info
<<
"zero: "
<<
boolVector
(
Zero
)
<<
nl
;
Info
<<
nl
;
{
boolVector
vec
{
1
,
0
,
1
};
print
(
vec
);
vec
.
flip
();
print
(
vec
);
vec
=
false
;
print
(
vec
);
vec
=
true
;
print
(
vec
);
}
Info
<<
"
\n
End
\n
"
<<
nl
;
return
0
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/boundBox/Make/files
0 → 100644
View file @
55e5a777
Test-boundBox.C
EXE = $(FOAM_USER_APPBIN)/Test-boundBox
OpenFOAM-v2112/applications/test/boundBox/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
OpenFOAM-v2112/applications/test/boundBox/Test-boundBox.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) 2016-2018 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 bounding box behaviour
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "boundBox.H"
#include "treeBoundBox.H"
#include "cellModel.H"
#include "bitSet.H"
#include "HashSet.H"
#include "ListOps.H"
using
namespace
Foam
;
//- simple helper to create a cube
boundBox
cube
(
scalar
start
,
scalar
width
)
{
return
boundBox
(
point
::
uniform
(
start
),
point
::
uniform
(
start
+
width
)
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
#include "setRootCase.H"
Info
<<
"boundBox faces: "
<<
boundBox
::
faces
<<
nl
<<
"hex faces: "
<<
cellModel
::
ref
(
cellModel
::
HEX
).
modelFaces
()
<<
nl
<<
"tree-bb faces: "
<<
treeBoundBox
::
faces
<<
nl
<<
"tree-bb edges: "
<<
treeBoundBox
::
edges
<<
endl
;
boundBox
bb
=
boundBox
::
greatBox
;
Info
<<
"great box: "
<<
bb
<<
endl
;
// bb.clear();
// Info<<"zero box: " << bb << endl;
bb
=
boundBox
::
invertedBox
;
Info
<<
"invalid box: "
<<
bb
<<
endl
;
Info
<<
nl
<<
endl
;
if
(
Pstream
::
parRun
())
{
bb
=
cube
(
Pstream
::
myProcNo
(),
1
.
1
);
Pout
<<
"box: "
<<
bb
<<
endl
;
bb
.
reduce
();
Pout
<<
"reduced: "
<<
bb
<<
endl
;
}
else
{
bb
=
cube
(
0
,
1
);
Info
<<
"starting box: "
<<
bb
<<
endl
;
point
pt
(
Zero
);
bb
.
add
(
pt
);
Info
<<
"enclose point "
<<
pt
<<
" -> "
<<
bb
<<
endl
;
pt
=
point
(
0
,
1
.
5
,
0
.
5
);
bb
.
add
(
pt
);
Info
<<
"enclose point "
<<
pt
<<
" -> "
<<
bb
<<
endl
;
pt
=
point
(
5
,
2
,
-
2
);
bb
.
add
(
pt
);
Info
<<
"enclose point "
<<
pt
<<
" -> "
<<
bb
<<
endl
;
// restart with same points
bb
=
boundBox
::
invertedBox
;
bb
.
add
(
point
(
1
,
1
,
1
));
bb
.
add
(
point
::
zero
);
bb
.
add
(
point
(
0
,
1
.
5
,
0
.
5
));
bb
.
add
(
point
(
5
,
2
,
-
2
));
Info
<<
"repeated "
<<
bb
<<
endl
;
boundBox
box1
=
cube
(
0
,
1
);
boundBox
box2
=
cube
(
0
,
0
.
75
);
boundBox
box3
=
cube
(
0
.
5
,
1
);
boundBox
box4
=
cube
(
-
1
,
0
.
5
);
Info
<<
"union of "
<<
box1
<<
" and "
<<
box2
<<
" => "
;
box1
.
add
(
box2
);
Info
<<
box1
<<
endl
;
box1
.
add
(
box3
);
Info
<<
"union with "
<<
box3
<<
" => "
<<
box1
<<
endl
;
box1
.
add
(
box4
);
Info
<<
"union with "
<<
box4
<<
" => "
<<
box1
<<
endl
;
labelRange
range
(
10
,
25
);
auto
variousPoints
=
ListOps
::
create
<
point
>
(
range
.
begin
(),
range
.
end
(),
[](
const
label
val
)
{
return
vector
(
val
,
val
,
val
);
}
);
Info
<<
nl
<<
nl
;
labelHashSet
select1
{
4
,
5
,
55
};
bitSet
select2
(
15
,
{
1
,
5
,
20
,
24
,
34
});
Info
<<
"From points: size="
<<
variousPoints
.
size
()
<<
" from "
<<
variousPoints
.
first
()
<<
" ... "
<<
variousPoints
.
last
()
<<
nl
;
Info
<<
"add points @ "
<<
flatOutput
(
select1
.
sortedToc
())
<<
nl
;
box1
.
add
(
variousPoints
,
select1
);
Info
<<
"box is now => "
<<
box1
<<
endl
;
box1
.
add
(
variousPoints
,
select2
);
Info
<<
"box is now => "
<<
box1
<<
endl
;
}
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/callback/Make/files
0 → 100644
View file @
55e5a777
Test-callback.C
EXE = $(FOAM_USER_APPBIN)/Test-callback
OpenFOAM-v2112/applications/test/callback/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/callback/Test-callback.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-2015 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/>.
Application
callBackTest
Description
\*---------------------------------------------------------------------------*/
#include "Callback.H"
using
namespace
Foam
;
class
callback
:
public
Callback
<
callback
>
{
public:
callback
(
CallbackRegistry
<
callback
>&
cbr
)
:
Callback
<
callback
>
(
cbr
)
{}
~
callback
()
{}
virtual
const
word
&
name
()
const
{
return
word
::
null
;
}
void
testCallbackFunction
()
const
{
Info
<<
"calling testCallbackFunction for object "
<<
name
()
<<
endl
;
}
};
class
callbackRegistry
:
public
CallbackRegistry
<
callback
>
{
public:
callbackRegistry
()
{}
~
callbackRegistry
()
{}
void
testCallbackFunction
()
const
{
forAllConstIters
(
*
this
,
iter
)
{
iter
().
testCallbackFunction
();
}
}
};
class
objectWithCallback
:
public
callback
{
word
name_
;
public:
objectWithCallback
(
const
word
&
n
,
callbackRegistry
&
cbr
)
:
callback
(
cbr
),
name_
(
n
)
{}
virtual
const
word
&
name
()
const
{
return
name_
;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
callbackRegistry
cbr
;
objectWithCallback
ob1
(
"ob1"
,
cbr
);
objectWithCallback
ob2
(
"ob2"
,
cbr
);
cbr
.
testCallbackFunction
();
{
objectWithCallback
ob1
(
"ob1"
,
cbr
);
cbr
.
testCallbackFunction
();
}
cbr
.
testCallbackFunction
();
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cellModels/Make/files
0 → 100644
View file @
55e5a777
Test-cellModels.C
EXE = $(FOAM_USER_APPBIN)/Test-cellModels
OpenFOAM-v2112/applications/test/cellModels/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/cellModels/Test-cellModels.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 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
Test-cellModels
Description
Print information about known cellModels
\*---------------------------------------------------------------------------*/
#include "cellModel.H"
#include "cellModeller.H"
using
namespace
Foam
;
void
printInfo
(
const
cellModel
*
mdl
)
{
if
(
mdl
)
{
Info
<<
*
mdl
<<
endl
;
}
else
{
Info
<<
"nullptr"
<<
endl
;
}
}
void
printInfo
(
const
cellModel
::
modelType
type
)
{
Info
<<
cellModel
::
modelNames
[
type
]
<<
" = "
;
printInfo
(
cellModel
::
ptr
(
type
));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
Info
<<
"lookup by enum"
<<
nl
<<
"========================="
<<
endl
;
printInfo
(
cellModel
::
UNKNOWN
);
printInfo
(
cellModel
::
HEX
);
printInfo
(
cellModel
::
WEDGE
);
printInfo
(
cellModel
::
PRISM
);
printInfo
(
cellModel
::
PYR
);
printInfo
(
cellModel
::
TET
);
printInfo
(
cellModel
::
SPLITHEX
);
printInfo
(
cellModel
::
TETWEDGE
);
Info
<<
"lookup by name"
<<
nl
<<
"========================="
<<
endl
;
printInfo
(
cellModel
::
ptr
(
"tet"
));
Info
<<
"lookup by index"
<<
nl
<<
"========================="
<<
endl
;
printInfo
(
cellModel
::
ptr
(
7
));
// Compatibility mode
Info
<<
"cellModeller::lookup (compatibility)"
<<
nl
<<
"========================="
<<
endl
;
printInfo
(
cellModeller
::
lookup
(
"tet"
));
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/charList/Make/files
0 → 100644
View file @
55e5a777
Test-charList.C
EXE = $(FOAM_USER_APPBIN)/Test-charList
OpenFOAM-v2112/applications/test/charList/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/charList/Test-charList.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) 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
Test-charList
Description
Some test of UList, List for characters
\*---------------------------------------------------------------------------*/
#include "OSspecific.H"
#include "argList.H"
#include "IOstreams.H"
#include "messageStream.H"
#include "charList.H"
#include "labelList.H"
#include "StringStream.H"
#include "ListOps.H"
#include "SubList.H"
#include "FlatOutput.H"
#include <numeric>
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noBanner
();
argList
::
noParallel
();
argList
::
noFunctionObjects
();
#include "setRootCase.H"
Info
<<
"Known compound tokens: "
<<
token
::
compound
::
IstreamConstructorTablePtr_
->
sortedToc
()
<<
nl
;
OStringStream
ostr
;
{
List
<
char
>
alphabet
(
64
);
std
::
iota
(
alphabet
.
begin
(),
alphabet
.
end
(),
'@'
);
alphabet
.
writeEntry
(
"alphabet"
,
Info
);
ostr
<<
alphabet
;
Info
<<
"wrote: "
<<
ostr
.
str
()
<<
nl
;
}
{
IStringStream
istr
(
ostr
.
str
());
List
<
char
>
alphabet
(
istr
);
Info
<<
"re-read: "
<<
alphabet
<<
nl
;
}
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/checkDecomposePar/Make/files
0 → 100644
View file @
55e5a777
Test-checkDecomposePar.C
EXE = $(FOAM_USER_APPBIN)/Test-checkDecomposePar
OpenFOAM-v2112/applications/test/checkDecomposePar/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ldecompose \
-ldecompositionMethods
Prev
1
…
16
17
18
19
20
21
22
23
24
…
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