CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

scalarSquareMatrix to SparseMatrix

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 4, 2018, 09:05
Default scalarSquareMatrix to SparseMatrix
  #1
New Member
 
Join Date: Dec 2018
Posts: 2
Rep Power: 0
giuseppe03 is on a distinguished road
Hi everybody,


I wrote a script using:
Code:
scalarSquareMatrix Kappa( DIM ,Zero);

and I access to the element writing Kappa[i][j];


now I need a sparse matrix, because I'm increasing the size of this matrix.


Can I just change the "declaration"? Or do I need to rewrite all the script in a different way?


I'm looking for something like sparse matrix Kappa(DIM)

https://es.mathworks.com/help/matlab/ref/sparse.html

I tried with:
LduMatrix<scalar,scalar,scalar> Kappa(DIM), but it doesn't work.


At the end I solve a system like that:


Code:
scalarField RHS(size, 0);

LUscalarMatrix LU(Kappa);

scalarField UU(LU.solve(RHS));


Thanks for the help in advance!

Last edited by giuseppe03; December 5, 2018 at 09:11.
giuseppe03 is offline   Reply With Quote

Reply

Tags
ldumatrix, matrix, sparse

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
inner product of a scalarSquareMatrix and scalarDiagonalMatrix. sharonyue OpenFOAM Programming & Development 0 June 3, 2014 04:37


All times are GMT -4. The time now is 14:48.