# Matrix addressing

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 March 13, 2017, 14:50 Matrix addressing #1 New Member   Basel Abu-sinni Join Date: Mar 2017 Posts: 6 Rep Power: 7 Hi, I'm very new to OpenFOAM, and I've been tasked in exporting a certain matrix's data from the solver on each time-step. I've read Matrices_in_OpenFOAM but unfortunately I didn't fully understand lduaddressing... where can I find more examples on the subject? as I mentioned, I need to export the matrix's data, meaning I need to loop over all non-zero entries and output the value along with its row-col index. any tips are very much welcomed. Thanks in advance, Basel

 March 14, 2017, 10:23 #2 New Member   Hasan Shetabivash Join Date: Jan 2017 Location: Montreal Posts: 17 Rep Power: 10 Dear BaselAS, LduAddressing keeps the addressing of related cells. In lduMatrix coefficients are stored in three list named diagonal, upper and lower. If you just want to export the fvMatrix data you can simply use << operator for those list. And if you want to have indexing of all the lists you need to loop over all faces. The following example may help you. Code: ``` fvScalarMatrix TEqn ( fvm::ddt(T)+ fvm::laplacian(dimensionedScalar("D", dimensionSet(0,2,-1,0,0,0,0), 1), T) ); //Printing diagonal lower and upper lists Info<

March 14, 2017, 12:11
#3
New Member

Basel Abu-sinni
Join Date: Mar 2017
Posts: 6
Rep Power: 7
Quote:
 Originally Posted by hasan_shetabivash Dear BaselAS, LduAddressing keeps the addressing of related cells. In lduMatrix coefficients are stored in three list named diagonal, upper and lower. If you just want to export the fvMatrix data you can simply use << operator for those list. And if you want to have indexing of all the lists you need to loop over all faces. The following example may help you. Code: ``` fvScalarMatrix TEqn ( fvm::ddt(T)+ fvm::laplacian(dimensionedScalar("D", dimensionSet(0,2,-1,0,0,0,0), 1), T) ); //Printing diagonal lower and upper lists Info<
That's fantastic, exactly what I needed!
Thank you very much!

 Tags addressing, export data, matrix

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post maybee OpenFOAM Programming & Development 10 August 1, 2020 07:55 maybee OpenFOAM Programming & Development 0 December 7, 2013 12:40 colopolo CFX 13 October 4, 2011 22:03 lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 21:47 marziolettich OpenFOAM Running, Solving & CFD 2 February 19, 2008 05:04

All times are GMT -4. The time now is 06:37.

 Contact Us - CFD Online - Privacy Statement - Top