Code covered by the BSD License  

Highlights from
Freefem to matlab

Be the first to rate this file! 29 Downloads (last 30 days) File Size: 23.8 KB File ID: #26833
image thumbnail

Freefem to matlab

by

 

A tool to import Freefem meshes into matlab.

| Watch this File

File Information
Description

The function [p e t]=importfilemesh(<name>) reads <name> and creates the corresponding matlab-pde formatted mesh (p, e, t) that can be handeled with the matlab pde toolbox.
The function u=importfiledata(<name>) reads <name> and creates the corresponding matlab node data (u) that can be handeled with the matlab pde toolbox.

The file "freefem_example.edp" generates two files :
- A freefem-formatted mesh : "Gilgamesh.mesh"
- A node data file : "Heat.bb"
The example file shows how to read the mesh and node data generated by "freefem_example.edp", and how to plot them.

Enjoy !

Required Products Partial Differential Equation Toolbox
MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
09 Nov 2012 Márleson

After to save the freefem mesh I saved the vectorial solution:

{
ofstream file("velocity.bb");
file << "2 1 1 "<< u1[].n << " 2 \n";
for (int j=0;j<u1[].n ; j++)
file << u1[][j] <<" "<< u2[][j] << endl;
}

Now I need to plot velocity vectors as arrows with components (u,v) at the points (x,y).

could you give a example how to do that? Do you have any m-file? Thanks!

Contact us