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

Accessing X and Y coordinates of Face centre

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By fumiya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2015, 16:00
Unhappy Accessing X and Y coordinates of Face centre
  #1
New Member
 
rafath
Join Date: Jun 2014
Location: mumbai
Posts: 24
Rep Power: 11
R_21 is on a distinguished road
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
R_21 is offline   Reply With Quote

Old   May 9, 2015, 02:26
Default
  #2
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
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
}
I hope this will be of help
Fumiya
Luttappy and micheall like this.
__________________
[Personal]

Last edited by fumiya; May 9, 2015 at 06:26.
fumiya is offline   Reply With Quote

Old   May 9, 2015, 05:15
Default
  #3
New Member
 
rafath
Join Date: Jun 2014
Location: mumbai
Posts: 24
Rep Power: 11
R_21 is on a distinguished road
Thanks a lot Fumiya,
That really helped my case.
R_21 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
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15


All times are GMT -4. The time now is 12:43.