Thanks for answer, Filip.
It is obviously not distance in bytes. It is something like direction.
Pieces of sources:
enum direction { X=0,Y,Z,R,P, NO_DIRECTION };
int num_direction(direction d) const {
return num[((int) d) % 3];
};
int nr() const { return num_direction(R); }
int nx() const { return num_direction(X); }
int ny() const { return num_direction(Y); }
int nz() const { return num_direction(Z); }
// START READING HERE
void grid_volume::set_strides() {
FOR_DIRECTIONS(d) the_stride[d] = 0; // Yuck yuck yuck.
LOOP_OVER_DIRECTIONS(dim,d)
switch(d) {
case Z: the_stride[d] = 1; break;
case R: the_stride[d] = nz()+1; break;
case X: the_stride[d] = (nz()+1)*(ny() + 1); break;
case Y: the_stride[d] = nz() + 1; break;
case P: break; // There is no phi stride...
case NO_DIRECTION: break; // no stride here, either
}
}
2015-03-26 20:07 GMT+03:00 Filip Dominec <[email protected]>:
> As far as I understood the source, the 'stride' represents how much
> bytes in the computer memory shall be skipped to get to the voxel in
> the neighboring row.
> More readable, but perhaps less efficient, implementation would be to
> address the voxels as a 2-D or 3-D array.
> Is this correct?
> Filip
>
> 2015-03-26 17:53 GMT+01:00, Alex <[email protected]>:
>> Dear Meep users and developers.
>> I'm trying to understand Meep sources. So, what means "stride"? Why
>> project needs additional source file "step_generic_stride1.cpp"
>> (automatically generated)?
>>
>> Sorry if answers of this questions are obvious. English and C++ is not
>> my native languages.
>>
>> Best regards, Alex Friman
>> LPI RAS
>>
>> _______________________________________________
>> meep-discuss mailing list
>> [email protected]
>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss