Dear Patrick,
> number coeff; //where "number" is VectorizedArray<double>
> for (i=0; i<2; ++i) {
> if (p[2][i] > 0)
> coeff[i]=1.0
> else coeff[i]=2.0
> }
> return coeff;
It is generally unsafe to run loops from 0 to 2 like you write here. A
better form would be to run it up to the static member variable
VectorizedArray<number>::n_array_elements as the number depends on the
computer system. Your error is most likely because n_array_elements in
your vectorized array is 1 but you run the loop as if it were 2. Can you
check what VectorizedArray<number>::n_array_elements is in your case?
Cases currently implemented in deal.II have this value set to 1 except
for double & float number types where it is 2 & 4 for systems with SSE2
and 4 & 8 for systems with AVX.
> I get an error about index 1 not being in [0,1[, which I assume is due
> to not initializing the array correctly or not adding elements to it
> correctly, although I am not sure what the proper way is.
It shouldn't be because of improper initialization as VectorizedArray is
a POD data type where allocation = initialization (just as you have for
double, int, float and so on).
Best,
Martin