sdr_attribute_module Module

Module to describe attributes attached to geometrical objects.

Attribute list will be a dynamic unique list. Thus, multiple definitions of the same attribute in the configuration file does not result in multiple storages.


Uses

Used by

  • module~~sdr_attribute_module~~UsedByGraph module~sdr_attribute_module sdr_attribute_module module~sdr_periodic_module sdr_periodic_module module~sdr_periodic_module->module~sdr_attribute_module module~sdr_protodata_module sdr_protoData_module module~sdr_protodata_module->module~sdr_attribute_module module~sdr_proto2treelm_module sdr_proto2treelm_module module~sdr_proto2treelm_module->module~sdr_attribute_module module~sdr_proto2treelm_module->module~sdr_periodic_module module~sdr_config_module sdr_config_module module~sdr_proto2treelm_module->module~sdr_config_module module~sdr_prototree_module sdr_protoTree_module module~sdr_proto2treelm_module->module~sdr_prototree_module module~sdr_geometry_module sdr_geometry_module module~sdr_proto2treelm_module->module~sdr_geometry_module module~sdr_boundary_module sdr_boundary_module module~sdr_proto2treelm_module->module~sdr_boundary_module module~sdr_node_module sdr_node_module module~sdr_proto2treelm_module->module~sdr_node_module module~sdr_config_module->module~sdr_attribute_module module~sdr_config_module->module~sdr_geometry_module module~sdr_refinept_module sdr_refinePT_module module~sdr_refinept_module->module~sdr_attribute_module module~sdr_refinept_module->module~sdr_config_module module~sdr_refinept_module->module~sdr_prototree_module module~sdr_refinept_module->module~sdr_geometry_module module~sdr_refinept_module->module~sdr_node_module module~sdr_prototree_module->module~sdr_attribute_module module~sdr_prototree_module->module~sdr_protodata_module module~sdr_prototree_module->module~sdr_config_module module~sdr_prototree_module->module~sdr_geometry_module module~sdr_prototree_module->module~sdr_node_module module~sdr_geometry_module->module~sdr_attribute_module module~sdr_geometry_module->module~sdr_periodic_module module~sdr_boundary_module->module~sdr_attribute_module module~sdr_boundary_module->module~sdr_periodic_module module~sdr_boundary_module->module~sdr_prototree_module module~sdr_boundary_module->module~sdr_geometry_module module~sdr_boundary_module->module~sdr_node_module program~sdr_harvesting sdr_harvesting program~sdr_harvesting->module~sdr_protodata_module module~sdr_node_module->module~sdr_geometry_module module~sdr_flooding_module sdr_flooding_module module~sdr_flooding_module->module~sdr_config_module module~sdr_flooding_module->module~sdr_prototree_module module~sdr_flooding_module->module~sdr_geometry_module module~sdr_flooding_module->module~sdr_boundary_module module~sdr_flooding_module->module~sdr_node_module program~seeder seeder program~seeder->module~sdr_proto2treelm_module program~seeder->module~sdr_config_module program~seeder->module~sdr_refinept_module program~seeder->module~sdr_prototree_module program~seeder->module~sdr_geometry_module program~seeder->module~sdr_flooding_module

Contents


Variables

TypeVisibilityAttributesNameInitial
integer, public, parameter:: sdr_object_kinds_max =5

Maximal number of different object kinds to distinguish.

This is used to allow allocations of arrays for all object kinds with direct access to each component by the sdr_*_object constants below.

integer, public, parameter:: sdr_Boundary_object =1

Identifier for boundary objects

integer, public, parameter:: sdr_Seed_object =2

Identifier for seed objects

integer, public, parameter:: sdr_Refinement_object =3

Identifier for refinement objects

integer, public, parameter:: sdr_Fluidifyable_object =4

Identifier for solid objects, that can be fluidify in the solver

integer, public, parameter:: sdr_noSolidification_object =5

Identifier for no Solidification objects


Interfaces

public interface init

initialize the dynamic array

public interface truncate

truncate the array, meaning cut off the trailing empty entries

public interface empty

empty the entries without changing arrays

public interface destroy

destroy the dynamic array

public interface placeat

insert an element at a given position

public interface append

append a value to the dynamic array and return its position.

public interface sorttruncate

fix the dynamic array, meaning: store the array in the sorted order and cut off the trailing empty entries

public interface positionofval

return the position of a given value in the array val, which is what you usually want to know. it is the index of a given value

  • private function posofval_attribute(me, val, nextifnotfound, lower, upper) result(pos)

    the actual position of a given value in the dynamic array

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type), intent(in) :: me
    type(sdr_attribute_type), intent(in) :: val
    logical, intent(in), optional :: nextifnotfound

    flag to indicate, if the position of the next entry in the sorted list should be returned instead, if val is not found.

    integer, intent(in), optional :: lower
    integer, intent(in), optional :: upper

    Return Value integer

private interface expand

increase the size of the container for the array.

private interface init

initialize the dynamic array

private interface destroy

destroy the dynamic array

private interface append

append a value to the dynamic array and return its position.

  • private subroutine append_da_attribute(me, val, length, pos, wasadded)

    appending a value to the dynamic array

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type) :: me
    type(sdr_attribute_type), intent(in) :: val
    integer, intent(in), optional :: length

    optional length to expand the array

    integer, intent(out), optional :: pos

    position in the array, if the value is found

    logical, intent(out), optional :: wasadded

    flag to indicate, if val was newly added

  • private subroutine append_da_vecattribute(me, val, length, pos, wasadded)

    appending a sorted list of values to the dynamic array

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type) :: me
    type(sdr_attribute_type), intent(in) :: val(:)
    integer, intent(in), optional :: length

    optional length to expand the array

    integer, intent(out), optional :: pos(:)

    position in the array, the values are found at.

    logical, intent(out), optional :: wasadded(:)

    flag to indicate, if val was newly added

private interface truncate

truncate the array, meaning cut off the trailing empty entries

  • private subroutine truncate_da_attribute(me)

    truncate the array after the last valid entry and hence cut off the empty trailing empty entries

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type) :: me

private interface empty

empty the array, reset nvals to be 0

private interface expand

increase the size of the container for the array.

  • private subroutine expand_da_attribute(me, increment, length)

    expanding the dynamic array

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type) :: me
    integer, optional :: increment
    integer, intent(in), optional :: length

    optional length to expand the array

private interface sortedposofval

return the position of a given value in the list 'sorted'. this is mainly for internal usage. the sorted list is only a pointer list to the actual values thus, in order to get the index of a given value, you need to look up the entry in the sorted list. this is done by the positionofval routine

  • private function sortposofval_attribute(me, val, nextifnotfound, lower, upper) result(pos)

    return the sorted position of a value in the given dynamic array

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(dyn_attributearray_type), intent(in) :: me
    type(sdr_attribute_type), intent(in) :: val
    logical, intent(in), optional :: nextifnotfound

    flag to indicate, if the next entry in the list should be returned, if the searched one is not found.

    integer, intent(in), optional :: lower
    integer, intent(in), optional :: upper

    Return Value integer

private interface operator(==)

  • private function isEqual(left, right) result(equality)

    This function provides the test for equality of two attributes.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(sdr_attribute_type), intent(in) :: left

    attribute to compare

    type(sdr_attribute_type), intent(in) :: right

    attribute to compare against

    Return Value logical

    is equal??

private interface operator(/=)

  • private function isUnequal(left, right) result(unequality)

    This function provides the test for unequality of two attributes.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(sdr_attribute_type), intent(in) :: left

    attribute to compare

    type(sdr_attribute_type), intent(in) :: right

    attribute to compare against

    Return Value logical

    is unequal??

private interface operator(<)

  • private function isSmaller(left, right) result(small)

    This function provides a comparison of two attributes.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(sdr_attribute_type), intent(in) :: left

    attribute to compare

    type(sdr_attribute_type), intent(in) :: right

    attribute to compare against

    Return Value logical

    is smaller??

private interface operator(<=)

  • private function isSmallerOrEqual(left, right) result(small)

    This function provides a comparison of two attributes.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(sdr_attribute_type), intent(in) :: left

    attribute to compare

    type(sdr_attribute_type), intent(in) :: right

    attribute to compare against

    Return Value logical

    is smaller??

private interface operator(>)

  • private function isGreater(left, right) result(great)

    This function provides a comparison of two attributes.

    Read more…

    Arguments

    TypeIntentOptionalAttributesName
    type(sdr_attribute_type), intent(in) :: left

    attribute to compare

    type(sdr_attribute_type), intent(in) :: right

    attribute to compare against

    Return Value logical

    is greater??


Derived Types

type, public :: sdr_attribute_type

This data type describes type of attribute

Components

TypeVisibilityAttributesNameInitial
integer, private :: kind

Kind of this attribute: - boundary - seed - refinement - fluidifyable - noSolidification

character(len=labelLen), private :: label

Label to identify this attribute.

character(len=labelLen), private :: color

Color to associate the object with.

Read more…
integer, private :: level

Refinement level to resolve this attribute with at least.

integer, private :: id =0

ID in the list of attributes of this kind.

integer, private :: uni_id =0

Uni-id of this attribute in the list of unique names for this kind. (labels for boundaries, colors for seeds)

logical, private :: subresolution =.false.

This object should be resolved further than the elements of the mesh.

Read more…
logical, private :: calc_dist =.false.

Indicator of whether to calculate link-wise distance

logical, private :: flood_diagonal =.true.

Indicator of whether to flood diagonal node during flood_periphery

integer, private :: distRefine_id =0

Uni-id to identify attribute with certain number of distance refinement

integer, private :: distance_first =0

Start position of distance refine object of this attribute in growing array of distance refine

integer, private :: distance_last =0

Last position of distance refine object of this attribute in growing array of distance refine

type, public :: dyn_attributearray_type

dynamic array (da) type for type(sdr_attribute_type)

Components

TypeVisibilityAttributesNameInitial
integer, private :: nvals =0
integer, private :: containersize =0
type(sdr_attribute_type), private, allocatable:: val(:)
integer, private, allocatable:: sorted(:)

type, public :: sdr_attrList_type

Components

TypeVisibilityAttributesNameInitial
type(dyn_attributearray_type), private :: dynArray

Dynamic array of all unique attributes.

Read more…
type(dyn_labelarray_type), private :: uni_name(sdr_object_kinds_max)

Unique list of used names for the various attribute kinds.

Read more…
integer, private :: none_color_id =-1

uni_id of the 'none' color.

Read more…
integer, private, allocatable:: bc_color_id(:)

ID of unique colors for each kindpos(sdr_Boundary_object).

Read more…
logical, private, allocatable:: color_inverted(:)

Flag for each unique color, wether it should be inverted.

Read more…
type(grw_logicalarray_type), private :: bc_uni_calcdist

Growing array with flags on whether to calculate distances for each unique boundary.

Read more…
type(grw_intarray_type), private :: kindpos(sdr_object_kinds_max)

A list of all the attribute positions for each kind. This provides the mapping of the kind id to the attribute position.

type(grw_distancerefinearray_type), private :: distRefine

Growing array of distance refinement info for boundary attribute. Use dynArray%distRefine_id to create attribute with distance refine

type, private :: sdr_distanceRefine_type

This data type contains info for distance refinement defined in config file for each boundary attribute.

Components

TypeVisibilityAttributesNameInitial
real(kind=rk), private :: radius

Defines the distance to which this boundary should be refined

integer, private :: reach_level

level to refine nodes with in given radius

growing array type for type(sdr_distancerefine_type)

Components

TypeVisibilityAttributesNameInitial
integer, private :: nvals =0
integer, private :: containersize =0
type(sdr_distanceRefine_type), private, allocatable:: val(:)

Functions

public function sdr_any_bc_subresolution(attribute) result(any_subres)

Returns if any bc attribute has the subresolution option set.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(in) :: attribute

The attribute list to check th boundaries in.

Return Value logical

Returned value, true if any boundary object has the subresolution flag set.

public function sdr_any_bc_distanceRefine(attribute) result(any_distRef)

Returns if any bc attribute has the distance refine option with reach_level>0.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(in) :: attribute

The attribute list to check th boundaries in.

Return Value logical

Returned value, true if any boundary object has the valid distance refine

public function sdr_isPeriodicDefined(attribute) result(isPeriodic)

Returns if periodic bc attribute is defined

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(in) :: attribute

The attribute list to check th boundaries in.

Return Value logical

Returned value, true if periodic attribute is defined

private function sdr_attr_of_uni(attribute, object_kind, id) result(allattr)

Get all attributes of the given object kind and (unique) id from the list of attributes in "attribute".

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(in) :: attribute

The list of attributes to look up the unique entries in.

integer, intent(in) :: object_kind

The kind of objects to look for (boundaries, seeds, refinements...)

integer, intent(in) :: id

The unique id, to look for (all attributes with this id will be returned).

Return Value type(grw_intarray_type)

Resulting list of attributes with the same unique id.

private function sortposofval_attribute(me, val, nextifnotfound, lower, upper) result(pos)

return the sorted position of a value in the given dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type), intent(in) :: me
type(sdr_attribute_type), intent(in) :: val
logical, intent(in), optional :: nextifnotfound

flag to indicate, if the next entry in the list should be returned, if the searched one is not found.

integer, intent(in), optional :: lower
integer, intent(in), optional :: upper

Return Value integer

private function posofval_attribute(me, val, nextifnotfound, lower, upper) result(pos)

the actual position of a given value in the dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type), intent(in) :: me
type(sdr_attribute_type), intent(in) :: val
logical, intent(in), optional :: nextifnotfound

flag to indicate, if the position of the next entry in the sorted list should be returned instead, if val is not found.

integer, intent(in), optional :: lower
integer, intent(in), optional :: upper

Return Value integer

private function isEqual(left, right) result(equality)

This function provides the test for equality of two attributes.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attribute_type), intent(in) :: left

attribute to compare

type(sdr_attribute_type), intent(in) :: right

attribute to compare against

Return Value logical

is equal??

private function isUnequal(left, right) result(unequality)

This function provides the test for unequality of two attributes.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attribute_type), intent(in) :: left

attribute to compare

type(sdr_attribute_type), intent(in) :: right

attribute to compare against

Return Value logical

is unequal??

private function isSmaller(left, right) result(small)

This function provides a comparison of two attributes.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attribute_type), intent(in) :: left

attribute to compare

type(sdr_attribute_type), intent(in) :: right

attribute to compare against

Return Value logical

is smaller??

private function isSmallerOrEqual(left, right) result(small)

This function provides a comparison of two attributes.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attribute_type), intent(in) :: left

attribute to compare

type(sdr_attribute_type), intent(in) :: right

attribute to compare against

Return Value logical

is smaller??

private function isGreater(left, right) result(great)

This function provides a comparison of two attributes.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attribute_type), intent(in) :: left

attribute to compare

type(sdr_attribute_type), intent(in) :: right

attribute to compare against

Return Value logical

is greater??


Subroutines

public subroutine sdr_init_attribute(me)

Subroutine to initialize the list for all attributes

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(out) :: me

public subroutine sdr_load_attribute(attrList, conf, thandle, subres_colors, attr_pos)

This routine loads the attribute information from the config file.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(inout) :: attrList

dynamic array of attribute type

type(flu_State) :: conf
integer, intent(in) :: thandle
type(dyn_labelarray_type), intent(in) :: subres_colors

List of colors which should by default use subelement resolution for their boundaries.

