||February 14, 2013 12:26
terms with the second derivative
I need to discretize/calculate terms which contain second derivative (not Laplacian), as follows:
and non-linear term with first derivative:
For now the only way which works for me is to calculate twice the gradient of the function:
gradf = fvc::grad(f); \\ it gives (f_x, f_y)
gradgradf0 = fvc::grad(gradf.component(0)); \\it gives (f_xx, f_yx)
gradgradf1 = fvc::grad(gradf.component(1)); \\it gives (f_xy, f_yy)
then term 1. is:
gradgradf1.component(1); \\ f_xy
term 2. is:
gradgradf0.component(0) - gradgradf1.component(1); \\ (f_xx - f_yy)
term 3. is:
gradf.component(0)*gradf.component(0) - gradf.component(1)*gradf.component(1); \\ (f_x)^2- (f_y)^2
but unfortunately second derivative calculated as above gives me non-smooth results...
Is there any other/better way to compute terms like the one above ?