How to use the oommfc.util function in oommfc

To help you get started, we’ve selected a few oommfc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ubermag / oommfc / oommfc / drivers / hysteresisdriver.py View on Github external
def _script(self, system, **kwargs):
        # Save initial magnetisation.
        m0filename = 'initial_magnetisation.omf'
        system.m.write(m0filename)

        meshname = system.m.mesh.name
        systemname = system.name
        Hmin = kwargs["Hmin"]
        Hmax = kwargs["Hmax"]
        n = kwargs["n"]

        mif = oc.util.mif_file_vector_field(m0filename,
                                            'initial_magnetisation',
                                            'main_atlas')
        mif += oc.util.mif_vec_mag_scalar_field('initial_magnetisation',
                                                'initial_magnetisation_norm')
        mif += "# UZeeman\n"
        mif += "Specify Oxs_UZeeman {\n"
        mif += "  Hrange {\n"
        mif += "    {{ {} {} {} {} {} {} {} }}\n".format(*Hmin, *Hmax, n)
        mif += "    {{ {} {} {} {} {} {} {} }}\n".format(*Hmax, *Hmin, n)
        mif += "  }\n"
        mif += "}\n\n"
        mif += "# CGEvolver\n"
        mif += "Specify Oxs_CGEvolve {}\n\n"
        mif += "# MinDriver\n"
        mif += "Specify Oxs_MinDriver {\n"
        mif += "  evolver Oxs_CGEvolve\n"
        mif += "  stopping_mxHxm 0.01\n"
        mif += "  mesh :{}\n".format(meshname)
        mif += "  Ms :initial_magnetisation_norm\n"
github ubermag / oommfc / oommfc / drivers / hysteresisdriver.py View on Github external
def _script(self, system, **kwargs):
        # Save initial magnetisation.
        m0filename = 'initial_magnetisation.omf'
        system.m.write(m0filename)

        meshname = system.m.mesh.name
        systemname = system.name
        Hmin = kwargs["Hmin"]
        Hmax = kwargs["Hmax"]
        n = kwargs["n"]

        mif = oc.util.mif_file_vector_field(m0filename,
                                            'initial_magnetisation',
                                            'main_atlas')
        mif += oc.util.mif_vec_mag_scalar_field('initial_magnetisation',
                                                'initial_magnetisation_norm')
        mif += "# UZeeman\n"
        mif += "Specify Oxs_UZeeman {\n"
        mif += "  Hrange {\n"
        mif += "    {{ {} {} {} {} {} {} {} }}\n".format(*Hmin, *Hmax, n)
        mif += "    {{ {} {} {} {} {} {} {} }}\n".format(*Hmax, *Hmin, n)
        mif += "  }\n"
        mif += "}\n\n"
        mif += "# CGEvolver\n"
        mif += "Specify Oxs_CGEvolve {}\n\n"
        mif += "# MinDriver\n"
        mif += "Specify Oxs_MinDriver {\n"
        mif += "  evolver Oxs_CGEvolve\n"