Getting the dimension of a vector in LAMMPS

If we don’t know the dimension of a calculated vector before hand, are there any ways to check?

Please be more specific and provide an example illustrating your question.

For example, if I try to compute the number of chunks in a system based on a certain property, and then the torque on each chunk, how can I know how many chunks are calculated, or the dimension of the “c_torque” vector, if I don’t know beforehand?
Code:
compute chunk all chunk/atom f_property[2] nchunk every ids every compress yes discard yes pbc yes units box
compute torque all torque/chunk chunk

Thank you!

Please have a closer look at the documentation for compute chunk/atom. It computes two properties: 1) the per-atom chunk-ID and b) a global scalar that is the number of chunks.
So the “size of the vector” that you are looking for is accessible via c_chunk.

Thank you, Dr. Kohlmeyer.