-
Notifications
You must be signed in to change notification settings - Fork 19
[Bug] Parameters with scalar field written as vector field #118
Copy link
Copy link
Open
Description
Some of the energy terms (e.g. ZhangLi.u) can be defined with a scalar (dim=1) field. However, when writing the input for OOMMF the field is saved with extend_scalar=True (which repeats the single component three times). For ZhangLi.u OOMMF fails because it expects a scalar field but reads a vector field.
The relevant parts of the code:
oommfc/oommfc/scripts/evolver.py
Lines 24 to 25 in 547ece4
| if hasattr(evolver, "u"): | |
| umif, uname = oc.scripts.setup_scalar_parameter(evolver.u, "zl_u") |
Lines 78 to 80 in 547ece4
| def setup_scalar_parameter(parameter, name): | |
| if isinstance(parameter, df.Field): | |
| parameter.write(f"{name}.ovf", extend_scalar=True) |
@marijanbeg Is there any casy where we need extend_scalar=True in the input for OOMMF (because we start from a scalar field where OOMMF expects a vector field)?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels