|
[Sponsors] |
January 19, 2016, 10:40 |
Access (x y z) coordinates of cellSet
|
#1 |
Senior Member
Join Date: Jan 2014
Posts: 179
Rep Power: 12 |
Hi guys,
I try to access the coordinates of a cellSet. Code:
const labelList& sensorCell = sensorCells.toc(); // Access celSet HashList via TOC forAll(sensorCell,i) { const volVectorField& C_sensor = mesh[sensorCell[i]].C(); - //volScalarField Cx_sensor = C_sensor.component(0); } Is there any other function I am missing? Thanks in advance |
|
January 21, 2016, 06:40 |
|
#2 |
Senior Member
Join Date: Jan 2014
Posts: 179
Rep Power: 12 |
For those who are interested, I solved it that way:
Code:
const volVectorField& C = mesh.C(); // Get Mesh Coordinates of all Cells as Vector vector C_sensor=C[sensorCell[i]]; // Loop only over cellSet scalar Cx_sensor=C_sensor.component(0); //Coordinate Components x,y,z of sensorCellSet scalar Cy_sensor=C_sensor.component(1); scalar Cz_sensor=C_sensor.component(2); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can we have access to cells coordinates? | adrianahscott | OpenFOAM Running, Solving & CFD | 20 | January 23, 2018 15:39 |
Access to cellid in cellSet | Tobi | OpenFOAM Programming & Development | 5 | April 16, 2017 22:05 |
access to velocity component in cylindrical coordinates | swati_mohanty | FLUENT | 0 | August 18, 2010 11:16 |
Center coordinates of all the cells in a cellset | lizhihua | Siemens | 0 | August 21, 2006 04:59 |
Access cell coordinates and wall data in posdat.f | Boban | Siemens | 5 | July 22, 2005 05:25 |