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

change symmetric lduMatrix into asymmetric

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2011, 06:19
Default change symmetric lduMatrix into asymmetric
  #1
New Member
 
Marek
Join Date: Aug 2011
Posts: 6
Rep Power: 15
marek88 is on a distinguished road
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?
Marek
marek88 is offline   Reply With Quote

Old   August 24, 2011, 09:44
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22
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:

M.upper();
M.lower();

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, 10:02
Default
  #3
New Member
 
Marek
Join Date: Aug 2011
Posts: 6
Rep Power: 15
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.

Marek
marek88 is offline   Reply With Quote

Reply


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
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 20:12
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12
Symmetric problem - Asymmetric prediction Mark Main CFD Forum 14 January 29, 2001 14:21


All times are GMT -4. The time now is 03:20.