44 if ( !
mesh->npnil )
return 0;
47 ppt = &
mesh->point[curpt];
48 memcpy(ppt->
c,c,3*
sizeof(
double));
61 "larger xpoint table",
66 assert(tag <=
MG_NUL*2-1 &&
"Value for tag is valid");
84 ppt = &
mesh->point[ip];
86 pxp = &
mesh->xpoint[ppt->
xp];
93 if ( ip ==
mesh->np ) {
102 if ( !
mesh->nenil )
return 0;
103 curiel =
mesh->nenil;
106 mesh->nenil =
mesh->tetra[curiel].v[3];
107 mesh->tetra[curiel].v[3] = 0;
108 mesh->tetra[curiel].mark=
mesh->mark;
126 pt = &
mesh->tetra[iel];
128 fprintf(stderr,
"\n ## INVALID ELEMENT %" MMG5_PRId
".\n",iel);
132 pt->
v[3] =
mesh->nenil;
133 iadr = 4*(iel-1) + 1;
135 memset(&
mesh->adja[iadr],0,4*
sizeof(MMG5_int));
137 if ( iel ==
mesh->ne ) {
174 size_t usedMem,avMem,reservedMem,npadd;
185 + (3*
mesh->nt+1)*
sizeof(MMG5_int) + (4*
mesh->ne+1)*
sizeof(MMG5_int)
186 + (
mesh->np+1)*
sizeof(
double);
188 if ( usedMem >
mesh->memMax ) {
189 fprintf(stderr,
"\n ## Error: %s: %zu MB of memory ",__func__,
mesh->memMax/
MMG5_MILLION);
190 fprintf(stderr,
"is not enough to load mesh. You need to ask %zu MB minimum\n",
200 4*6*
sizeof(MMG5_int) + ctri*3*
sizeof(MMG5_int) +
206 bytes = bytes + 3*6*
sizeof(MMG5_int);
209 avMem =
mesh->memMax-usedMem;
214 npadd = avMem/(2*bytes);
219 if (
sizeof(MMG5_int) ==
sizeof(int32_t) ) {
223 if (
mesh->nprism ) {
232 int32_t int32_nemax = (INT32_MAX-(coef+1))/coef;
234 if ( int32_nemax < mesh->nemax ) {
235 if ( int32_nemax <= mesh->ne ) {
237 fprintf(stderr,
"\n ## Error: %s: with %" MMG5_PRId
" tetrahedra Mmg will overflow"
238 " the 32-bit integer.\n",__func__,
mesh->ne);
239 fprintf(stderr,
"Please, configure Mmg with MMG5_INT=int64_t argument.\n");
244 mesh->nemax = int32_nemax;
250 if ( abs(
mesh->info.imprim) > 4 ||
mesh->info.ddebug ) {
251 fprintf(stdout,
" MAXIMUM MEMORY AUTHORIZED (MB) %zu\n",
254 if ( abs(
mesh->info.imprim) > 5 ||
mesh->info.ddebug ) {
255 fprintf(stdout,
" MMG3D_NPMAX %" MMG5_PRId
"\n",
mesh->npmax);
256 fprintf(stdout,
" MMG3D_NTMAX %" MMG5_PRId
"\n",
mesh->ntmax);
257 fprintf(stdout,
" MMG3D_NEMAX %" MMG5_PRId
"\n",
mesh->nemax);
292 fprintf(stderr,
" Exit program.\n");
297 fprintf(stderr,
" Exit program.\n");
301 if (
mesh->nprism ) {
327 for (k=
mesh->npnil; k<mesh->npmax-1; k++) {
329 mesh->point[k].tmp = k+1;
332 for (k=
mesh->nenil; k<mesh->nemax-1; k++)
333 mesh->tetra[k].v[3] = k+1;
363 for (k=1; k<=
mesh->ne; k++) {
364 pt = &
mesh->tetra[k];
382 for (k=1; k<=
mesh->nprism; k++) {
383 pp = &
mesh->prism[k];
#define MMG5_SAFE_CALLOC(ptr, size, type, law)
void MMG5_memOption_memSet(MMG5_pMesh mesh)
#define MMG5_ADD_MEM(mesh, size, message, law)
#define MMG5_TAB_RECALLOC(mesh, ptr, initSize, wantedGap, type, message, law)
#define MMG5_DEL_MEM(mesh, ptr)
Structure to store edges of am MMG mesh.
Structure to store vertices of an MMG mesh.
Structure to store prsim of a MMG mesh.
Structure to store quadrangles of an MMG mesh.
Structure to store tetrahedra of an MMG mesh.
Structure to store triangles of a MMG mesh.
Used to hash edges (memory economy compared to MMG5_hgeom).
Structure to store surface vertices of an MMG mesh.
Structure to store additional information for the surface tetrahedra of an MMG mesh.
MMG5_int MMG3D_newElt(MMG5_pMesh mesh)
void MMG5_freeXPrisms(MMG5_pMesh mesh)
void MMG3D_delPt(MMG5_pMesh mesh, MMG5_int ip)
void MMG5_freeXTets(MMG5_pMesh mesh)
int MMG3D_memOption_memRepartition(MMG5_pMesh mesh)
MMG5_int MMG3D_newPt(MMG5_pMesh mesh, double c[3], uint16_t tag, MMG5_int src)
int MMG3D_delElt(MMG5_pMesh mesh, MMG5_int iel)
int MMG3D_memOption_memSet(MMG5_pMesh mesh)
int MMG3D_setMeshSize_alloc(MMG5_pMesh mesh)
int MMG3D_zaldy(MMG5_pMesh mesh)
int MMG3D_memOption(MMG5_pMesh mesh)