Driver#
- class oommfc.Driver(**kwargs)#
Driver base class.
Methods
__dir__
Default dir() implementation.
__eq__
Return self==value.
__iter__
Iterator.
__repr__
Representation string.
drive
Drives the system in phase space.
Additional keyword arguments allowed for drive.
schedule
Schedule drive of the system in phase space.
Additional keyword arguments allowed for schedule.
Write the mif file and related files.
Properties
name
Name.
- drive_kwargs_setup(drive_kwargs)#
Additional keyword arguments allowed for drive.
This function tests additional keyword arguments that have been passed to the
drive
method (it is not intended for direct use). A drive in oommfc can accept the following additional keyword arguments.- Parameters:
fixed_subregions (list, optional) – List of strings, where each string is the name of the subregion in the mesh whose spins should remain fixed while the system is being driven. Defaults to
None
.output_step (bool, optional) – If
True
, output is saved at each step. Default toFalse
.n_threads (int, optional) – Controls the number of threads that OOMMF uses. The number can alternatively also be controlled via the environment variable
OOMMF_THREADS
. If not specified a default value that depends on the OOMMF installation (typically 4) is used.compute (str, optional) –
Schedule...
MIF line which can be added to the OOMMF file to save additional data. Defaults toNone
.
- schedule_kwargs_setup(schedule_kwargs)#
Additional keyword arguments allowed for schedule.
This function tests additional keyword arguments that have been passed to the
schedule
method (it is not intended for direct use). A drive in oommfc can accept the following additional keyword arguments.It is the user’s responsibility to ensure that OOMMF can be executed from the scheduled job. This would typically imply activating the conda environment in the schedule header.
To control the number of threads that OOMMF uses export the environment variable
OOMMF_THREADS
in the header file. This variable should have the same value as the number of CPUs requested from the scheduling system. If not specified a default value that depends on the OOMMF installation (typically 4) is used.Note that OOMMF cannot run on multiple nodes.
- Parameters:
fixed_subregions (list, optional) – List of strings, where each string is the name of the subregion in the mesh whose spins should remain fixed while the system is being driven. Defaults to
None
.output_step (bool, optional) – If
True
, output is saved at each step. Default toFalse
.compute (str, optional) –
Schedule...
MIF line which can be added to the OOMMF file to save additional data. Defaults toNone
.
- write_mif(system, dirname='.', ovf_format='bin8', fixed_subregions=None, output_step=False, compute=None, **kwargs)#
Write the mif file and related files.
Takes
micromagneticmodel.System
and write the mif file (and related files) to drive it in the phase space. The files are written directly to directorydirname
(if not specified the current working directory). No additional subdirectiories are created. To save a specific value during an OOMMF runSchedule...
line can be passed usingcompute
.This method accepts any other arguments that could be required by the specific driver.
Users are generally not encouraged to use this method directly. Instead
Driver.drive
,Driver.schedule
, oroommfc.schedule
should be used to write the files an run the simulation. This method is provided to give advanced users full flexibility.- Parameters:
system (micromagneticmodel.System) – System object to be driven.
dirname (str, optional) – Name of a directory in which the input files are stored. If not specified the current workinng directory is used.
ovf_format (str) – Format of the magnetisation output files written by OOMMF. Can be one of
'bin8'
(binary, double precision),'bin4'
(binary, single precision) or'txt'
(text-based, double precision). Defaults to'bin8'
.fixed_subregions (list, optional) – List of strings, where each string is the name of the subregion in the mesh whose spins should remain fixed while the system is being driven. Defaults to
None
.output_step (bool, optional) – If
True
, output is saved at each step. Default toFalse
.compute (str, optional) –
Schedule...
MIF line which can be added to the OOMMF file to save additional data. Defaults toNone
.seealso:: (..) –
drive()
schedule()
compute()