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:

SmartCard Blogger 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

mechmaster4u said...

Hiiii

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

adaptive meshing using matlab.....

will u provide me some codes....

my id:mechmaster4u@gmail.com

Sarath Ramadurgam 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?

ghkj said...

welcome to the wow power leveling cheap Wow gold service site, buy cheap wow gold,wow gold,world of warcraft power leveling buy wow gold

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

Omar zaher 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

jas caselton said...

How can I see the code ? Please