LOT7: fix compilation at med_int==int64

This commit is contained in:
eap 2019-12-19 16:34:19 +03:00
parent 70d591791d
commit fa9f8a6224
12 changed files with 22 additions and 19 deletions

View File

@ -266,7 +266,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
}
#endif
if ( !anIsNodeNum )
aNodeIds.swap( *(aBallInfo->myConn ));
aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end());
// allocate array of diameters
vtkIdType maxID = myMesh->MaxElementID() + aNbBalls;

View File

@ -34,6 +34,7 @@
#include "SMDS_MeshNode.hxx"
#include "SMDS_SetIterator.hxx"
#include "SMESHDS_Mesh.hxx"
#include "MED_Common.hxx"
#include <med.h>

View File

@ -30,7 +30,7 @@
#include "SMESH_DriverMED.hxx"
#include "Driver_SMESHDS_Mesh.h"
#include "MED_Common.hxx"
//#include "MED_Common.hxx"
#include <string>
#include <list>

View File

@ -31,7 +31,7 @@
#include <set>
#include <map>
#include <hdf5.h>
#include <med.h>
#ifdef WIN32
#pragma warning(disable:4099)
@ -41,11 +41,12 @@ namespace MED
{
typedef enum {eFAUX, eVRAI} EBooleen;
typedef double TFloat;
#if defined(HAVE_F77INT64)
typedef long TInt;
#else
typedef int TInt;
#endif
// #if defined(HAVE_F77INT64)
// typedef long TInt;
// #else
// typedef int TInt;
// #endif
typedef med_int TInt;
typedef hid_t TIdt;
typedef herr_t TErr;

View File

@ -23,6 +23,7 @@ INCLUDE_DIRECTORIES(
${OMNIORB_INCLUDE_DIR}
${OpenCASCADE_INCLUDE_DIR}
${HDF5_INCLUDE_DIRS}
${MEDFILE_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${KERNEL_INCLUDE_DIRS}

View File

@ -479,7 +479,7 @@ bool SMESH_PreMeshInfo::readMeshInfo()
MED::PMeshInfo medMeshInfo = aMed->CrMeshInfo(3,3,SMESH_Comment( _meshID ));
// read nb nodes
int nbNodes = std::max( 0, aMed->GetNbNodes( medMeshInfo ));
int nbNodes = Max( 0, aMed->GetNbNodes( medMeshInfo ));
if ( nbNodes > 0 )
{
setNb( SMDSEntity_Node, nbNodes);

View File

@ -211,7 +211,7 @@ int main(int argc, char *argv[])
{
bool plus = false;
bool moins = false;
int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
med_int *offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
for (int is = 0; is < 4; is++)
{
int ng = *(offset + is);
@ -1065,7 +1065,7 @@ int main(int argc, char *argv[])
// cout << "Legacy " << tm << " effectif " << MAILLAGE1->EFFECTIFS_TYPES[tm] << endl;
int tailleType = Nnoeuds(tm);
MAILLAGE2->CNX[tm] = (int*) malloc(sizeof(int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm]
MAILLAGE2->CNX[tm] = (med_int*) malloc(sizeof(med_int) * tailleType * (MAILLAGE1->EFFECTIFS_TYPES[tm]
+ cptNouvellesMailles[tm]));
for (int i = 0; i < MAILLAGE1->EFFECTIFS_TYPES[tm]; i++)
for (int j = 0; j < tailleType; j++)

View File

@ -89,7 +89,7 @@ int MESHCUT::intersectionSegmentPlan(int it4, int na)
float A[3], B[3];
// Détermination des ng des extrémités de l'arête passée en argument na
int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
med_int * offset = MAILLAGE1->CNX[TETRA4] + 4 * it4;
if (na == 0)
{
ngA = *(offset + 0);

View File

@ -66,7 +66,7 @@ void Maillage::afficheMailles(TYPE_MAILLE tm)
{
cout << "\tMaille " << i << " :" << endl;
//Boucle sur les noeuds de la maille de numéro local i dans le type tm
int * offset = CNX[tm] + nnoeuds * i;
med_int * offset = CNX[tm] + nnoeuds * i;
for (int j = 0; j < nnoeuds; j++)
{
int ngnoeud = *(offset + j);
@ -868,7 +868,7 @@ void Maillage::acquisitionTYPE_inputMED(TYPE_MAILLE TYPE, int nTYPE, med_idt fid
med_int *famTYPE = (med_int*) malloc(sizeof(med_int) * nTYPE);
//med_int *conTYPE = (med_int*) malloc(sizeof(med_int)*tTYPE*nTYPE);
CNX[TYPE] = (int*) malloc(sizeof(int) * tTYPE * nTYPE);
CNX[TYPE] = (med_int*) malloc(sizeof(med_int) * tTYPE * nTYPE);
med_bool inomTYPE, inumTYPE, ifamTYPE;
med_geometry_type typeBanaliseMED = InstanceMGE(TYPE);
@ -1705,10 +1705,10 @@ void Maillage::eliminationMailles(TYPE_MAILLE tm, vector<int> listeMaillesSuppr)
// ************* Modification de la connectivité du type concerné
int* CNX2;
med_int* CNX2;
int nNoeudsType = Nnoeuds(tm);
int tailleCNX2 = nNoeudsType * (EFFECTIFS_TYPES[tm] - listeMaillesSuppr.size());
CNX2 = (int*) malloc(sizeof(int) * tailleCNX2);
CNX2 = (med_int*) malloc(sizeof(med_int) * tailleCNX2);
// Recopie sélective des connectivités
int isuppr = 0; // indice dans listeMaillesSuppr
int ih2 = 0; // nouveau numéro local ( remarque: ih2 = ih1 - isuppr )

View File

@ -75,7 +75,7 @@ namespace MESHCUT
// Le numéro global du j-ième noeud de la maille de numéro global i est stocké à l'adresse
// CNX[tm]+t*(i-1)+(j-1)
// (t = taille du type, i.e. nombre de noeuds de l'élément)
std::map<TYPE_MAILLE, int*> CNX; // ****** MED-OBLIGATOIRE ******
std::map<TYPE_MAILLE, med_int*> CNX; // ****** MED-OBLIGATOIRE ******
// Enveloppes cubiques
std::map<TYPE_MAILLE, float*> EC;

View File

@ -1035,7 +1035,7 @@ float MESHCUT::distance2(float x1, float y1, float z1, float x2, float y2, float
/*!
* Conversion HL-MED d'une table de connectivités
*/
void MESHCUT::conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N)
void MESHCUT::conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N)
{
int n = Nnoeuds(tm);

View File

@ -71,7 +71,7 @@ namespace MESHCUT
std::string nomMaille(TYPE_MAILLE tm, int nl);
bool appartientVN(int n, std::vector<int> V);
float distance2(float x1, float y1, float z1, float x2, float y2, float z2);
void conversionCNX(int *CNXtm, TYPE_MAILLE tm, int N);
void conversionCNX(med_int *CNXtm, TYPE_MAILLE tm, int N);
}