|
[Sponsors] |
August 9, 2012, 11:40 |
How to access to field point data
|
#1 |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
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 |
|
August 10, 2012, 15:25 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
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 |
|
August 11, 2012, 07:35 |
|
#3 | |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
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 |
||
August 11, 2012, 08:11 |
|
#4 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
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 |
|
August 11, 2012, 17:47 |
|
#5 | |
Senior Member
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14 |
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 |
||
August 14, 2012, 04:32 |
|
#6 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
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"); U.boundaryField()[patchi] == whatever you want Greetings, Arne |
|
May 21, 2015, 06:35 |
|
#7 | |
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
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 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem in toposet | Ahmed Khattab | OpenFOAM Pre-Processing | 27 | March 3, 2023 22:12 |
[ANSYS Meshing] Importing Cylinders by Point Data Input with Radii | EphemeralMemory | ANSYS Meshing & Geometry | 2 | May 31, 2012 14:34 |
matching variable data with grid point data | anfho | OpenFOAM Programming & Development | 0 | May 6, 2011 16:28 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
How to access acceleration of steady Euler field? | winnie | FLUENT | 0 | May 2, 2003 23:53 |