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

Neighbouring processor number for a patch

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes
  • 7 Post By Artur

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2014, 09:49
Default Neighbouring processor number for a patch
  #1
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20
Artur will become famous soon enough
Hi Foamers,

I'm trying to find what processor a particular cell neighbours with. I've found that his may be done by looping over all boundaries, finding those of type processorFvPatch and then accessing the faceCells() list. To get the processor index I've found the processorFvPatch::neighbProcNo() method.

I have a problem with getting the number of the domain the patch neighbours with. In the code given below I get an error:

Code:
error: ‘const class Foam::fvPatch’ has no member named ‘neighbProcNo’
Clearly, I'm not accessing the derived processorFvPatch but the base fvPatch type. How can I overcome this? It seems trivial but I've already spent too much time dwelling on this so I thought I'd ask.

Code:
forAll(mesh.boundary(),patchi)
{
    if (isType<processorFvPatch>(mesh.boundary()[patchi]))
    {
        Pout << mesh.boundary()[patchi].name() << " " << mesh.boundary()[patchi].neighbProcNo() << endl;
    }
}
Many thanks,

A
Artur is offline   Reply With Quote

Old   May 29, 2014, 05:48
Default
  #2
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 20
Artur will become famous soon enough
For those interested, here's the solution:

Code:
const processorPolyPatch& pp = refCast<const processorPolyPatch>( mesh.boundaryMesh()[patchi] );
Pout << mesh.boundary()[patchi].name() << " "  << pp.neighbProcNo() << endl;
JackW, acgnipper, saloo and 4 others like this.
Artur 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
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 114 August 23, 2023 06:37
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 03:01
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 06:56.