The language of my code is C++. I think it is ok for double precision.
I use the same .mesh for exe and lib (see “ok_with_exe.mesh” in post #11). It crashes only using the lib.
Here is a snap of the code I use.
MMG5_pMesh mmg_mesh_reload_ptr = nil;
MMG5_pSol mmgSol = nil;
MMG2D_Init_mesh( MMG5_ARG_start,
MMG5_ARG_ppMesh, &mmg_mesh_reload_ptr, MMG5_ARG_ppMet, &mmgSol,
MMG5_ARG_end );
MMG2D_loadMesh( mmg_mesh_reload_ptr, "/tmp/ok_with_exe.mesh" );
MMG2D_Set_solSize( mmg_mesh_reload_ptr, mmgSol, MMG5_Vertex,
static_cast< int >( vertices.size() ), MMG5_Scalar );
/// Set the metric
for( index_t p = 0; p < vertices.size(); p++ ) {
MMG2D_Set_scalarSol( mmgSol, resolution,
static_cast< int >( MMG_START_ID + p ) );
}
MMG2D_mmg2dmesh( mmg_mesh_reload_ptr, mmg_metric_ptr );
with resolution a double (=1), MMG_START_ID = 1.
BR
Pierre