Skip to content
ForCADDocumentation

boundary_index Interface

public interface boundary_index

Return flattened indices on a curve endpoint, surface edge, or volume face.

reverse, swap, and flip options map interface orientation without copying the associated control net.


Module Procedures

private pure subroutine boundary_index_1d(nc, side, reverse, idx)

Return the selected endpoint index of a one-dimensional control array.

Side 1 is the minimum endpoint and side 2 the maximum endpoint. Because an endpoint contains one index, reverse has no effect. An invalid side returns the sentinel array [0].

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nc

Number of controls.

integer, intent(in) :: side

Endpoint identifier, 1 for minimum or 2 for maximum.

logical, intent(in) :: reverse

Orientation flag; immaterial for a single endpoint.

integer, intent(out), allocatable :: idx(:)

One-element endpoint index, or [0] for an invalid side.

private pure subroutine boundary_index_2d(nc, side, reverse, idx)

Return direction-1-fastest control indices on one surface edge.

Sides 1:4 denote u_min, u_max, v_min, and v_max. The output is ordered along the tangential direction and reverse reverses that ordering. An invalid side returns an empty array.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), contiguous :: nc(:)

Directional control counts [nu,nv].

integer, intent(in) :: side

Surface-edge identifier in 1:4.

logical, intent(in) :: reverse

Reverse tangential output ordering when true.

integer, intent(out), allocatable :: idx(:)

Flattened one-based edge indices.

private pure subroutine boundary_index_3d(nc, side, reverse, swap, flip, idx)

Return direction-1-fastest control indices on one volume face.

Sides 1:6 denote the minimum and maximum faces normal to directions 1, 2, and 3. swap exchanges the two face coordinates, flip reverses either mapped coordinate, and reverse reverses the final flattened ordering. An invalid side returns an empty array.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), contiguous :: nc(:)

Directional control counts [nu,nv,nw].

integer, intent(in) :: side

Volume-face identifier in 1:6.

logical, intent(in) :: reverse

Reverse the final face ordering when true.

logical, intent(in) :: swap

Exchange the two tangential face directions when true.

logical, intent(in), contiguous :: flip(:)

Tangential-axis reversal flags; up to the first two entries apply.

integer, intent(out), allocatable :: idx(:)

Flattened one-based face indices.