ubermag / help

Repository for raising issues and requesting help on Ubermag
BSD 2-Clause "Simplified" License
11 stars 3 forks source link

Probing in time one magnetization cell only #195

Closed nirelbern closed 2 years ago

nirelbern commented 2 years ago

Hi All,

Using ubermag with discretisedfield, oommfc and micromagneticmodel. How do I 'Probe' in time the magnetization of only one cell in the mesh instead of probing the average over all the cells with: system.table.data['mx'].values

Many Thanks! Nirel

marijanbeg commented 2 years ago

Hi @nirelbern, thank you for your question and for using Ubermag. You can probe the magnetisation at a point by typing system.m(point), where point is a coordinate at which you are sampling, e.g. system.m((0, 0, 0)).

You can find more details: https://ubermag.github.io/documentation/ipynb/discretisedfield/field-definition.html (cell 4)

Please feel free to reopen this issue if this does not answer your question :)

nirelbern commented 2 years ago

Hi @marijanbeg, thanks for your fast response.

system.m(point) returns a single point while system.table.data['mx'].values return a numpy array with a shape equal to the number of timesteps given to the timedriver.

Is there a way of sampling system.m(point) in time?

marijanbeg commented 2 years ago

Thank you, @nirelbern, for the clarification. In that case, you can use micromagneticdata package, in particular, Drive class. For instance,

import micromagneticdata as md

data = md.Data(system_name). # system_object_name is the name you passed to mm.System(name=system_name)
data[N][M](point)  # where N is the drive number (0, 1, 2...) and M is the timestep you are interested in  

Please let me know if you need any further assistance.