Skip to content

EvalTo method for magnetic parameters #370

@Chris317

Description

@Chris317

Issue details

hello!
May I ask what is the difference in the required Slice for the EvalTo method between B-ext and alpha? Why can Slice constructed with newVectorMask run normally for B_ext, but not for alpha? How to construct Slice with magnetic parameters?

For example:
mask := newVectorMask(Nx, Ny, 1)
for i:=0; i<Nx; i++{
for j:=0; j<Ny; j++{
r := index2coord(i, j, 0)
x := r.X()
y := r.Y()
Bz := exp(-pow((x-500e-9)/100e-9, 2)) * exp(-pow(y/250e-9, 2))
mask.setVector(i, j, 0, vector(0, 0, Bz))
}
}
B_ext.EvalTo(mask)
The above code can run normally

However,
mask := newVectorMask(Nx, Ny, 1)
for i:=0; i<Nx; i++{
for j:=0; j<Ny; j++{
r := index2coord(i, j, 0)
x := r.X()
y := r.Y()
Bz := exp(-pow((x-500e-9)/100e-9, 2)) * exp(-pow(y/250e-9, 2))
mask.SetScalar(i, j, 0, 0.1)
}
}
alpha.EvalTo(mask)
panic: slice not accessible by GPU

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions