grad_curv Module

Routines to calculate surface gradients and curvatures


Uses

  • module~~grad_curv~~UsesGraph module~grad_curv grad_curv data_arch data_arch module~grad_curv->data_arch fftw3 fftw3 module~grad_curv->fftw3 module~filter filter module~grad_curv->module~filter sort_arrays sort_arrays module~grad_curv->sort_arrays surfile surfile module~grad_curv->surfile module~filter->data_arch module~filter->fftw3 module~filter->sort_arrays module~filter->surfile module~stat_mom stat_mom module~filter->module~stat_mom module~stat_mom->data_arch module~stat_mom->sort_arrays

Used by

  • module~~grad_curv~~UsedByGraph module~grad_curv grad_curv program~test_grad_curv test_grad_curv program~test_grad_curv->module~grad_curv

Subroutines

public subroutine curv2(tab, nx, ny, dx, dy, gradxx, gradyy)

Function to calculate the double derivatives of a 2D array

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: tab

input 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along x

real(kind=R8), intent(in) :: dx

x lag

real(kind=R8), intent(in) :: dy

y lag

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradxx

double derivative along x, x 2D array

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradyy

double derivative along y, y 2D array

public subroutine curvature(tab, nx, ny, dx, dy, S_param_grad, S_param_curv, gcurvt)

Function to calculate the gaussian curvature of a 2D array, its mean quadratic value and the gradient mean quadratic value

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: tab

input 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along x

real(kind=R8), intent(in) :: dx

x lag

real(kind=R8), intent(in) :: dy

y lag

real(kind=R8), intent(out) :: S_param_grad

mean quadratic gradient value

real(kind=R8), intent(out) :: S_param_curv

mean quadratic curvature value

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gcurvt

gaussian curvature 2D array

private subroutine deriv_N(x, y, mat_d)

Function to provide the interpolation functions of a QU9 element, as well as its derivatives

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in) :: x

abscissa between -1 and +1

real(kind=R8), intent(in) :: y

ordinate between -1 and +1

real(kind=R8), intent(out), dimension(1:9, 1:6) :: mat_d

array containing N, dN/di, d2N/di2

public subroutine gauss_curv(gradx, grady, nx, ny, dx, dy, gradxx, gradyy, gradxy)

Function to calculate the double derivatives of a 2D array

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: gradx

derivative along x 2D array

real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: grady

derivative along y 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along x

real(kind=R8), intent(in) :: dx

x lag

real(kind=R8), intent(in) :: dy

y lag

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradxx

double derivative along x, x 2D array

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradyy

double derivative along y, y 2D array

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradxy

double derivative along x, y 2D array

public subroutine gradient(tab, nx, ny, dx, dy, gradx, grady)

Function to calculate the gradient of a 2D array

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: tab

Input 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along x

real(kind=R8), intent(in) :: dx

x lag

real(kind=R8), intent(in) :: dy

y lag

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: gradx

derivative along x 2D array

real(kind=R8), intent(out), dimension(1:nx, 1:ny) :: grady

derivative along y 2D array

private subroutine gradient_corner(hgt, gdx, gdy)

Function that gives the nodal height gradients

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:3, 1:3) :: hgt

local height 2D array

real(kind=R8), intent(out), dimension(1:3) :: gdx

nodal x gradient

real(kind=R8), intent(out), dimension(1:3) :: gdy

nodal x gradient

public subroutine label_surf_summits(tab, nx, ny, valleys, peaks, saddles, nb_summits)

Function to output the extrema of a 2D array, as peaks, valleys or saddles.

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: tab

input 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along y

integer(kind=I4), intent(out), dimension(:,:), allocatable :: valleys

list of valley coordinates

integer(kind=I4), intent(out), dimension(:,:), allocatable :: peaks

list of peaks coordinates

integer(kind=I4), intent(out), dimension(:,:), allocatable :: saddles

list of saddles coordinates

integer(kind=I4), intent(out), dimension(1:3) :: nb_summits

number of extrema of each kind

private subroutine labelize_point(height, label, x, y)

Function to label a point as: peak, valley, saddle or nothing particular

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:3, 1:3) :: height

nodal height values as a 2D array

character(len=1), intent(out) :: label

kind of point

real(kind=R8), intent(out), optional :: x

coordinates of the extremum found

real(kind=R8), intent(out), optional :: y

coordinates of the extremum found

public subroutine peaks_and_pits_curvatures(heights, nx, ny, dx, dy, S_param_grad, S_param_curv, peak_curv, pits_curv)

Function to calculate and output the peaks and pits curvatures as well as then mean quadratic gradient value and the mean quadratic curvature value.

Arguments

Type IntentOptional Attributes Name
real(kind=R8), intent(in), dimension(1:nx, 1:ny) :: heights

input 2D array

integer(kind=I4), intent(in) :: nx

number of pixels along x

integer(kind=I4), intent(in) :: ny

number of pixels along x

real(kind=R8), intent(in) :: dx

x lag

real(kind=R8), intent(in) :: dy

y lag

real(kind=R8), intent(out) :: S_param_grad

mean quadratic gradient value

real(kind=R8), intent(out) :: S_param_curv

mean quadratic curvature value

real(kind=R8), intent(out) :: peak_curv

3 first peaks mean curvature

real(kind=R8), intent(out) :: pits_curv

3 first pits mean curvature

public subroutine test_label_surf_summits()

Function to test the capicity in detecting peaks, pits and saddles in a simple double sinus surface.

Arguments

None

public subroutine test_labelize_point()

Function to test the function “labelize_point” on a QU9 domain with a 2nd order polynomial along x and y

Arguments

None

public subroutine test_peaks_and_pits_curvatures()

Function to test the function “peaks_and_pits_curvatures” on a real rough surface. Outputs surface gradients and curvatures as 2D arrays or single values.

Arguments

None