integer, intent(out) :: attr_pos

public subroutine sdr_identify_bc_colors(attribute)

Identify all unique boundary colors, after all boundary attributes and seeds are known.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(inout) :: attribute

public subroutine sdr_identify_inv_colors(attribute, invert_color)

Look up colors that should be inverted and set their inversion flag accordingly.

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(inout) :: attribute
type(dyn_labelarray_type), intent(in) :: invert_color

private subroutine load_distanceRefine(attrList, conf, thandle, attribute)

This routine loads the distance refine table from attribute table and appends the loaded distance in radius and level to refine nodes within radius the given radius.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(inout) :: attrList

dynamic array of attribute type

type(flu_State) :: conf
integer, intent(in) :: thandle
type(sdr_attribute_type), intent(inout) :: attribute

save attibute info temporarily

private subroutine load_distanceRefine_single(attrList, conf, thandle, attribute)

load single distance refine table

Arguments

TypeIntentOptionalAttributesName
type(sdr_attrList_type), intent(inout) :: attrList

dynamic array of attribute type

type(flu_State) :: conf
integer, intent(in) :: thandle
type(sdr_attribute_type), intent(inout) :: attribute

save attibute info temporarily

private subroutine init_ga_distancerefine(me, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type), intent(out) :: me
integer, intent(in), optional :: length

private subroutine destroy_ga_distancerefine(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type), intent(inout) :: me

private subroutine truncate_ga_distancerefine(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me

private subroutine empty_ga_distancerefine(me)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me

private subroutine placeat_ga_distancerefine(me, val, pos, length)

adds the value to a given position inside the growing array.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me
type(sdr_distanceRefine_type), intent(in) :: val
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine placeat_ga_distancerefine_vec(me, val, pos, length)

adds the values starting from a given position inside the growing array.

Read more…

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me
type(sdr_distanceRefine_type), intent(in) :: val(:)
integer, intent(in) :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_distancerefine(me, val, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me
type(sdr_distanceRefine_type), intent(in) :: val
integer, intent(in), optional :: length

optional length to expand the array

private subroutine append_ga_distancerefine_vec(me, val, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me
type(sdr_distanceRefine_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array

private subroutine expand_ga_distancerefine(me, pos, length)

Arguments

TypeIntentOptionalAttributesName
type(grw_distancerefinearray_type) :: me
integer, intent(in), optional :: pos
integer, intent(in), optional :: length

optional length to expand the array

private subroutine init_da_attribute(me, length)

initialization of a dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type), intent(out) :: me
integer, intent(in), optional :: length

private subroutine destroy_da_attribute(me)

destruction of a dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type), intent(inout) :: me

private subroutine append_da_attribute(me, val, length, pos, wasadded)

appending a value to the dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me
type(sdr_attribute_type), intent(in) :: val
integer, intent(in), optional :: length

optional length to expand the array

integer, intent(out), optional :: pos

position in the array, if the value is found

logical, intent(out), optional :: wasadded

flag to indicate, if val was newly added

private subroutine append_da_vecattribute(me, val, length, pos, wasadded)

appending a sorted list of values to the dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me
type(sdr_attribute_type), intent(in) :: val(:)
integer, intent(in), optional :: length

optional length to expand the array

integer, intent(out), optional :: pos(:)

position in the array, the values are found at.

logical, intent(out), optional :: wasadded(:)

flag to indicate, if val was newly added

private subroutine truncate_da_attribute(me)

truncate the array after the last valid entry and hence cut off the empty trailing empty entries

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me

private subroutine empty_da_attribute(me)

empty all contents of the array without changing the size or status of any array

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me

private subroutine sorttruncate_da_attribute(me)

fixing the dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me

private subroutine expand_da_attribute(me, increment, length)

expanding the dynamic array

Read more…

Arguments

TypeIntentOptionalAttributesName
type(dyn_attributearray_type) :: me
integer, optional :: increment
integer, intent(in), optional :: length

optional length to expand the array