|
[Sponsors] | |||||
|
|
|
#1 |
|
New Member
Join Date: Apr 2010
Location: Linz, Austria
Posts: 15
Rep Power: 5 ![]() |
Hi folks,
I want to access the faces of a certain patch in a certain region. I do some first tests with the code from the Thread area of a patch Code:
// Find the patchID of the patch by name
label patchID = mesh.boundaryMesh().findPatchID("movingWall");
// Create a polyPatch for looping
const polyPatch& myPatch = mesh.boundaryMesh()[patchID];
// Initialize patchArea
scalar patchArea = 0.0;
// Loop trhough all faces on the polyPatch, adding their magnitude surface
// area vectors
forAll(myPatch, faceI)
{
patchArea += mesh.magSf().boundaryField()[patchID][faceI];
}
How do I have to modify the mentioned code? Thanks for your support Michael |
|
|
|
|
|
|
|
|
#2 |
|
New Member
Join Date: Apr 2010
Location: Linz, Austria
Posts: 15
Rep Power: 5 ![]() |
I figured out how to access the mesh of a region. Maybe the following information will help other foamers:
You just have to add these lines to the main program: Code:
timeSelector::addOptions(); # include "addRegionOption.H" Code:
# include "createMesh.H" Code:
# include "createNamedMesh.H" |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| No layers in a small gap | bobburnquist | OpenFOAM Native Meshers: snappyHexMesh and Others | 2 | November 25, 2012 08:54 |
| Basic hints for runing a multiregion case | RuiVO | OpenFOAM Pre-Processing | 1 | February 2, 2012 09:44 |
| udf to access variables from a different case | yashmash | Fluent UDF and Scheme Programming | 6 | January 25, 2012 09:10 |
| multi region case - access field from another region | mabinty | OpenFOAM Programming & Development | 3 | September 6, 2011 10:25 |
| Problem with decomposePar tool | vinz | OpenFOAM Pre-Processing | 18 | January 26, 2011 02:17 |