How to access to field point data
Dear foamers,
I can have access to coordinate of point by: mesh.points(), and field cell data by U.mesh().C()[]. But now my problem is that how to access and change the corresponding field point data if I choose some interested coordinate? Many thanks, Jian |
The values are always stored "in the cells" or at the boundaries, i.e. there is no value assignment for points. These only give the coordinates of the cells.
If you are interested in manipulating the (cell) values at a location x,y,z of interest, you could e.g. have a look at mesh.findCell(), http://www.cfd-online.com/Forums/ope...ordinates.html, which gives you the position in the field (cell index) you want to manipulate. Greetings, Arne |
Quote:
Many thanks. After I have changed the field data of some cells (first layer of inlet as zero), the case can not run in parallel. Do you know how to solve the problem? My best regards, Jian |
You did not give the entire error you get from your run, so I'm not sure what's the problem.
But you have to keep in mind that if running in parallel, every single processor builds up its own mesh, i.e. face and point labels refer to the single processor meshes and are different from the global mesh labels! Arne |
Quote:
Actually, I first select the first layer cell IDs near the inlet and outlet after searching the whole cells. Then I modified the corresponding cell values. It can run directly in one cpu, but can not run in parallel. Do you have any code or documents about parallel running? My best regards, Jian |
Hi Jian,
I am still not sure what the problem is. Did you check whether you modified the right cells, e.g. by having a look at the specific processorX folders in ParaView and giving the cells e.g. large numbers? I am afraid I have no further documents about parallel coding, but my field/cell modifications so far work in parallel with no problem. One hint: if you are just modifying the boundary-next cells, you could use Code:
const label patchi = mesh.boundaryMesh().findPatchID("inlet"); Greetings, Arne |
Quote:
I'm so sorry to trobule you and dig that old topic. I have a problem to access the points coorinadte of the assign face. for example i want to get the nodes coordinate of mesh.BoundaryField()[patchID][I], how i can do that? Thank you. Greeting Fan Fei |
All times are GMT -4. The time now is 06:30. |