CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   How to extract face label point label relations (https://www.cfd-online.com/Forums/openfoam-programming-development/93856-how-extract-face-label-point-label-relations.html)

clean-energy October 28, 2011 05:09

How to extract face label point label relations
 
Hello,

I would like to get a connectivity list between face labels and cell vertices (global) this should work also for parallel runs.

Could someone please point me to some methods from which I can get the information from.


ThX!

clean-energy October 28, 2011 16:37

Some more details:

In the OF Users Guide it says:

5.1.1.1 Points

A point is a location in 3-D space, defined by a vector in units of metres (). The points are compiled into a list and each point is referred to by a label, which represents its position in the list, starting from zero. The point list cannot contain two different points at an exactly identical position nor any point that is not part at least one face.


My question is if anyone could please tell me, with routine allows it to query for these point label (global) in a boundary patch.


I figured out that the following code gives the point coords:

pointField patchPoints = mesh.boundaryMesh()[coupledPatchIDs[patchI]].localPoints();

patchPoints[0].x()


Could anyone maybe help me to get the point labels in a similar way?

cliffoi October 28, 2011 19:15

Forgetting about parallel runs for now, you can use mesh.pointFaces() to give you the list of faces sharing each point.
For parallel runs this is more difficult since OpenFOAM does not keep a list of all faces on each processor and doesn't use ghost cells either, i.e. the face information on neighbouring processors is not readily available.
A quick look at the doxygen brings up two possible classes which could help you with the parallel issue; mapDistributePolyMesh and globalMeshData. I couldn't tell you how to achieve this though.

clean-energy November 2, 2011 11:11

Thank you very much Ivor for your hints!

This code now returns the local labels of the points:

labelList meshPoints = mesh.boundaryMesh()[coupledPatchIDs[patchI]-coupledPatchIDs[patchI]].meshPoints();

List<labelList> allmeshPoints(Pstream::nProcs());

allmeshPoints[Pstream::myProcNo()] = meshPoints;
Pstream::gatherList( allmeshPoints);
if (Pstream::master())
{
meshPoints =
ListListOps::combine<labelList >
(
allmeshPoints,
accessOp<labelList >()
);
}

The problem is now that I get the nodes at the processor boundaries twice. Does anybody know how to avoid that?

Thank you very much!

Stefan


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