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

change symmetric lduMatrix into asymmetric

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 24, 2011, 05:19
Default change symmetric lduMatrix into asymmetric
  #1
New Member
 
Marek
Join Date: Aug 2011
Posts: 6
Rep Power: 5
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, 08:44
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 397
Rep Power: 12
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, 09:02
Default
  #3
New Member
 
Marek
Join Date: Aug 2011
Posts: 6
Rep Power: 5
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

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


All times are GMT -4. The time now is 09:24.