Skip to content

fossil_decimate ​

Source: src/lib/fossil_decimate.f90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
DEC_STATUS_OKinteger(kind=I4P)parameter
DEC_STATUS_BAD_INPUTinteger(kind=I4P)parameter
DEC_STATUS_NO_PROGRESSinteger(kind=I4P)parameter
QSIZEinteger(kind=I4P)parameter
NOT_IN_HEAPinteger(kind=I4P)parameter
MODE_FREEinteger(kind=I4P)parameter
MODE_AT_Ainteger(kind=I4P)parameter
MODE_AT_Binteger(kind=I4P)parameter
MODE_RIMinteger(kind=I4P)parameter
MODE_LOCKEDinteger(kind=I4P)parameter
CERT_MAX_DEPTHinteger(kind=I4P)parameter
CERT_MAX_TRIANGLESinteger(kind=I4P)parameter

Derived Types ​

cert_t ​

Components

NameTypeAttributesDescription
onlogical
epsreal(kind=R8P)
rfacettype(facet_object)pointer
rtreetype(aabb_tree_object)pointer
idxinteger(kind=I4P)allocatable
rfinteger(kind=I4P)allocatable
rvreal(kind=R8P)allocatable
r2f_startinteger(kind=I4P)allocatable
r2finteger(kind=I4P)allocatable
fan_stateinteger(kind=I4P)allocatable
fan_nreal(kind=R8P)allocatable
vdreal(kind=R8P)allocatable
vginteger(kind=I4P)allocatable

Subroutines ​

decimate ​

fortran
subroutine decimate(facet, target_facets, max_error, rim_collapses, reference_facet, reference_tree, status)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)inoutallocatable
target_facetsinteger(kind=I4P)in
max_errorreal(kind=R8P)inoptional
rim_collapseslogicalinoptional
reference_facettype(facet_object)intarget, optional
reference_treetype(aabb_tree_object)intarget, optional
statusinteger(kind=I4P)outoptional

Call graph

collect_vertex_ids ​

fortran
subroutine collect_vertex_ids(facet, f_v, nv, st)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)in
f_vinteger(kind=I4P)outallocatable
nvinteger(kind=I4P)out
stinteger(kind=I4P)out

Call graph

collect_vertex_coords ​

fortran
subroutine collect_vertex_coords(facet, f_v, vcoord)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)in
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)inout

Call graph

build_v2f ​

fortran
subroutine build_v2f(f_v, nv, v2f_head, v2f_count, v2f_cap, v2f_val)

Arguments

NameTypeIntentAttributesDescription
f_vinteger(kind=I4P)in
nvinteger(kind=I4P)in
v2f_headinteger(kind=I4P)outallocatable
v2f_countinteger(kind=I4P)outallocatable
v2f_capinteger(kind=I4P)outallocatable
v2f_valinteger(kind=I4P)outallocatable

Call graph

v2x_append ​

fortran
subroutine v2x_append(head, count, cap, val, vertex, item)

Arguments

NameTypeIntentAttributesDescription
headinteger(kind=I4P)inoutallocatable
countinteger(kind=I4P)inout
capinteger(kind=I4P)inout
valinteger(kind=I4P)inoutallocatable
vertexinteger(kind=I4P)in
iteminteger(kind=I4P)in

Call graph

build_quadrics ​

fortran
subroutine build_quadrics(facet, f_v, vcoord, Q)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)in
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)in
Qreal(kind=R8P)inout

Call graph

build_edges ​

fortran
subroutine build_edges(facet, f_v, e_v, ne)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)in
f_vinteger(kind=I4P)in
e_vinteger(kind=I4P)outallocatable
neinteger(kind=I4P)out

Call graph

sort_he ​

fortran
subroutine sort_he(he_lo, he_hi, order)

Arguments

NameTypeIntentAttributesDescription
he_lointeger(kind=I4P)in
he_hiinteger(kind=I4P)in
orderinteger(kind=I4P)outallocatable

Call graph

qsort_he ​

Attributes: recursive

fortran
subroutine qsort_he(he_lo, he_hi, order, lo, hi)

Arguments

NameTypeIntentAttributesDescription
he_lointeger(kind=I4P)in
he_hiinteger(kind=I4P)in
orderinteger(kind=I4P)inout
lointeger(kind=I4P)in
hiinteger(kind=I4P)in

Call graph

build_v2e ​

fortran
subroutine build_v2e(e_v, ne, nv, v2e_head, v2e_count, v2e_cap, v2e_val)

Arguments

NameTypeIntentAttributesDescription
e_vinteger(kind=I4P)in
neinteger(kind=I4P)in
nvinteger(kind=I4P)in
v2e_headinteger(kind=I4P)outallocatable
v2e_countinteger(kind=I4P)outallocatable
v2e_capinteger(kind=I4P)outallocatable
v2e_valinteger(kind=I4P)outallocatable

