I am running a Navier-stokes 2d problem with PETSc. Now I need to export velocity [ux, uy] in .txt format. I have followed the video ([Paraview Tutorial 4] How to display node and elements data in Paraview - YouTube) to convert the information from local partitions to global mesh and save it in .txt format (using ofstream). However, the number of values I get is more than 140000 which is way higher than the number of triangles (30920) and the number of vertices (15761). I want to ask the following questions:
How does the field data (like velocity) saved in FreeFem? Is it saved as a value per cell or per vertex? I am confused by the large number of values saved by the ofstream function. It is not supposed to be that much.
If the field data is associated to the node or elements, how do I output the data with the sequence of cell numbering or node number?
My ultimate goal is to output the data from one 240 * 60 rectangular mesh domain to a smaller irregular mesh domain. This small domain is actually a part of the larger domain but the meshes are different (as shown below). I am thinking to do like this: output value+output corresponding coordinates and then do interpolation to the new mesh. it is a bit cumbersome. Is there any clever way to do it in freefem?
Why are you not interpolating the velocity field directly in FreeFEM? Why are you not using the .vtu format if you want to postprocess results in ParaView?
Hi, I actually want to interpolate this field directly in FreeFEM. This is not a post-process for me. These are two meshes for two simulations, and I want to run these two simulations in terms while passing the velocity in between them. I have checked the interpolation matrix before, but since one of my meshes is irregular, I don’t know how to use it on my meshes.
Thank you for the information. The interpolation function works. I have another question regarding the read and write the solutions. Is there any way to save both the solution and mesh and then read them in another .edp file?
However, when I run it with nu = 0.00002, and some coefficients kcoe < 1e-5, it will show an error like
nan != nan diff nan => Sorry error in Optimization add: (p) int2d(Th,optimize=0)(...)
remark if you add (.. , optimize=2) then you remove this check (be carefull);
current line = 239 mpirank 1 / 4
but when nu = 0.0002, it can run successfully. And if I add optimize=0 to the integrals, it can run but I get null values. So is the problem is one of the coefficients in the Navier Stokes equation is too small? Is there any other way that I can fix this problem?