|
[Sponsors] |
What does [0][0] in U.boundaryField()[0][0] mean? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 15, 2014, 05:05 |
What does [0][0] in U.boundaryField()[0][0] mean?
|
#1 |
New Member
Olivia Nalen
Join Date: Apr 2014
Location: Vancouver
Posts: 19
Rep Power: 12 |
Hello again,
I have a question to notation "U.boundaryField()[0][0]" What does [0][0] mean? So far I understand, this should be a single point on the mesh, but is there an option to find out, where exactly this point is? |
|
May 15, 2014, 06:11 |
|
#2 |
Senior Member
|
Hi,
U.boundaryField() is a list of fvPatchFields, so Code:
Info << U.boundaryField()[0].typeName << endl; Code:
fvPatchField and finally U.boundaryMesh()[0][0] is a value of U in face 0 of the patch with ID == 0. You can try to learn the location of the face using: Code:
const polyPatch& ptch = mesh.boundaryMesh()[0]; Info << ptch.faceCentres()[0] << endl; |
|
May 15, 2014, 09:31 |
|
#3 |
New Member
Olivia Nalen
Join Date: Apr 2014
Location: Vancouver
Posts: 19
Rep Power: 12 |
Hello Alexey,
thanks a lot! But what do you mean by "0 is the ID of the patch of your mesh"? Can I somehow find out, what ID belongs to what patch? Kind regards, Olivia |
|
May 15, 2014, 09:40 |
|
#4 |
Senior Member
|
Hi,
as you've used 0 in the code snippet, I've referenced to this 0 There are two methods of boundaryMesh: 1. patchNames - list of patch names, so you can get a name of patch with ID == 0 using something like mesh.boundaryMesh().patchNames()[0] 2. findPatchID - to lookup patch ID by its name, i.e. mesh.boundaryMesh().findPatchID("wall") will find ID of the patch with a name wall. |
|
May 15, 2014, 10:58 |
|
#5 |
New Member
Olivia Nalen
Join Date: Apr 2014
Location: Vancouver
Posts: 19
Rep Power: 12 |
Hi
finally I've found it out. This Code:
mesh.boundaryMesh().findPatchID("airfoil") I should type there "airfoil" and not "wall" or "patch". I think it is so because I may have more than one patch and more than one wall actually. Thank you for your help again! |
|
May 15, 2014, 11:13 |
|
#6 |
Senior Member
|
Surely "wall" was just an example of the patch's name. Though my telepathic abilities are improving, I still wasn't able to guess names of the patches in your case
|
|
May 16, 2014, 08:09 |
|
#7 |
New Member
Olivia Nalen
Join Date: Apr 2014
Location: Vancouver
Posts: 19
Rep Power: 12 |
Well, I hope this is my last question to this matter...
There is a difference between Code:
U.boundaryField ()[0][1] Code:
U.boundaryMesh ()[0][1] |
|
May 16, 2014, 08:24 |
|
#8 |
Senior Member
|
Well, it's rather easy to check
First of all, U.boundaryMesh()[0][1] won't compile, as volVectorField doesn't have boundaryMesh() method. So it should be U.mesh().boundaryMesh()[0][1] (if you really need the boundary mesh). Then you can use following snippet to find difference (or read documentation instead): Code:
Info<< U.boundaryField ()[0][1].typeName << endl; Info<< U.boundaryField ()[0][1] << endl; Info<< U.mesh().boundaryMesh ()[0][1].typeName << endl; Info<< U.mesh().boundaryMesh ()[0][1] << endl; Code:
vector (0 0 0) face 4(51 357 408 102) |
|
May 16, 2014, 09:03 |
|
#9 |
New Member
Olivia Nalen
Join Date: Apr 2014
Location: Vancouver
Posts: 19
Rep Power: 12 |
Thank you sooooo much!
|
|
|
|