Skip to content

Cache calls to calc_energy_electric and calc_energy_magnetic #124

@nikosavola

Description

@nikosavola

calc_energy_electric (and calc_energy_magnetic) are called in many places in DistributedAnalysis and currently you are supposed to transfer the result of these as a parameter like U_E and U_H to for example get_Qdielectric_all and get_Qseam_sweep.

It would make sense to instead just cache the values, as the inputs consist of simple strings, bools and ints. A simple lru_cache from the standard library almost works. I think this would fail only if the Ansys simulation is changed in a way that does not invalidate the simulation solution but would change the values of the computed fields. This might be a rare case, but still unwanted behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions