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 Tree6Likes
  • 6 Post By Artur

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2014, 08: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: 19
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, 04:48
Default
  #2
Senior Member
 
Artur's Avatar
 
Artur
Join Date: May 2013
Location: Southampton, UK
Posts: 372
Rep Power: 19
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, saloo, lzhou and 3 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 05:37
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 02:01
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 02:34
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


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