pysdic.Mesh.from_dict#

classmethod Mesh.from_dict(data, *, load_properties=True, element_type=None)[source]#

Create a mesh from a flat dictionary.

The dictionary must contain the keys "coordinates" (shape \((N_v, E)\)) and "elements" (shape \((N_e, N_{vpe})\)). The properties are read from the keys "_vertex_property/{name}" and "_element_property/{name}", and the element type from the optional key "element_type" (a string, or an array with one string as written by the NPZ and HDF5 serializers).

Note

The dictionary is flat (one level), as required by the NPZ format. See pysdic.NpzSerializerMixin.

Parameters:
  • data (Dict[str, Any]) – The dictionary to read.

  • load_properties (bool, optional (default: True)) – If False, the properties are ignored.

  • element_type (Optional[str], optional (default: None)) – The expected element type. If the dictionary also defines one, both must be the same.

Returns:

The new mesh.

Return type:

pysdic.Mesh