Skip to content

[Bug] Parameters with scalar field written as vector field #118

@lang-m

Description

@lang-m

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:

if hasattr(evolver, "u"):
umif, uname = oc.scripts.setup_scalar_parameter(evolver.u, "zl_u")

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)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions