def T(self, value): self._T[:] = helpers.scalar_valued_function( value, self.S1).vector().array()[:] self._T_dg = helpers.scalar_valued_dg_function(value, self.mesh) As = self._A_dg.vector().array() Ts = self._T_dg.vector().array() mes = self._m_e_dg.vector().array() for i in range(len(Ts)): As[i] = self.mat.A(Ts[i]) mes[i] = self.mat.m_e(Ts[i]) self._A_dg.vector().set_local(As) self._m_e_dg.vector().set_local(mes) self._m_e.shape = (3, -1) for i in range(len(self._T)): self._m_e[:, i] = self.mat.m_e(self._T[i]) self.inv_chi_par[i] = self.mat.inv_chi_par(self._T[i]) self._m_e.shape = (-1, ) # TODO: Trying to use spatial parameters self.inv_chi_perp = self.mat.inv_chi_perp(self._T[0])
def set_alpha(self, value): """ Set the damping constant :math:`\\alpha`. The parameter `value` can have any of the types accepted by the function :py:func:`finmag.util.helpers.scalar_valued_function` (see its docstring for details). """ self.alpha = helpers.scalar_valued_function(value, self.S1) self.alpha.rename('alpha', 'Gilbert damping constant')
def set_alpha(self, value): """ Set the damping constant :math:`\\alpha`. The parameter `value` can have any of the types accepted by the function :py:func:`finmag.util.helpers.scalar_valued_function` (see its docstring for details). """ self._alpha[:] = helpers.scalar_valued_function( value, self.S1).vector().array()[:]
def setup(self, m, Ms, unit_length=1): self.m = m self.Ms = Ms self.unit_length = unit_length if self.scalar_df_expression: dofmap = m.functionspace.dofmap() self.S1 = df.FunctionSpace( m.mesh(), "Lagrange", 1, constrained_domain=dofmap.constrained_domain) self.h0 = helpers.scalar_valued_function(self.df_expression, self.S1).vector().array() self.H0 = df.Function(m.functionspace) else: self.H0 = helpers.vector_valued_function(self.df_expression, self.m.functionspace) self.E = -mu0 * self.Ms.f * df.dot(self.m.f, self.H0) self.H_init = self.H0.vector().array() self.H = self.H_init.copy()
def set_spatial_alpha(self, value): self._alpha[:] = helpers.scalar_valued_function( value, self.S1).vector().array()[:]
def T(self, value): self._T[:] = helpers.scalar_valued_function( value, self.S1).vector().array()[:] log.info('Temperature : %g', self._T[0])
def pins(self, value): self._pins[:]=helpers.scalar_valued_function(value,self.S1).vector().array()[:]