Call graph

cost_all_edges ​

fortran
subroutine cost_all_edges(e_v, ne, vcoord, Q, e_target, e_cost)

Arguments

NameTypeIntentAttributesDescription
e_vinteger(kind=I4P)in
neinteger(kind=I4P)in
vcoordreal(kind=R8P)in
Qreal(kind=R8P)in
e_targetreal(kind=R8P)inout
e_costreal(kind=R8P)inout

Call graph

cost_one_edge ​

fortran
subroutine cost_one_edge(va, vb, vcoord, Q, target, cost, mode)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
vcoordreal(kind=R8P)in
Qreal(kind=R8P)in
targetreal(kind=R8P)out
costreal(kind=R8P)out
modeinteger(kind=I4P)inoptional

Call graph

solve_3x3 ​

Attributes: pure

fortran
subroutine solve_3x3(A, b, x, det)

Arguments

NameTypeIntentAttributesDescription
Areal(kind=R8P)in
breal(kind=R8P)in
xreal(kind=R8P)out
detreal(kind=R8P)out

Call graph

heap_build ​

fortran
subroutine heap_build(ne, e_alive, e_cost, heap, e_heappos, heap_size)

Arguments

NameTypeIntentAttributesDescription
neinteger(kind=I4P)in
e_alivelogicalin
e_costreal(kind=R8P)in
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
heap_sizeinteger(kind=I4P)inout

Call graph

heap_decrease_key ​

fortran
subroutine heap_decrease_key(heap, e_heappos, e_cost, heap_size, e)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)in
einteger(kind=I4P)in

Call graph

heap_increase_key ​

fortran
subroutine heap_increase_key(heap, e_heappos, e_cost, heap_size, e)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)in
einteger(kind=I4P)in

Call graph

heap_insert ​

fortran
subroutine heap_insert(heap, e_heappos, e_cost, heap_size, e)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)inout
einteger(kind=I4P)in

Call graph

heap_sift_up ​

fortran
subroutine heap_sift_up(heap, e_heappos, e_cost, heap_size, i)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)in
iinteger(kind=I4P)in

Call graph

heap_sift_down ​

fortran
subroutine heap_sift_down(heap, e_heappos, e_cost, heap_size, i)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)in
iinteger(kind=I4P)in

Call graph

gather_incidence ​

fortran
subroutine gather_incidence(head, count, val, vertex, out)

Arguments

NameTypeIntentAttributesDescription
headinteger(kind=I4P)inallocatable
countinteger(kind=I4P)in
valinteger(kind=I4P)inallocatable
vertexinteger(kind=I4P)in
outinteger(kind=I4P)outallocatable

Call graph

find_shared_facets ​

fortran
subroutine find_shared_facets(va, vb, f_v, facet_alive, shared_facets, n_shared)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
f_vinteger(kind=I4P)in
facet_alivelogicalin
shared_facetsinteger(kind=I4P)out
n_sharedinteger(kind=I4P)out

Call graph

vertex_ring ​

fortran
subroutine vertex_ring(v, v2f_head, v2f_count, v2f_val, f_v, facet_alive, nb, cnt, n)

Arguments

NameTypeIntentAttributesDescription
vinteger(kind=I4P)in
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
f_vinteger(kind=I4P)in
facet_alivelogicalin
nbinteger(kind=I4P)outallocatable
cntinteger(kind=I4P)outallocatable
ninteger(kind=I4P)out

Call graph

recost_va_edges ​

fortran
subroutine recost_va_edges(va, v2e_head, v2e_count, v2e_val, e_v, e_alive, vcoord, Q, e_target, e_cost, heap, e_heappos, heap_size)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
v2e_headinteger(kind=I4P)inallocatable
v2e_countinteger(kind=I4P)in
v2e_valinteger(kind=I4P)inallocatable
e_vinteger(kind=I4P)in
e_alivelogicalin
vcoordreal(kind=R8P)in
Qreal(kind=R8P)in
e_targetreal(kind=R8P)inout
e_costreal(kind=R8P)inout
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
heap_sizeinteger(kind=I4P)inout

Call graph

add_constraint_planes ​

fortran
subroutine add_constraint_planes(facet, f_v, f_p, vcoord, v2f_head, v2f_count, v2f_val, rims, open, Q)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)in
f_vinteger(kind=I4P)in
f_pinteger(kind=I4P)in
vcoordreal(kind=R8P)in
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
rimslogicalin
openlogicalin
Qreal(kind=R8P)inout

Call graph

add_edge_plane ​

fortran
subroutine add_edge_plane(p, r, n, n_alt, vcoord, Q)

Arguments

NameTypeIntentAttributesDescription
pinteger(kind=I4P)in
rinteger(kind=I4P)in
nreal(kind=R8P)in
n_altreal(kind=R8P)in
vcoordreal(kind=R8P)in
Qreal(kind=R8P)inout

Call graph

materialize_output ​

fortran
subroutine materialize_output(facet, f_v, vcoord, facet_alive)

Arguments

NameTypeIntentAttributesDescription
facettype(facet_object)inoutallocatable
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)in
facet_alivelogicalin

Call graph

cert_setup ​

fortran
subroutine cert_setup(cert, eps, reference_facet, reference_tree, nv, ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
epsreal(kind=R8P)in
reference_facettype(facet_object)intarget
reference_treetype(aabb_tree_object)intarget
nvinteger(kind=I4P)in
oklogicalout

Call graph

fan_build ​

fortran
subroutine fan_build(cert, v)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
vinteger(kind=I4P)in

Call graph

clip_polygon ​

Attributes: pure

fortran
subroutine clip_polygon(np, p, m, o, nq, q)

Arguments

NameTypeIntentAttributesDescription
npinteger(kind=I4P)in
preal(kind=R8P)in
mreal(kind=R8P)in
oreal(kind=R8P)in
nqinteger(kind=I4P)out
qreal(kind=R8P)out

Call graph

Functions ​

quadric_eval ​

Attributes: pure

Returns: real(kind=R8P)

fortran
function quadric_eval(Q, x) result(c)

Arguments

NameTypeIntentAttributesDescription
Qreal(kind=R8P)in
xreal(kind=R8P)in

Call graph

heap_pop ​

Returns: integer(kind=I4P)

fortran
function heap_pop(heap, e_heappos, e_cost, heap_size) result(top)

Arguments

NameTypeIntentAttributesDescription
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
e_costreal(kind=R8P)in
heap_sizeinteger(kind=I4P)inout

Call graph

try_collapse ​

Returns: logical

fortran
function try_collapse(va, vb, target, f_v, vcoord, vertex_alive, facet_alive, v2f_head, v2f_count, v2f_cap, v2f_val, v2e_head, v2e_count, v2e_cap, v2e_val, e_v, e_alive, Q, nf_alive, f_p, p_live, e_target, e_cost, heap, e_heappos, heap_size, cert, refused) result(accepted)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
targetreal(kind=R8P)in
f_vinteger(kind=I4P)inout
vcoordreal(kind=R8P)inout
vertex_alivelogicalinout
facet_alivelogicalinout
v2f_headinteger(kind=I4P)inoutallocatable
v2f_countinteger(kind=I4P)inoutallocatable
v2f_capinteger(kind=I4P)inoutallocatable
v2f_valinteger(kind=I4P)inoutallocatable
v2e_headinteger(kind=I4P)inoutallocatable
v2e_countinteger(kind=I4P)inoutallocatable
v2e_capinteger(kind=I4P)inoutallocatable
v2e_valinteger(kind=I4P)inoutallocatable
e_vinteger(kind=I4P)inout
e_alivelogicalinout
Qreal(kind=R8P)inout
nf_aliveinteger(kind=I4P)inout
f_pinteger(kind=I4P)in
p_liveinteger(kind=I4P)inout
e_targetreal(kind=R8P)inout
e_costreal(kind=R8P)inout
heapinteger(kind=I4P)inout
e_heapposinteger(kind=I4P)inout
heap_sizeinteger(kind=I4P)inout
certtype(cert_t)inout
refusedlogicalout

Call graph

check_normal_flip ​

Returns: logical

fortran
function check_normal_flip(va, vb, target, facets_b, n_b, shared_facets, n_shared, f_v, vcoord, facet_alive) result(would_flip)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
targetreal(kind=R8P)in
facets_binteger(kind=I4P)in
n_binteger(kind=I4P)in
shared_facetsinteger(kind=I4P)in
n_sharedinteger(kind=I4P)in
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)in
facet_alivelogicalin

Call graph

check_normal_flip_around_va ​

Returns: logical

fortran
function check_normal_flip_around_va(va, vb, target, v2f_head, v2f_count, v2f_val, shared_facets, n_shared, f_v, vcoord, facet_alive) result(would_flip)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
targetreal(kind=R8P)in
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
shared_facetsinteger(kind=I4P)in
n_sharedinteger(kind=I4P)in
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)in
facet_alivelogicalin

Call graph

cross ​

Attributes: pure

Returns: real(kind=R8P)

fortran
function cross(a, b) result(c)

Arguments

NameTypeIntentAttributesDescription
areal(kind=R8P)in
breal(kind=R8P)in

Call graph

Returns: logical

fortran
function link_condition_holds(va, vb, v2f_head, v2f_count, v2f_val, f_v, facet_alive, shared_facets, n_shared) result(holds)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
f_vinteger(kind=I4P)in
facet_alivelogicalin
shared_facetsinteger(kind=I4P)in
n_sharedinteger(kind=I4P)in

Call graph

has_facet ​

Returns: logical

fortran
function has_facet(v, c, d, v2f_head, v2f_count, v2f_val, f_v, facet_alive) result(found)

Arguments

NameTypeIntentAttributesDescription
vinteger(kind=I4P)in
cinteger(kind=I4P)in
dinteger(kind=I4P)in
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
f_vinteger(kind=I4P)in
facet_alivelogicalin

Call graph

find_edge ​

Returns: integer(kind=I4P)

fortran
function find_edge(va, vw, v2e_head, v2e_count, v2e_val, e_v, e_alive) result(e_found)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vwinteger(kind=I4P)in
v2e_headinteger(kind=I4P)inallocatable
v2e_countinteger(kind=I4P)in
v2e_valinteger(kind=I4P)inallocatable
e_vinteger(kind=I4P)in
e_alivelogicalin

Call graph

edge_mode ​

Returns: integer(kind=I4P)

fortran
function edge_mode(va, vb, v_bnd, rims, f_v, f_p, facet_alive, v2f_head, v2f_count, v2f_val) result(mode)

Arguments

NameTypeIntentAttributesDescription
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
v_bndlogicalin
rimslogicalin
f_vinteger(kind=I4P)in
f_pinteger(kind=I4P)in
facet_alivelogicalin
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable

Call graph

rim_degree ​

Returns: integer(kind=I4P)

fortran
function rim_degree(v, w, f_v, f_p, facet_alive, v2f_head, v2f_count, v2f_val) result(deg)

Arguments

NameTypeIntentAttributesDescription
vinteger(kind=I4P)in
winteger(kind=I4P)in
f_vinteger(kind=I4P)in
f_pinteger(kind=I4P)in
facet_alivelogicalin
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable

Call graph

cert_point ​

Returns: logical

fortran
function cert_point(cert, x, d, g) result(ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)in
xreal(kind=R8P)in
dreal(kind=R8P)out
ginteger(kind=I4P)out

Call graph

cert_vertex ​

Returns: logical

fortran
function cert_vertex(cert, v, x, d, g) result(ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
vinteger(kind=I4P)in
xreal(kind=R8P)in
dreal(kind=R8P)out
ginteger(kind=I4P)out

Call graph

cert_collapse ​

Returns: logical

fortran
function cert_collapse(cert, va, vb, target, facets_b, shared_facets, n_shared, f_v, vcoord, facet_alive, v2f_head, v2f_count, v2f_val, dt, gt) result(ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
targetreal(kind=R8P)in
facets_binteger(kind=I4P)in
shared_facetsinteger(kind=I4P)in
n_sharedinteger(kind=I4P)in
f_vinteger(kind=I4P)in
vcoordreal(kind=R8P)in
facet_alivelogicalin
v2f_headinteger(kind=I4P)inallocatable
v2f_countinteger(kind=I4P)in
v2f_valinteger(kind=I4P)inallocatable
dtreal(kind=R8P)out
gtinteger(kind=I4P)out

Call graph

cert_new_facet ​

Returns: logical

fortran
function cert_new_facet(cert, fv, va, vb, target, dt, gt, vcoord) result(ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
fvinteger(kind=I4P)in
vainteger(kind=I4P)in
vbinteger(kind=I4P)in
targetreal(kind=R8P)in
dtreal(kind=R8P)in
gtinteger(kind=I4P)in
vcoordreal(kind=R8P)in

Call graph

cert_triangle ​

Returns: logical

fortran
function cert_triangle(cert, c, d, g) result(ok)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
creal(kind=R8P)in
dreal(kind=R8P)in
ginteger(kind=I4P)in

Call graph

cert_bound ​

Returns: real(kind=R8P)

fortran
function cert_bound(cert, c, d, g) result(u)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
creal(kind=R8P)in
dreal(kind=R8P)in
ginteger(kind=I4P)in

Call graph

piece_bound ​

Returns: real(kind=R8P)

fortran
function piece_bound(cert, f, np, p) result(u)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)in
finteger(kind=I4P)in
npinteger(kind=I4P)in
preal(kind=R8P)in

Call graph

edge_bound ​

Returns: real(kind=R8P)

fortran
function edge_bound(cert, f1, f2, c) result(u)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)in
f1integer(kind=I4P)in
f2integer(kind=I4P)in
creal(kind=R8P)in

Call graph

wedge_bound ​

Returns: real(kind=R8P)

fortran
function wedge_bound(cert, v, c) result(u)

Arguments

NameTypeIntentAttributesDescription
certtype(cert_t)inout
vinteger(kind=I4P)in
creal(kind=R8P)in

Call graph