CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Error in obtaining faceIndex

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2021, 07:09
Default Error in obtaining faceIndex
  #1
Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 6
sunagra27 is on a distinguished road
Dear All,



I am trying to obtain the face IDs of a particular patch in the geometry. I am using Openfoam 5 version.



I wrote this code shown below.



Code:
code
    #{

    const fvPatch& mesh = this->patch();
    //const vectorField& Cf = mesh.Cf();
    
    const fvBoundaryMesh& boundaryMesh = mesh.boundaryMesh();

    forAll(mesh.boundaryMesh()[patch], facei)
      {
            const label& face = boundaryMesh[patch].start() + facei;        // Face index
        }
    #};
When I output Cf, it cleary gives the faceCentre coordinates as expected. Likewise, I try to loop over the boundaryMesh patch to obtain label of a face. But, I am unable to execute this. It throws few errors mentioned below. How to clear these errors.?


Error 1:

Quote:
invalid use of non-static member function ‘const Foam::fvPatch& Foam::fvPatchField<Type>:atch() const [with Type = double]’
/opt/openfoam5/src/OpenFOAM/lnInclude/UList.H:430:30: note: in definition of macro ‘forAll’
for (Foam::label i=0; i<(list).size(); i++)
Error 2:
Quote:
declared here
const fvPatch& patch() const
What wrong am I doing here in the code?


Any leads will with appreciated.


Regards,
Sunag R A.
sunagra27 is offline   Reply With Quote

Reply

Tags
code stream, controldict, openfoam, post process


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
Obtaining a clean post production contour plot Lapis1 ANSYS 2 June 22, 2017 05:46
Problem obtaining normal vectors on blade loading line francois louw CFX 10 April 26, 2016 04:47
Obtaining results from simulation geod FLUENT 3 February 27, 2015 09:44
Failing to obtaining the shadow wall Bright ANSYS 0 September 26, 2013 03:50
Obtaining Nu result from internal fin channel andrew FLUENT 2 March 1, 2007 21:38


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