CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Patch mesh export

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2006, 11:40
Default Hi everybody, I hope that s
  #1
Member
 
Rosario Russo
Join Date: Mar 2009
Location: Trieste, Italy
Posts: 56
Rep Power: 17
ariorus is on a distinguished road
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

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

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

markus
hartinger is offline   Reply With Quote

Old   March 6, 2006, 12:52
Default Get the patch from polyMesh:
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,906
Rep Power: 33
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

OpenFOAM-1.2/src/OpenFOAM/meshes/PrimitivePatch/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.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   March 7, 2006, 05:41
Default Thank you Hrvoje. Your sugg
  #4
Member
 
Rosario Russo
Join Date: Mar 2009
Location: Trieste, Italy
Posts: 56
Rep Power: 17
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

Reply


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 Off
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 04:27
Moving interface patch using mesh subsets lr103476 OpenFOAM Running, Solving & CFD 0 January 10, 2008 16:14
My patch causes a discontinuity in the mesh Aline Siemens 5 July 7, 2004 07:45


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