Mordicus.Modules.Cemosis.IO.FeelppSolutionReader module

class Mordicus.Modules.Cemosis.IO.FeelppSolutionReader.FeelppSolutionReader(mesh, space)[source]

Bases: SolutionReaderBase

ReadReducedOrderBasis(fileName, solutionStructure, fieldName)[source]

Converts the format into Mordicus reduced order basis for reading fields

Parameters
  • fileName (str) – file to read reduced basis from

  • fieldStructure (SolutionStructureBase) – field structure giving the context to interpret the vector in terms of field values on the mesh

  • fieldName (str) – name of field associated with the basis (e.g. “U”, “sigma”)

Returns

reducedOrderBasis – numpy array of the modes

Return type

nparray(numberOfModes, numberOfDofs)

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

Reads a snapshots from the solutions of name “fieldName”, at time “time” and of primality “primality”, from the HF 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) – primality of the solution from which the snapshot is read

Returns

of size (numberOfDofs,)

Return type

np.ndarray

WriteReducedOrderBasis(fileName, solutionStructure, reducedOrderBasis, fieldName)[source]

Converts Mordicus reduced order basis into the format for writing fields

Parameters
  • fileName (str) – file to write reduced basis to

  • fieldStructure (SolutionStructureBase) – field structure giving the context to interpret the vector in terms of field values on the mesh

  • reducedOrderBasis (nparray(numberOfModes, numberOfDofs)) – numpy array of the modes

  • fieldName (str) – name of field associated with the basis (e.g. “U”, “sigma”)

WriteSolution(fileName, solution, fieldStructure=None, fieldName='', nameInFile=None, append=False)[source]

write solution to disk

Parameters
  • fileName (_type_) – name of the file

  • solution (_type_) – field to be saved

  • fieldStructure (_type_, optional) – _description_. Defaults to None.

  • fieldName (str, optional) – name of the field. Defaults to “”.

  • nameInFile (_type_, optional) – _description_. Defaults to None.

  • append (bool, optional) – _description_. Defaults to False.