mumax / 3

GPU-accelerated micromagnetic simulator
Other
457 stars 151 forks source link

initializing an array variable #162

Closed AIrodrigo closed 6 years ago

AIrodrigo commented 6 years ago

Hello everyone, I've been trying to create an array in mumax but it's been impossible. I tried using the golang language : x:= [3]float64{0,5,3}... However it always pops up an error message. How can I initialize an array in mumax3?

Thank you, Rodrigo

JeroenMulkers commented 6 years ago

In your example, you could use x := vector(0,5,3).

The scripting language of mumax3 is not golang (it's at most a very small subset). However, it is possible to use golang instead of the scripting language. An example: https://github.com/mumax/3/blob/master/test/standardproblem4.go

AIrodrigo commented 6 years ago

Hi Jeroen, thank you very much for your help. The problema is that from that way you are giving to the vector 3 arguments. However, I need to initialize a string (vector) with many elements (numbers, float64)... x:= [0.1, 0.3, 0.5, etc].

Thank you, Rodrigo

JeroenMulkers commented 6 years ago

Then you are probably better of by writing your simulation directly in Go.

AIrodrigo commented 6 years ago

Ok, I will try this way. Thank you