[Paraview] trying to achieve odd symmetry reflection where axis is inside original domain

Cory Quammen cory.quammen at kitware.com
Fri Nov 6 15:04:03 EST 2015


Noah,

Unfortunately, no examples that I know of will be adaptable to this
problem. What you would probably want to do is create a new
vtkStructuredGrid of the proper dimension and copy the data you need to the
right locations by looping over the logical grid locations.

HTH,
Cory

On Fri, Nov 6, 2015 at 2:38 PM, Noah Reddell <reddell at uw.edu> wrote:

> Cory,
>   Thanks for the encouragement that a programmable filter may make this
> possible.
>    Can you point to any example code that could do this sort of trimming
> in the programmable filter?  I'm hoping by logical index, but I suppose a
> x-coordinate mask could work too.
>    Likewise, how can cells be added to the output to fill-in the center?
> This point data, so I'm guessing we really need to express the connectivity
> between the old trimmed x>0 nodes and the new reflected (and -1 scaled) x<0
> nodes.
>
> Best Regards,
>
> Noah Reddell
>
> On Thu, Nov 5, 2015 at 7:41 PM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>
>> On Mon, Nov 2, 2015 at 11:30 AM, Noah Reddell <reddell at uw.edu> wrote:
>>
>>> Hi Cory,
>>>
>>>    Thanks for your interest.  I can answer your two questions pretty
>>> compactly.
>>>
>>> *> Could you describe the glitches? I couldn't understand them from just
>>> the images you attached.*
>>> The scalar variable EM_field_n_c4 in the referenced .VTS file is the
>>> analytic function: *tanh(-x/4.082)*.
>>> The resulting odd symmetry reflection about x=0 should achieve the same
>>> function.  The function is smooth.
>>> I suspect the glitches come from the two nodes left of x=0 in my
>>> original data.  I speculate that the Reflect filter is reflecting those as
>>> well.  Actually, I'm pretty sure I observed as much yesterday when not
>>> using the option to copy the original data.  This means some kind of funny
>>> overlap occurs between the before and after reflection data.
>>>
>>
>> Ah, thanks for clarifying. Now I understand your grid layout better.
>>
>> *> what do you expect to see at x=0 if your original data doesn't have
>>> anything at x = 0?*
>>> My preference would be to have no new nodes created along x=0.  I have
>>> nodes at x= { 0-d2,  0-d1,  0+d1, 0+d2, 0+d3, 0+d4, ... }.
>>> One way to look at the problem would be to reflect nodes {0+d3,0+d4,...}
>>> about x=0 because the the existing two nodes {0-d2, 0-d1} are already
>>> correct.
>>> Another way to look it it is to discard existing nodes {0-d2, 0-d1} and
>>> reflect what remains about x=0.
>>> In both cases, reflect with possible negative scaling!
>>>
>>
>> Yes, I would try trimming the extent to get rid of 0-d2 and 0-d1, then
>> reflect the rest. This *should* solve the glitch you see, but you will
>> still have the center missing from the result.
>>
>>
>>> I don't care if a new node is created at x=0 which would be the average
>>> value of nodes {0-d1, 0+d1}.  But Paraview linear interpolation already
>>> does this for presentation purposes and it would not be strictly correct
>>> for the underlying polynomial element.
>>>
>>
>> Your best bet is probably a programmable filter to get the control you
>> want. You should be able to take care of the trimming away of {0-d2, 0-d1},
>> do the reflection with odd symmetry, then fill in the center by adding
>> cells to the output.
>>
>> - Cory
>>
>>
>>> Best Regards,
>>>
>>> Noah Reddell
>>>
>>> On Mon, Nov 2, 2015 at 7:42 AM, Cory Quammen <cory.quammen at kitware.com>
>>> wrote:
>>>
>>>> Hi Noah,
>>>>
>>>> See answers and questions for you inlined below.
>>>>
>>>>
>>>>> 1)  My original data extends beyond the x=0 symmetry plane by two data
>>>>> points.  And I have no data point on x=0 itself.  This is because in the
>>>>> simulation, there is a third-order polynomial element centered on x=0.
>>>>>
>>>>
>>>> What would you like to see on x=0?
>>>>
>>>>
>>>>> 2)  My data is represented as Structured Curvilinear Grid (.VTS files)
>>>>> though in actuality, it is rectilinear.
>>>>>
>>>>
>>>> Shouldn't be a problem.
>>>>
>>>>
>>>>> 3)  Some data arrays have odd symmetry, such that f(x<0) = -f(x>0)
>>>>>
>>>>
>>>> The Reflect filter doesn't support this, but you obviously know that.
>>>>
>>>>
>>>>> Here’s what I’ve tried.
>>>>> A) Use the Reflect filter, reflect about x=0.  Works quite well for
>>>>> even symmetry data, but the odd-symmetry data is misrepresented with
>>>>> opposite sign for (x<0).  Also, there are glitches with the doubled-up mesh
>>>>> points about x=0.  That becomes obvious when I tried to add a calculator to
>>>>> correct the odd symmetry based on (x<0) boolean expression.
>>>>>
>>>>
>>>> Could you describe the glitches? I couldn't understand them from just
>>>> the images you attached.
>>>>
>>>>
>>>>> B) Manually select data points with (x>0); Extract Selection; Reflect
>>>>> that extraction; Group original and new selection.  Problem:  I end up with
>>>>> a band of missing data for the cell centered on x=0.
>>>>>
>>>>
>>>> Again, what do you expect to see at x=0 if your original data doesn't
>>>> have anything at x = 0?
>>>>
>>>> Thanks,
>>>> Cory
>>>>
>>>>
>>>>> Ideally, I want to end up with a consistent full-domain representation
>>>>> such that I can perform stream line traces across the x=0 mid-plane.
>>>>>
>>>>> I’d be very grateful if anyone could point out a working solution.
>>>>> Here’s one of my data files and some screenshots of my failed attempts.  (
>>>>> The scalar data item EM_field_n_c4 is a good odd-symmetry example. )
>>>>>
>>>>> VTS data file 800 kB
>>>>> <https://dl.dropboxusercontent.com/u/54478577/supporting%20forum%20posts/paraview_odd_symmetry_help/harris_current_sheet_equilibreum_2.vts>
>>>>>
>>>>> Existing Curvilinear Mesh representation
>>>>> <https://dl.dropboxusercontent.com/u/54478577/supporting%20forum%20posts/paraview_odd_symmetry_help/By.jpg>
>>>>>
>>>>> ProblemA demonstration of missing band about x=0
>>>>> <https://dl.dropboxusercontent.com/u/54478577/supporting%20forum%20posts/paraview_odd_symmetry_help/missingband.jpg>
>>>>>
>>>>> ProblemB demonstration of glitch at centerline
>>>>> <https://dl.dropboxusercontent.com/u/54478577/supporting%20forum%20posts/paraview_odd_symmetry_help/glitch_at_centerline.jpg>
>>>>>
>>>>>
>>>>> Best Regards,
>>>>>
>>>>> Noah Reddell
>>>>> University of Washington
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the ParaView Wiki at:
>>>>> http://paraview.org/Wiki/ParaView
>>>>>
>>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Cory Quammen
>>>> R&D Engineer
>>>> Kitware, Inc.
>>>>
>>>
>>>
>>
>>
>> --
>> Cory Quammen
>> R&D Engineer
>> Kitware, Inc.
>>
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151106/ac9d59cb/attachment.html>


More information about the ParaView mailing list