Hi all,
Recently i wrote a postprocess/visualization plugin, an important step to make this plugin work is to select things like material properties for different compositional fields.
Supposing there are serveral compositional fields named: stress_xx, stress_yy, stress_xy, upper_crust, lower_crust, inclusion, lithosphere.
Here is how i did in the function: evaluate_vector_field()
…
for(unsigned int q=0; q<n_quadrature_points; ++q)
{
if(this->introspection().name_for_compositional_index(q) == “upper_crust”)
{
statement…
}
else if(this->introspection().name_for_compositional_index(q) == “lower_crust”)
{
statement…
}
else if(this->introspection().name_for_compositional_index(q) == “lithosphere”)
{
statement…
}
}
However, an error occurred:
Index 7 is not in the half-open range [0,7)
How should I deal with this problem?Or is there a better way to realize such function?
Best,
Xie