There is probably an easy answer for this that I am missing, so sorry in advance if that is the case.
I have found a few times now when writing a script that sweeps over the size of an element (waveguide cross-section for example) that it is not easy to save the E-field, because I do not know the size of the matrix in advance since with each new cross section the mesh changes.
Also, the size of the E-field matrices for different meshes will be different for each object size I am sweeping over thus it is not easier to store all the results in one matrix. If the field results always have the same size then it is straightforward, but that is not the case here.
Is there some simple programming trick I am missing here?