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

Access (x y z) coordinates of cellSet

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 19, 2016, 10:40
Default Access (x y z) coordinates of cellSet
  #1
Senior Member
 
Join Date: Jan 2014
Posts: 105
Rep Power: 4
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: 105
Rep Power: 4
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access to cellid in cellSet Tobi OpenFOAM Programming & Development 4 September 13, 2016 11:24
Can we have access to cells coordinates? adrianahscott OpenFOAM Running, Solving & CFD 19 February 19, 2013 15:02
access to velocity component in cylindrical coordinates swati_mohanty FLUENT 0 August 18, 2010 10:16
Center coordinates of all the cells in a cellset lizhihua CD-adapco 0 August 21, 2006 03:59
Access cell coordinates and wall data in posdat.f Boban CD-adapco 5 July 22, 2005 04:25


All times are GMT -4. The time now is 15:30.