Skip to content

Commit

Permalink
micro: removed comments in Ms setup
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcortesortuno committed Feb 2, 2024
1 parent 12da65a commit eeb9eba
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions fidimag/micro/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,39 +152,22 @@ def Ms_profile(r):
"""

print('Set Ms')
self._Ms[:] = helper.init_scalar(value, self.mesh)

print('Finish Set Ms')
nonzero = 0

filterMs = self._Ms > 0.0
filterMs = (self._Ms > 0.0)
self._Ms_inv[filterMs] = 1.0 / self._Ms[filterMs]
nonzero = self._Ms[filterMs].size
# for i in range(self.n):
# if self._Ms[i] > 0.0:
# self._Ms_inv[i] = 1.0 / self._Ms[i]
# nonzero += 1
print(f'{nonzero=}')
print(f'{self.mesh.n=}')

# We moved this variable to the micro_driver class
self.driver.n_nonzero = nonzero

print('Set inverse')
filterMs = (self._Ms == 0.0)
self._pins[filterMs] = 1
filterNgbs = np.isin(self.mesh.neighbours, np.where(filterMs))
self.mesh.neighbours[filterNgbs] = -1

# for i in range(len(self._Ms)):
# if self._Ms[i] == 0.0:
# self._pins[i] = 1

# # Set the neighbour index to -1 for sites with Ms = 0
# self.mesh.neighbours[self.mesh.neighbours == i] = -1
print('Set pins')

# TODO: Check if this is necessary here, it is only defined
# for the LLG STT in the drivers
self.driver.Ms_const = np.max(self._Ms)
Expand Down

0 comments on commit eeb9eba

Please sign in to comment.