CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Patch mesh export

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   March 6, 2006, 12:40
Default Hi everybody, I hope that s
Rosario Russo
Join Date: Mar 2009
Location: Trieste, Italy
Posts: 56
Rep Power: 10
ariorus is on a distinguished road
Sponsored Links
Hi everybody,

I hope that somebody could help to cope with
this problem...

I need to export a patch mesh from a OpenFoam
case. I'd like to have the mesh points of the patch, the surface area of the patch faces and
the connectivity.

I'm writing some code which performs the task and it would be nice to expolit
the tools in the OpenFoam library.

So far I tried to use fvMesh. I can get
the faces centre of the mesh patch
and the faces area vectors but I am not able
to get the patch points positions;

Then I tried to use polyMesh and pointMesh classes, in this way I can get the points
of the patch mesh but not the connectivity
of them i.e. the patch faces;

Finally I tried using faMesh class but I'm not able to select only the patch mesh I'm interested in.

BTW I saw also a class called boundaryMesh
which maybe fits my needs but I don't know
how to construct an object...

Thank you for any hint.
ariorus is offline   Reply With Quote
Sponsored Links

Old   March 6, 2006, 13:47
Default Hi, if you read in a mesh w
Senior Member
Markus Hartinger
Join Date: Mar 2009
Posts: 102
Rep Power: 10
hartinger is on a distinguished road

if you read in a mesh with

# include "createMesh.H"

it will give you a fvMesh, which is derived from
polyMesh and surfaceInterpolation. You can access all public member functions from which fvMesh is derived. Have a look at the Programmers C++ doxygen.
So, fvMesh contains all mesh information

hartinger is offline   Reply With Quote

Old   March 6, 2006, 13:52
Default Get the patch from polyMesh:
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,802
Rep Power: 24
hjasak will become famous soon enough
Get the patch from polyMesh:

const polyPatch& p mesh.boundaryMesh()[patchI];

You can now get the local points, faces etc directly - have a look at the PrimitivePatch.H


So, for local points use:

//- Return pointField of points in patch
const pointField& localPoints() const;

For faces in terms of local points use:

//- Return patch faces addressing into local point list
const List<face>& localFaces() const;

and you've got all the associated connectivity and addressing there as well.


Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting:
hjasak is offline   Reply With Quote

Old   March 7, 2006, 06:41
Default Thank you Hrvoje. Your sugg
Rosario Russo
Join Date: Mar 2009
Location: Trieste, Italy
Posts: 56
Rep Power: 10
ariorus is on a distinguished road
Thank you Hrvoje.

Your suggestion was very precious to me. I would never have found out that way by myself.

In the Doxygen documentation I didn't find any link between polyMesh and polyPatch and it seemed to me the function boundaryMesh in polyMesh could only construct object of polyBoundaryMesh class.

The only drawback is that deeper I look, and deeper I have to look... :-)

Thanks again.
ariorus is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP NEEDED HOW TO MAP VALUES FROM PATCH OF ONE MESH TO PATCH OF ANOTHER MESH mkraposhin OpenFOAM Running, Solving & CFD 3 September 4, 2011 09:42
SampleDict patch export surface size amp orientation axel OpenFOAM Post-Processing 1 September 29, 2008 13:42
Export patch profile johndeas OpenFOAM Running, Solving & CFD 5 January 25, 2008 05:27
Moving interface patch using mesh subsets lr103476 OpenFOAM Running, Solving & CFD 0 January 10, 2008 17:14
My patch causes a discontinuity in the mesh Aline Siemens 5 July 7, 2004 07:45

Sponsored Links

All times are GMT -4. The time now is 06:47.