Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tomáš Jakubec
GTMesh
Commits
d44c22a8
Commit
d44c22a8
authored
Nov 15, 2019
by
Tomáš Jakubec
Browse files
Refactor, sppedup the export of the backward mapped cell properties.
parent
54bc1ed4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataReader.h
View file @
d44c22a8
...
...
@@ -33,6 +33,7 @@ class VTKMeshDataReader {
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
i
)).
size
();
j
++
){
ist
>>
value
[
j
];
}
DBGVAR
(
value
);
Traits
<
T
>::
ttype
::
template
setValue
<
Index
>(
data
.
at
(
i
),
value
);
}
...
...
Unstructured_mesh/UnstructuredMesh/MeshDataContainer/MeshDataIO/VTKMeshDataWriter.h
View file @
d44c22a8
...
...
@@ -27,29 +27,35 @@ class VTKMeshDataWriter {
{
if
(
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
()
==
MeshDimension
)
ost
<<
"VECTORS "
;
ost
<<
"VECTORS "
;
else
if
(
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
()
==
MeshDimension
*
MeshDimension
)
ost
<<
"TENZORS "
;
ost
<<
"TENZORS "
;
ost
<<
Traits
<
T
>::
ttype
::
template
getName
<
Index
>()
<<
" double
\n
"
;
IndexType
realIndex
=
0
;
for
(
IndexType
i
=
0
;
i
<
writer
.
getNumberOfCells
();
i
++
)
{
auto
iterator
=
writer
.
backwardCellIndexMapping
.
find
(
i
);
if
(
iterator
==
writer
.
backwardCellIndexMapping
.
end
()){
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
();
j
++
)
{
IndexType
localIndex
=
0
;
for
(
const
std
::
pair
<
IndexType
,
IndexType
>&
key
:
writer
.
backwardCellIndexMapping
)
{
while
(
localIndex
<
key
.
first
)
{
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
();
j
++
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))[
j
]
<<
' '
;
}
realIndex
++
;
}
else
{
realIndex
=
iterator
->
second
;
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
();
j
++
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))[
j
]
<<
' '
;
}
localIndex
++
;
}
realIndex
=
key
.
second
;
localIndex
++
;
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
();
j
++
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))[
j
]
<<
' '
;
}
}
while
(
realIndex
<
data
.
size
()
-
1
)
{
for
(
unsigned
int
j
=
0
;
j
<
Traits
<
T
>::
ttype
::
template
getReference
<
Index
>()
->
getValue
(
data
.
at
(
0
)).
size
();
j
++
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))[
j
]
<<
' '
;
}
realIndex
++
;
}
}
...
...
@@ -64,20 +70,20 @@ class VTKMeshDataWriter {
ost
<<
"SCALARS "
<<
Traits
<
T
>::
ttype
::
template
getName
<
Index
>()
<<
" double 1
\n
LOOKUP_TABLE default
\n
"
;
IndexType
realIndex
=
0
;
for
(
IndexType
i
=
0
;
i
<
writer
.
getNumberOfCells
();
i
++
)
{
auto
iterator
=
writer
.
backwardCellIndexMapping
.
find
(
i
);
if
(
iterator
==
writer
.
backwardCellIndexMapping
.
end
()){
IndexType
localIndex
=
0
;
for
(
const
std
::
pair
<
IndexType
,
IndexType
>&
key
:
writer
.
backwardCellIndexMapping
)
{
while
(
localIndex
<
key
.
first
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))
<<
' '
;
realIndex
++
;
}
else
{
realIndex
=
iterator
->
second
;
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))
<<
' '
;
localIndex
++
;
}
realIndex
=
key
.
second
;
localIndex
++
;
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))
<<
' '
;
}
while
(
realIndex
<
data
.
size
()
-
1
)
{
ost
<<
Traits
<
T
>::
ttype
::
template
getValue
<
Index
>(
data
.
at
(
realIndex
))
<<
' '
;
realIndex
++
;
}
}
...
...
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