]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of RevIntegral management.
authorageay <ageay>
Tue, 9 Mar 2010 09:28:45 +0000 (09:28 +0000)
committerageay <ageay>
Tue, 9 Mar 2010 09:28:45 +0000 (09:28 +0000)
src/ParaMEDMEM/InterpolationMatrix.cxx
src/ParaMEDMEM/InterpolationMatrix.hxx

index 344e00b121c2f26d7998570ff647ecea084b7780..ffe839fc3c96ccb931f2747e82c9b3be17d8e1cc 100644 (file)
@@ -310,6 +310,14 @@ namespace ParaMEDMEM
       case IntegralGlobConstraint:
         computeGlobConstraintDenoW(elementLocator);
         break;
+      case RevIntegral:
+        {
+          if(!elementLocator.isM1DCorr())
+            computeRevIntegralDenoW(elementLocator);
+          else
+            computeConservVolDenoW(elementLocator);
+          break;
+        }
       default:
         throw INTERP_KERNEL::Exception("Not recognized nature of field. Change nature of Field.");
         break;
@@ -336,6 +344,14 @@ namespace ParaMEDMEM
         //this is not a bug doing like ConservativeVolumic
         computeConservVolDenoL(elementLocator);
         break;
+      case RevIntegral:
+        {
+          if(!elementLocator.isM1DCorr())
+            computeRevIntegralDenoL(elementLocator);
+          else
+            computeConservVolDenoL(elementLocator);
+          break;
+        }
       default:
         throw INTERP_KERNEL::Exception("Not recognized nature of field. Change nature of Field.");
         break;
@@ -388,6 +404,21 @@ namespace ParaMEDMEM
     source_triangle_surf->decrRef();
     _deno_reverse_multiply=_target_volume;
   }
+
+  void InterpolationMatrix::computeRevIntegralDenoW(ElementLocator& elementLocator)
+  {
+    _deno_multiply=_target_volume;
+    MEDCouplingFieldDouble *source_triangle_surf = _source_support->getMeasureField(getMeasureAbsStatus());
+    _deno_reverse_multiply.resize(_coeffs.size());
+    vector<vector<double> >::iterator iter6=_deno_reverse_multiply.begin();
+    const double *values=source_triangle_surf->getArray()->getConstPointer();
+    for(vector<vector<pair<int,double> > >::const_iterator iter4=_coeffs.begin();iter4!=_coeffs.end();iter4++,iter6++,values++)
+      {
+        (*iter6).resize((*iter4).size());
+        std::fill((*iter6).begin(),(*iter6).end(),*values);
+      }
+    source_triangle_surf->decrRef();
+  }
   
   /*!
    * Nothing to do because surface computation is on working side.
@@ -396,6 +427,14 @@ namespace ParaMEDMEM
   {
   }
 
+  /*!
+   * Nothing to do because surface computation is on working side.
+   */
+  void InterpolationMatrix::computeRevIntegralDenoL(ElementLocator& elementLocator)
+  {
+  }
+
+
   void InterpolationMatrix::computeGlobConstraintDenoW(ElementLocator& elementLocator)
   {
     computeGlobalColSum(_deno_multiply);
index e0dfceab320ccb74537db97881606d143a2ecc9c..1664fdb2a6fecb1f53740dadcaefe2e800f1e164 100644 (file)
@@ -53,9 +53,11 @@ namespace ParaMEDMEM
   private:
     void computeConservVolDenoW(ElementLocator& elementLocator);
     void computeIntegralDenoW(ElementLocator& elementLocator);
+    void computeRevIntegralDenoW(ElementLocator& elementLocator);
     void computeGlobConstraintDenoW(ElementLocator& elementLocator);
     void computeConservVolDenoL(ElementLocator& elementLocator);
     void computeIntegralDenoL(ElementLocator& elementLocator);
+    void computeRevIntegralDenoL(ElementLocator& elementLocator);
     
     void computeLocalColSum(std::vector<double>& res) const;
     void computeLocalRowSum(const std::vector<int>& distantProcs, std::vector<std::vector<int> >& resPerProcI,