CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Access (x y z) coordinates of cellSet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 19, 2016, 10:40
Default Access (x y z) coordinates of cellSet
  #1
Senior Member
 
Join Date: Jan 2014
Posts: 179
Rep Power: 12
hxaxtma is on a distinguished road
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);             
}
I knew to access coordinates with mesh.C().component(0), this is here not really working cause of the cellSet saved as Hashlist.

Is there any other function I am missing?

Thanks in advance
hxaxtma is offline   Reply With Quote

Old   January 21, 2016, 06:40
Default
  #2
Senior Member
 
Join Date: Jan 2014
Posts: 179
Rep Power: 12
hxaxtma is on a distinguished road
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);
hxaxtma is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:21.