Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

look at linking slices in smokeview menus to &SLCF entries in input file #1026

Open
gforney opened this issue Sep 18, 2020 · 17 comments
Open
Assignees

Comments

@gforney
Copy link
Contributor

gforney commented Sep 18, 2020

now smokeview collects slices together based upon their location. associating slices with &SCLF input file entries would allow the user to view slices as they are defined in the input file

@gforney gforney self-assigned this Sep 18, 2020
@obscureed
Copy link

I haven't completely understood what you're working towards here, but I do have an enhancement request that might be partially relevant: It would be really nice if slices could be named, with the names visible in the smokeview load menu. Currently, I have to remember which slice is which.

@rmcdermo
Copy link
Contributor

rmcdermo commented Dec 4, 2020

Related to this, it would also be nice if a given slice index was consistent from mesh to mesh. Say, I have a horizontal slice plane (PBZ=...) and I also have a vertical slice plane (PBY). If I have a mesh block arrangement that is 6 x 6 in x and y, then a given slice (say 'HRRPUV') in the z plane my have an index of 1 in most of the meshes, except the meshes where the vertical slice also lives (assuming I listed the vertical slice first in the input file). As I write post-processing scripts to make use of the slice data (using slread.m) this becomes challenging, the scripts get ugly. If the slices had an ID, this could be used instead of the index, though an ID string can usually have spaces and we'd want to avoid this in file names.

@gforney
Copy link
Contributor Author

gforney commented Dec 4, 2020

creating slice menus in smokeview is pretty messy. something like this could simplify things. think fds is now outputting some type of slice index nowto the smv file but for some reason which I can't remember there was a problem. I'll take another look.

@rmcdermo
Copy link
Contributor

rmcdermo commented Dec 4, 2020

Hmmm... ID is already a parameter on SLCF. I've never used it though.

@gforney
Copy link
Contributor Author

gforney commented Dec 4, 2020 via email

@JakeOShannessy
Copy link
Contributor

I use the ID parameter of slices quite extensively. Not only does it show up in the load menu (by name), but use it when running scripts to great effect.

@gforney
Copy link
Contributor Author

gforney commented Dec 4, 2020 via email

@gforney
Copy link
Contributor Author

gforney commented Dec 5, 2020

I had forgotten that I make use of the ID keyword from the &SLCF namelist. If you add ID='test111' to a &SLCF line, the attached image is what you'll see in a slice menu in smokeview so you can annotate your slice file menus.

slice_menu_id

@obscureed
Copy link

This works for me and is good news -- thanks! (OK, it doesn't apply to vector slices -- but you can look in the Slice menu, find the name, memorise the coordinates and then use them in the vector slice menu.)

If anyone else is reading this and wondering whether you can use the same name for different quantities: yes, you can. (So, for example, you can apply ID='stairdoor' to a pressure slice and to a temperature slice, presumably at the same location.) On the other hand, if you apply two different names to the same quantity at the same location, you only see the first name in the GUI.

JakeOShannessy: Thanks for the tips! Please could you tell me the syntax for a script command that uses slice ID, and/or point me to the documentation? (Or do you mean that you record a script of finding the slice by hand, and use this as the start of script-writing?)

@gforney
Copy link
Contributor Author

gforney commented Dec 8, 2020

take a look at smokeview here at link below. The slice id's should now show up in vector slice menus.

https://drive.google.com/drive/folders/0B_wB1pJL2bFQc1F4cjJWY2duWTA?usp=sharing

also, I implemented a new smokeview script command, LOADSLCF that is friendlier than LOADSLICE or LOADFILE. LOADSLCF mimics the &SLCF name list use in an FDS input file

If you had

&SLCF PBY=1.0, QUANTITY='TEMPERATURE' VECTOR=T ID='y slice' /
&SLCF PBX=1.0, QUANITTY='TEMPERATURE' CELL_CENTERED ID='x slice' /

in your input file you could use either

LOADSLCF
ID='y slice'

LOADSLICE
QUANTITY='TEMPERATURE' PBY=1.0

to load the Y slice. To load the y slice as a vector slice add VECTOR=T

LOADSLICE
QUANTITY='TEMPERATURE' PBY=1.0 VECTOR=T

or

LOADSLCF
ID='y slice' VECTOR=T

To load the X cell centered slice use

LOADSLCF
ID='x slice'

or

LOADSLICE
QUANTITY='TEMPERATURE' PBY=1,0 CELL_CENTERED=T

I have tested this command and it seems to work but it is new. If you use it and see problems let me know

@gforney
Copy link
Contributor Author

gforney commented Dec 8, 2020

typo, should have been
&SLCF PBX=1.0, QUANITTY='TEMPERATURE' CELL_CENTERED=T ID='x slice' /

@rmcdermo
Copy link
Contributor

rmcdermo commented Dec 8, 2020

I've played with the ID stuff. It is definitely helpful. But, for me, it does not get all the way to what I need because the filenames in the working directory are all still based on indices. True, now at least it is easy to manually look in the smv file and match up my ID to the .sf file I want. And it is true that I could somehow parse this automatically, but that seems at bit kludgy.

@JakeOShannessy, I am not sure what type of scripts you are talking about, unless they are the smv script language. When I'm trying to develop Python or Matlab scripts, it would be much cleaner if ID were somehow used in the filename instead of an index. Am I missing something?

@gforney
Copy link
Contributor Author

gforney commented Dec 8, 2020 via email

@rmcdermo
Copy link
Contributor

rmcdermo commented Dec 8, 2020

No need to add more files. If I need something like that, I'd just parse the smv file, it's al there.

I'm not suggesting you make this a big priority, I'm just commenting on things from my point of view. Blanks are not hard to deal with; for example, Python will make a rule to insert a hyphen for the blank.

@gforney
Copy link
Contributor Author

gforney commented Dec 8, 2020 via email

@JakeOShannessy
Copy link
Contributor

@rmcdermo, @obscureed: The scripting I'm referring to is using the lua hooks within smokeview (they're under a preprocessor directive) so neither SSF nor completely external.

Since the scripts are internal to smokeview they have access to the labels which are parsed by the smokeview parser, so at the very least I can be consistent with smokeview. The format of the .smv files relies on ampersand to delimit the end of an id, so whitespace hasn't been an issue although ampersands would be.

If you're curious, the label is simply stored in the struct for slicedata...

typedef struct _slicedata {
  ...
  char *slicelabel;
  ...
}

... and I match on that when loading slices (or doing whatever else).

function load.namedslice(name)
    local result, indices = load.slice(function(slice)
        return (slice.label == name)
    end)
    if (result ~= 0) then
        error("Slice named " .. name .. " could not be found.")
    end
    return result, indices
end

@rmcdermo
Copy link
Contributor

rmcdermo commented Dec 9, 2020

@JakeOShannessy Thanks for the explanation. Sounds like I just need to build a .smv parser for Matlab or Python. Might be a good summer student project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants