CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

change symmetric lduMatrix into asymmetric

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

LinkBack Thread Tools Display Modes
Old   August 24, 2011, 05:19
Default change symmetric lduMatrix into asymmetric
New Member
Join Date: Aug 2011
Posts: 6
Rep Power: 8
marek88 is on a distinguished road
Sponsored Links
The fvm::laplacian(psi) returns a symmetric matrix M.

I am trying to modify single entries of this matrix by accessing M.upper() and M.lower(). Unfortunately every modification of M.upper() is treated as if M.lower() is modified as well, because a symmetric matrix holds only one shared pointer for both fields.

How can I change this matrix into an asymmetric matrix?
lduMatrix::upper() is implemented such that it duplicates (*lowerPtr_) into a new scalarField, if only *lowerPtr_ exists but not *upperPtr_.
Unfortunately, this is not implemented vice versa: fvm::laplacian(psi) is written such that it defines only *upperPtr_ but not *lowerPtr_. And lduMatrix::lower() does not duplicate (*upperPtr_) into a new scalarField if (*lowerPtr_) doesn't exist.

Can somebody help?
marek88 is offline   Reply With Quote
Sponsored Links

Old   August 24, 2011, 08:44
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 436
Rep Power: 15
marupio is on a distinguished road
All you need to do is make a non-const access request for both the upper and lower. Just write:


If your M is not const, then your matrix is now asymmetric... Although at this point upper and lower are still the same.
marupio is offline   Reply With Quote

Old   August 24, 2011, 09:02
New Member
Join Date: Aug 2011
Posts: 6
Rep Power: 8
marek88 is on a distinguished road
Thank you, marupio, you are right.

I was confused by the lduMatrix source code, when I wrote about different implementations of lower() and upper(). Actually both are implemented equivalent.

marek88 is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell zone index/thread during simulation neilduffy1024 FLUENT 0 January 17, 2011 10:40
Merits and Demerits of symmetric and asymmetric re Mukkarum Husain Main CFD Forum 0 January 7, 2009 09:46
asymmetric solution generated by symmetric problem Twiti CFX 7 October 16, 2004 19:12
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
Symmetric problem - Asymmetric prediction Mark Main CFD Forum 14 January 29, 2001 14:21

Sponsored Links

All times are GMT -4. The time now is 01:33.