Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julia
Nektar
Commits
7685fc06
Commit
7685fc06
authored
Jan 31, 2014
by
Spencer Sherwin
Browse files
Updated OutputTecplot to use a L2 error and also modified .tst files
parent
a9d09192
Changes
7
Hide whitespace changes
Inline
Side-by-side
utilities/PostProcessing/FieldConvert/OutputTecplot.cpp
View file @
7685fc06
...
...
@@ -59,7 +59,7 @@ namespace Nektar
void
OutputTecplot
::
Process
(
po
::
variables_map
&
vm
)
{
m_do
Flo
or
=
(
vm
.
count
(
"error"
)
==
1
)
?
true
:
false
;
m_do
Err
or
=
(
vm
.
count
(
"error"
)
==
1
)
?
true
:
false
;
if
(
!
m_f
->
m_exp
.
size
())
// do nothing if no expansion defined
{
...
...
@@ -164,16 +164,19 @@ namespace Nektar
m_f
->
m_exp
[
0
]
->
GetCoords
(
coords
[
0
],
coords
[
1
],
coords
[
2
]);
if
(
m_do
Flo
or
)
if
(
m_do
Err
or
)
{
// restrict coores to six significant figure
for
(
int
i
=
0
;
i
<
totpoints
;
++
i
)
NekDouble
l2err
;
std
::
string
coordval
[]
=
{
"x"
,
"y"
,
"z"
};
int
rank
=
m_f
->
m_session
->
GetComm
()
->
GetRank
();
for
(
int
i
=
0
;
i
<
coordim
;
++
i
)
{
for
(
int
j
=
0
;
j
<
3
;
++
j
)
l2err
=
m_f
->
m_exp
[
0
]
->
L2
(
coords
[
i
]);
if
(
rank
==
0
)
{
coords
[
j
][
i
]
*=
100000
;
coords
[
j
][
i
]
=
floor
(
coords
[
j
][
i
]);
coords
[
j
][
i
]
/=
100000
;
cout
<<
"L 2 error (variable "
<<
coordval
[
i
]
<<
") : "
<<
l2err
<<
endl
;
}
}
}
...
...
@@ -268,21 +271,16 @@ namespace Nektar
m_f
->
m_exp
[
field
]
->
UpdatePhys
());
}
if
(
m_do
Flo
or
)
if
(
m_do
Err
or
)
{
for
(
int
i
=
0
;
i
<
totpoints
;
++
i
)
NekDouble
l2err
=
m_f
->
m_exp
[
0
]
->
L2
(
m_f
->
m_exp
[
field
]
->
UpdatePhys
());
if
(
m_f
->
m_session
->
GetComm
()
->
GetRank
()
==
0
)
{
NekDouble
val
=
m_f
->
m_exp
[
field
]
->
GetPhys
()[
i
];
val
*=
100000
;
val
=
floor
(
val
);
val
/=
100000
;
outfile
<<
val
<<
" "
;
if
((
!
(
i
%
1000
))
&&
i
)
{
outfile
<<
std
::
endl
;
}
cout
<<
"L 2 error (variable "
<<
m_f
->
m_fielddef
[
0
]
->
m_fields
[
field
]
<<
") : "
<<
l2err
<<
endl
;
}
}
else
{
...
...
utilities/PostProcessing/FieldConvert/OutputTecplot.h
View file @
7685fc06
...
...
@@ -59,7 +59,7 @@ namespace Nektar
virtual
void
Process
(
po
::
variables_map
&
vm
);
private:
bool
m_do
Flo
or
;
bool
m_do
Err
or
;
void
WriteTecplotHeader
(
std
::
ofstream
&
outfile
,
std
::
string
var
);
...
...
utilities/PostProcessing/FieldConvert/Tests/bfs_tec.tst
View file @
7685fc06
...
...
@@ -8,11 +8,13 @@
<file
description=
"Session File"
>
bfs_tg.fld
</file>
</files>
<metrics>
<metric
type=
"file"
id=
"1"
>
<file
filename=
"bfs_tg.dat"
>
<sha1>
2a8aca916f8db040c2a8c2ced64cc3298ddfac04
</sha1>
</file>
</metric>
<metric
type=
"L2"
id=
"1"
>
<value
variable=
"x"
tolerance=
"1e-6"
>
289.252
</value>
<value
variable=
"y"
tolerance=
"1e-6"
>
6.0553
</value>
<value
variable=
"u"
tolerance=
"1e-6"
>
4.6773
</value>
<value
variable=
"v"
tolerance=
"1e-6"
>
0.172187
</value>
<value
variable=
"p"
tolerance=
"1e-6"
>
0.359627
</value>
</metric>
</metrics>
</test>
utilities/PostProcessing/FieldConvert/Tests/bfs_tec_rng.tst
View file @
7685fc06
...
...
@@ -8,11 +8,13 @@
<file
description=
"Session File"
>
bfs_tg.fld
</file>
</files>
<metrics>
<metric
type=
"file"
id=
"1"
>
<file
filename=
"bfs_tg.dat"
>
<sha1>
7d8fb6d1df918e7218f8d5705742e67a69fd51bc
</sha1>
</file>
</metric>
<metric
type=
"L2"
id=
"1"
>
<value
variable=
"x"
tolerance=
"1e-6"
>
1.35354
</value>
<value
variable=
"y"
tolerance=
"1e-6"
>
1.09498
</value>
<value
variable=
"u"
tolerance=
"1e-6"
>
1.15931
</value>
<value
variable=
"v"
tolerance=
"1e-6"
>
0.0195245
</value>
<value
variable=
"p"
tolerance=
"1e-6"
>
0.119152
</value>
</metric>
</metrics>
</test>
utilities/PostProcessing/FieldConvert/Tests/chan3D_tec.tst
View file @
7685fc06
...
...
@@ -8,11 +8,15 @@
<file
description=
"Session File"
>
chan3D.fld
</file>
</files>
<metrics>
<metric
type=
"file"
id=
"1"
>
<file
filename=
"chan3D.dat"
>
<sha1>
5775c16cc4c8f1a2e059170c6fbbbcb4739c8659
</sha1>
</file>
</metric>
<metric
type=
"L2"
id=
"1"
>
<value
variable=
"x"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"y"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"z"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"u"
tolerance=
"1e-6"
>
2.0864
</value>
<value
variable=
"v"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"w"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"p"
tolerance=
"1e-6"
>
6.59218
</value>
</metric>
</metrics>
</test>
utilities/PostProcessing/FieldConvert/Tests/chan3D_tec_n10.tst
View file @
7685fc06
...
...
@@ -8,11 +8,15 @@
<file
description=
"Session File"
>
chan3D.fld
</file>
</files>
<metrics>
<metric
type=
"file"
id=
"1"
>
<file
filename=
"chan3D.dat"
>
<sha1>
bafe913a59cdd16b5bc298d3379b14bbd6a8d387
</sha1>
</file>
</metric>
<metric
type=
"L2"
id=
"1"
>
<value
variable=
"x"
tolerance=
"1e-6"
>
1.63299
</value>
<value
variable=
"y"
tolerance=
"1e-6"
>
1.63299
</value>
<value
variable=
"z"
tolerance=
"1e-6"
>
1.63299
</value>
<value
variable=
"u"
tolerance=
"1e-6"
>
2.06559
</value>
<value
variable=
"v"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"w"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"p"
tolerance=
"1e-6"
>
6.53197
</value>
</metric>
</metrics>
</test>
utilities/PostProcessing/FieldConvert/Tests/chan3D_tec_par.tst
View file @
7685fc06
...
...
@@ -9,16 +9,15 @@
<file
description=
"Session File"
>
chan3D.fld
</file>
</files>
<metrics>
<metric
type=
"file"
id=
"1"
>
<file
filename=
"chan3D_P0.dat"
>
<sha1>
9bfd6d3bc24137f77f32a3148ee69eafdcf811ab
</sha1>
</file>
</metric>
<metric
type=
"file"
id=
"2"
>
<file
filename=
"chan3D_P1.dat"
>
<sha1>
7eb90cc0db9d011be2552d72a6c3c9e665a9d720
</sha1>
</file>
</metric>
<metric
type=
"L2"
id=
"1"
>
<value
variable=
"x"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"y"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"z"
tolerance=
"1e-6"
>
1.69239
</value>
<value
variable=
"u"
tolerance=
"1e-6"
>
2.0864
</value>
<value
variable=
"v"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"w"
tolerance=
"1e-6"
>
0
</value>
<value
variable=
"p"
tolerance=
"1e-6"
>
6.59218
</value>
</metric>
</metrics>
</test>
Write
Preview
Supports
Markdown
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