pymoto.ElementOperation

class pymoto.ElementOperation(domain: VoxelDomain, element_matrix: ndarray)

Generic module for element-wise operations based on nodal information

\(y_e = \mathbf{B} \mathbf{u}_e\)

This module is the reverse of pymoto.NodalOperation.

Input Signal:
  • u: Nodal vector of size (#dofs_per_node * #nodes)

Output Signal:
  • y: Elemental output data of size (..., #elements) or (#dofs, ..., #elements)

__init__(domain: VoxelDomain, element_matrix: ndarray)

Initialize element operation module

Parameters:
  • domain (pymoto.VoxelDomain) – The finite element domain

  • element_matrix (np.ndarray) – The element operator matrix \(\mathbf{B}\) of size (..., #dofs_per_element) or (..., #nodes_per_element)

Methods

__init__(domain, element_matrix)

Initialize element operation module

connect(sig_in[, sig_out])

Connect without automatic adding to a function network

get_input_sensitivities([as_list])

get_input_states([as_list])

get_output_sensitivities([as_list])

get_output_states([as_list])

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

Attributes

n_in

Get the number of input signals

n_out

Get the number of output signals

sig_in

sig_out

connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)

Connect without automatic adding to a function network

get_input_sensitivities(as_list=False)
get_input_states(as_list=False)
get_output_sensitivities(as_list=False)
get_output_states(as_list=False)
property n_in: int

Get the number of input signals

property n_out: int

Get the number of output signals

Note: Cannot be used in the initial __call__()

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in

sig_in: List = None
sig_out: List = None