mmg2d
inout_2d.c File Reference
#include "mmg2d.h"
Include dependency graph for inout_2d.c:

Macros

#define sw   4
 
#define sd   8
 

Functions

int MMG_swapbin (int sbin)
 
float MMG_swapf (float sbin)
 
double MMG_swapd (double sbin)
 
int MMG2D_loadMesh (MMG5_pMesh mesh, const char *filename)
 
static int MMG2D_2dMshCheck (MMG5_pMesh mesh)
 
int MMG2D_loadMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG2D_loadMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
static void MMG2D_readFloatSol (MMG5_pSol sol, FILE *inm, int bin, int iswp, int pos)
 
static void MMG2D_readDoubleSol (MMG5_pSol sol, FILE *inm, int bin, int iswp, int pos)
 
int MMG2D_loadSol (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG2D_loadAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
int MMG2D_saveMesh (MMG5_pMesh mesh, const char *filename)
 
int MMG2D_saveMshMesh (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG2D_saveMshMesh_and_allData (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
static void MMG2D_writeDoubleSol (MMG5_pSol sol, FILE *inm, int bin, int pos)
 
int MMG2D_saveSol (MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
 
int MMG2D_saveAllSols (MMG5_pMesh mesh, MMG5_pSol *sol, const char *filename)
 
int MMG2D_savemesh_db (MMG5_pMesh mesh, char *filename, char pack)
 
int MMG2D_savemet_db (MMG5_pMesh mesh, MMG5_pSol met, char *filename, char pack)
 
int MMG2D_savenor_db (MMG5_pMesh mesh, char *filename, char pack)
 
int MMG2D_savedisp_db (MMG5_pMesh mesh, MMG5_pSol disp, char *filename, char pack)
 

Macro Definition Documentation

◆ sd

#define sd   8

◆ sw

#define sw   4

Function Documentation

◆ MMG2D_2dMshCheck()

static int MMG2D_2dMshCheck ( MMG5_pMesh  mesh)
inlinestatic
Parameters
meshpointer toward the mesh structure.
Returns
0 if failed, 1 otherwise.

Check mesh data for a Msh mesh : mark the vertices as used if no triangles in the mesh (mesh generation) and check that all z-componants are 0.

Here is the caller graph for this function:

◆ MMG2D_loadAllSols()

int MMG2D_loadAllSols ( MMG5_pMesh  mesh,
MMG5_pSol sol,
const char *  filename 
)
Parameters
meshpointer toward the mesh structure.
solpointer toward an allocatable sol structure.
filenamename of file.
Returns
-1 data invalid or we fail, 0 no file, 1 ok.

Load a medit solution file containing 1 or more solutions.

Read the file header

Sol tab allocation

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

◆ MMG2D_loadMesh()

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

Read mesh data.

Remarks
Fortran interface:

SUBROUTINE MMG2D_LOADMESH(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:

◆ MMG2D_loadMshMesh()

int MMG2D_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 MMG2D_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:

◆ MMG2D_loadMshMesh_and_allData()

int MMG2D_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 MMG2D_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:

◆ MMG2D_loadSol()

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

Load metric field.

Read the file header

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

◆ MMG2D_readDoubleSol()

static void MMG2D_readDoubleSol ( MMG5_pSol  sol,
FILE *  inm,
int  bin,
int  iswp,
int  pos 
)
inlinestatic
Parameters
solpointer toward an allocatable sol structure.
inmpointer toward the solution file
bin1 if binary file
iswpEndianess
indexof the readed solution

Read the solution value for vertex of index pos in double precision.

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

◆ MMG2D_readFloatSol()

static void MMG2D_readFloatSol ( MMG5_pSol  sol,
FILE *  inm,
int  bin,
int  iswp,
int  pos 
)
inlinestatic
Parameters
solpointer toward an allocatable sol structure.
inmpointer toward the solution file
bin1 if binary file
iswpEndianess
indexof the readed solution

Read the solution value for vertex of index pos in floating precision.

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

◆ MMG2D_saveAllSols()

int MMG2D_saveAllSols ( 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.

Write 1 or more solutions.

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

◆ MMG2D_savedisp_db()

int MMG2D_savedisp_db ( MMG5_pMesh  mesh,
MMG5_pSol  disp,
char *  filename,
char  pack 
)
Here is the call graph for this function:

◆ MMG2D_saveMesh()

int MMG2D_saveMesh ( 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.

Remarks
Fortran interface:

SUBROUTINE MMG2D_SAVEMESH(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:

◆ MMG2D_savemesh_db()

int MMG2D_savemesh_db ( MMG5_pMesh  mesh,
char *  filename,
char  pack 
)
Here is the caller graph for this function:

◆ MMG2D_savemet_db()

int MMG2D_savemet_db ( MMG5_pMesh  mesh,
MMG5_pSol  met,
char *  filename,
char  pack 
)
Here is the call graph for this function:

◆ MMG2D_saveMshMesh()

int MMG2D_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). Save file at ASCII format for .msh extension, at binary format for .msh one.

Remarks
Fortran interface:

SUBROUTINE MMG2D_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:

◆ MMG2D_saveMshMesh_and_allData()

int MMG2D_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 at MSH file format (.msh extension). Save file at ASCII format for .msh extension, at binary format for .mshb one.

Remarks
Fortran interface:

SUBROUTINE MMG2D_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:

◆ MMG2D_savenor_db()

int MMG2D_savenor_db ( MMG5_pMesh  mesh,
char *  filename,
char  pack 
)
Here is the call graph for this function:

◆ MMG2D_saveSol()

int MMG2D_saveSol ( MMG5_pMesh  mesh,
MMG5_pSol  sol,
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.

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

◆ MMG2D_writeDoubleSol()

static void MMG2D_writeDoubleSol ( MMG5_pSol  sol,
FILE *  inm,
int  bin,
int  pos 
)
inlinestatic
Parameters
solpointer toward an allocatable sol structure.
inmpointer toward the solution file
bin1 if binary file
indexof the writted solution

Write the solution value for vertex of index pos in double precision.

Here is the caller graph for this function:

◆ MMG_swapbin()

int MMG_swapbin ( int  sbin)
Here is the caller graph for this function:

◆ MMG_swapd()

double MMG_swapd ( double  sbin)
Here is the caller graph for this function:

◆ MMG_swapf()

float MMG_swapf ( float  sbin)
Here is the caller graph for this function: