|
[Sponsors] |
February 11, 2016, 11:03 |
Access processor patches in parallel run
|
#1 |
New Member
Join Date: Jan 2016
Posts: 19
Rep Power: 10 |
Hello together,
I am currently working with the wallDist functionality to compute the distance of each cell to its nearest wall. After that I want to cut the data regarding some criterions. Everything works fine, when I calculate on one processor. However, when performing a parallel run, I need to access the patches that connect the seperated meshes of each processor. That's where I need help. Here is some of the code, that needs fixing: Code:
cellDist = wallDist(mesh).y(); const fvPatchList& patches = mesh.boundary(); forAll (patches, iPatch) { const fvPatch& singlePatch = patches[iPatch]; forAll (singlePatch, iFace) { label iFaceCell = singlePatch.faceCell()[iFace]; cellDist[iFaceCell] = 0.0; } } I'm thankful for any advice. Michael |
|
February 12, 2016, 04:54 |
|
#2 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 |
You can combine lists from separate processors using the following function. This can be used for face positions, areas, field values etc..
Code:
template<class Type> void combineFields(Field<Type>& field) { List<Field<Type> > allValues(Pstream::nProcs()); allValues[Pstream::myProcNo()] = field; Pstream::gatherList(allValues); Pstream::scatterList(allValues); field = ListListOps::combine<Field<Type> > ( allValues, accessOp<Field<Type> >() ); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error running simpleFoam in parallel | Yuby | OpenFOAM Running, Solving & CFD | 14 | October 7, 2021 05:38 |
Some questions about a multi region case run in parallel | zfaraday | OpenFOAM Running, Solving & CFD | 5 | February 23, 2017 11:25 |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 13:40 |
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel | JR22 | OpenFOAM Running, Solving & CFD | 2 | April 19, 2013 17:49 |
Unable to run OF in parallel on a multiple-node cluster | quartzian | OpenFOAM | 3 | November 24, 2009 14:37 |