Macha Posted March 22, 2011 Share Posted March 22, 2011 (edited) How do I dopimport all the scalar and vector fields, especially if I don't know the names of the fields in advance? Edited March 22, 2011 by Macha Quote Link to comment Share on other sites More sharing options...
Macha Posted March 25, 2011 Author Share Posted March 25, 2011 Still none the wiser but I found the following python code in the sopsolver of the Gas Resize Fluid DOP: " ".join("../../..:" + y for y in ch("../../refobject").split()) Could that be of any help? Not sure what's going there. Quote Link to comment Share on other sites More sharing options...
static Posted March 25, 2011 Share Posted March 25, 2011 (edited) " ".join("../../..:" + y for y in ch("../../refobject").split()) Apparently you can plug in multiple dynamic objects when using the gas resize, based on this code. It's simply expanding each object entered to ../../..:{object} (without curly brackets). For example, if you enter "a b" into the Dynamic object parameter, this expression will expand it to "../../..:a ../../..:b" in the object_merge. Perhaps you can do something like this in a similar setup pyro = pwd().parent().parent().simulation().findObject("pyro") if not pyro: return " " strexp = " ".join("../../..:" + y for y in [field for field in pyro.subData().keys() if "Field" in pyro.subData()[field].dataType()] return strexp This would merge in all data which contains "Field" in it's data type, ie: SIM_ScalarField, SIM_IndexField, SIM_VectorField Edited March 25, 2011 by static Quote Link to comment Share on other sites More sharing options...
bunker Posted April 1, 2011 Share Posted April 1, 2011 that's very useful. thanks Static Apparently you can plug in multiple dynamic objects when using the gas resize, based on this code. It's simply expanding each object entered to ../../..:{object} (without curly brackets). For example, if you enter "a b" into the Dynamic object parameter, this expression will expand it to "../../..:a ../../..:b" in the object_merge. Perhaps you can do something like this in a similar setup pyro = pwd().parent().parent().simulation().findObject("pyro") if not pyro: return " " strexp = " ".join("../../..:" + y for y in [field for field in pyro.subData().keys() if "Field" in pyro.subData()[field].dataType()] return strexp This would merge in all data which contains "Field" in it's data type, ie: SIM_ScalarField, SIM_IndexField, SIM_VectorField Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.