paraview热流图(5):只保留一个网格

问题描述

how to combine mesh to one

相关资料

paraview wiki

Multiple data sets

我有一个压力数据集和一个速度数据集(x,y,z)。我想用计算器calculator把它们结合起来。我将它们组合在一起,并尝试使用计算器过滤器calculator filter。我可以在标量按钮上选择压力和速度,但新数组没有出现在电子表格中。我还尝试了python计算器(python calculator )paraview/user-Guide/python计算器(paraview/user Guide/Python Calculator description),它们描述了如何比较多个数据集,但没有成功。
我想画Cp(压力系数)。有什么提示吗?

假设两个数据文件具有相同的网格点(the same mesh points),我认为您需要使用一个“附加”过滤器(the “Append” filters),而不是分组(grouping)。问题是我永远不知道哪一个是正确的附加过滤器。。。有3个“附加”过滤器,您可以从这里开始阅读:ParaView/Users Guide/List of filters
您提到的其他过滤器也在该wiki页面中。

Append Attributes

附加属性
从第一个输入复制几何图形。将所有数组放入输出。附加属性过滤器获取具有相同几何图形的多个输入数据集,并合并它们的点和单元属性,以生成包含输入的所有点和单元属性的单个输出。忽略与第一个输入没有相同点数和单元数的任何输入。输入数据集必须已经收集在一起,这可能是由于读卡器reader加载了多个部件(例如EnSight读卡器),也可能是因为已运行组部件过滤器 Group Parts filter以形成数据集的集合。

Append Datasets

Append Geometry

Python script for Integrate Variable集成变量的python脚本

我正在使用paraview来可视化我所做的切片/剪辑(slice/clip)上的速度和流量( the velocity and the flow)
我有很多剪辑(clips),我必须为每一个导出数据,甚至在这个j剪辑上集成变量数据。第一部分现在完成了,我不知道在剪辑clips上集成变量的sciprt是什么,这个脚本可以帮我可以自动完成集成变量!!

我想做一个类似的脚本化后处理:在不同的剪辑clips上集成一个变量,然后将电子表格spreadsheet数据导出到一个文件中

try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

import csv
surf = LegacyVTKReader( FileNames=['pathToImportFile.vtk'] )

RenderView1 = GetRenderView()
                                      
Clip1 = Clip( ClipType="Plane" )
Clip1.Scalars = ['POINTS', 'p']
Clip1.ClipType.Origin = [0.0, 0.0, 0.0] #can be a random origin point
Clip1.ClipType.Normal = [1.0, 0.0, 0.0]   #can be a random normal orientation
Clip1.ClipType = "Plane"              

Clip2 = Clip( ClipType="Plane" )
Clip2.Scalars = ['POINTS', 'p']  
Clip2.ClipType.Origin = [1.0, 0.0, 0.0]  #can be a random origin point
Clip2.ClipType.Normal = [-1.0, 0.0, 0.0]  #can be a random normal orientation
Clip2.ClipType = "Plane"
                                      
# we define the variable to be integrated on Clip2                  
Calculator1 = Calculator()       
Calculator1.AttributeMode = 'point_data'
Calculator1.Function = 'writeHereTheFunctionOfYourVariable'
Calculator1.ReplaceInvalidResults = 0
Calculator1.ResultArrayName = 'NameOfYourVariable'

IntegrateVariables1 = IntegrateVariables()   #this integrates the current variable over Clip2

finalFile = open('pathToCSVFile.csv','wb')
fd = csv.writer(finalFile)  
                                     
writer = CreateWriter('PathToATemporaryFile.csv', IntegrateVariables1) 
writer.FieldAssociation = "Points"  # or "Cells"

for x in range(-6, 6): #loop through the origin point of Clip1
    print "We integrate from %1.1f to %1.1f" % (x,x+1)
        
    Clip1.ClipType.Origin = [x,0.0,0.0] #moves the first clip
    Clip1.ClipType.Normal = [1.0,0.0,0.0]
      
    Clip2.ClipType.Origin = [x+1,0.0,0.0] # moves the second clip
    Clip2.ClipType.Normal = [-1.0,0.0,0.0]
                      
    writer.UpdatePipeline() # writes the integrated variable table to the tmp file
    
    # appends the integrated results of this Clip to the final csv file
    ftmp = open('PathToATemporaryFile.csv','rb')
    reader = csv.reader(ftmp, delimiter=',')
    row = reader.next()                                        
    row = reader.next()
    fd.writerow([str(row)]) 
    ftmp.close()           
    
