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
b52bae62
Commit
b52bae62
authored
16 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
unused
parent
e06bf700
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/OpenFOAM/containers/Lists/PackedList/PackedListIO.C
+0
-152
0 additions, 152 deletions
src/OpenFOAM/containers/Lists/PackedList/PackedListIO.C
with
0 additions
and
152 deletions
src/OpenFOAM/containers/Lists/PackedList/PackedListIO.C
deleted
100644 → 0
+
0
−
152
View file @
e06bf700
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2008 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
"PackedList.H"
#include
"Ostream.H"
#include
"token.H"
#include
"contiguous.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template
<
class
T
>
void
PackedList
<
T
>::
writeEntry
(
Ostream
&
os
)
const
{
if
(
size
()
&&
token
::
compound
::
isCompound
(
"List<"
+
word
(
pTraits
<
T
>::
typeName
)
+
'>'
)
)
{
os
<<
word
(
"List<"
+
word
(
pTraits
<
T
>::
typeName
)
+
'>'
)
<<
" "
;
}
os
<<
*
this
;
}
template
<
class
T
>
void
PackedList
<
T
>::
writeEntry
(
const
word
&
keyword
,
Ostream
&
os
)
const
{
os
.
writeKeyword
(
keyword
);
writeEntry
(
os
);
os
<<
token
::
END_STATEMENT
<<
endl
;
}
template
<
class
T
>
Ostream
&
operator
<<
(
Ostream
&
os
,
const
PackedList
<
T
>&
L
)
{
// Write list contents depending on data format
if
(
os
.
format
()
==
IOstream
::
ASCII
||
!
contiguous
<
T
>
())
{
bool
uniform
=
false
;
if
(
L
.
size
()
>
1
&&
contiguous
<
T
>
())
{
uniform
=
true
;
unsigned
int
L0
=
L
.
get
(
0
);
forAll
(
L
,
i
)
{
if
(
L
.
get
(
i
)
!=
L0
)
{
uniform
=
false
;
break
;
}
}
}
if
(
uniform
)
{
// Write size of list and start contents delimiter
os
<<
L
.
size
()
<<
token
::
BEGIN_BLOCK
;
// Write list contents
os
<<
L
.
get
(
0
);
// Write end of contents delimiter
os
<<
token
::
END_BLOCK
;
}
else
if
(
L
.
size
()
<
11
&&
contiguous
<
T
>
())
{
// Write size of list and start contents delimiter
os
<<
L
.
size
()
<<
token
::
BEGIN_LIST
;
// Write list contents
forAll
(
L
,
i
)
{
if
(
i
>
0
)
os
<<
token
::
SPACE
;
os
<<
L
.
get
(
i
);
}
// Write end of contents delimiter
os
<<
token
::
END_LIST
;
}
else
{
// Write size of list and start contents delimiter
os
<<
nl
<<
L
.
size
()
<<
nl
<<
token
::
BEGIN_LIST
;
// Write list contents
forAll
(
L
,
i
)
{
os
<<
nl
<<
L
.
get
(
i
);
}
// Write end of contents delimiter
os
<<
nl
<<
token
::
END_LIST
<<
nl
;
}
}
else
{
os
<<
nl
<<
L
.
size
()
<<
nl
;
if
(
L
.
size
())
{
os
.
write
((
const
char
*
)
L
.
v_
,
L
.
size
()
*
sizeof
(
T
));
}
}
// Check state of IOstream
os
.
check
(
"Ostream& operator<<(Ostream&, const PackedList&)"
);
return
os
;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// ************************************************************************* //
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