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

Loop over faces of a cell in paralele

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2020, 09:04
Default Loop over faces of a cell in paralele
  #1
New Member
 
Simon Guillot
Join Date: Mar 2020
Posts: 1
Rep Power: 0
sguillot is on a distinguished road
Dear Foamers


I would like to know how to loop over faces of a cell in paralele.
I currently have the following code :



Code:
    forAll(psi.internalField(), celli)         
    {
        const labelList& faces = mesh.cells()[celli];
        
        forAll(faces, fi)                   // Local numbering
        {
            const label facei = faces[fi];  // Global numbering
            
            if (mesh.isInternalFace(facei))
            {
                dgPsi[celli] = max( mag(  d[facei] & gPsi[celli] ), dgPsi[celli]);
            }
            else
            {

            }
        }
 
    volScalarField::Boundary psiBf = psi.boundaryField();
    
    forAll(psiBf,patchi)
    {
        scalarField& psip = psiBf[patchi];
        fvPatchScalarField& pDX = dXbf[patchi];
        fvPatchScalarField& pEps = epsbf[patchi];
        
        forAll(psip,i)
        {
            pDX[i] = Foam::pow(V[patchi], 1.0/3.0);
            pEps[i] = (3.0/2.0) * pDX[i];            
        }    
    }

I don't have the same results for serial and paralele when I want to plot dX for example. I think I have to do something in the "else{ }" (test if patch.coupled() for example) but everything I use is quite bad.



Thank you for your help !
sguillot 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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 07:34
[snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 08:26
[snappyHexMesh] layer not added Rasmusiwersen OpenFOAM Meshing & Mesh Conversion 1 January 2, 2020 09:43
Need help setting up chtMultiRegion OskarT OpenFOAM Pre-Processing 1 September 25, 2019 15:51
decomposePar -allRegions stru OpenFOAM Pre-Processing 2 August 25, 2015 03:58


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