Google
Grid Generation: Mesh Generation using Matlab

Friday, October 27, 2006

Mesh Generation using Matlab

These days most of the research in the field of fluids, structures, porous media, brain computer interfacing you name it, uses numerical simulations. Reason: It is much cheaper and many times faster compared to experiments. Mesh Generation forms an integral part of numerical analysis/simulation. Although, there are plenty of commercial softwares based on Finite Element Methods and Finite Volume Methods like COMSOL, FLEUNT, ANSYS, NUMECA and many more with exceptional Mesh/Grid Generation features. But many times its difficult to use the meshes generated by these softwares which suits to your particluar simulation need. Reason: Many of the exsiting software don't have this feature where you can create a mesh and use it some which have such feathures requires you to do some complicated modifications in your code to import these meshes. There are although loads of mesh generator available some of which open source and free to download. But, then again problem comes does these free source code suits your purpose. I encountred this problem over the last couple of months. I am doing research in the field of Petroleum Reservoir Simulation and I need to test a lot of numerical examples on different sorts of meshes/grids in 2 and 3D. I do most of my simulation work in MATLAB, some people might argue that MATLAB is slow and all sorts of reason about other programming languages are faster like C++ and Fortran. I dont deny that fact but on the other hand the library of exsiting function which matlab has is amazing and its Array handling feature and sprase code it amazing too. The only and important reason I use MATLAB is its capability to handle array operations. In my simulation code I have to solve at times 9 simulatneous equations in 2D and 27 equations in 3D, which maximizes use of array operations. I also frequently use MAPLE to do my algebra and other good thing about MATLAB is that I can directly import the MAPLE algebra in Array Format into MATLAB which suits my purpose.

Now comming to the meshes in MATLAB, try doing a google on 'meshes in MATLAB' or 'grid generation in 2 and 3D in MATLAB', a invested a lot of time to find some unseful source code in matlab searching on google groups etc the only useful package I found was by Per-Olof Persson titled 'DistMesh - A Simple Mesh Generator in MATLAB'. No doubt its an amazing piece of work but again it didnt realy suits my purpose. The reason being I needed unstructured meshes of different element types in 3D like prisms, hex, tetra and pyramids. In 2D also I needed meshes which are boundary aligned to control volume and are matching to the underlying medium. So, What next ? I started from scratch and now I have come up with stand alone code in MATLAB which has functionality to create different kind of meshes in 2D and 3D. These are structured and Unstructured meshes, perturbed and bondary aligned too. If any one is in need of such meshes in 2 and 3D please have a look at www.mayurpal.com. Then you can drop me an email and I will get back to you and will help you and if required will also provide you with the source code if it suits your purpose.

10 comments:

Digvijay Chauhan said...

Hey,

What book do you recommend for Matlab .... and which version would you recommend for academic use?

Thanks in advance,

Mayur said...

Nice article...do u know about mesh generation in Matlab..

darren said...

Have you seen this MATLAB mesh generator:

http://www.mathworks.com/matlabcentral
/fileexchange/loadFile.do?objectId=
10307&objectType=FILE

Admin said...

Hiiii

I am doing the same work......

adaptive meshing using matlab.....

will u provide me some codes....

my id:mechmaster4u@gmail.com

Sarath said...

Great posts. As you said, most mesh generation softwares/packages were not for matlab. I searched cfd online etc, but wasnt successful. Thanks a lot, it was really helpful.

carpedium said...

hello i am working on aproject that requires me use matlab for mesh generation of deformation zone during a rolling process
i want that in your program
how do i define the elment matrix?

Harpreet said...

want to generate mesh for transmitting rays from 0-360 degree and want to represent in matrix form.
how we can represent grid in matrix form

Unknown said...

Heey..
i'm working on a downhole simulator project for logging tools and i want to generate mesh for the irregular wellbore profile i've so as to perform some simulations on it...any advices & wether your code could help or not ??


thanks,
omar

Unknown said...

How can I see the code ? Please

Success James said...

I am so Happy to be writing this article in here, i am here to explore blogs forum about the wonderful and most safe cure for HERPES SIMPLEX VIRUS.I was positive to the Virus called HERPES and i lost hope completely because i was rejected even by my closet friends. i searched online to know and inquire about cure for HERPES and i saw testimony about DR Ebhota online on how he cured so many persons from Herpes Disease so i decided to contact the great herbalist because i know that nature has the power to heal everything. i contacted him to know how he can help me and he told me never to worry that he will help me with the natural herbs from God! after 2 days of contacting him, he told me that the cure has been ready and he sent it to me via FEDEX or DHL and it got to me after 4 days! i used the medicine as he instructed me (MORNING and EVENING) and i was cured! its really like a dream but i'm so happy! that's the reason i decided to also add more comment of Him so that more people can be saved just like me! and if you need his help,contact his Email: (drebhotasoltion@gmail.com) You can contact him on WhatsApp +2348089535482 He also have the herb to cure difference cure for any sickness (1) HERPES,
(2) DIABETES,
(3) HIV&AIDS,
(4) URINARY TRACT INFECTION,
(5) HEPATITIS B,
(6) IMPOTENCE,
(7) BARENESS/INFERTILITY
(8) DIARRHEA
(9) ASTHMA..