Conversation
|
It might be nice to not dump the whole field, if you have a large one, but do it like numpy, where it only prints the first and last 3 row in each dimension, although 4 is probably better, if there are 2 guard cells, and have an option to change it to dump everything? |
|
Good idea. Numpy has two related options:
So we could have something like:
and then perhaps one or both of these:
|
|
Thanks @ZedThree! I don't have suggestions beyond echoing David's idea. I assume the three numbers in brackets are X, Y and Z in that order? So when you say "Z points being on a single line", you mean that the Z axis is incremented in the horizontal direction in the console? I would personally find it more useful to have Y increment on the vertical and X on the horizontal, and then have different blocks for Z increments. This would then mirror the physical layout of the coordinates in a tokamak. This would also make an XY Field2D show a grid of points instead of a single column. It would make it more interpretable when looking at Y boundaries which is a common use case. |
|
This looks super useful. I think it might be helpful to add an option not to print the indices, though. Sometimes they aren't needed and just make the output look cluttered. |
Yes, exactly
Hmm, this might be tricky, but I think I have a way to do this.
Yup, that's easy enough. |
4c4ccca to
d5fa122
Compare
|
Unbelievable. Thanks @ZedThree!!! |
Will this plot x-z slices? and the number can specify which y-slice? That sounds very cool! |
I've not added that, but you should be able to do that with: output.write("{:#T}", sliceXZ(field, y));I did consider adding general slicing to this, but I've already spent way too long on it! |
|
@ZedThree I agree that we should merge it in. |

Needs some more docs, but lets you write out fields:
output.write("{}", field);and get something like:
or specify a region and a floating point format:
output.write("{:r'RGN_NOX':3.1e}", field);Works on
Field2D,Field3D, andFieldPerp. For the sake of an easy implementation, z points are always on a single line, then blocks of y, so aField2Dlooks like:and a
FieldPerp:I need to write some docs, but are there any other options that would be useful?