mmg3d
inout_3d.c File Reference

Input / Output Functions. More...

#include "mmg3d.h"
Include dependency graph for inout_3d.c:

Functions

int MMG3D_openMesh (int imprim, const char *filename, FILE **inm, int *bin, char *modeASCII, char *modeBIN)
 
int MMG3D_loadMesh_opened (MMG5_pMesh mesh, FILE *inm, int bin)
 
int MMG3D_loadMesh (MMG5_pMesh mesh, const char *filename)
 
int MMG3D_loadMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG3D_loadMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
int MMG3D_saveMesh (MMG5_pMesh mesh, const char *filename)
 
int MMG3D_saveMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG3D_saveMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
int MMG3D_loadSol (MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
 
int MMG3D_loadAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
int MMG3D_saveSol (MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
 
int MMG3D_saveAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
static int MMG3D_saveEle (MMG5_pMesh mesh, const char *filename)
 
static int MMG3D_saveNeigh (MMG5_pMesh mesh, const char *filename)
 
static int MMG3D_saveFace (MMG5_pMesh mesh, const char *filename)
 
int MMG3D_saveTetgenMesh (MMG5_pMesh mesh, const char *filename)
 

Detailed Description

Input / Output Functions.

Author
Charles Dapogny (UPMC)
Cécile Dobrzynski (Bx INP/Inria/UBordeaux)
Pascal Frey (UPMC)
Algiane Froehly (Inria/UBordeaux)
Version
5
Todo:
doxygen documentation.

Function Documentation

◆ MMG3D_loadAllSols()

int MMG3D_loadAllSols ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the solutions array
filenamename of file.
Returns
0 if failed, 1 otherwise.

Load 1 or more solutions in a solution file at medit file format.

Remarks
Fortran interface:

SUBROUTINE MMG3D_LOADALLSOLS(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Read the file header

Sol tab allocation

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_loadMesh()

int MMG3D_loadMesh ( MMG5_pMesh  mesh,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
filenamename of file.
Returns
0 if the file is not found, -1 if we detect mismatch parameters or we fail, 1 otherwise.

Read mesh data.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_loadMesh_opened()

int MMG3D_loadMesh_opened ( MMG5_pMesh  mesh,
FILE *  inm,
int  bin 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_loadMshMesh()

int MMG3D_loadMshMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Read mesh and 0 or 1 data at MSH file format (.msh extension). We read only low-order points, edges, tria, quadra, tetra and prisms.

Remarks
Fortran interface:

SUBROUTINE MMG3D_LOADMSHMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_loadMshMesh_and_allData()

int MMG3D_loadMshMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward a list of solution structures.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Read mesh and a list of data at MSH file format (.msh extension). We read only low-order points, edges, tria, quadra, tetra and prisms.

Remarks
Fortran interface:

SUBROUTINE MMG3D_LOADMSHMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_loadSol()

int MMG3D_loadSol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.
filenamename of file.
Returns
-1 data invalid, 0 no file, 1 ok.

Load metric field. The solution file must contains only 1 solution: the metric

Remarks
Fortran interface:

SUBROUTINE MMG3D_LOADSOL(mesh,met,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Read the file header

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_openMesh()

int MMG3D_openMesh ( int  imprim,
const char *  filename,
FILE **  inm,
int *  bin,
char *  modeASCII,
char *  modeBIN 
)
Parameters
imprimverbosity level (muted for stdout if -1)
filenamefile to open
inmpointer toward the file unit
bin1 if file will be at binary format
modeASCIImode in which to open an ascii file ("r","r+","w","w+",...)
modeASCIImode in which to open an ascii file ("r","r+","w","w+",...)
Returns
-1 if lack of memory, 0 if fail to open file, 1 if success.

Try to open a Medit file at asked mode (read only, write, etc) and store if file is binary (depending on the extension).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveAllSols()

int MMG3D_saveAllSols ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the solutions array
filenamename of the solution file.
Returns
0 or -1 if fail, 1 otherwise.

Save 1 or more solutions at medit solution file format

Remarks
Fortran interface:

SUBROUTINE MMG3D_SAVEALLSOLS(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveEle()

static int MMG3D_saveEle ( MMG5_pMesh  mesh,
const char *  filename 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveFace()

static int MMG3D_saveFace ( MMG5_pMesh  mesh,
const char *  filename 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveMesh()

int MMG3D_saveMesh ( MMG5_pMesh  mesh,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
filenamepointer toward the name of file.
Returns
0 if failed, 1 otherwise.

Save mesh data.

Warning
you must call the MMG3D_packMesh function before saving your mesh.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveMshMesh()

int MMG3D_saveMshMesh ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and 0 or 1 data at MSH file format (.msh extension). Write binary file for .mshb extension and ASCII for .msh one.

Remarks
Fortran interface:

SUBROUTINE MMG3D_SAVEMSHMESH(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveMshMesh_and_allData()

int MMG3D_saveMshMesh_and_allData ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward the solution structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write mesh and a list of data fields (that are considered as solutions and not metrics, thus, we do nothing over the ridge points) at MSH file format (.msh extension). Save file at ASCII format for .msh extension, at binary format for .mshb one.

Remarks
Fortran interface:

SUBROUTINE MMG3D_SAVEMSHMESH_AND_ALLDATA(mesh,sol,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,sol
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveNeigh()

static int MMG3D_saveNeigh ( MMG5_pMesh  mesh,
const char *  filename 
)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveSol()

int MMG3D_saveSol ( MMG5_pMesh  mesh,
MMG5_pSol  met,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
metpointer toward the sol structure.
filenamename of file.
Returns
0 if failed, 1 otherwise.

Write isotropic or anisotropic metric.

Remarks
Fortran interface:

SUBROUTINE MMG3D_SAVESOL(mesh,met,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh,met
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MMG3D_saveTetgenMesh()

int MMG3D_saveTetgenMesh ( MMG5_pMesh  ,
const char *   
)
Parameters
meshpointer toward the mesh structure.
filenamename of the readed file.
Returns
0 or -1 if fail, 1 otherwise.

Save mesh data at Triangle (or equivalent to Tetgen in 3D) file format.

Remarks
Fortran interface:

SUBROUTINE MMG3D_SAVETETGENMESH(mesh,filename,strlen0,retval)
MMG5_DATA_PTR_T, INTENT(INOUT) :: mesh
CHARACTER(LEN=*), INTENT(IN) :: filename
INTEGER, INTENT(IN) :: strlen0
INTEGER, INTENT(OUT) :: retval
END SUBROUTINE

Here is the call graph for this function:
Here is the caller graph for this function: