|
[Sponsors] |
April 24, 2014, 06:37 |
Warping Cells by Vectors?
|
#1 |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
I am correctly using and displaying a large number of triangular cells, which constitute a 3D tessellation. I import the data from .vtk files and I also know the displacement of every group of cells (which is made of n triangles). The issue i found in displaying the deformed shape of the thing is: a lot of cells share edges and vertices, so it's impossible to define a point-based vector field to correctly represent the displacement. So i tried to define the disp vector as CELL_DATA but applying the "Warp By Vector" Filter on the so-defined vector is not giving correct results.
Any ideas? |
|
April 24, 2014, 17:40 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings Alessandro,
Sorry, I'm having trouble mentally visualizing the problem you're seeing. Any chance you can share images of what you're seeing or a small test case we can load in ParaView to check this ourselves? Best regards, Bruno |
|
April 25, 2014, 05:53 |
|
#3 |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
Sorry if it was not clear enough. Basically I wanna do this:
imagine I have 2 triangles which share an edge (and so, 2 points). The total number of points in my model will be 4. Now, I want to move triangle 1 to the left, and triangle 2 to the right. The result I want obviously involves the creation of 2 extra-points since the two triangles will not share the edge anymore. I would imagine I could do this by defining a CELL_DATA vector and applying it to the triangles, but this doesn't look to be working properly. |
|
April 25, 2014, 15:15 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Alessandro,
Ah, then what you're looking for is essentially what's been discussed recently on this thread: http://www.cfd-online.com/Forums/par...ng-stress.html If you scroll down to post #6, you'll see the solution I figured out today, which is to use an unstructured grid and to repeat the necessary points. In addition, a way to split the triangles apart, is to apply the filter "Shrink" with a factor of 1.0, which will make sure to duplicate your points and separate the triangles. The problem is that if you only use the "Shrink" filter, the damage is already done, in the sense that if you had repeated data for the coincident points in the data files, only 1 data value/group will be assigned to each point, therefore the other data value/group for the overlapping point will not be present in ParaView's loaded data. Best regards, Bruno |
|
April 26, 2014, 10:37 |
|
#5 |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
Hello Bruno, thanks for the support.
Anyways, duplicating point, at least for me, is not an option. In my analyses I have something like 75,000 points in the mesh and the connectivity is so dense I would need to duplicate every point at least 50 times, which makes it impossible to realize. Also, the size of the files would become just too big (I am working with 5-8 GB of files for a 200 time steps analysis). Any other idea? I tried using shrink, but at that point how can I tell ParaView I need to pass the cell_data to the points connecting the cell? The filter "Cell Data to Point Data" isn't doing that properly! |
|
April 26, 2014, 11:17 |
|
#6 | |||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Alessandro,
Quote:
Because the way I see it, the size of the files should not increase all that much, because technically you're already repeating points in your structured mesh, in the files you already have. The difference is that you're not getting a representation of the repeated data, because it's being discarded during the loading process. Quote:
Quote:
Yes, but you probably won't like it If you do use "cell data" to store data at the centre of the cells, where each cell is composed by N triangles... oh, wait this is what you have!... OK, as I was describing, the "cell data" will actually need to store a massive amount of data to be later redistributed to each point. Essentially, each cell centre would have to store all points of the cell and their respective values. Then you would have to use the "Shrink" filter, followed by the "Programmable Filter" filter in ParaView for coding a Python algorithm that reassigns the data at each centre to each point. In other words, it would sort-of uncompress the data. Therefore, the way I see it, either you have 5-8GB in data and take 2-5 minutes to uncompress the data for each iteration, or you have 8-11GB in data and take 1 minute to load each iteration. Best regards, Bruno |
||||
April 26, 2014, 11:55 |
|
#7 |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
Hmmm I do not have any repeated point in the data I load. Why should I? If a node is connected to more than 1 cell I just create 1 point and join all the needed cell. So no, my files are 3GB and contain zero repeated data.
Repeating 50-100 times every node for this reason means a 100ish GB file, which not only takes a little more than 1 minute to be loaded, but also means I can store 8-10 simulations in a TB hard drive and then it's over. Last, but certainly not least, in some cases it would be very long to compute how many times I should repeat a certain point, and then duplicate it and change ALL my connectivity matrix along. Also, defining displacement as POINT_FATA instead of CELL_DATA would increase file size even more (cell numbers are approx 100 times more than point numbers), so that would probably lead to 200ish GB files?.? PS: I am not using any structured mesh!! |
|
April 26, 2014, 14:39 |
|
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Hi Alessandro,
Sorry about that. I got confused between the topics of this thread and the other thread I mentioned above. Since the issue seemed so similar, I wrongly assumed you were also using a structured mesh . And usually on weekends I tend to be a bit more slow... long week, need the rest, so my brain turns off a few features Having a simple test case for opening in ParaView would help, so that I could think a bit better by looking at the data and to deduce a few ideas... and to not loose track of the topic being discussed. Let me see if I can imagine/visualize this... your mesh is composed of polyhedral cells, all of which are composed by triangle faces. You're storing the displacement data in "cell data" mode. I've re-read your posts and I can't tell for certain how exactly the data is stored for each cell. You've mentioned a connectivity matrix and displacement vectors you need to impose on each point... for moving those points, to reflect the displacement. OK, there are two ways you might be storing your data:
Now, the connectivity matrix for the 2 triangles example would indicate that the displacement (X1_2, Y1_2, Z1_2) in a particular triangle ID1 refers to another triangle face ID2; since the triangles are connected by 2 points, this would mean that those two points would be equally displaced. The problem with this scenario, is that... this seems a pretty hectic problem: by moving 2 points, all other triangles would feel this displacement, unless either:
The wrap cells by vectors won't work for this, because it was designed for the vertexes to remain attached. What you need is to, after loading the data in ParaView, first apply the "Shrink" filter with a factor of 1, so that the points are cloned for each triangle. Then you've have to use the "Programmable Filter" for:
Best regards, Bruno |
|
April 28, 2014, 05:52 |
|
#9 |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
Dear Bruno, first of all I want to thank you for your support.
My script is structured like this: I have a very large number of triangles, and they are subdivided into groups, every group must move altogether. To do so, I define a cell_data vector (same size as number of triangles) in which I define the displacement for every triangle (it means that I forcedly repeat the displacement values for all the triangles that must move together). I am using Unstructured grids and 3-point cells in Paraview. A little example could be like this: Code:
# vtk DataFile Version 4.0 Unstructured grid legacy vtk file with point scalar data ASCII DATASET UNSTRUCTURED_GRID POINTS 6 float 0 0 0 1 0 0 2 0 0 2 1 0 1 1 0 0 1 0 CELLS 4 16 3 0 4 5 3 0 1 4 3 1 3 4 3 1 2 3 CELL_TYPES 4 5 5 5 5 CELL_DATA 4 VECTORS disp float -1.0 0.0 0.0 -1.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 Thanks again. EDIT: applying the Shrink filter with a factor of 1 and THEN the warp by vector filter seems to work. This is the results I obtain before warping: and this is after warping: Do you think this can be a permanent solution to the problem? |
|
April 28, 2014, 15:47 |
|
#10 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
This makes everything a lot more clear!
OK, then if you only care about the displacement made to the centres of the triangles, then yes, this should do the trick! The steps seem to be:
My question is: is the displacement of each triangle already globally calculated or is it relative to each other? Because these steps assume the displacement is global, if I'm not mistaken. |
|
April 29, 2014, 06:52 |
|
#11 | |
New Member
Alessandro
Join Date: Apr 2014
Location: Italy
Posts: 19
Rep Power: 12 |
Quote:
as you can see from the screenshots I posted, the "Cell Data to Point Data" filter is not even needed. This means ParaView understands the CELL_DATA vector is applied to the triangles and not to the points. The only step needed is the "Shrink" filter, otherwise the displacement gets interpolated and the triangles don't split! And yes, you're right, the displacement is calculated in the global reference system. |
||
Tags |
warp vector cells |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] snappyHexMesh <-> dynamicMeshDict problem with protected cells | Billy_16 | OpenFOAM Meshing & Mesh Conversion | 2 | November 21, 2020 04:34 |
cellZone not taking all the cells inside | rahulksoni | OpenFOAM Running, Solving & CFD | 6 | January 25, 2019 01:11 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
[snappyHexMesh] snappyHexMesh matches wrong cells to CellZone | Siegunn | OpenFOAM Meshing & Mesh Conversion | 4 | July 31, 2015 06:10 |
snappyhexmesh remove blockmesh geometry | philipp1 | OpenFOAM Running, Solving & CFD | 2 | December 12, 2014 11:58 |