ElementBlock

class ElementBlock

Represents an element block.

Element block is a connectivity array with an ID and optionally a name. Each element block can have only one type of elements in it.

Public Functions

int get_id() const

Get element block ID.

Returns:

Node set ID

const std::string &get_name() const

Get element block name.

Returns:

Element block name

int get_size() const

Get the number of elements in the block.

Returns:

Element block size

int get_num_nodes_per_element() const

Get the number of nodes per element.

Returns:

The number of nodes per element

const std::string &get_element_type() const

Get the type of elements in the element block.

Returns:

The type of the elements in this block

std::vector<int> get_element_connectivity(std::size_t element_idx) const

Get the element connectivity.

See also

get_size

Parameters:

element_idx – Index of an element in the block. 0..<n>, where <n> is the size of the block.

Returns:

List of node IDs that comprise the element

int get_num_elements() const

Get the number of elements in this element block.

Returns:

The number of elements in this element block

const std::vector<int> &get_connectivity() const

Get connectivity of the block.

Returns:

Connectivity array

void set_id(int id)

Set element block ID.

Parameters:

id – Desired ID of the element block

void set_name(const std::string &name)

Set element block name.

Parameters:

name – Desired name of the element block

void set_connectivity(const char *elem_type, int n_elems_in_block, int n_nodes_per_elem, const std::vector<int> &connect)

Set block connectivity.

Parameters:
  • elem_type – Element type.

  • n_elems_in_block – Number of elements in the block

  • n_nodes_per_elem – Number of nodes per element

  • connect – Connectivity array. Must contain n_elems_in_block * n_nodes_per_elem numbers. Elements must be ordered as follows [el1_n1, el1_n2, ..., el2_n1, el2_n2, ... ]