コード例 #1
0
ファイル: llg.py プロジェクト: fangohr/fidimag
 def skyrmion_number(self):
     nx = self.mesh.nx
     ny = self.mesh.ny
     nz = self.mesh.nz
     number = clib.compute_skyrmion_number(self.spin, self._skx_number, nx,
                                           ny, nz, self.mesh.neighbours)
     return number
コード例 #2
0
ファイル: llg.py プロジェクト: fangohr/fidimag
 def skyrmion_number(self):
     nx = self.mesh.nx
     ny = self.mesh.ny
     nz = self.mesh.nz
     number = clib.compute_skyrmion_number(
         self.spin, self._skx_number, nx, ny, nz, self.mesh.neighbours)
     return number
コード例 #3
0
ファイル: sim.py プロジェクト: writergirish/fidimag
    def skyrmion_number(self, method='FiniteSpinChirality'):
        """
        Calculate the skyrmion number using different methods:

        method      :: 'FiniteSpinChirality', 'BergLuscher'

        which are specifically defined for discrete spin lattices.

        Calling this function will fill the _skx_number array with the skyrmion
        number density per lattice site.

        It is important to mention that this calculation only works for a
        2D layer in the XY plane.

        See the corresponding C code at fidimag/atomistic/lib/util.c for a
        detailed documentation about the methods.

        """
        nx = self.mesh.nx
        ny = self.mesh.ny
        nz = self.mesh.nz

        if method == 'FiniteSpinChirality':
            if self.mesh.mesh_type == 'cuboid':
                number = clib.compute_skyrmion_number(self.spin,
                                                      self._skx_number, nx, ny,
                                                      nz, self.mesh.neighbours,
                                                      self.mesh.n_ngbs)
            else:
                raise ValueError('FiniteSpinChirality method only'
                                 ' defined for cuboid meshes')

        elif method == 'BergLuscher':
            number = clib.compute_skyrmion_number_BergLuscher(
                self.spin, self._skx_number, nx, ny, nz, self.mesh.neighbours,
                self.mesh.n_ngbs)
        else:
            raise ValueError('Specify a valid method')

        return number
コード例 #4
0
ファイル: sim.py プロジェクト: computationalmodelling/fidimag
    def skyrmion_number(self, method='FiniteSpinChirality'):
        """
        Calculate the skyrmion number using different methods:

        method      :: 'FiniteSpinChirality', 'BergLuscher'

        which are specifically defined for discrete spin lattices.

        Calling this function will fill the _skx_number array with the skyrmion
        number density per lattice site.

        It is important to mention that this calculation only works for a
        2D layer in the XY plane.

        See the corresponding C code at fidimag/atomistic/lib/util.c for a
        detailed documentation about the methods.

        """
        nx = self.mesh.nx
        ny = self.mesh.ny
        nz = self.mesh.nz

        if method == 'FiniteSpinChirality':
            if self.mesh.mesh_type == 'cuboid':
                number = clib.compute_skyrmion_number(
                    self.spin, self._skx_number, nx, ny, nz,
                    self.mesh.neighbours)
            else:
                raise ValueError('FiniteSpinChirality method only'
                                 ' defined for cuboid meshes')

        elif method == 'BergLuscher':
            number = clib.compute_skyrmion_number_BergLuscher(
                self.spin, self._skx_number, nx, ny, nz,
                self.mesh.neighbours)
        else:
            raise ValueError('Specify a valid method')

        return number