SCIRun User Mailing List

[SCIRUN-USERS] Re: matrix manipulation question

• From: David Weinstein <dmw@sci.utah.edu>
• To: p.johnston@griffith.edu.au
• Cc: SCIRUN Users Mailing List <scirun-users@sci.utah.edu>
• Subject: [SCIRUN-USERS] Re: matrix manipulation question
• Date: Wed, 20 Apr 2011 00:10:48 -0600

 Hi Peter,The CalculateFieldData module can do what you've described.  Pass in the gradient field into its Field port and the conductivity tensors (as an Nx6 NRRD) into its NRRD port.  Then set the function text-entry string on the CalculateFieldData UI to be:RESULT = Vector(x(DATA)*xx(A)+y(DATA)*xy(A)+z(DATA)*xz(A), x(DATA)*xy(A)+y(DATA)*yy(A)+z(DATA)*yz(A), x(DATA)*xz(A)+y(DATA)*yz(A)+z(DATA)*zz(A));I created two synthetic vectors and two synthetic tensors, stored as ASCII text files, to demonstrate this for you.  Just place the attached .txt files in a folder along-side the attached current.srn network, and then run "scirun -e current.srn" from the command-line.Let me know if you have any questions about this or problems running it.Cheers,DaveOn Apr 17, 2011, at 9:57 PM, Peter Johnston wrote: Hi All,     I am seeking some advice regarding matrix multiplication in scirun. I have performed some external simulations of electric fields and am using scirun for visualisation. So, what I have is an array of points and the accompanying hex definition file to define the mesh, the solution at the node points and the anisotropic conductivity at the node points. I have found that I can read in the solution and subsequently obtain the gradient of the solution at the node points.     My question is, can I read in the conductivity matrix and multiply this by the array of gradients to obtain the current? The conductivity matrix is Nx6 (one row for each of the N node points) and, since the conductivity matrix is symmetric, has rows of the form     a11 a12 a13 a22 a23 a33 Hence the current vector at any node should be the matrix-vector product of this matrix (expanded to 3x3) at this node and the gradient vector calculated at the node. Is such a manipulation possible in scirun?     Thanks for your help,         Peter Johnston. ```-- ------------------------------------------------------------------------- Assoc. Prof. Peter Johnston Associate Professor in Applied Mathematics Phone (07) 3735 7748 School of Biomolecular and Physical Science Fax (07) 3735 7773 Griffith University Nathan Queensland 4111 AUSTRALIA ```

Attachment: current.srn
Description: Binary data

0 1 2 3 4 5
1 2 3 4 5 6
0 10 20
-5 2 7