|
[Sponsors] |
May 8, 2015, 17:00 |
Accessing X and Y coordinates of Face centre
|
#1 |
New Member
rafath
Join Date: Jun 2014
Location: mumbai
Posts: 24
Rep Power: 12 |
Hi Foamers,
I have been trying to access the x- and y- co-ordinate of a mesh cell face closest to a particular set of points. I have written the following set of code referring to various posts on this Forum. " label actMeshID = mesh.findCell(point(4.0,0.75,1.0)); const vectorField& ActPoint = mesh.Cf().boundaryField()[actMeshID]; const scalarField xa = ActPoint.component(vector::X); const scalarField ya = ActPoint.component(vector::Y); " I am getting this sort of error while running: "--> FOAM FATAL ERROR: hanging pointer at index 669 (size 6), cannot dereference From function PtrList:perator[] const in file /home/rafath/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/PtrListI.H at line 134. " Can Someone please help Please!!! Thanks in advance |
|
May 9, 2015, 03:26 |
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
This code is an example:
Code:
vector probePoint(4.0,0.75,1.0); label probeCell = mesh.findCell(probePoint); const labelList& f = mesh.cells()[probeCell]; // face label list of probeCell forAll(f, facei) { label nFace = f[facei]; Info<< mesh.Cf()[nFace] << endl; // mesh.Cf()[nFace][0]: x // mesh.Cf()[nFace][1]: y } Fumiya
__________________
[Personal]
Last edited by fumiya; May 9, 2015 at 07:26. |
|
May 9, 2015, 06:15 |
|
#3 |
New Member
rafath
Join Date: Jun 2014
Location: mumbai
Posts: 24
Rep Power: 12 |
Thanks a lot Fumiya,
That really helped my case. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |