SCIRun User Mailing List

Text archives Help

Re: [SCIRUN-USERS] Couple of SCIRun5 questions.

Chronological Thread 
  • From: Daniel White <>
  • To: Peter Johnston <>
  • Cc: "" <>
  • Subject: Re: [SCIRUN-USERS] Couple of SCIRun5 questions.
  • Date: Thu, 3 Dec 2020 13:16:33 -0700
  • Ironport-sdr: Yr5qB2zkais0xYT94cI7Q3yiYctG1DsyPLVxFUKopXcpyQavy/eKQfVXtExWrSoYMnzflgYsG2 zGH6QkzjRrrGlf2kPb0S400DfC3hlKR8303s9coVYcjcEUrKbA0A0xMg6PGsy7x9RfJ1/Nrjnz xnGW5EdmRfwzguetGAYZ348YmDdpvpgiYfYhiX+RLNDIj/w7PnaXVXjBUKGQObo99EpmbojA3z /JslDE2kK04czVYjzJJehnOWKuTF4/qnH+ETert7dbT+wF+/HZ6T1FpSV28fHpHKemoa4LTCtQ dmo=

This is another good question for the discussion page, if you could copy/paste your question there, I will copy/paste my answer.

1. There’s an open issue for that, as it is not implemented in v5 yet. We have yet to get enough consistent graphics developer time to get it done, but you can watch it here:

2. Here’s a description of the general sparse row storage format: 

You have the first part exactly, #rows, #cols, #nonzero elements.

Then SCIRun saves the outer indices (row counters) first, then the inner indices (columns), then the nonzero values. The “8” is there since the rows and columns are stored in an index form that specifies the width of the index variable in bytes (this is more crucial for the binary representation, but it uses the same code at the matrix level). The row accumulator vector should end in the number of nonzero elements (56 in this case), but the initial zero is extraneous—we may only write that for some ancient backward compatibility requirement. It’s not counting row index position, but # of zeros in each row (as partial sums). Since there is exactly one nonzero in every row, you get all the numbers from 1 to 56. The next vector has the column indices of each value, so that’s essentially the mapping in this case. Then the value vector is written in floating point, so no “8” printed—it’s always an 8-byte double—and these are just 1s so no decimal part is printed there either.

If you hook up a CreateMatrix module to ConvertMatrixType (set to Sparse) to a WriteMatrix (saving as SCI ASCII), you can experiment with small example matrices to see how the format works.

And sorry I’ve gotten behind on solving the Linux build problem, the other Linux users have other versions of Linux, or older versions of Ubuntu, and my home 20.04 machine just bit the dust I think. So that answer might be a few more weeks to solve.

On Dec 2, 2020, at 11:17 PM, Peter Johnston <> wrote:


I have a couple of questions regarding SCIRun5:
  1. How do you display node numbers in ViewScene window? I know how to do this in SCIRun 4, but the same option no longer appears in SCIRun 5. (Apologies if this is a dumb question.)
  2. Could someone explain the file format of the SparseRowMatrix (ASCII) output file. I am mainly interested in the long line that contains all the values. I have attached a simple SCIRun file that illustrates my question as well as the saved sparse matrix file. The example is a simple 4x4x4 cubic mesh. I generate the mesh and then extract the boundary using GetFieldBoundary. One of the outputs from this is a SparseRowMatrix (presumably) mapping the boundary nodes to the overall node numbers in the original 3D mesh. Looking at the long line in the sparse matrix file, the first three numbers are reasonably clear: the number of nodes in the boundary mesh (56), the number of nodes in the original mesh (64), the number of non-zero elements in the matrix (56). There are then three sets of numbers between pairs of {}’s. The first set starts with the number ‘8’ and then has 57 numbers running from 0 to 56. Two questions: (1) what is the ‘8’ for? (2) Shouldn’t the following numbers run from 0 to 55? The next set of numbers again starts with an ‘8’ and then there are 56 unique numbers from the range 0 to 63 (this is presumably the mapping?) Again, why the ‘8’? The last set of numbers contains 56 1’s. It is reasonably clear what this means.
Any help in understanding these points would be much appreciated.



Associate Professor Peter Johnston (FAustMS, FIMA)
School of Environment and Science
Griffith University | Nathan | QLD 4111 | Technology (N44) Room 3.19
T +61 7 373 57748| F +61 7 373 57656 Email
SCIRun users mailing list:
To unsubscribe, email with the "unsubscribe scirun-users" in the message body.

Archive powered by MHonArc 2.6.18.

Top of page