finalFile.close()             
del(writer)                

Render()

Python Programmable Filter

ParaView/Custom Filters

Composite Datasets

apend data set filter

group data set filter

Merging two datasets

我有两个数据集共享同一个网格,都是单元数据。我想把它们放在一个数据集中,这样我就可以从一个原始数据集中提取一组给定条件的单元格,然后对另一个数据集应用过滤器。我尝试过使用GroupDataSet,但它没有正确地绘制其中一个数据集。在选择的颜色中,我可以看到原始数据集名称旁边的“partial”。我们怎样才能做到这一点?

附加属性过滤器Append Attributes filter是否满足您的要求?将两个数据集的字段合并为一个。

append attributes 与append datasets,append geometry,append geometry,append location attributes,append molecule,append reduce?

Combining data into one input file

附加数据集筛选器 append dataset filter方法不适用于我拥有的两个数据集(请参见附件)。这是一张高度图,是这片土地上的一条小路。
我希望能够将这些数据类型放在一个文件中,并在Paraview中可视化,而无需手动输入。

如果你真的想把它们放在一起,一种可能是把它们做成一个非结构化网格unstructured grid,它“由任何可能的单元类型的任意组合组成”。问题是,所有的点或单元都必须定义相同的属性,并且只能为两个数据集中的一个定义高度属性。

您还可以创建“多块”数据集(“multi-block” dataset)。要了解这将如何工作,请将这两个文件加载到ParaView中,应用组数据集过滤器 Group Datasets filter。然后,您可以将数据另存为.vtm(多块XML格式文件),并选择ascii。这两个数据文件在另一个文件夹中仍然是分开的,但您可以将这个.vtm文件加载到ParaView中,并可以根据需要单独提取块。仍然存在仅一个集合包含height属性的问题,但它至少是您的另一个选项。

Joining / Merging different data sources

Paraview newbie here. First time posting.

I have multiple data sets and I think I would like to merge or join them to make the final product easier to work with.

Specifically, I have two CSV files. One pipeline is load -> Delauny 2D. The other CSV pipeline is just load. Then I would like apply “Warp by Scalar” to both, and select a colorbar and have that apply to both.

I’ll be bringing in other data that I would like to Warp by Scalar (the same scalar, so that everything has a better Z scale). But the other data will have its own colorbar, and further processing.

Being a newbie I’m not even sure if “merge” or “join” are the correct keywords to use when searching for what I want to do. I’ve read the manual section on Manipulating the Pipeline.
http://www.paraview.org/Wiki/ParaView/UsersGuide/Manipulating_the_Pipeline
I don’t see an appropriate section to explore based on the ToC in the Paraview manual.

这里是Paraview新手。第一次张贴。

我有多个数据集,我想我希望合并或加入它们,使最终产品更易于使用。

具体来说,我有两个CSV文件。一个管道是load->Delauny 2D。另一个CSV管道只是加载。然后我想将“按标量扭曲”应用于两者,并选择一个颜色条,并将其应用于两者。

我将引入我希望按标量扭曲的其他数据(相同的标量,以便所有数据都具有更好的Z比例)。但其他数据将有自己的颜色栏,并进行进一步处理。

作为一个新手,我甚至不确定“合并”或“加入”是否是搜索我想做的事情时使用的正确关键字。我已经阅读了操作管道的手册部分。
http://www.paraview.org/Wiki/ParaView/UsersGuide/Manipulating_the_Pipeline
我在Paraview手册中没有看到基于ToC的适当章节。

There are 2 options that sound kind of what you’re looking for.
有两种选择,听起来像是你在寻找的。

