nurbs_multipatch_volume Derived Type
type, public :: nurbs_multipatch_volume
Ordered collection of connected trivariate NURBS patches.
Valid side labels are u_min/u_max, v_min/v_max, and w_min/w_max,
including the short aliases accepted by connect. The patch-B face map
can reverse orientation, swap its two tangential axes, and flip either
mapped axis. continuity=-1 stores topology without constraints.
Sampling is independent of the IGA knot discretization. The legacy
res1/res2/res3 form broadcasts three counts. A rank-one res contains
common directional counts, while rank-two res(d,k) specifies direction
d of patch k. create(target_size=h) estimates counts in physical
space. New resolution overloads synchronize connected face-tangential
directions by default, including axis swaps; synchronize=.false.
retains exact independent requests.
Diagnostic codes are: 201 invalid patch identifier; 202 invalid side; 203 invalid continuity metadata; 204 incompatible interface geometry or trace space; 205 invalid patch state; 206 invalid sampling request; and 207 invalid transformation data and 208 invalid or unrepresentable sensitivity data.
Components
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(debug), | public | :: | err |
Recoverable diagnostic state for the most recent failed operation. |
Type-Bound Procedures
procedure, public :: add_patch => add_patch_volume
Append a validated patch copy and optionally return its identifier.
-
private pure subroutine add_patch_volume(this, patch, id)
Append a copy of a valid volume patch.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this Multipatch container.
type(nurbs_volume), intent(in) :: patch Complete, internally consistent volume geometry with a clear diagnostic state.
integer, intent(out), optional :: id Assigned one-based patch identifier; zero is returned on failure.
procedure, public :: assemble_sensitivities => assemble_sensitivities_volume
Assemble independent control and log-weight gradients.
-
private pure subroutine assemble_sensitivities_volume(this, local_dXc, local_dlogWc, dXc, dlogWc, err, map)
Assemble patch-local partials in independent design variables. See
assemble_design_gradient.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this real(kind=rk), intent(in), optional :: local_dXc(:,:) real(kind=rk), intent(in), optional :: local_dlogWc(:) real(kind=rk), intent(out), optional, allocatable :: dXc(:,:) real(kind=rk), intent(out), optional, allocatable :: dlogWc(:) type(debug), intent(out), optional :: err integer, intent(out), optional, allocatable :: map(:)
procedure, public :: cmp_dof_constraint => cmp_dof_constraint_volume
Assemble derivative-continuity equations in CSR form.
-
private pure subroutine cmp_dof_constraint_volume(this, rowptr, col, val, geometric, field, err, active_only)
Assemble one-based sparse continuity equations for connected faces. Call
is_validto verify the geometry. Seeconstraint_rowsfor the field, solver-numbering and connection-filter options.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this integer, intent(out), allocatable :: rowptr(:) integer, intent(out), allocatable :: col(:) real(kind=rk), intent(out), allocatable :: val(:) logical, intent(in), optional :: geometric logical, intent(in), optional :: field type(debug), intent(out), optional :: err logical, intent(in), optional :: active_only
procedure, public :: cmp_dof_map => cmp_dof_map_volume
Compact directly shareable controls.
-
private pure function cmp_dof_map_volume(this, active_only) result(map)
Number scalar controls across periodic seams and directly shareable faces. The input index follows patch storage order. A directly shared trace requires an interpolatory endpoint on each side and proportional oriented trace weights. Call
is_validto check the geometry. General traces use cmp_dof_constraint.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this logical, intent(in), optional :: active_only Number participating controls in first-active storage order and return zero elsewhere.
Return Value integer, allocatable, (:)
procedure, public :: cmp_dof_offsets => cmp_dof_offsets_volume
Return prefix offsets for unmerged patch controls.
-
private pure function cmp_dof_offsets_volume(this) result(offsets)
Return prefix offsets into patch-concatenated control-variable numbering. The result starts at zero and its final entry is the total unmerged control-point count across all volume patches.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value integer, allocatable, (:)
procedure, public :: cmp_elem => cmp_elem_volume
Concatenate patch element connectivity with optional shared numbering.
-
private pure function cmp_elem_volume(this, shared, active_only) result(elem)
Concatenate active tensor-product elements from all volume patches. Rows follow patch insertion order and direction-1-fastest local element order. Different local basis sizes are zero-padded to the largest row.
shared=.true.applies direct sharing from the compact map; the default retains unmerged patch-offset numbering. General unclamped traces and rational traces with nonconstant projective scale still requirecmp_dof_constraint.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this logical, intent(in), optional :: shared logical, intent(in), optional :: active_only Use the shared active solver IDs, with zero padding for shorter element rows.
Return Value integer, allocatable, (:,:)
procedure, public :: cmp_elem_local => cmp_elem_local_volume
Return the patch-local identifier for every global element.
-
private pure function cmp_elem_local_volume(this) result(local_id)
Return each concatenated element's one-based patch-local identifier.
Result ordering is identical to cmp_elem.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value integer, allocatable, (:)
procedure, public :: cmp_elem_patch => cmp_elem_patch_volume
Return the owning patch identifier for every global element.
-
private pure function cmp_elem_patch_volume(this) result(patch_id)
Return the owning patch identifier for every concatenated element.
Result ordering is identical to cmp_elem.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value integer, allocatable, (:)
procedure, public :: connect => connect_volume
Validate metadata and trace-space shape, then record a face interface.
-
private pure subroutine connect_volume(this, patch_a, side_a, patch_b, side_b, continuity, reverse, swap, flip, geometric, reparameterization, transition_jet, projective_jet)
Record two volume faces with parametric or geometric metadata.
geometricdefaults to.false.for C^n continuity. For the compact G^n representation,reparameterizationstores the scalar normal transition derivatives. The general representation usestransition_jet(i,j,c,r), the tensor-product Bernstein coefficient(i,j)of . Componentsc=1:2follow the two mapped patch-B tangential directions after orientation andc=3is the patch-B normal coordinate.projective_jet(i,j,r+1)stores the corresponding homogeneous projective-factor derivatives. Do not pass both compact and full transition jets.The mapped tangential degrees must match. At order zero with an implicit weight scale, interpolating normal endpoints also accept a whole clamped face refined by knot insertion in either or both tangential directions. Call
is_validto verify physical geometry and denominator compatibility.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this Multipatch container.
integer, intent(in) :: patch_a One-based first patch identifier.
character(len=*), intent(in) :: side_a First face label (
u_minthroughw_max).integer, intent(in) :: patch_b One-based second patch identifier.
character(len=*), intent(in) :: side_b Second face label.
integer, intent(in), optional :: continuity Requested order, default zero;
-1disables constraints.logical, intent(in), optional :: reverse Reverse both mapped tangential orientations.
logical, intent(in), optional :: swap Exchange patch-B tangential axes before matching.
logical, intent(in), optional, contiguous :: flip(:) Reverse either mapped patch-B tangential axis.
logical, intent(in), optional :: geometric Select geometric rather than parametric continuity.
real(kind=rk), intent(in), optional, contiguous :: reparameterization(:) Compact normalized normal transition derivatives for .
real(kind=rk), intent(in), optional, contiguous :: transition_jet(:,:,:,:) Full Bernstein transition coefficients
[q1+1,q2+1,3,n].real(kind=rk), intent(in), optional, contiguous :: projective_jet(:,:,:) Bernstein projective-factor coefficients
[q1+1,q2+1,n+1].
generic, public :: create => create_common, create_uniform, create_patches, create_automatic
Sample patches with common, patch-specific, or physically scaled resolutions.
-
private pure subroutine create_volume(this, res1, res2, res3, Xt1, Xt2, Xt3, Xt)
Sample every volume patch with common directional sampling arguments. Arguments are forwarded unchanged to create. Any patch failure is converted to multipatch diagnostic code 205.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this integer, intent(in), optional :: res1 integer, intent(in), optional :: res2 integer, intent(in), optional :: res3 real(kind=rk), intent(in), optional, contiguous :: Xt1(:) real(kind=rk), intent(in), optional, contiguous :: Xt2(:) real(kind=rk), intent(in), optional, contiguous :: Xt3(:) real(kind=rk), intent(in), optional, contiguous :: Xt(:,:) -
private pure subroutine create_volume_uniform(this, res, synchronize)
Sample every volume patch with one common directional resolution.
res=[n_u,n_v,n_w]is broadcast before connected tangential directions are synchronized. This rank-one overload complements the legacyres1/res2/res3keywords without changing their behavior.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this integer, intent(in), contiguous :: res(:) Three positive directional sample counts.
logical, intent(in), optional :: synchronize Synchronize connected tangential counts; default is true.
-
private pure subroutine create_volume_patches(this, res, synchronize)
Sample volume patches with independent directional resolutions.
res(d,k)requests the sample count in parameter directiondof patchk. With synchronization enabled, requested counts are lower bounds. The largest count in every transitive connected tangential-direction component is propagated after applying each face-axis swap. Reversal and flips change parameter order but not the count.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this integer, intent(in), contiguous :: res(:,:) Positive resolution matrix with shape
[3,npatch].logical, intent(in), optional :: synchronize Synchronize connected tangential counts; default is true.
-
private pure subroutine create_volume_automatic(this, target_size, min_res, max_res, synchronize)
Choose volume-patch resolutions from a physical target edge size.
In each parameter direction, the estimator takes the longest corresponding control-polygon line and applies . Connected tangential directions are subsequently synchronized unless disabled. This is a scale-aware visualization-density estimate, not a certified volumetric tessellation error bound.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in) :: target_size Positive finite target physical edge size.
integer, intent(in), optional, contiguous :: min_res(:) Three minimum directional counts; defaults to
[2,2,2].integer, intent(in), optional, contiguous :: max_res(:) Three maximum directional counts; defaults to the integer range limit.
logical, intent(in), optional :: synchronize Synchronize connected tangential counts; default is true.
procedure, public :: export_Xc => export_Xc_volume
Export separate or combined patch control lattices.
-
private impure subroutine export_Xc_volume(this, prefix, encoding, combined)
Export patch control lattices in legacy VTK format.
By default patch
iis written as<prefix>_Xc_<i>.vtk. Withcombined=.true., all cells are written to<prefix>_Xc.vtkand retain their one-based owner in the cell fieldpatch_id.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this character(len=*), intent(in) :: prefix character(len=*), intent(in), optional :: encoding logical, intent(in), optional :: combined
procedure, public :: export_Xg => export_Xg_volume
Export separate or combined cached patch geometry.
-
private impure subroutine export_Xg_volume(this, prefix, encoding, combined)
Export cached patch geometry in legacy VTK format.
By default patch
iis written as<prefix>_Xg_<i>.vtk. Withcombined=.true., all cells are written to<prefix>_Xg.vtkand retain their one-based owner in the cell fieldpatch_id.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this character(len=*), intent(in) :: prefix character(len=*), intent(in), optional :: encoding logical, intent(in), optional :: combined
procedure, public :: export_Xth_in_Xg => export_Xth_in_Xg_volume
Export separate or combined embedded parameter grids.
-
private impure subroutine export_Xth_in_Xg_volume(this, prefix, res, encoding, combined)
Export parameter lines mapped into every volume patch.
By default patch
iis written as<prefix>_Xth_<i>.vtk. Withcombined=.true., all line segments are written to<prefix>_Xth.vtkwith cell fieldpatch_id.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this character(len=*), intent(in) :: prefix integer, intent(in), optional :: res character(len=*), intent(in), optional :: encoding logical, intent(in), optional :: combined
procedure, public :: finalize => clear_volume
Release patches and connections and reset counts.
-
private pure elemental subroutine clear_volume(this)
Release all owned volume patches and connections.
Active counts are reset to zero and the multipatch diagnostic is preserved.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this
procedure, public :: get_connection => get_connection_volume
Return a copy of one connection.
-
private pure function get_connection_volume(this, i) result(conn)
Return a value copy of connection
i.An out-of-range one-based identifier returns a default connection.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this integer, intent(in) :: i Return Value type(multipatch_connection)
procedure, public :: get_elem => cmp_elem_volume
Alias for cmp_elem.
-
private pure function cmp_elem_volume(this, shared, active_only) result(elem)
Concatenate active tensor-product elements from all volume patches. Rows follow patch insertion order and direction-1-fastest local element order. Different local basis sizes are zero-padded to the largest row.
shared=.true.applies direct sharing from the compact map; the default retains unmerged patch-offset numbering. General unclamped traces and rational traces with nonconstant projective scale still requirecmp_dof_constraint.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this logical, intent(in), optional :: shared logical, intent(in), optional :: active_only Use the shared active solver IDs, with zero padding for shorter element rows.
Return Value integer, allocatable, (:,:)
procedure, public :: get_nconnection => get_nconnection_volume
Return the active connection count.
-
private pure elemental function get_nconnection_volume(this) result(n)
Return the number of recorded face connections.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value integer
procedure, public :: get_npatch => get_npatch_volume
Return the active patch count.
-
private pure elemental function get_npatch_volume(this) result(n)
Return the number of active volume patches.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value integer
procedure, public :: get_patch => get_patch_volume
Return a copy of one patch.
-
private pure function get_patch_volume(this, i) result(patch)
Return a value copy of patch
i.An out-of-range one-based identifier returns a default empty patch.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this integer, intent(in) :: i Return Value type(nurbs_volume)
procedure, public :: interface_quadrature => interface_quadrature_volume
Paired integration on a connected boundary.
-
private pure subroutine interface_quadrature_volume(this, connection, Xt_a, Xt_b, weight, ngauss, physical, err)
Quadrature on both trace meshes. See
interface_quadrature.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this integer, intent(in) :: connection real(kind=rk), intent(out), allocatable :: Xt_a(:,:) real(kind=rk), intent(out), allocatable :: Xt_b(:,:) real(kind=rk), intent(out), allocatable :: weight(:) integer, intent(in), optional :: ngauss(:) logical, intent(in), optional :: physical type(debug), intent(out), optional :: err
procedure, public :: is_rational => is_rational_volume
Report whether any patch has nonuniform rational weights.
-
private pure elemental function is_rational_volume(this) result(r)
Report whether at least one active patch uses nonuniform rational weights.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this Return Value logical
procedure, public :: is_valid => is_valid_volume
Validate patch states, face maps, traces, and continuity.
-
private pure function is_valid_volume(this, rtol, atol) result(ok)
Validate the stored volume patches, their oriented interfaces and homogeneous continuity residuals. See
valid_multipatchfor the residual test used by geometry sensitivity assembly.Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(in) :: this real(kind=rk), intent(in), optional :: rtol Relative trace and homogeneous-residual tolerance; default
sqrt(epsilon(rk)).real(kind=rk), intent(in), optional :: atol Absolute homogeneous-residual tolerance; default zero.
Return Value logical
procedure, public :: rotate_Xc => rotate_Xc_volume
Rotate all patch control points.
-
private pure subroutine rotate_Xc_volume(this, alpha, beta, theta)
Apply one x-y-z Euler rotation in degrees to every control lattice.
Cached physical samples are not changed.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in) :: alpha real(kind=rk), intent(in) :: beta real(kind=rk), intent(in) :: theta
procedure, public :: rotate_Xg => rotate_Xg_volume
Rotate all cached patch geometry points.
-
private pure subroutine rotate_Xg_volume(this, alpha, beta, theta)
Apply one x-y-z Euler rotation in degrees to every sampled patch.
Control points are not changed.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in) :: alpha real(kind=rk), intent(in) :: beta real(kind=rk), intent(in) :: theta
procedure, public :: transform => transform_volume
Apply one affine map to every patch and cache.
-
private pure subroutine transform_volume(this, linear, translation, center)
Apply one common affine transformation to all volume patches.
Every control lattice and existing sampled-geometry cache receives . A common affine map preserves matching interface jets and homogeneous projective relations, so recorded and connections remain valid whenever the original multipatch was valid.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in), contiguous :: linear(:,:) Square linear map shared by every patch.
real(kind=rk), intent(in), optional, contiguous :: translation(:) Shared translation vector.
real(kind=rk), intent(in), optional, contiguous :: center(:) Shared transformation center.
procedure, public :: translate_Xc => translate_Xc_volume
Translate all patch control points.
-
private pure subroutine translate_Xc_volume(this, vec)
Translate every patch control lattice by physical vector
vec.Cached physical samples are not changed.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in), contiguous :: vec(:)
procedure, public :: translate_Xg => translate_Xg_volume
Translate all cached patch geometry points.
-
private pure subroutine translate_Xg_volume(this, vec)
Translate every patch's cached samples by physical vector
vec.Control points are not changed.
Arguments
Type Intent Optional Attributes Name class(nurbs_multipatch_volume), intent(inout) :: this real(kind=rk), intent(in), contiguous :: vec(:)