Hello,
I have trouble understanding the syntax of this instruction, found in log-conform.h or navier-stokes/conserving.h:
for (scalar s in {my_vector, my_tensor})
s.v.x.i = -1;
// just a scalar, not the component of a vectorThanks to the comment I understand the goal: to treat each component of the considered vector or tensor as a scalar, as to apply the same boundary conditions to normal and tangential components. What I have trouble understanding here is the syntax of this instruction: I can't find anywhere (even searching in qcc.c) that a scalar structure has an attribute v, which has an attribute x and so on. Digging in the forum I found
a post from Jose where we can see that s.v is a vector, which was unexpected given that s is a scalar.
My question is the following: what is the underlying data structure hidden here, and what is the meaning of all the attributes v, x, i, and even d (found line 409 of grid/cartesian_commons.h)?
As a side note, the above instruction "for (scalar s in {my_vector, my_tensor}) s.v.x.i = -1;" is not allowed outside of an event (it leads to compilation errors, just like when using foreach_dimension() outside of an event). Is there a reason for only allowing these instructions inside events?
Many thanks,
Damien