The first is the Group Datasets filter which combines data sets into a multiblock data set. Just highlight the filters that you want to combine before selecting the Group Datasets filter. The advantage to this is that it is very cheap memory wise due to shallow-copying of data. It also doesn’t have the requirement that they must be the same original data set or even contain the same fields.
第一个是组数据集过滤器,它将数据集组合成多块数据集。在选择组数据集过滤器之前,只需突出显示要组合的过滤器。这样做的好处是,由于数据的浅拷贝,它在内存方面非常便宜。它也没有要求它们必须是相同的原始数据集,甚至包含相同的字段。

The second option is to use the Append Datasets filter which turns all of your grouped data sets into a single unstructured grid and ignores and point or cell data that doesn’t exist in all of the input grids. This has the advantage that it acts as a single “joined” data set but can be costly memory-wise, especially if any of your original grids are a structured grid.
第二个选项是使用附加数据集过滤器,该过滤器将所有分组的数据集转换为单个非结构化网格,并忽略所有输入网格中不存在的点或单元数据。这样做的好处是,它可以作为一个单一的“连接”数据集,但在内存方面可能会非常昂贵,特别是当您的任何原始网格是结构化网格时。

How to merge .vtk files to visualize the result in Paraview

I am using Paraview in order to visualize the result produced by parallel program.

Each processor currently outputs its own .vtk files , which corresponsd to the value of the fields in the domain.
I would like to know if there is a way of merging these .vtk files into one .vtk file so that I can visualize using Paraview.

我使用Paraview来可视化并行程序产生的结果。
每个处理器当前输出自己的.vtk文件,该文件对应于域中字段的值。
我想知道是否有办法将这些.vtk文件合并成一个.vtk文件,这样我就可以使用Paraview可视化。

I’m not an expert at Paraview’s IO system, but I believe that individual .vtk files would have to be opened individually i.e. Paraview cannot stitch the .vtk files together. If you want to be able to open a single file and have the data for each processor’s output file be shown in one coherent data set, then I think you should look into the parallel xml file format that Paraview uses.

我不是Paraview IO系统的专家,但我相信单个.vtk文件必须单独打开,即Paraview无法将.vtk文件缝合在一起。如果您希望能够打开单个文件,并将每个处理器输出文件的数据显示在一个一致的数据集中,那么我认为您应该研究Paraview使用的并行xml文件格式。

A PDF of VTK file formats (XML format is on page 11 of the document)

there is probably a better way to do this, but this is what I would do.

  • 1.) Write a paraview python script to first convert all of the .vtk files to the newer xml format. See:
    You will have to use the correct writer to write the proper XML file format for your data set type – See page 12 of that file-formats pdf that I posted above to see what types exist for the datasets

也许有更好的方法,但我会这么做。

  • 1.)编写paraview python脚本,首先将所有.vtk文件转换为较新的xml格式。见: http://stackoverflow.com/questions/26158599/how-to-convert-vtk-legacy-files-to-vtu-format。 您必须使用正确的编写器为您的数据集类型编写正确的XML文件格式–请参阅我在上面发布的文件格式pdf的第12页,以查看数据集的类型

  • 2.) Let’s assume your data is unstructured. You will now have data for each sub-domain written to a bunch of .vtu files. One .vtu file per processor, just like the .vtk files. You can stitch all of these files together by using the parallel file format that VTK supports ( see page 16 of that pdf ). You just need to write out a .pvtu file that essentially just has a list containing the name of every .vtu file.

  • 2.)假设您的数据是非结构化的。现在,您将把每个子域的数据写入一组.vtu文件。每一个.vtu文件对应一个处理器,就像.vtk文件一样。您可以使用VTK支持的并行文件格式将所有这些文件缝合在一起(参见该pdf的第16页)。您只需要写出一个.pvtu文件,该文件实际上只有一个包含每个.vtu文件名的列表。

Furthermore, if you end up opening them all individually in paraview, you can select all of the input files in Pipeline Browser and then run the Group Datasets filter on them. This is a poor man’s solution I think, but in a pinch it works well.

此外,如果最终在paraview中单独打开所有输入文件,则可以在管道浏览器中选择所有输入文件,然后对其运行组数据集过滤器。我认为这是一个穷人的解决方案,但在紧要关头它很有效。

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容