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

Entrywise matrix multiplication (Hadamard or Schur multiplication)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 25, 2014, 06:10
Default Entrywise matrix multiplication (Hadamard or Schur multiplication)
  #1
New Member
 
Thilo Franke
Join Date: Mar 2014
Location: Bunswick
Posts: 4
Rep Power: 12
denhelden is on a distinguished road
Hi,

i have a really simple question, but i didn't find the answer in the forum search or the programmer manual. I'd like to multiply two volScalarFields entrywise. This is also called Hadamard or Schur product.

Example: A ○ B = C with c11 = a11 * b11 (similar to the matrix addition)

How is this done in OpenFoam?

Thanks in advance
Thilo
denhelden is offline   Reply With Quote

Old   April 26, 2014, 14:50
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
Hi,

You might want to try

volScalarField C = A * B; //C[celli]=A[celli]*B[celli] where A[celli]: value of A at celli-th cell center

Hope this helps,
Fumiya
__________________
[Personal]
fumiya is offline   Reply With Quote

Old   April 28, 2014, 05:16
Default
  #3
New Member
 
Thilo Franke
Join Date: Mar 2014
Location: Bunswick
Posts: 4
Rep Power: 12
denhelden is on a distinguished road
Hi Fumiya,

thanks for your answer. I thought, * would be the Outer Product in OpenFoam when handeling tensors. So it is defined in another way with matrixVolFields? I have found over the weekend the function cmptMultiply. Is the result the same? Is there a recommendation for which function to use?

Greetings
Thilo
denhelden is offline   Reply With Quote

Old   July 18, 2019, 07:15
Default
  #4
Member
 
Rishikesh
Join Date: Apr 2016
Posts: 63
Rep Power: 9
mrishi is on a distinguished road
Hi,
Did you find the implementation of Hadamard product?

Regards,
mrishi
mrishi 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
Force can not converge colopolo CFX 13 October 4, 2011 22:03
OpenFOAM version 1.6 details lakeat OpenFOAM Running, Solving & CFD 42 August 26, 2009 21:47


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