8/15/2023 0 Comments Paraview vtk write matlab hangsThe integer numbers represent which points should be connected by lines, therefor I can not replace NaN with zeros because it will interpret it as Point with ID 0. I have a file with NaN values in almost every column and row. It offers more options, details and much better performance than built-in Matlab 3D visualization modules. On Mon, at 2:48 PM, Doina Gumeniuc (224252 MAHS) > wrote: csv file, the correct string that is interpreted as NaN is "nan" without the quotes. ParaView understand NaN correctly as blanks. ![]() I was thinking it is because of my NaN values. I am using a vtk poly data file, which when I load in paraview, it gives me error (paraview just stops working). On Mon, at 4:10 PM, Doina Gumeniuc (224252 MAHS) > wrote: Originally, instead of NaN there are zeros, but I just need blanks without changing the shape of the matrix, which is why I use NaN, but it gives me error in paraview. ![]() I make the vtk file in matlab by extracting the information from a. Sadly I can not import the whole file, but here is an example: The following should be the correct representation of that:įrom: ParaView on behalf of "Doina Gumeniuc (224252 MAHS)" In the example you sent us, I presume that you mean to have 4 line cells with 2, 3, 2, and 2 vertices, respectively. It looks like you can solve your problem by simply not writing out the NaN’s in the fill. The LINES connectivity list allows you to vary the length of the line chain. ![]() However, I do not see why you need NaN at all. It worked fine.) However, you are trying to introduce NaN’s in a list of integer connections, which is just wrong on many levels. To: Doina Gumeniuc (224252 MAHS) Mathieu Westphal paraview at So my question would be again, is it possible to replace it with anything else? If I ask matlab to delete the zeros from my file, the shape of the matrix will change, so the only solution I found so far is to replace the zeros by NaNs in matlab, which gives me error in paraview, for the reason you, Moreland, explained. There is a bit of a problem though: In reality, this file is much more bigger and deleting the NaNs by hand is not an option (also I am trying to make it all happen automatically). Thanks a lot for your time and help.NaN values Doina Gumeniuc (224252 MAHS) 224252 at via.dk Extracting ParaView Data into Python Arrays - CFD Online Discussion ForumsĬode: #Import the useful library from paraview.simple import * import numpy as np from paraview import numpy_support as ns import vtk # Get active boundary (actualy a 3D wing from a mesh with pressure data) Junction = GetActiveSource() # For several positions on the z axis for z in np.arange(2e-6,28e-6,2e-6): Slice1 = Slice(Input=Junction) Slice1.SliceType = "Plane" Slice1.SliceOffsetValues = Z.append(Slice1) # Took two slice as an example but for multiple ones, just repeat the procedure Slice1 = FindSource("Slice1") m1 = MergeBlocks(Slice1) d1 = servermanager.Fetch(m1) d1.GetCellData() u1= ns.vtk_to_numpy(d1.GetCellData().GetArray("U")) #numCells = u1.GetNumberOfCells() Slice2 = FindSource("Slice2") m2 = MergeBlocks(Slice2) d2 = servermanager.Fetch(m2) d2.GetCellData() u2=ns.vtk_to_numpy(d2.GetCellData().GetArray("U")) uvg = (u1+u2)/2I was wondering now how can I render this field (uvg) as a color map for instance ?Ĭan I ''rebuild'' a slice away from my gemeotry where I can stock the average field and then access it on the Render view ?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |