buffalo_panel.families.PerElementDofMap

class buffalo_panel.families.PerElementDofMap(global_indices)[source]

Bases: DofMap

Assign one global degree of freedom to each element.

Each family element contributes to and reads from its own distinct entry in the global solved coefficient vector.

Methods

lift_local_row(local_weights, n_unknowns)

Lift one per-element local row into the global unknown space.

local_coefficients(x, n_elements)

Return the solved coefficient for each family-local degree of freedom.

n_local_dofs(n_elements)

Return the number of family-local coefficients for this map.

scatter_columns(local_block, global_matrix)

Accumulate one local column per element into the global matrix.

Attributes

global_indices

Global coefficient index associated with each family element.

global_indices: IntArray

Global coefficient index associated with each family element.

n_local_dofs(n_elements)[source]

Return the number of family-local coefficients for this map.

Parameters:

n_elements (int) – Number of elements owned by the family using this map.

Returns:

Number of family-local coefficients.

Return type:

int

Raises:

ValueError – If the stored index count does not match n_elements.

scatter_columns(local_block, global_matrix)[source]

Accumulate one local column per element into the global matrix.

Parameters:
  • local_block (FloatArray) – Family-local influence block with one column per owned element.

  • global_matrix (FloatArray) – Global matrix that receives the columns at global_indices.

Raises:

ValueError – If local_block does not have one column per stored global index.

local_coefficients(x, n_elements)[source]

Return the solved coefficient for each family-local degree of freedom.

Parameters:
  • x (FloatArray) – Global solved coefficient vector.

  • n_elements (int) – Number of elements owned by the family using this map.

Returns:

One solved coefficient per family-local degree of freedom, gathered from global_indices.

Return type:

FloatArray

Raises:

ValueError – If the number of stored global indices does not match n_elements.

lift_local_row(local_weights, n_unknowns)[source]

Lift one per-element local row into the global unknown space.

Parameters:
  • local_weights (FloatArray) – One-dimensional local weight row with one entry per stored global index.

  • n_unknowns (int) – Length of the global solve vector.

Returns:

Global row with the local weights placed at global_indices.

Return type:

FloatArray

Raises:

ValueError – If local_weights is not one-dimensional, does not match the number of stored global indices, or n_unknowns is too small.