Label

class Label : public godzilla::PetscObjectWrapper<DMLabel>

Public Functions

void create(MPI_Comm comm, String name)

Create the label.

Parameters:
  • comm – The communicator

  • name – The label name

void destroy()

Destroy the label.

void reset()

Destroys internal data structures in the underlying DMLabel.

void set_default_value(Int default_value) const

Set the default value returned by get_value() if a point has not been explicitly given a value.

When a label is created, it is initialized to -1.

Parameters:

default_value – The default value

Int get_default_value() const

Get the default value returned by get_value() if a point has not been explicitly given a value.

When a label is created, it is initialized to -1.

Returns:

The default value

Int get_num_values() const

Get the number of values that the label takes.

Returns:

The number of values

Int get_value(Int point) const

Return the value a label assigns to a point.

Parameters:

point – The point

Returns:

The value associated with the point. If value is not set, return the label’s default value

IndexSet get_value_index_set() const

Get an IndexSet of all values that the Label takes.

Returns:

IndexSet with all label values

std::vector<Int> get_values() const

Get all values that the Label takes.

Returns:

std::vector with all label values

Int get_stratum_size(Int value) const

Get the size of a stratum.

Parameters:

value – The stratum value

Returns:

Size of the stratum

std::tuple<Int, Int> get_stratum_bounds(Int value) const

Get the largest and smallest point of a stratum.

Parameters:

value – The stratum value

Returns:

Tuple with the smallest and largest point of the stratum

IndexSet get_stratum(Int value) const

Get an IndexSet with the stratum points.

Parameters:

value – The stratum value

Returns:

The stratum points

void set_stratum(Int value, const IndexSet &is) const

Set the stratum points using an IndexSet.

Parameters:
  • value – The stratum value

  • is – The stratum points

void view(PetscViewer viewer = PETSC_VIEWER_STDOUT_WORLD) const

View the label.

Parameters:

viewer – The PETSc viewer