Fields

NodeField - A physical field on nodes

The entries U, dU, P, V and A every node field holds, and their meaning, are defined in Node field results.

class edelweissfe.fields.nodefield.NodeField(fieldName, dimension, nodeSet)[source]

This class represents a node field. A node field associates every node with the entries of a field variable listed in ENTRIES: the solution U, its increment dU, the nodal force P, and the rates V and A. Every node field holds all of them, from its construction on; their meaning is defined once, in Node field results. Furthermore, for convencience, it allows to get fast access to values for individual nodes or node sets.

The purpose is to store field data in an efficient, contiguos manner rather than distributing it across all individual nodes.

Example:

NodeField 'Displacement'
   values: {'U' : [[0,0,0],  # Node (1)
                   [1,0,0],  # Node (2)
                   [0,1,0]]} # Node (3)

Spatial representation:

(1) --------- (2)
 | *             *
 |  *+---------+   *+---------+
 |   | [0,0,0] |    | [1,0,0] |
(3)  +---------+    +---------+
  *
   * +---------+
     | [0,1,0] |
     +---------+
Parameters:
  • fieldName (str) – The name of the field.

  • dimension (int) – The dimension of the field.

  • nodes – The associated nodes. Only nodes with active fields are considered.

  • nodeSet (NodeSet)

Methods

addEntriesFromOther(other[, fieldValueEntries])

Add values from another NodeField.

copyEntriesFromOther(other[, fieldValueEntries])

Copy values from another NodeField.

indexOfNode(node)

The row index of a node's entries within this field's value arrays.

resize(nodes)

Resize this NodeField in-place for a new list of associated nodes, preserving values for every node identity present both before and after the resize (e.g. AMR-retained nodes keep their converged state; new nodes get a zeroed entry until a caller fills it in, e.g. with an interpolated warm start).

subset(subset)

Get a view on a subset of the field.

addEntriesFromOther(other, fieldValueEntries=None)[source]

Add values from another NodeField. Of the nodes, the intersection is considered.

Parameters:
  • other – The NodeField to add from.

  • fieldValueEntries (list[str] | dict[str, str]) – The entries which should be added. Default: all entries are added. May be a list of entry names shared by both fields, or a dict mapping an entry name on other to the (possibly differently named) entry name on self it should be accumulated into.

copyEntriesFromOther(other, fieldValueEntries=None)[source]

Copy values from another NodeField. Of the nodes, the intersection is considered; the other nodes of this field get zero.

Parameters:
  • other – The NodeField to copy from.

  • fieldValueEntries (list[str]) – The list of entries which should be copied. Default: all entries are copied.

indexOfNode(node)[source]

The row index of a node’s entries within this field’s value arrays.

Parameters:

node – The node.

Returns:

The row index.

Return type:

int

resize(nodes)[source]

Resize this NodeField in-place for a new list of associated nodes, preserving values for every node identity present both before and after the resize (e.g. AMR-retained nodes keep their converged state; new nodes get a zeroed entry until a caller fills it in, e.g. with an interpolated warm start).

This object’s identity is preserved – consumers holding a reference to this NodeField (or a NodeFieldSubset of it) see the new size without re-fetching from the model.

Parameters:

nodes – The new (possibly larger or smaller) list of nodes this NodeField is associated with. Only nodes with this field active are retained, exactly as at construction.

Return type:

None

subset(subset)[source]

Get a view on a subset of the field.

Parameters:

subset – The subset, e.g., a single :class:`Node, or a :class:`NodeSet or :class:`ElementSet.

Returns:

The subset of the present NodeField.

Return type:

NodeFieldSubset

ENTRIES = ('U', 'dU', 'P', 'V', 'A')

the solution U, the increment dU of the last accepted increment, the nodal force P, and the rate V and second rate A of the solution. There are no others.

Type:

The entries every node field holds, see Node field results

class edelweissfe.fields.nodefield.NodeFieldSubset(parentNodeField, subset)[source]

Methods

addEntriesFromOther(other[, fieldValueEntries])

Add values from another NodeField.

copyEntriesFromOther(other[, fieldValueEntries])

Copy values from another NodeField.

indexOfNode(node)

The row index of a node's entries within this field's value arrays.

resize(nodes)

Resize this NodeField in-place for a new list of associated nodes, preserving values for every node identity present both before and after the resize (e.g. AMR-retained nodes keep their converged state; new nodes get a zeroed entry until a caller fills it in, e.g. with an interpolated warm start).

subset(subset)

Get a view on a subset of the field.

subset(subset)[source]

Get a view on a subset of the field.

Parameters:

subset – The subset, e.g., a single :class:`Node, or a :class:`NodeSet or :class:`ElementSet.

Returns:

The subset of the present NodeField.

Return type:

NodeFieldSubset