48 fprintf(stdout,
"\n ELAPSED TIME %s\n",stim);
73 fprintf(stderr,
"\n ## Error: %s: unable to allocate the first boundary"
74 " reference node.\n",__func__);
82 for ( k=1; k<=
mesh->
ne; ++k ) {
86 fprintf(stderr,
"\n ## Warning: %s: unable to list the tetra references.\n"
87 " Uncomplete parameters file.\n",__func__ );
90 else if (
ier ) ++npar;
111 fprintf(out,
"%"MMG5_PRId
" Tetrahedron %e %e %e \n",cur->val,
141 if ( ptr ) *ptr =
'\0';
142 strcat(data,
".mmg3d");
144 if ( !(out = fopen(data,
"wb")) ) {
145 fprintf(stderr,
"\n ** UNABLE TO OPEN %s.\n",data);
149 fprintf(stdout,
"\n %%%% %s OPENED\n",data);
163 fprintf(out,
"parameters\n %d\n",nparTri+nparTet);
178 fprintf(stdout,
" -- WRITING COMPLETED\n");
216 fprintf(stderr,
"\n ## Error: %s: "
217 "unable to save of a local parameter file with"
218 " the default parameters values because local parameters"
219 " are provided.\n",__func__);
224 if (
mesh->
info.
imprim > 0 ) fprintf(stdout,
"\n -- INPUT DATA\n");
229 if ( met && met->
np && (met->
np !=
mesh->
np) ) {
230 fprintf(stderr,
"\n ## WARNING: WRONG SOLUTION NUMBER. IGNORED\n");
236 fprintf(stderr,
"\n ## WARNING: WRONG SOLUTION NUMBER. IGNORED\n");
244 fprintf(stdout,
" -- INPUT DATA COMPLETED. %s\n",stim);
251 fprintf(stdout,
"\n -- DEFAULT PARAMETERS COMPUTATION\n");
278 fprintf(stderr,
"\n ## Error: %s: Unable to save the local parameters file.\n"
279 " Exit program.\n",__func__);
297int main(
int argc,
char *argv[]) {
301 int ier,ierSave,fmtin,fmtout;
306 setvbuf(stdout, NULL, _IOLBF, 1024);
307 setvbuf(stderr, NULL, _IOLBF, 1024);
310#ifndef MMG_COMPARABLE_OUTPUT
311 fprintf(stdout,
" -- MMG3D, Release %s (%s) \n",MMG_VERSION_RELEASE,MMG_RELEASE_DATE);
312 fprintf(stdout,
" %s\n",MMG_COPYRIGHT);
313 fprintf(stdout,
" %s %s\n",__DATE__,__TIME__);
354 fprintf(stdout,
"\n -- INPUT DATA\n");
388 if (
ier < 1 ) {
break; }
401 fprintf(stdout,
" ## ERROR: UNABLE TO LOAD SOLUTION FILE.\n");
408 fprintf(stderr,
"\n ## ERROR: WRONG DATA TYPE OR WRONG SOLUTION NUMBER.\n");
417 fprintf(stdout,
" ## ERROR: UNABLE TO LOAD METRIC.\n");
424 fprintf(stdout,
" ## ERROR: UNABLE TO GIVE A NAME TO THE METRIC.\n");
436 fprintf(stderr,
" ** %s NOT FOUND.\n",
mesh->
namein);
437 fprintf(stderr,
" ** UNABLE TO OPEN INPUT FILE.\n");
445 fprintf(stdout,
" ## WARNING: MESH ADAPTATION UNAVAILABLE IN"
446 " LAGRANGIAN MODE. METRIC IGNORED.\n");
451 if ( ls == NULL || ls->
m == NULL ) {
452 fprintf(stderr,
"\n ## ERROR: NO ISOVALUE DATA.\n");
464 fprintf(stdout,
" -- DATA READING COMPLETED. %s\n",stim);
483 fprintf(stdout,
"\n ## ERROR: IMPOSSIBLE TO PROVIDE BOTH A METRIC"
484 " AND A SOLUTION IN ADAPTATION MODE.\n");
494 fprintf(stdout,
"\n -- WRITING DATA FILE %s\n",
mesh->
nameout);
514 if ( met && met->
np ) {
524 if ( met && met->
np ) {
535 fprintf(stdout,
" -- WRITING COMPLETED\n");
int MMG5_Compute_constantSize(MMG5_pMesh mesh, MMG5_pSol met, double *hsiz)
const char * MMG5_Get_formatName(enum MMG5_Format fmt)
int MMG5_Get_format(char *ptr, int fmt)
char * MMG5_Get_filenameExt(char *filename)
int MMG3D_Init_mesh(const int starter,...)
Initialize a mesh structure and optionally the associated solution and metric structures.
int MMG3D_Set_inputSolName(MMG5_pMesh mesh, MMG5_pSol sol, const char *solin)
Set the name of input solution file.
int MMG3D_Free_names(const int starter,...)
Structure deallocations before return.
int MMG3D_Set_solSize(MMG5_pMesh mesh, MMG5_pSol sol, int typEntity, MMG5_int np, int typSol)
Initialize a solution field.
MMG5_pMesh MMG5_pSol * sol
program main
Example for using mmglib (basic use)
void tminit(mytime *t, int maxtim)
Initialize mytime object.
void printim(double elps, char *stim)
Print real time.
void chrono(int cmode, mytime *ptt)
Function to measure time.
int MMG3D_saveMesh(MMG5_pMesh mesh, const char *filename)
Save a mesh in .mesh/.meshb format.
int MMG3D_loadSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Load a metric field (or other solution).
int MMG3D_loadMesh(MMG5_pMesh mesh, const char *filename)
Load a mesh (in .mesh/.mesb format) from file.
int MMG3D_loadMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Load a mesh and possibly a solution in .msh format from file.
int MMG3D_saveTetgenMesh(MMG5_pMesh mesh, const char *filename)
Save data in Tetgen's Triangle format.
int MMG3D_saveSol(MMG5_pMesh mesh, MMG5_pSol met, const char *filename)
Write isotropic or anisotropic metric.
int MMG3D_saveMshMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save a mesh in MSH format, ascii or binary depending on the filename extension.
int MMG3D_loadVtkMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and possibly a solution from a file in VTK format.
int MMG3D_saveVtkMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save a mesh and optionally one solution in VTK format.
int MMG3D_loadVtuMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol, const char *filename)
Load a mesh and possibly a solution in VTU (VTK) format from file.
int MMG3D_saveVtuMesh(MMG5_pMesh mesh, MMG5_pSol sol, const char *filename)
Save a mesh and optionally one data field in VTU format.
void MMG3D_Set_commonFunc(void)
int MMG3D_mmg3dls(MMG5_pMesh mesh, MMG5_pSol sol, MMG5_pSol umet)
Main "program" for the level-set discretization library.
int MMG3D_mmg3dlib(MMG5_pMesh mesh, MMG5_pSol met)
Main "program" for the mesh adaptation library.
int MMG3D_mmg3dmov(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol disp)
Main program for the rigid-body movement library.
API headers and documentation for the mmg3d library, for volumetric meshes in 3D.
LIBMMG3D_EXPORT int MMG3D_parsop(MMG5_pMesh mesh, MMG5_pSol met)
Read a file containing Local parameters (.mmg3d extension)
LIBMMG3D_EXPORT int(* MMG3D_doSol)(MMG5_pMesh mesh, MMG5_pSol met)
Compute isotropic size map according to the mean of the length of the edges passing through a vertex.
LIBMMG3D_EXPORT int MMG3D_parsar(int argc, char *argv[], MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol)
Store command-line arguments.
LIBMMG3D_EXPORT void MMG3D_setfunc(MMG5_pMesh mesh, MMG5_pSol met)
Set function pointers for caltet, lenedg, lenedgCoor defsiz, gradsiz... depending if the metric that ...
#define MMG5_RETURN_AND_FREE(mesh, met, ls, disp, val)
LIBMMG_CORE_EXPORT int MMG5_unscaleMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
LIBMMG_CORE_EXPORT int MMG5_scaleMesh(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol ls)
#define MMG5_STRONGFAILURE
static int MMG3D_defaultOption(MMG5_pMesh mesh, MMG5_pSol met, MMG5_pSol sol)
int MMG5_writeLocalParamAtTet(MMG5_pMesh mesh, MMG5_iNode *bdryRefs, FILE *out)
int MMG3D_writeLocalParam(MMG5_pMesh mesh)
mytime MMG5_ctim[TIMEMAX]
static void MMG5_endcod(void)
int MMG5_countLocalParamAtTet(MMG5_pMesh mesh, MMG5_iNode **bdyRefs)
#define _LIBMMG5_RETURN(mesh, sol, met, val)
static void MMG5_excfun(int sigid)
#define MMG5_FILESTR_LGTH
#define MMG5_DEL_MEM(mesh, ptr)
Cell for linked list of integer value.