Open
Description
import discretisedfield as df
import matplotlib.pyplot as plt
Specify the path to the .omf file
file_path = "C:/Users/NIKITHA UNNI/hysteresis_angle_0_step_840.omf"
Define angle
angle = 0.1 # Example angle
Loop over steps from 0 to 999
for step in range(1000):
# Load the .omf file for the given step
field = df.Field.from_file(f"{file_path.split('step')[0]}step{step}.omf")
# Slice the field at z=0 for visualization
field_slice = field.sel(z=0) # Select the z=0 plane
# Extract and visualize Mx component
mx_field = field_slice.x # Extract Mx
mx_field.mpl.scalar(figsize=(8, 6))
plt.title(f"Domain Pattern: Mx Component at {angle} Degree (Step {step})")
plt.show()
# Compute and visualize the magnitude of the magnetization
magnitude_field = field_slice.norm # Compute the magnitude
magnitude_field.mpl.scalar(figsize=(8, 6))
plt.title(f"Domain Pattern: Magnitude of Magnetization at {angle} Degree (Step {step})")
plt.show() I have just saved the different applied external angle in different steps in .omf format and tried to visualise the domain image,first of all I need to get the domain image of the single angle 0 degree external applied angle and visualise magnetic moment orientation of it with arrows showing moments orientation,how can I do that?
Metadata
Metadata
Assignees
Labels
No labels