]> SALOME platform Git repositories - modules/filter.git/commitdiff
Salome HOME
Fix compilation errors on Mandrake.
authorsmh <smh@opencascade.com>
Thu, 3 May 2007 12:04:47 +0000 (12:04 +0000)
committersmh <smh@opencascade.com>
Thu, 3 May 2007 12:04:47 +0000 (12:04 +0000)
src/FILTER/Makefile.in
src/FILTER/field2nodes.cxx

index ab2e256f93c2469c9d82754d9d352ca30e2c4c64..f3a642843ae8771006a7b086e994bb69520bccc0 100644 (file)
@@ -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
 
index b6c275812d9394694ca172bf12484dcc666e69e7..95f206f900d219d8b7c44f0bc1614356b0fed7ee 100644 (file)
@@ -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<int> myList;
-           for(int k=0;k<nbe;k++){
-             myList.push_back(numb[k]);
-             supset.insert(numb[k]);
-           }
-           newSup = mesh->buildSupportOnNodeFromElementList(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<int> myList;
+              for(int k=0;k<nbe;k++){
+                myList.push_back(numb[k]);
+                supset.insert(numb[k]);
+              }
+              newSup = mesh->buildSupportOnNodeFromElementList(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;k<NumberOfMeshes;k++)
-           if(strcmp(mesh->getName().c_str(),MeshName[k].c_str())==0)
-             ivol = k;
-         if( volume[ivol] == NULL )
-           volume[ivol] = myField->getSupport()->getMesh()->getVolume(myField->getSupport());
-         if (dynamic_cast<MEDMEM::FIELD<double>*>(myField)){
-           FIELD<double> *myDField = (MEDMEM::FIELD<double>*)myField;
-           FIELD<double> *newDField = new FIELD<double>(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; k<NumberOfNodes+1; k++){
-               // listElements contains elements which contains a node of element i
-               listElements.clear();
-               for(int l=indC[k-1];l<indC[k];l++){
-                 // c element contains node k
-                 int c=revC[l-1];
-                 listElements.insert(c);
-               }
-               
-               // calculate field value on node k 
-               double sigmaV = 0.;
-               for(int l=0;l<NumberOfComponents;l++)
-                 val[l] = 0.;
-               for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
-                 int elem = *elemIt;
-                 double vol = volume[ivol]->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];l<indC[kk];l++){
-                 // c element contains node k
-                 int c=revC[l-1];
-                 // add c element only if it is in partial support
-                 ssIt = supset.find(c);
-                 if(ssIt!=supset.end())
-                   listElements.insert(c);
-               }
-               
-               // calculate field value on node k 
-               double sigmaV = 0.;
-               for(int l=0;l<NumberOfComponents;l++)
-                 val[l] = 0.;
-               for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
-                 int elem = *elemIt;
-                 double vol = volume[ivol]->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);
-             }
-           }
-           delete [] val;
-           int id = newDField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI);
-           newDField->write(id);
-           delete newSup;
-           delete newDField;
-           cout << "    * Iteration "<<FieldIteration[j].dt<<" and  order number "<<FieldIteration[j].it<<" ) is written !" << endl;
-         }
-         else{
-           FIELD<int> *myIField = (MEDMEM::FIELD<int>*)myField;
-           FIELD<int> *newIField = new FIELD<int>(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; k<NumberOfNodes+1; k++){
-               // listElements contains elements which contains a node of element i
-               listElements.clear();
-               for(int l=indC[k-1];l<indC[k];l++){
-                 // c element contains node i
-                 int c=revC[l-1];
-                 listElements.insert(c);
-               }
+            // 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;k<NumberOfMeshes;k++)
+              if(strcmp(mesh->getName().c_str(),MeshName[k].c_str())==0)
+                ivol = k;
+            if( volume[ivol] == NULL )
+              volume[ivol] = myField->getSupport()->getMesh()->getVolume(myField->getSupport());
+            if (dynamic_cast<MEDMEM::FIELD<double>*>(myField)){
+              FIELD<double> *myDField = (MEDMEM::FIELD<double>*)myField;
+              FIELD<double> *newDField = new FIELD<double>(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; k<NumberOfNodes+1; k++){
+                  // listElements contains elements which contains a node of element i
+                  listElements.clear();
+                  for(int l=indC[k-1];l<indC[k];l++){
+                    // c element contains node k
+                    int c=revC[l-1];
+                    listElements.insert(c);
+                  }
 
-               // calculate field value on node k 
-               double sigmaV = 0.;
-               for(int l=0;l<NumberOfComponents;l++)
-                 val[l] = 0.;
-               for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
-                 int elem = *elemIt;
-                 double vol = volume[ivol]->getValueIJ(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];l<indC[kk];l++){
-                 // c element contains node k
-                 int c=revC[l-1];
-                 // add c element only if it is in partial support
-                 ssIt = supset.find(c);
-                 if(ssIt!=supset.end())
-                   listElements.insert(c);
-               }
-               
-               // calculate field value on node k 
-               double sigmaV = 0.;
-               for(int l=0;l<NumberOfComponents;l++)
-                 val[l] = 0.;
-               for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
-                 int elem = *elemIt;
-                 double vol = volume[ivol]->getValueIJ(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 "<<FieldIteration[j].dt<<" and  order number "<<FieldIteration[j].it<<" ) is written !" << endl;
-         }
+                  // calculate field value on node k 
+                  double sigmaV = 0.;
+                  for(int l=0;l<NumberOfComponents;l++)
+                    val[l] = 0.;
+                  for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
+                    int elem = *elemIt;
+                    double vol = volume[ivol]->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];l<indC[kk];l++){
+                    // c element contains node k
+                    int c=revC[l-1];
+                    // add c element only if it is in partial support
+                    ssIt = supset.find(c);
+                    if(ssIt!=supset.end())
+                      listElements.insert(c);
+                  }
+
+                  // calculate field value on node k 
+                  double sigmaV = 0.;
+                  for(int l=0;l<NumberOfComponents;l++)
+                    val[l] = 0.;
+                  for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
+                    int elem = *elemIt;
+                    double vol = volume[ivol]->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);
+                }
+              }
+              delete [] val;
+              int id = newDField->addDriver(MED_DRIVER,filenameOUT,FieldName[i],MED_EN::MED_ECRI);
+              newDField->write(id);
+              delete newSup;
+              delete newDField;
+              cout << "    * Iteration "<<FieldIteration[j].dt<<" and  order number "<<FieldIteration[j].it<<" ) is written !" << endl;
+            }
+            else{
+              FIELD<int> *myIField = (MEDMEM::FIELD<int>*)myField;
+              FIELD<int> *newIField = new FIELD<int>(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; k<NumberOfNodes+1; k++){
+                  // listElements contains elements which contains a node of element i
+                  listElements.clear();
+                  for(int l=indC[k-1];l<indC[k];l++){
+                    // c element contains node i
+                    int c=revC[l-1];
+                    listElements.insert(c);
+                  }
+
+                  // calculate field value on node k 
+                  double sigmaV = 0.;
+                  for(int l=0;l<NumberOfComponents;l++)
+                    val[l] = 0.;
+                  for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
+                    int elem = *elemIt;
+                    double vol = volume[ivol]->getValueIJ(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];l<indC[kk];l++){
+                    // c element contains node k
+                    int c=revC[l-1];
+                    // add c element only if it is in partial support
+                    ssIt = supset.find(c);
+                    if(ssIt!=supset.end())
+                      listElements.insert(c);
+                  }
+
+                  // calculate field value on node k 
+                  double sigmaV = 0.;
+                  for(int l=0;l<NumberOfComponents;l++)
+                    val[l] = 0.;
+                  for(elemIt=listElements.begin();elemIt!=listElements.end();elemIt++){
+                    int elem = *elemIt;
+                    double vol = volume[ivol]->getValueIJ(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 "<<FieldIteration[j].dt<<" and  order number "<<FieldIteration[j].it<<" ) is written !" << endl;
+            }
+          }
          break;
        case MED_FACE:
          cout << "*************************** CHAMP AUX FACES" << endl;