You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently experimenting with non-uniform z-layering in my mesh, and I want to be able to make plots of my VPPs as a function of z. Here's an example of my z-layering scheme using the AdvancedExtruderGenerator
I'm currently trying to use an AuxVariable + ParsedAux to compute the z of each element with an ElementValueSampler VPP to generate a CSV of z-heights, but it's kind of clunky -- and requiring me to do more post processing to delete the duplicates from each element.
It would be nice to have a way to take the information from the mesh generator and generate a layering scheme (in my case in the z-direction), but it could be arbitrary for the direction parameter for the x,y, and z unit vectors.
Design
Here's the python code I wrote to do this, which accepts heights and num_layers (just as is used in AdvancedExtruderGenerator)
defcompute_mesh_z_positions(layers, heights, z_min=0):
try:
len(layers) ==len(heights)
exceptValueError:
print(f"The length of layers ({len(layers)}) and heights ({len(heights)}) must be the same")
z_bounds= [z_min]
forlayer,heightinzip(layers,heights):
foriinrange(layer):
z_bounds.append(z_bounds[-1] +height)
z_centers= [0.5*(z_bounds[i+1]+z_bounds[i]) foriinrange(len(z_bounds)-1)]
returnz_bounds, z_centers
Impact
While I'm pretty sure my python code works, it would be great from a QC standpoint to have MOOSE output the z corresponding to each VPP value in a way that doesn't require removing duplicates (like w ElementValueSampler)
The text was updated successfully, but these errors were encountered:
Oh a note about my python code. I define my heights a little differently than the AdvancedExtruderGenerator, but converting between them isn't too bad.
E.g., where I specify (0.1, 3) for the first (height, num_layers) pair in my list of heights and layers in the mesh generation script, the python would actually want (0.1/3, 3)
Motivation
I'm currently experimenting with non-uniform z-layering in my mesh, and I want to be able to make plots of my VPPs as a function of z. Here's an example of my z-layering scheme using the
AdvancedExtruderGenerator
I'm currently trying to use an AuxVariable + ParsedAux to compute the z of each element with an
ElementValueSampler
VPP to generate a CSV of z-heights, but it's kind of clunky -- and requiring me to do more post processing to delete the duplicates from each element.It would be nice to have a way to take the information from the mesh generator and generate a layering scheme (in my case in the z-direction), but it could be arbitrary for the
direction
parameter for the x,y, and z unit vectors.Design
Here's the python code I wrote to do this, which accepts
heights
andnum_layers
(just as is used inAdvancedExtruderGenerator
)Impact
While I'm pretty sure my python code works, it would be great from a QC standpoint to have MOOSE output the z corresponding to each VPP value in a way that doesn't require removing duplicates (like w ElementValueSampler)
The text was updated successfully, but these errors were encountered: