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
1027 additions
and
0 deletions
+1027
-0
OpenFOAM-v2112/applications/test/coordinateSystem/Make/files
OpenFOAM-v2112/applications/test/coordinateSystem/Make/files
+3
-0
OpenFOAM-v2112/applications/test/coordinateSystem/Make/options
...OAM-v2112/applications/test/coordinateSystem/Make/options
+5
-0
OpenFOAM-v2112/applications/test/coordinateSystem/Test-coordinateSystem.C
...pplications/test/coordinateSystem/Test-coordinateSystem.C
+225
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCase0/constant/coordinateSystems
...est/coordinateSystem/testCase0/constant/coordinateSystems
+32
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCase0/system/controlDict
...ations/test/coordinateSystem/testCase0/system/controlDict
+48
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCase1/constant/coordinateSystems
...est/coordinateSystem/testCase1/constant/coordinateSystems
+86
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCase1/system/controlDict
...ations/test/coordinateSystem/testCase1/system/controlDict
+48
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys1
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys1
+185
-0
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys2
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys2
+59
-0
OpenFOAM-v2112/applications/test/copyFile/Make/files
OpenFOAM-v2112/applications/test/copyFile/Make/files
+3
-0
OpenFOAM-v2112/applications/test/copyFile/Make/options
OpenFOAM-v2112/applications/test/copyFile/Make/options
+2
-0
OpenFOAM-v2112/applications/test/copyFile/Test-copyFile.C
OpenFOAM-v2112/applications/test/copyFile/Test-copyFile.C
+181
-0
OpenFOAM-v2112/applications/test/cplusplus1/Make/files
OpenFOAM-v2112/applications/test/cplusplus1/Make/files
+3
-0
OpenFOAM-v2112/applications/test/cplusplus1/Make/options
OpenFOAM-v2112/applications/test/cplusplus1/Make/options
+2
-0
OpenFOAM-v2112/applications/test/cplusplus1/Test-cpluplus1.C
OpenFOAM-v2112/applications/test/cplusplus1/Test-cpluplus1.C
+86
-0
OpenFOAM-v2112/applications/test/cpuInfo/Make/files
OpenFOAM-v2112/applications/test/cpuInfo/Make/files
+3
-0
OpenFOAM-v2112/applications/test/cpuInfo/Make/options
OpenFOAM-v2112/applications/test/cpuInfo/Make/options
+2
-0
OpenFOAM-v2112/applications/test/cpuInfo/Test-cpuInfo.C
OpenFOAM-v2112/applications/test/cpuInfo/Test-cpuInfo.C
+49
-0
OpenFOAM-v2112/applications/test/cstring/Make/files
OpenFOAM-v2112/applications/test/cstring/Make/files
+3
-0
OpenFOAM-v2112/applications/test/cstring/Make/options
OpenFOAM-v2112/applications/test/cstring/Make/options
+2
-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/coordinateSystem/Make/files
0 → 100644
View file @
55e5a777
Test-coordinateSystem.C
EXE = $(FOAM_USER_APPBIN)/Test-coordinateSystem
OpenFOAM-v2112/applications/test/coordinateSystem/Make/options
0 → 100644
View file @
55e5a777
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools
OpenFOAM-v2112/applications/test/coordinateSystem/Test-coordinateSystem.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) 2018-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-coordinateSystem
Description
Expand coordinate system definitions
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "coordinateSystems.H"
#include "identityRotation.H"
#include "cartesianCS.H"
#include "indirectCS.H"
#include "Fstream.H"
#include "IOstreams.H"
#include "transform.H"
using
namespace
Foam
;
template
<
class
T
>
void
testTransform
(
const
coordinateSystem
&
cs
,
const
point
&
p
,
const
T
&
val
)
{
Info
<<
" "
<<
pTraits
<
T
>::
typeName
<<
": "
<<
val
<<
" transform: "
<<
cs
.
transform
(
p
,
val
)
<<
" invTransform: "
<<
cs
.
invTransform
(
p
,
val
)
<<
nl
;
// Info<< " both: " << cs.invTransform(p, cs.transform(p, val)) << nl;
}
void
basicTests
(
const
coordinateSystem
&
cs
)
{
cs
.
writeEntry
(
cs
.
name
(),
Info
);
if
(
const
auto
*
cartptr
=
isA
<
coordSystem
::
cartesian
>
(
cs
))
{
if
(
!
cartptr
->
active
())
{
Info
<<
"inactive cartesian = "
<<
(
*
cartptr
)
<<
" with: "
<<
(
*
cartptr
).
R
()
<<
nl
;
}
}
Info
<<
"rotation: "
<<
cs
.
R
()
<<
nl
;
List
<
point
>
testPoints
({
{
1
,
0
,
0
},
{
0
,
1
,
0
},
{
0
,
0
,
1
},
{
1
,
1
,
1
},
});
for
(
const
point
&
p
:
testPoints
)
{
Info
<<
nl
<<
" test point: "
<<
p
<<
" = local point "
<<
cs
.
transformPoint
(
p
)
<<
" = local coord "
<<
cs
.
localPosition
(
p
)
<<
nl
;
const
vector
v1
(
1
,
1
,
1
);
const
tensor
t1
(
tensor
::
I
);
const
tensor
t2
(
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
);
testTransform
(
cs
,
p
,
v1
);
testTransform
(
cs
,
p
,
t1
);
testTransform
(
cs
,
p
,
t2
);
}
Info
<<
nl
;
}
void
doTest
(
const
dictionary
&
dict
)
{
Info
<<
dict
.
dictName
()
<<
dict
<<
nl
;
// Could fail?
const
bool
oldThrowingError
=
FatalError
.
throwing
(
true
);
const
bool
oldThrowingIOErr
=
FatalIOError
.
throwing
(
true
);
try
{
auto
cs1ptr
=
coordinateSystem
::
New
(
dict
,
""
);
coordinateSystem
&
cs1
=
*
cs1ptr
;
cs1
.
rename
(
dict
.
dictName
());
basicTests
(
cs1
);
}
catch
(
const
Foam
::
IOerror
&
err
)
{
Info
<<
"Caught FatalIOError "
<<
err
<<
nl
<<
endl
;
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
"Caught FatalError "
<<
err
<<
nl
<<
endl
;
}
FatalError
.
throwing
(
oldThrowingError
);
FatalIOError
.
throwing
(
oldThrowingIOErr
);
}
void
doTest
(
const
objectRegistry
&
obr
,
const
dictionary
&
dict
)
{
Info
<<
dict
.
dictName
()
<<
dict
<<
nl
;
// Could fail?
const
bool
oldThrowingError
=
FatalError
.
throwing
(
true
);
const
bool
oldThrowingIOErr
=
FatalIOError
.
throwing
(
true
);
try
{
auto
cs1ptr
=
coordinateSystem
::
New
(
obr
,
dict
,
word
::
null
);
coordinateSystem
&
cs1
=
*
cs1ptr
;
basicTests
(
cs1
);
}
catch
(
const
Foam
::
IOerror
&
err
)
{
Info
<<
"Caught FatalIOError "
<<
err
<<
nl
<<
endl
;
}
catch
(
const
Foam
::
error
&
err
)
{
Info
<<
"Caught FatalError "
<<
err
<<
nl
<<
endl
;
}
FatalError
.
throwing
(
oldThrowingError
);
FatalIOError
.
throwing
(
oldThrowingIOErr
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noParallel
();
argList
::
addArgument
(
"dict .. dictN"
);
argList
args
(
argc
,
argv
,
false
,
true
);
if
(
args
.
found
(
"case"
))
{
Info
<<
"using case for tests"
<<
nl
;
#include "createTime.H"
const
coordinateSystems
&
systems
=
coordinateSystems
::
New
(
runTime
);
Info
<<
systems
.
size
()
<<
" global systems"
<<
nl
;
for
(
const
coordinateSystem
&
cs
:
systems
)
{
basicTests
(
cs
);
}
// systems.write();
for
(
label
argi
=
1
;
argi
<
args
.
size
();
++
argi
)
{
const
auto
dictFile
=
args
.
get
<
fileName
>
(
argi
);
IFstream
is
(
dictFile
);
dictionary
inputDict
(
is
);
for
(
const
entry
&
dEntry
:
inputDict
)
{
if
(
dEntry
.
isDict
())
{
doTest
(
runTime
,
dEntry
.
dict
());
}
}
}
}
else
if
(
args
.
size
()
<=
1
)
{
Info
<<
"no coordinateSystem dictionaries to expand"
<<
nl
;
}
else
{
for
(
label
argi
=
1
;
argi
<
args
.
size
();
++
argi
)
{
const
auto
dictFile
=
args
.
get
<
fileName
>
(
argi
);
IFstream
is
(
dictFile
);
dictionary
inputDict
(
is
);
for
(
const
entry
&
dEntry
:
inputDict
)
{
if
(
dEntry
.
isDict
())
{
doTest
(
dEntry
.
dict
());
}
}
}
}
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/coordinateSystem/testCase0/constant/coordinateSystems
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 IOPtrList<coordinateSystem>; //<-- Older name
object coordinateSystems;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
(
cs1
{
type cartesian;
origin (1 2 3);
coordinateRotation
{
type axes;
e1 (0 0 1);
e2 (0 1 0);
}
}
)
// ************************************************************************* //
OpenFOAM-v2112/applications/test/coordinateSystem/testCase0/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;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 4;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
OpenFOAM-v2112/applications/test/coordinateSystem/testCase1/constant/coordinateSystems
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;
//OLD class IOPtrList<coordinateSystem>;
class coordinateSystems;
object coordinateSystems;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
(
cs1
{
type cartesian;
origin (1 2 3);
rotation
{
type axes;
e1 (0 0 1);
e2 (0 1 0);
}
}
cs2
{
type cartesian;
origin (0 3 5);
e1 (1 2 0);
e2 (2 0 2);
}
cs3
{
type cartesian;
origin (0 3 5);
coordinateRotation // older name
{
type euler;
angles (90 0 0);
}
}
cs4
{
type cylindrical;
origin (0 3 5);
rotation
{
type euler;
angles (90 0 0);
}
}
cyl
{
type cylindrical;
origin (0 0 0);
degrees false;
rotation
{
type axisAngle;
axis (0 0 1);
angle 90;
}
}
ident
{
origin (0 0 0);
rotation
{
type none;
}
}
)
// ************************************************************************* //
OpenFOAM-v2112/applications/test/coordinateSystem/testCase1/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;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application simpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 4;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys1
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 testCsys1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Rotate 90 deg around x: y -> z, z -> -y
rot_x90
{
origin (0 0 0);
e1 (1 0 0);
e3 (0 -1 0);
}
rot_x90_axesRotation
{
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e3 (0 -1 0);
}
}
rot_x90_axisAngle
{
origin (0 0 0);
coordinateRotation
{
type axisAngle;
axis (1 0 0); // non-unit also OK
angle 90;
}
}
rot_x90_euler
{
origin (0 0 0);
coordinateRotation
{
type euler;
angles (0 90 0); // z-x'-z''
}
}
// Rotate 45 deg around z: x -> (1 1 0), y = (-1 1 0)
rot_z45_axesRotation
{
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 1 0);
e3 (0 0 1);
}
}
rot_z45_axisAngle
{
origin (0 0 0);
coordinateRotation
{
type axisAngle;
axis (0 0 10); // non-unit also OK
angle 45;
}
}
rot_z45_euler
{
origin (0 0 0);
coordinateRotation
{
type euler;
angles (45 0 0); // z-x'-z''
}
}
rot_z45_starcd
{
origin (0 0 0);
coordinateRotation
{
type starcd;
angles (45 0 0); // z-x'-y''
}
}
// Rotate -45 deg around z: x -> (1 -1 0), y = (1 1 0)
rot_zm45_axesRotation
{
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 -1 0);
e3 (0 0 1);
}
}
rot_zm45_axisAngle
{
origin (0 0 0);
coordinateRotation
{
type axisAngle;
axis (0 0 10); // non-unit also OK
angle -45;
}
}
rot_zm45_euler
{
origin (0 0 0);
coordinateRotation
{
type euler;
angles (-45 0 0); // z-x'-z''
}
}
// Null transforms
null_axesRotation
{
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e3 (0 0 1);
}
}
null_axisAngle0
{
origin (0 0 0);
coordinateRotation
{
type axisAngle;
axis (0 0 0); // non-unit also OK
angle 0;
}
}
null_axisAngle1
{
origin (0 0 0);
coordinateRotation
{
type axisAngle;
axis (1 1 1); // non-unit also OK
angle 0;
}
}
null_euler
{
origin (0 0 0);
coordinateRotation
{
type euler;
angles (0 0 0); // z-x'-z''
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/coordinateSystem/testCsys2
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 testCsys1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// This dictionary only works in combination with constant/coordinateSystems
mycs1
{
type indirect;
name cs1;
}
mycs2
{
type indirect;
name cs2;
}
mycs3
{
type indirect;
name cs3;
}
mycyl
{
type indirect;
name cyl;
}
mycy2
{
coordinateSystem
{
type indirect;
name cyl;
}
}
mycy3
{
coordinateSystem cyl;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
OpenFOAM-v2112/applications/test/copyFile/Make/files
0 → 100644
View file @
55e5a777
Test-copyFile.C
EXE = $(FOAM_USER_APPBIN)/Test-copyFile
OpenFOAM-v2112/applications/test/copyFile/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
OpenFOAM-v2112/applications/test/copyFile/Test-copyFile.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 atomic copyFile as per timeActivatedFileUpdate
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "OSspecific.H"
#include "Switch.H"
using
namespace
Foam
;
#ifdef _WIN32
#undef DebugInfo // Windows name clash with OpenFOAM messageStream
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
unsigned
maxPath
=
MAX_PATH
;
// Prefix "\\?\" for extended-length path and widen
// The prefix is only valid with absolute paths
//
// In the future, this code will be relocated in MSwindows.C
static
inline
std
::
wstring
longName
(
const
fileName
&
file
)
{
const
auto
len
=
file
.
length
();
std
::
wstring
out
;
out
.
reserve
(
4
+
len
);
if
(
len
>
maxPath
)
{
if
(
file
.
isAbsolute
())
{
out
.
append
(
L"
\\\\
?
\\
"
);
}
else
{
Warning
<<
"Relative fileName exceeds "
<<
maxPath
<<
" characters"
<<
nl
<<
" "
<<
file
<<
nl
<<
nl
;
}
}
// Character-wise copy to get widening
for
(
const
auto
c
:
file
)
{
out
+=
c
;
}
return
out
;
}
bool
win_mv
(
const
fileName
&
src
,
const
fileName
&
dst
)
{
constexpr
const
int
flags
(
MOVEFILE_COPY_ALLOWED
|
MOVEFILE_REPLACE_EXISTING
|
MOVEFILE_WRITE_THROUGH
);
if
(
src
.
length
()
>
maxPath
||
dst
.
length
()
>
maxPath
)
{
const
std
::
wstring
srcName
(
longName
(
src
));
const
std
::
wstring
dstName
(
longName
(
dst
));
Info
<<
"Windows mv (wide)"
<<
nl
;
return
::
MoveFileExW
(
srcName
.
c_str
(),
dstName
.
c_str
(),
flags
);
}
Info
<<
"Windows mv (ansi)"
<<
nl
;
return
::
MoveFileExA
(
src
.
c_str
(),
dst
.
c_str
(),
flags
);
}
#else
bool
win_mv
(
const
fileName
&
src
,
const
fileName
&
dst
)
{
Info
<<
"No Windows mv, using Foam::mv"
<<
nl
;
return
Foam
::
mv
(
src
,
dst
);
}
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
noBanner
();
argList
::
noParallel
();
argList
::
noFunctionObjects
();
argList
::
addNote
(
"Test atomic copyFile methods"
);
#ifdef _WIN32
argList
::
addBoolOption
(
"win1"
,
"Foam cp, Windows mv"
);
argList
::
addOption
(
"maxPath"
,
"length"
,
"Test with shorter MAX_PATH"
);
#endif
argList
::
addArgument
(
"srcFile"
);
argList
::
addArgument
(
"dstFile"
);
#include "setRootCase.H"
#ifdef _WIN32
args
.
readIfPresent
(
"maxPath"
,
maxPath
);
#endif
const
auto
srcFile
=
args
.
get
<
fileName
>
(
1
);
const
auto
dstFile
=
args
.
get
<
fileName
>
(
2
);
const
fileName
tmpFile
(
dstFile
+
Foam
::
name
(
pid
()));
Info
<<
"src : "
<<
srcFile
<<
nl
<<
"tmp : "
<<
tmpFile
<<
nl
<<
"dst : "
<<
dstFile
<<
nl
#ifdef _WIN32
<<
"test with max-path: "
<<
maxPath
<<
nl
#endif
<<
nl
;
bool
cpOk
=
false
,
mvOk
=
false
;
if
(
args
.
found
(
"win1"
))
{
const
auto
usage
=
argList
::
optionUsage
.
cfind
(
"win1"
);
if
(
usage
.
good
())
{
Info
<<
" "
<<
(
*
usage
).
c_str
()
<<
nl
;
}
cpOk
=
Foam
::
cp
(
srcFile
,
tmpFile
);
mvOk
=
win_mv
(
tmpFile
,
dstFile
);
}
else
{
Info
<<
" Foam cp, Foam mv"
<<
nl
;
cpOk
=
Foam
::
cp
(
srcFile
,
tmpFile
);
mvOk
=
Foam
::
mv
(
tmpFile
,
dstFile
);
}
Info
<<
nl
<<
"cp: "
<<
Switch
(
cpOk
)
<<
nl
<<
"mv: "
<<
Switch
(
mvOk
)
<<
nl
;
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cplusplus1/Make/files
0 → 100644
View file @
55e5a777
Test-cpluplus1.C
EXE = $(FOAM_USER_APPBIN)/Test-cpluplus1
OpenFOAM-v2112/applications/test/cplusplus1/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
OpenFOAM-v2112/applications/test/cplusplus1/Test-cpluplus1.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-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 miscellaneous C++ templates/functionality.
\*---------------------------------------------------------------------------*/
#include "string.H"
#include "macros.H"
#include "IOstreams.H"
#include "UList.H"
#include "HashSet.H"
#include <typeinfo>
#include <type_traits>
#include <utility>
using
namespace
Foam
;
#define PRINT_TYPEID(arg) \
Info<< typeid(arg).name() << " <= typeid of " << STRING_QUOTE(arg) << nl
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
Info
<<
"various declaration types"
<<
nl
<<
nl
;
PRINT_TYPEID
(
label
);
PRINT_TYPEID
(
decltype
(
UList
<
label
>::
value_type
()));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
UList
<
label
>>
().
cbegin
()));
PRINT_TYPEID
(
decltype
(
*
(
std
::
declval
<
UList
<
label
>>
().
cbegin
())));
Info
<<
nl
;
PRINT_TYPEID
(
decltype
(
HashTable
<
label
>::
key_type
()));
PRINT_TYPEID
(
decltype
(
HashTable
<
label
>::
value_type
()));
// Not yet: PRINT_TYPEID(decltype(HashTable<label>::mapped_type()));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
HashTable
<
label
>>
().
begin
()));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
const
HashTable
<
label
>>
().
begin
()));
PRINT_TYPEID
(
decltype
(
*
(
std
::
declval
<
HashTable
<
label
>>
().
begin
())));
PRINT_TYPEID
(
decltype
(
*
(
std
::
declval
<
const
HashTable
<
label
>>
().
begin
())));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
const
HashTable
<
label
>>
().
keys
()));
Info
<<
nl
;
PRINT_TYPEID
(
decltype
(
HashSet
<
label
>::
key_type
()));
PRINT_TYPEID
(
decltype
(
HashSet
<
label
>::
value_type
()));
// Not yet: PRINT_TYPEID(decltype(HashSet<label>::mapped_type()));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
HashSet
<
label
>>
().
begin
()));
PRINT_TYPEID
(
decltype
(
std
::
declval
<
const
HashSet
<
label
>>
().
begin
()));
PRINT_TYPEID
(
decltype
(
*
(
std
::
declval
<
HashSet
<
label
>>
().
begin
())));
PRINT_TYPEID
(
decltype
(
*
(
std
::
declval
<
const
HashSet
<
label
>>
().
begin
())));
Info
<<
nl
;
Info
<<
"
\n
End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cpuInfo/Make/files
0 → 100644
View file @
55e5a777
Test-cpuInfo.C
EXE = $(FOAM_USER_APPBIN)/Test-cpuInfo
OpenFOAM-v2112/applications/test/cpuInfo/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = */
/* EXE_LIBS = */
OpenFOAM-v2112/applications/test/cpuInfo/Test-cpuInfo.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 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 "cpuInfo.H"
#include "IOstreams.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int
main
(
int
argc
,
char
*
argv
[])
{
cpuInfo
().
write
(
Info
);
Info
<<
endl
;
return
0
;
}
// ************************************************************************* //
OpenFOAM-v2112/applications/test/cstring/Make/files
0 → 100644
View file @
55e5a777
Test-cstring.C
EXE = $(FOAM_USER_APPBIN)/Test-cstring
OpenFOAM-v2112/applications/test/cstring/Make/options
0 → 100644
View file @
55e5a777
/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */
/* EXE_LIBS = -lfiniteVolume */
Prev
1
…
18
19
20
21
22
23
24
25
26
…
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