Commit 9b67c5b0 authored by Christophe Geuzaine's avatar Christophe Geuzaine

fix

parent 49ccfb36
Pipeline #2260 failed with stage
in 52 minutes and 49 seconds
......@@ -2392,7 +2392,7 @@ static bool meshGeneratorPeriodic(GFace *gf, bool repairSelfIntersecting1dMesh,
if(!e) {
// edgesNotRecovered.push_back(EdgeToRecover(edgeLoop_BDS[j]->iD,
// edgeLoop_BDS[(j + 1) % edgeLoop_BDS.size()]->iD));
Msg::Error("Impossible to recover the edge %d %d", edgeLoop_BDS[j]->iD,
edgeLoop_BDS[(j + 1) % edgeLoop_BDS.size()]->iD);
gf->meshStatistics.status = GFace::FAILED;
......@@ -2762,13 +2762,13 @@ static double TRIANGLE_VALIDITY(GFace *gf, MTriangle *t)
static bool isMeshValid(GFace *gf)
{
int invalid = 0;
size_t invalid = 0;
for(size_t i = 0; i < gf->triangles.size(); i++) {
double v = TRIANGLE_VALIDITY(gf, gf->triangles[i]);
if(v < 0) invalid++;
}
if(invalid == 0 || invalid == gf->triangles.size()) return true;
// printf("%d %d %d\n",gf->tag(),gf->triangles.size(),invalid);
return false;
}
......
......@@ -294,7 +294,7 @@ HXTStatus hxtLinearSystemLUCreate(HXTLinearSystemLU **pSystem, int nElements, in
}
free(nodeRowStart);
free(nodeRowEnd);
system->M = _mm_malloc(sizeof(double)*totalSize, PADDING*8);
system->M = malloc(sizeof(double)*totalSize, PADDING*8); // FIXME Gmsh instead of _mm_malloc
system->rows = malloc(sizeof(double*)*system->n);
for (int i = 0; i < totalSize; ++i)
system->M[i] = 0;
......@@ -306,7 +306,7 @@ HXTStatus hxtLinearSystemLUCreate(HXTLinearSystemLU **pSystem, int nElements, in
totalSize += system->rowEnd[i]-system->rowStart[i]+(paddedStart-start);
system->rows[i] = system->M + paddedStart;
}
system->x = _mm_malloc(sizeof(double)*system->n, PADDING*8);
system->x = malloc(sizeof(double)*system->n, PADDING*8); // FIXME Gmsh instead of _mm_malloc
return HXT_STATUS_OK;
}
......@@ -399,7 +399,7 @@ HXTStatus hxtLinearSystemLUAddMatrixEntry(HXTLinearSystemLU *system, int node0,
HXT_ERROR_MSG(HXT_STATUS_FAILED, "node %i or %i not in the domain", node0, node1);
int row0 = system->nodeMap[node0]*system->nFields + field0;
int col1 = system->nodeMap[node1]*system->nFields + field1;
system->rows[row0][col1] += v;
return HXT_STATUS_OK;
}
......@@ -418,7 +418,7 @@ HXTStatus hxtLinearSystemLUSolve(HXTLinearSystemLU *system, double *rhs, double
LUPDecompose(system);
system->flaglu=1;
}
LUPSolve(system, rhs);
for (int i = 0; i < system->nNodes; ++i){
int ii = system->nodeMap[i];
......
......@@ -46,7 +46,7 @@ ___
| int arrayLength = ...;
| int *array;
| HXT_CHECK( hxtMalloc(&array, sizeof(int)*arrayLength) );
|
|
| array[0] = ...;
| [...]
| array[arrayLength-1] = ...;
......@@ -97,6 +97,15 @@ static inline HXTStatus hxtRealloc(void* ptrToPtr, size_t size)
return HXT_STATUS_OK;
}
// FIXME Gmsh: aligned routines do not seem to work on 32 bit machines
#include <stdint.h>
#if UINTPTR_MAX == 0xffffffff
static inline HXTStatus hxtGetAlignedBlockSize(void* ptrToPtr, size_t* size){ *size = 0; return HXT_STATUS_OK; }
static inline HXTStatus hxtAlignedMalloc(void* ptrToPtr, size_t size){ return hxtMalloc(ptrToPtr, size); }
static inline HXTStatus hxtAlignedFree(void* ptrToPtr){ return hxtFree(ptrToPtr); }
static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size){ return hxtRealloc(ptrToPtr, size); }
#else
/*********************************************************
* Hextreme aligned malloc implementation
......@@ -172,7 +181,7 @@ static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size)
HXT_CHECK(hxtAlignedFree(ptrToPtr));
return HXT_STATUS_OK;
}
size_t old_size;
HXT_CHECK( hxtGetAlignedBlockSize(ptrToPtr, &old_size) );
......@@ -190,13 +199,15 @@ static inline HXTStatus hxtAlignedRealloc(void* ptrToPtr, size_t size)
return HXT_STATUS_OK;
}
#endif // FIXME Gmsh
/*********************************************************
A way to call rand with a seed to get a reproducible
result.
For example, we do not call srand() each time we
call a reproducible Delaunay, else if someone was calling
rand(); Delaunay(); rand(); ...
he would always get the same result. We use
he would always get the same result. We use
hxtReproducibleRand() instead
!!!! 1st seed must absolutely be 1 !!!!
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment