|
[Sponsors] |
July 14, 2015, 13:09 |
Mesh Coordinates?
|
#1 |
New Member
Joshua Hinton
Join Date: May 2015
Location: Boca Raton, FL
Posts: 7
Rep Power: 11 |
Is there any way to extract the coordinates of surface cells? As in the 8 corners of each individual cell on the surface of an object once it is meshed. It's not imperative, but I have been tasked with trying. Thanks for any info!
|
|
July 16, 2015, 09:12 |
|
#2 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 17 |
Hi,
Try this: Code:
forAll(mesh.C(),i) { const unallocLabelList& ne = mesh.cellPoints()[i]; forAll(ne, neI) { const unallocLabelList& ne_adj = mesh.pointCells()[ne[neI]]; forAll(ne_adj, ne_adjI) { vector Coord = mesh.C()[ne_adj[ne_adjI]]; // then Do what you want with the vector Coord } } } T.D. |
|
July 18, 2015, 19:24 |
|
#3 |
New Member
Joshua Hinton
Join Date: May 2015
Location: Boca Raton, FL
Posts: 7
Rep Power: 11 |
Thanks for the info!
I saved the code in its own file name "coor" I tried it and I'm getting a syntax error that reads: ./coor: line 1: syntax error near unexpected token `mesh.C' ./coor: line 1: `forAll(mesh.C(),i)' I tried removing some parenthesis but then it didn't like the "i" argument. Any ideas? Thanks again! - Josh |
|
July 24, 2015, 05:08 |
|
#4 | |
New Member
Jukka-Pekka Keskinen
Join Date: Dec 2009
Location: Helsinki
Posts: 3
Rep Power: 16 |
Quote:
J-P |
||
July 25, 2015, 10:42 |
|
#5 |
New Member
Joshua Hinton
Join Date: May 2015
Location: Boca Raton, FL
Posts: 7
Rep Power: 11 |
That probably explains it. I'll spend some time looking into that. Thanks!
- Josh |
|
December 19, 2016, 10:36 |
Where to put the code in?
|
#6 | |
New Member
HuangXin
Join Date: Dec 2016
Posts: 7
Rep Power: 9 |
Quote:
I used snappyMesh and chtMultiRegionSimpleFoam ,where should I put your code into? I want to get the cooridates of all the cells ,8 points for each cells, instead of only the cell centre points. Thank you! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
y+ = 1 boundary layer mesh with snappyHexMesh | Arzed23 | OpenFOAM Running, Solving & CFD | 6 | November 23, 2022 16:15 |
[ICEM] Problem making structural mesh on a surface | froztbear | ANSYS Meshing & Geometry | 1 | November 10, 2011 09:52 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |
Icemcfd 11: Loss of mesh from surface mesh option? | Joe | CFX | 2 | March 26, 2007 19:10 |