cashocs.io.read_function_from_xdmf#

cashocs.io.read_function_from_xdmf(filename: str, name: str, family: str, degree: int, vector_dim: int = 0, step: int = 0, comm: MPI.Comm | None = None) fenics.Function[source]#

Reads a function from a .xdmf file containing a checkpointed function.

Parameters:
  • filename (str) – The name of the .xdmf file.

  • name (str) – The name of the function.

  • family (str) – The finite element family of the function.

  • degree (int) – The degree of the finite element.

  • vector_dim (int) – The dimension of the vector, if the function is vector-valued. In case that this is 0, a scalar finite element is assumed. Default is 0.

  • step (int) – The checkpoint number. Default is 0.

  • comm (MPI.Comm | None) – The MPI communicator that shall be used. Default is None, which means that fenics.MPI.comm_world is used.

Returns:

A fenics representation of the function stored in the file.

Return type:

fenics.Function