|
[Sponsors] |
March 5, 2013, 06:47 |
Loop over Points of a boundary / patch
|
#1 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Dear all,
I am looking for a code able to loop over the points of a patch. From my research it seems that there is no member to find the points of a face. How can we get from a known face the corresponding nodes ? My idea is to get an algorithm like this - get patch id - loop over face of the patch - loop over the points of the faces -> do a point treatment (an arbitraty movement in my case) Thx in advance |
|
March 5, 2013, 08:49 |
meshPoints() function
|
#2 |
Senior Member
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 19 |
You can use the meshPoints() function.
The following thread will be of help: http://www.cfd-online.com/Forums/ope...ary-patch.html Fumiya |
|
March 7, 2013, 04:19 |
|
#3 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 17 |
Your link is quite useful ! It's not perfect but still really good. I guess there is no elegant way to do what I want.
Thx. |
|
May 25, 2015, 05:34 |
|
#4 | |
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
Quote:
Have you solve this question now. I have the same problem to access the nodes of face. could you give me a hints. Thanks. Best regards Fan Fei |
||
July 8, 2015, 11:52 |
|
#5 | |
Member
Bruno Blais
Join Date: Sep 2013
Location: Canada
Posts: 64
Rep Power: 13 |
Quote:
Here is an example (somebody might correct me, this is not perfect) on how to loop over a boundary patch of which the name is "left". Then you get the position at the center of the face and you apply a function, let's say a cosine in this case. Code:
label inletPatchID = mesh.boundaryMesh().findPatchID("left"); //Patch identifier of the boundary condition fvPatchScalarField& wallP = p.boundaryField()[inletPatchID]; // Obtain a patchScalar field on the BC forAll(wallP, faceI) // Loop over each face of the patch { vector pos(mesh.Cf().boundaryField()[inletPatchID][faceI]); x = pos[0]; y = pos[1]; wallP[faceI]=Foam::cos(PI*x)*Foam::cos(PI*y);; } |
||
July 8, 2015, 11:57 |
|
#6 | |
Member
Fei Fan
Join Date: Jul 2013
Location: NanJing, China
Posts: 54
Rep Power: 13 |
Quote:
Thanks for you reply me. this problem i have solved. I use lablist to access to the face vertices series number and use mesh.points() to get the coordinate of points. Best regards Fan Fei |
||
|
|
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 08:34 |
[Commercial meshers] Using starToFoam | clo | OpenFOAM Meshing & Mesh Conversion | 33 | September 26, 2012 05:04 |
[blockMesh] Cyclic BC's: Possible face ordering problem? (Channel flow) | sega | OpenFOAM Meshing & Mesh Conversion | 3 | September 28, 2010 13:46 |
[Other] StarToFoam error | Kart | OpenFOAM Meshing & Mesh Conversion | 1 | February 4, 2010 05:38 |
CheckMeshbs errors | ivanyao | OpenFOAM Running, Solving & CFD | 2 | March 11, 2009 03:34 |