Skip to content
ForCADDocumentation

ndgrid Interface

public interface ndgrid

Form a two- or three-dimensional tensor-product coordinate grid.

Returned point rows follow Fortran ordering: the first input vector varies fastest.


Module Procedures

private pure subroutine ndgrid2(X_dir1, X_dir2, Xt)

Form all pairs from two directional coordinate vectors. Row i+(j-1)*size(X_dir1) contains [X_dir1(i),X_dir2(j)].

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: X_dir1(:)
real(kind=rk), intent(in), contiguous :: X_dir2(:)
real(kind=rk), intent(out), allocatable :: Xt(:,:)

private pure subroutine ndgrid3(X_dir1, X_dir2, X_dir3, Xt)

Form all triples from three directional coordinate vectors. Direction 1 varies fastest, followed by directions 2 and 3.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: X_dir1(:)
real(kind=rk), intent(in), contiguous :: X_dir2(:)
real(kind=rk), intent(in), contiguous :: X_dir3(:)
real(kind=rk), intent(out), allocatable :: Xt(:,:)