Calculation of the gradient

238 views
Skip to first unread message

Jundi He

unread,
Jan 11, 2022, 9:30:21 AM1/11/22
to Nek5000
Hi Nek5000 users:

May I ask how to calculate the gradient of a variable vx, at only one direction? To calculate the gradient, I normally call subroutine gradm1:

call gradm1(dudx, dudy, dudz, vx)

But what if I only need the gradient at x direction (dudx), is there a subroutine that only calculates the gradient at one direction? Thanks!

Regards!
Jundi

Fischer, Paul

unread,
Jan 11, 2022, 9:57:41 AM1/11/22
to Jundi He, Nek5000
When you compute one, the others come for free, so there is no advantage
to computing just one.

This is because each requires application of the chain rule:

du/dx = r_x * du/dr + s_x * du/ds + t_x * du/dt

and it is the du/dr, du/ds, du/dt that is expensive.



From: nek...@googlegroups.com <nek...@googlegroups.com> on behalf of Jundi He <jund...@sheffield.ac.uk>
Sent: Tuesday, January 11, 2022 8:30 AM
To: Nek5000 <nek...@googlegroups.com>
Subject: [nek5000] Calculation of the gradient
 
--
You received this message because you are subscribed to the Google Groups "Nek5000" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nek5000+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nek5000/5854532b-5278-4e20-915f-47970322fc01n%40googlegroups.com.

Jundi He

unread,
Jan 11, 2022, 10:02:01 AM1/11/22
to Nek5000
Hi,

Thanks for the useful information. 

Regards!
Jundi

Reply all
Reply to author
Forward
0 new messages