Register Blogs Members List Search Today's Posts Mark Forums Read

 March 13, 2017, 14:50 Matrix addressing #1 New Member   Basel Abu-sinni Join Date: Mar 2017 Posts: 6 Rep Power: 9 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: 12 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: 9
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!