]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
WIP
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 23 Jan 2023 16:38:24 +0000 (17:38 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 23 Jan 2023 16:38:24 +0000 (17:38 +0100)
src/MEDCoupling/MEDCouplingFieldDiscretization.cxx

index 3847853662f3a42eb09654746b94a723d4c17baf..bf1397a4c053e0b394913cf62206f0df1f47c007 100755 (executable)
@@ -30,6 +30,7 @@
 #include "InterpKernelAutoPtr.hxx"
 #include "InterpKernelGaussCoords.hxx"
 #include "InterpKernelMatrixTools.hxx"
+#include "InterpKernelDenseMatrix.hxx"
 
 #include <set>
 #include <list>
@@ -1752,6 +1753,18 @@ MEDCouplingFieldDouble *MEDCouplingFieldDiscretizationGauss::getMeasureField(con
             umesh->getNodeIdsOfCell(*cellId,conn);
             std::vector<double> ptsInCell; ptsInCell.reserve(conn.size()*loc.getDimension());
             std::for_each( conn.cbegin(), conn.cend(), [coordsOfMesh,&ptsInCell](mcIdType c) { ptsInCell.insert(ptsInCell.end(),coordsOfMesh+c*2,coordsOfMesh+(c+1)*2); } );
+            std::size_t nbPtsInCell(ptsInCell.size()/3);
+            INTERP_KERNEL::DenseMatrix jacobian(2,2);
+            MCAuto<DataArrayDouble> shapeFunc = loc.getDerivativeOfShapeFunctionValues();
+            for(std::size_t i = 0 ; i < 2 ; ++i)
+              for(std::size_t j = 0 ; j < 2 ; ++j)
+              {
+                double res = 0.0;
+                for( std::size_t k = 0 ; k < nbPtsInCell ; ++k )
+                  res += ptsInCell[k*2+i] * shapeFunc->getIJ(0,2*k+j);
+                jacobian[ i ][ j ] = res;
+              }
+
 
             for(mcIdType j=0;j<nbOfGaussPt;j++)
               arrPtr[offsetPtr[*cellId]+j]=weights[j];//*volPtr[*cellId]