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

Can we have access to cells coordinates?

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2018, 15:39
Default
  #21
Senior Member
 
Join Date: Oct 2017
Location: United States
Posts: 233
Blog Entries: 1
Rep Power: 10
TurbJet is on a distinguished road
Quote:
Originally Posted by villet View Post
This may look a bit tricky, but you can get the y-coordinate (scalarField) at cell center like this:

mesh.C().component(vector::Y)

or

mesh.C().component(1)

so use it in the place of "y" in your equation. Basically "mesh.C()" is a vector field of cell center coordinates. I'm sure after this it's easier to look for more examples.

Ville
what if I want to use command mesh.C() in other source files? I tried it but the compiler keeps telling me that I have to declare mesh first. So how am I gonna access mesh in other source file and declare it?
TurbJet 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
how to get node coordinates for free surface cells fred FLUENT 1 August 15, 2014 02:52
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
Access to the derivatives of quantities at cells Parsa Zamankhan FLUENT 0 September 18, 2007 20:30
Center coordinates of all the cells in a cellset lizhihua Siemens 0 August 21, 2006 04:59
physical boundary error!! kris Siemens 2 August 3, 2005 01:32


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