genericROM.IO.ZsetSolutionReader module

ReadSnapshotComponent(solutionFileName, fieldName, time, primality=True)[source]

Functional API

Reads a snapshot component (e.g. fieldName=”U2” returns the second component of the solution “U”) from the Z-set solution file “solutionFileName” (.ut), at time “time” and of primality “primality”, from the high-fidelity computation

Parameters:
  • solutionFileName (str) – Z-set solution file

  • fieldName (str) – name of the solution from which the snapshot is read

  • time (float) – time at which the snapshot is read

  • primality (bool, optional) – primality of the solution from which the snapshot is read

Returns:

of size (numberOfNodes,)

Return type:

np.ndarray

ReadTimeSequenceFromSolutionFile(solutionFileName)[source]

Reads the time sequence from the Z-set solution file “solutionFileName” (.ut) (may be different from the ones defined in the input data file if the solver chose to solve at additional time steps)

Parameters:

solutionFileName (str) – Z-set solution file

Returns:

of size (numberOfSnapshots,)

Return type:

np.ndarray

class ZsetSolutionReader(solutionFileName)[source]

Bases: SolutionReaderBase

Class containing a reader for Z-set solution file

solutionFileName

name of the Z-set solution file (.ut)

Type:

str

reader

Muscat reader of .ut files

Type:

UtReader

ReadSnapshot(fieldName, time, numberOfComponents, primality=True)[source]

Reads a snapshot (e.g. fieldName=”U” returns snapshots from solution “U”) from the Z-set solution file, at time “time” and of primality “primality”, from the high-fidelity computation

Parameters:
  • fieldName (str) – name of the solution from which the snapshot is read

  • time (float) – time at which the snapshot is read

  • numberOfComponents (int (1, 2, or 3)) – number of components of the solution to read

  • primality (bool, optional) – primality of the solution from which the snapshot is read

Returns:

of size (numberOfDofs,)

Return type:

np.ndarray

ReadSnapshotComponent(fieldName, time, primality=True)[source]

Reads a snapshot component (e.g. fieldName=”U2” returns the second component of the solution “U”) from the Z-set solution file, at time “time” and of primality “primality”, from the high-fidelity computation

Parameters:
  • fieldName (str) – name of the solution from which the snapshot is read

  • time (float) – time at which the snapshot is read

  • primality (bool, optional) – primality of the solution from which the snapshot is read

Returns:

of size (numberOfNodes,)

Return type:

np.ndarray

ReadSnapshotComponentTimeSequence(fieldName, timeSequence, primality=True)[source]

Reads a snapshot component (e.g. fieldName=”U2” returns the second component of the solution “U”) from the Z-set solution file, at time sequence “timeSequence” and of primality “primality”, from the high-fidelity computation

Parameters:
  • fieldName (str) – name of the solution from which the snapshot is read

  • timeSequence (list or 1D np.ndarray) – time steps at which the snapshot is read

  • primality (bool, optional) – primality of the solution from which the snapshot is read

Returns:

of size (numberOfSnapshots,numberOfNodes)

Return type:

np.ndarray

ReadTimeSequenceFromSolutionFile()[source]

Reads the time sequence from the Z-set solution file (may be different from the ones defined in the input data file if the solver chose to solve at additional time steps)

Returns:

of size (numberOfSnapshots,)

Return type:

np.ndarray