Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xdmf
Xdmf
Commits
b52e0a2b
Commit
b52e0a2b
authored
Jul 21, 2017
by
Michal Habera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply indices to values array
parent
7fa397a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
XdmfAttribute.cpp
XdmfAttribute.cpp
+12
-4
No files found.
XdmfAttribute.cpp
View file @
b52e0a2b
...
...
@@ -27,6 +27,7 @@
#include "XdmfAttributeCenter.hpp"
#include "XdmfAttributeType.hpp"
#include "XdmfError.hpp"
#include "XdmfArray.hpp"
//-----------------------------------------------------------------------------
shared_ptr
<
XdmfAttribute
>
XdmfAttribute
::
New
()
...
...
@@ -157,7 +158,7 @@ XdmfAttribute::populateItem(
// If this attribute is FiniteElementFunction
if
(
mItemType
==
"FiniteElementFunction"
){
// FiniteElementFunction must have at least 2 children
if
(
childItems
.
size
()
<
2
)
{
...
...
@@ -169,7 +170,6 @@ XdmfAttribute::populateItem(
// Prepare arrays for values and indices
shared_ptr
<
XdmfArray
>
indices_array
;
shared_ptr
<
XdmfArray
>
values_array
;
shared_ptr
<
XdmfArray
>
parsed_array
;
// Iterate over each child under this Attribute
for
(
std
::
vector
<
shared_ptr
<
XdmfItem
>
>::
const_iterator
iter
=
...
...
@@ -193,8 +193,16 @@ XdmfAttribute::populateItem(
}
}
// TODO: Prepare here logic to combine indices and values to get single
// correct parsed_array
// Prepare new array
shared_ptr
<
XdmfArray
>
parsed_array
(
XdmfArray
::
New
());
parsed_array
->
initialize
(
XdmfArrayType
::
Float64
(),
indices_array
->
getSize
());
for
(
unsigned
int
i
=
0
;
i
<
indices_array
->
getSize
();
++
i
)
{
unsigned
int
index
=
indices_array
->
getValue
<
unsigned
int
>
(
i
);
parsed_array
->
insert
(
i
,
values_array
->
getValue
<
double
>
(
index
));
}
this
->
swap
(
parsed_array
);
if
(
parsed_array
->
getReference
())
{
...
...
Write
Preview
Markdown
is supported
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