Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
f4093656
Commit
f4093656
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
added unsigned label uLabel
parent
ef42bea6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/OpenFOAM/Make/files
+1
-0
1 addition, 0 deletions
src/OpenFOAM/Make/files
src/OpenFOAM/primitives/uLabel/uLabel.C
+56
-0
56 additions, 0 deletions
src/OpenFOAM/primitives/uLabel/uLabel.C
src/OpenFOAM/primitives/uLabel/uLabel.H
+169
-0
169 additions, 0 deletions
src/OpenFOAM/primitives/uLabel/uLabel.H
with
226 additions
and
0 deletions
src/OpenFOAM/Make/files
+
1
−
0
View file @
f4093656
...
...
@@ -14,6 +14,7 @@ primitives/long/longIO.C
primitives/longLong/longLongIO.C
primitives/ulong/ulongIO.C
primitives/label/label.C
primitives/uLabel/uLabel.C
primitives/Scalar/doubleScalar/doubleScalar.C
primitives/Scalar/floatScalar/floatScalar.C
primitives/Scalar/scalar/scalar.C
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/primitives/uLabel/uLabel.C
0 → 100644
+
56
−
0
View file @
f4093656
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include
"uLabel.H"
#include
"error.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const
char
*
const
pTraits
<
uLabel
>::
typeName
=
"uLabel"
;
const
uLabel
pTraits
<
uLabel
>::
zero
=
0
;
const
uLabel
pTraits
<
uLabel
>::
one
=
1
;
const
char
*
pTraits
<
uLabel
>::
componentNames
[]
=
{
"x"
};
pTraits
<
uLabel
>::
pTraits
(
Istream
&
is
)
{
is
>>
p_
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
src/OpenFOAM/primitives/uLabel/uLabel.H
0 → 100644
+
169
−
0
View file @
f4093656
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Typedef
Foam::uLabel
Description
A uLabel is an unsigned label. See label.H.
\*---------------------------------------------------------------------------*/
#ifndef uLabel_H
#define uLabel_H
#include
<climits>
#include
<cstdlib>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#if FOAM_LABEL64
# define WANTEDURANGE 18000000000000000000
#else
# define WANTEDURANGE 4000000000
#endif
#if UINT_MAX > WANTEDURANGE
// Define uLabel as an unsigned int
#include
"uint.H"
namespace
Foam
{
typedef
unsigned
int
uLabel
;
static
const
uLabel
uLabelMax
=
UINT_MAX
;
inline
uLabel
readULabel
(
Istream
&
is
)
{
return
readUint
(
is
);
}
}
// End namespace Foam
#elif ULONG_MAX > WANTEDURANGE
// Define uLabel as an unsigned long
#include
"uint.H"
#include
"ulong.H"
namespace
Foam
{
typedef
unsigned
long
uLabel
;
static
const
uLabel
uLabelMax
=
LONG_MAX
;
inline
uLabel
readULabel
(
Istream
&
is
)
{
return
readUlong
(
is
);
}
}
// End namespace Foam
#elif ULLONG_MAX > WANTEDURANGE
// Define uLabel as an unsigned long long
#error "Not implemented yet"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include
"pTraits.H"
#include
"direction.H"
namespace
Foam
{
// template specialisation for pTraits<label>
template
<
>
class
pTraits
<
uLabel
>
{
uLabel
p_
;
public:
//- Component type
typedef
uLabel
cmptType
;
// Member constants
enum
{
dim
=
3
,
// Dimensionality of space
rank
=
0
,
// Rank of uLabel is 0
nComponents
=
1
// Number of components in uLabel is 1
};
// Static data members
static
const
char
*
const
typeName
;
static
const
char
*
componentNames
[];
static
const
uLabel
zero
;
static
const
uLabel
one
;
// Constructors
//- Construct from Istream
pTraits
(
Istream
&
is
);
// Member Functions
operator
uLabel
()
const
{
return
p_
;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline
uLabel
&
setComponent
(
uLabel
&
l
,
const
direction
)
{
return
l
;
}
inline
uLabel
component
(
const
uLabel
l
,
const
direction
)
{
return
l
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment