From: smh Date: Thu, 3 May 2007 12:04:47 +0000 (+0000) Subject: Fix compilation errors on Mandrake. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a4028fe991132797953ec8f036abf91e6376bb21;p=modules%2Ffilter.git Fix compilation errors on Mandrake. --- diff --git a/src/FILTER/Makefile.in b/src/FILTER/Makefile.in index ab2e256..f3a6428 100644 --- a/src/FILTER/Makefile.in +++ b/src/FILTER/Makefile.in @@ -60,7 +60,11 @@ LDFLAGSFORBIN= -L$(top_builddir)/lib@LIB_LOCATION_SUFFIX@/salome CPPFLAGS += $(OCC_INCLUDES) $(MED2_INCLUDES) $(HDF5_INCLUDES) ${KERNEL_CXXFLAGS} $(MED_CXXFLAGS) CXXFLAGS += $(OCC_CXXFLAGS) ${KERNEL_CXXFLAGS} -LDFLAGS+= $(OCC_LIBS) $(HDF5_LIBS) ${KERNEL_LDFLAGS} \ +LDFLAGS += $(OCC_LIBS) $(HDF5_LIBS) ${KERNEL_LDFLAGS} \ + -lSalomeContainer -lSalomeHDFPersist -lSalomeDS -lSalomeNS -lRegistry -lOpUtil \ + ${MED_LDFLAGS} -lMEDMEMImpl -lmedmem -lmed_V2_1 + +LDFLAGSFORBIN += $(OCC_LIBS) $(HDF5_LIBS) ${KERNEL_LDFLAGS} \ -lSalomeContainer -lSalomeHDFPersist -lSalomeDS -lSalomeNS -lRegistry -lOpUtil \ ${MED_LDFLAGS} -lMEDMEMImpl -lmedmem -lmed_V2_1 diff --git a/src/FILTER/field2nodes.cxx b/src/FILTER/field2nodes.cxx index b6c2758..95f206f 100644 --- a/src/FILTER/field2nodes.cxx +++ b/src/FILTER/field2nodes.cxx @@ -87,184 +87,186 @@ int main (int argc, char ** argv) { int NumberOfComponents = myField->getNumberOfComponents(); switch(myField->getSupport()->getEntity()){ case MED_CELL: - cout << "*************************** CHAMP AUX CELLULES" << endl; - MESH *mesh = myField->getSupport()->getMesh(); + { + cout << "*************************** CHAMP AUX CELLULES" << endl; + MESH *mesh = myField->getSupport()->getMesh(); - // create new support for new field - SUPPORT *newSup; - if( myField->getSupport()->isOnAllElements() ) - newSup = new SUPPORT(mesh,"Support",MED_NODE); - else{ - int nbe = myField->getSupport()->getNumberOfElements(MED_ALL_ELEMENTS); - const int *numb = myField->getSupport()->getNumber(MED_ALL_ELEMENTS); - list myList; - for(int k=0;kbuildSupportOnNodeFromElementList(myList,MED_CELL); - } + // create new support for new field + SUPPORT *newSup; + if( myField->getSupport()->isOnAllElements() ) + newSup = new SUPPORT(mesh,"Support",MED_NODE); + else{ + int nbe = myField->getSupport()->getNumberOfElements(MED_ALL_ELEMENTS); + const int *numb = myField->getSupport()->getNumber(MED_ALL_ELEMENTS); + list myList; + for(int k=0;kbuildSupportOnNodeFromElementList(myList,MED_CELL); + } - // read number of nodes - int NumberOfNodes = newSup->getNumberOfElements(MED_ALL_ELEMENTS); - // calculate reverse connectivity to have the list of elements which contains node i - const int *revC = myField->getSupport()->getMesh()->getReverseConnectivity(MED_NODAL,MED_CELL); - const int *indC = myField->getSupport()->getMesh()->getReverseConnectivityIndex(MED_NODAL,MED_CELL); - int ivol; - // calculate volume field on mesh - for(int k=0;kgetName().c_str(),MeshName[k].c_str())==0) - ivol = k; - if( volume[ivol] == NULL ) - volume[ivol] = myField->getSupport()->getMesh()->getVolume(myField->getSupport()); - if (dynamic_cast*>(myField)){ - FIELD *myDField = (MEDMEM::FIELD*)myField; - FIELD *newDField = new FIELD(newSup,NumberOfComponents); - newDField->setName(myField->getName()); - newDField->setIterationNumber(FieldIteration[j].dt); - newDField->setOrderNumber(FieldIteration[j].it); - newDField->setTime(myDField->getTime()); - double *val = new double[NumberOfComponents]; - if( newSup->isOnAllElements() ){ - for (int k=1; kgetValueIJ(elem,1); - if( vol != 0. ){ - sigmaV += 1./vol; - for(int l=1;l<=NumberOfComponents;l++) - val[l-1] += myDField->getValueIJ(elem,l)/vol; - } - } - for(int l=1;l<=NumberOfComponents;l++) - newDField->setValueIJ(k,l,val[l-1]/sigmaV); - } - } - else{ - const int *numb = newSup->getNumber(MED_ALL_ELEMENTS); - for (int k=1; k<=NumberOfNodes; k++){ - int kk = numb[k-1]; - // listElements contains elements which contains a node of element i - listElements.clear(); - for(int l=indC[kk-1];lgetValueIJ(elem,1); - if( vol != 0. ){ - sigmaV += 1./vol; - for(int l=1;l<=NumberOfComponents;l++) - val[l-1] += myDField->getValueIJ(elem,l)/vol; - } - } - for(int l=1;l<=NumberOfComponents;l++) - newDField->setValueIJ(k,l,val[l-1]/sigmaV); - } - } - delete [] val; - int id = newDField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI); - newDField->write(id); - delete newSup; - delete newDField; - cout << " * Iteration "< *myIField = (MEDMEM::FIELD*)myField; - FIELD *newIField = new FIELD(newSup,NumberOfComponents); - newIField->setName(myField->getName()); - newIField->setIterationNumber(FieldIteration[j].dt); - newIField->setOrderNumber(FieldIteration[j].it); - newIField->setTime(myIField->getTime()); - double *val = new double[NumberOfComponents]; - if( newSup->isOnAllElements() ){ - for (int k=1; kgetNumberOfElements(MED_ALL_ELEMENTS); + // calculate reverse connectivity to have the list of elements which contains node i + const int *revC = myField->getSupport()->getMesh()->getReverseConnectivity(MED_NODAL,MED_CELL); + const int *indC = myField->getSupport()->getMesh()->getReverseConnectivityIndex(MED_NODAL,MED_CELL); + int ivol; + // calculate volume field on mesh + for(int k=0;kgetName().c_str(),MeshName[k].c_str())==0) + ivol = k; + if( volume[ivol] == NULL ) + volume[ivol] = myField->getSupport()->getMesh()->getVolume(myField->getSupport()); + if (dynamic_cast*>(myField)){ + FIELD *myDField = (MEDMEM::FIELD*)myField; + FIELD *newDField = new FIELD(newSup,NumberOfComponents); + newDField->setName(myField->getName()); + newDField->setIterationNumber(FieldIteration[j].dt); + newDField->setOrderNumber(FieldIteration[j].it); + newDField->setTime(myDField->getTime()); + double *val = new double[NumberOfComponents]; + if( newSup->isOnAllElements() ){ + for (int k=1; kgetValueIJ(elem,1); - if( vol != 0. ){ - sigmaV += 1./vol; - for(int l=1;l<=NumberOfComponents;l++) - val[l-1] += ((double)myIField->getValueIJ(elem,l))/vol; - } - } - for(int l=1;l<=NumberOfComponents;l++) - newIField->setValueIJ(k,l,(int)(val[l-1]/sigmaV)); - } - } - else{ - const int *numb = newSup->getNumber(MED_ALL_ELEMENTS); - for (int k=1; k<=NumberOfNodes; k++){ - int kk = numb[k-1]; - // listElements contains elements which contains a node of element i - listElements.clear(); - for(int l=indC[kk-1];lgetValueIJ(elem,1); - if( vol != 0. ){ - sigmaV += 1./vol; - for(int l=1;l<=NumberOfComponents;l++) - val[l-1] += myIField->getValueIJ(elem,l)/vol; - } - } - for(int l=1;l<=NumberOfComponents;l++) - newIField->setValueIJ(k,l,(int)(val[l-1]/sigmaV)); - } - } - delete [] val; - int id = newIField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI); - newIField->write(id); - delete newSup; - delete newIField; - cout << " * Iteration "<getValueIJ(elem,1); + if( vol != 0. ){ + sigmaV += 1./vol; + for(int l=1;l<=NumberOfComponents;l++) + val[l-1] += myDField->getValueIJ(elem,l)/vol; + } + } + for(int l=1;l<=NumberOfComponents;l++) + newDField->setValueIJ(k,l,val[l-1]/sigmaV); + } + } + else{ + const int *numb = newSup->getNumber(MED_ALL_ELEMENTS); + for (int k=1; k<=NumberOfNodes; k++){ + int kk = numb[k-1]; + // listElements contains elements which contains a node of element i + listElements.clear(); + for(int l=indC[kk-1];lgetValueIJ(elem,1); + if( vol != 0. ){ + sigmaV += 1./vol; + for(int l=1;l<=NumberOfComponents;l++) + val[l-1] += myDField->getValueIJ(elem,l)/vol; + } + } + for(int l=1;l<=NumberOfComponents;l++) + newDField->setValueIJ(k,l,val[l-1]/sigmaV); + } + } + delete [] val; + int id = newDField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI); + newDField->write(id); + delete newSup; + delete newDField; + cout << " * Iteration "< *myIField = (MEDMEM::FIELD*)myField; + FIELD *newIField = new FIELD(newSup,NumberOfComponents); + newIField->setName(myField->getName()); + newIField->setIterationNumber(FieldIteration[j].dt); + newIField->setOrderNumber(FieldIteration[j].it); + newIField->setTime(myIField->getTime()); + double *val = new double[NumberOfComponents]; + if( newSup->isOnAllElements() ){ + for (int k=1; kgetValueIJ(elem,1); + if( vol != 0. ){ + sigmaV += 1./vol; + for(int l=1;l<=NumberOfComponents;l++) + val[l-1] += ((double)myIField->getValueIJ(elem,l))/vol; + } + } + for(int l=1;l<=NumberOfComponents;l++) + newIField->setValueIJ(k,l,(int)(val[l-1]/sigmaV)); + } + } + else{ + const int *numb = newSup->getNumber(MED_ALL_ELEMENTS); + for (int k=1; k<=NumberOfNodes; k++){ + int kk = numb[k-1]; + // listElements contains elements which contains a node of element i + listElements.clear(); + for(int l=indC[kk-1];lgetValueIJ(elem,1); + if( vol != 0. ){ + sigmaV += 1./vol; + for(int l=1;l<=NumberOfComponents;l++) + val[l-1] += myIField->getValueIJ(elem,l)/vol; + } + } + for(int l=1;l<=NumberOfComponents;l++) + newIField->setValueIJ(k,l,(int)(val[l-1]/sigmaV)); + } + } + delete [] val; + int id = newIField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI); + newIField->write(id); + delete newSup; + delete newIField; + cout << " * Iteration "<