Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
e6937f60
Commit
e6937f60
authored
Feb 11, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Feb 11, 2019
Browse files
ENH: add Ensight output support for a labelField (treat like scalarField)
parent
c137d3f8
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/fileFormats/ensight/file/ensightFile.C
View file @
e6937f60
...
...
@@ -326,10 +326,17 @@ void Foam::ensightFile::beginParticleCoordinates(const label nparticles)
}
void
Foam
::
ensightFile
::
writeList
(
const
UList
<
scalar
>&
field
)
void
Foam
::
ensightFile
::
writeList
(
const
UList
<
label
>&
field
)
{
for
(
const
label
val
:
field
)
{
write
(
scalar
(
val
));
newline
();
}
}
void
Foam
::
ensightFile
::
writeList
(
const
UList
<
scalar
>&
field
)
{
for
(
const
scalar
&
val
:
field
)
{
...
...
@@ -347,6 +354,7 @@ void Foam::ensightFile::writeList
}
void
Foam
::
ensightFile
::
writeList
(
const
UList
<
scalar
>&
field
,
...
...
@@ -368,4 +376,5 @@ void Foam::ensightFile::writeList
}
}
// ************************************************************************* //
src/fileFormats/ensight/file/ensightFile.H
View file @
e6937f60
...
...
@@ -191,6 +191,9 @@ public:
//- Begin a "particle coordinates" block (measured data)
void
beginParticleCoordinates
(
const
label
nparticles
);
//- Write a list of integers as float values
void
writeList
(
const
UList
<
label
>&
field
);
//- Write a list of floats as "%12.5e" or as binary
// With carriage return after each value (ascii stream)
void
writeList
(
const
UList
<
scalar
>&
field
);
...
...
src/fileFormats/ensight/type/ensightPTraits.C
View file @
e6937f60
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2015 OpenFOAM Foundation
...
...
@@ -29,6 +29,15 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template
<>
const
char
*
const
Foam
::
ensightPTraits
<
Foam
::
label
>::
typeName
=
"scalar"
;
template
<>
const
Foam
::
direction
Foam
::
ensightPTraits
<
Foam
::
label
>::
componentOrder
[]
=
{
0
};
template
<>
const
char
*
const
Foam
::
ensightPTraits
<
Foam
::
scalar
>::
typeName
=
"scalar"
;
...
...
@@ -47,7 +56,7 @@ const Foam::direction
Foam
::
ensightPTraits
<
Foam
::
vector
>::
componentOrder
[]
=
{
0
,
1
,
2
};
//
u
se mag(sphericalTensor) instead
//
U
se mag(sphericalTensor) instead
template
<>
const
char
*
const
Foam
::
ensightPTraits
<
Foam
::
sphericalTensor
>::
typeName
=
"scalar"
;
...
...
src/fileFormats/ensight/type/ensightPTraits.H
View file @
e6937f60
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2013-2015 OpenFOAM Foundation
...
...
@@ -29,6 +29,9 @@ Class
Description
Conversion of OpenFOAM pTraits into the Ensight equivalent
For the purpose of traits, integers (label) are treated like
floating point (scalar). Spherical tensors are mapped as a scalar.
\*---------------------------------------------------------------------------*/
#ifndef ensightPTraits_H
...
...
@@ -62,6 +65,12 @@ public:
static
const
direction
componentOrder
[];
};
template
<
>
const
char
*
const
ensightPTraits
<
label
>::
typeName
;
template
<
>
const
direction
ensightPTraits
<
label
>::
componentOrder
[];
template
<
>
const
char
*
const
ensightPTraits
<
scalar
>::
typeName
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment