]> SALOME platform Git repositories - tools/paravisaddons_common.git/commitdiff
Salome HOME
[EDF24091] : Use of area per cell field was missing in computation of Force in Torseu... V9_8_0a1 V9_8_0a2 V9_8_0b1
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 22 Sep 2021 07:04:00 +0000 (09:04 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 22 Sep 2021 07:04:00 +0000 (09:04 +0200)
src/TorseurCIH/Test.py
src/TorseurCIH/plugin/TorseurCIHModule/vtkTorseurCIH.cxx

index dfff8c4ec653f0efdf73c1bf772381fd33c9e885..efbf7ec69356e2ac80c8b3ddf6526496a7aeb0c7 100644 (file)
@@ -40,11 +40,16 @@ def fff(initialVect,normalFace,OM,area_field):
     for expo in range(5):
         pos,p,v = fffff(initialVect,normalFace,OM,area_field,[pos+i*(10**-expo) for i in range(-9,10)])
     return pos,p,v
-    
-fname = "slice.med"
+
+"""
+EDF24091 : probleme de calcul dans TorseurCIH
+"""
+
+fname = "Case_22_09_21.med"
+fieldName = "LIN_____SIEF_NOEU"
 mm=MEDFileMesh.New(fname)
 m=mm[0]
-f1ts = MEDFileField1TS(fname,"RESUME__SIEF_NOEU")
+f1ts = MEDFileField1TS(fname,fieldName)
 f = f1ts.field(mm)
 m = f.getMesh()
 area_field = m.getMeasureField(True)
@@ -69,6 +74,7 @@ F_y = matrix[:,3]*eqn[:,0] + matrix[:,1]*eqn[:,1] + matrix[:,5]*eqn[:,2]
 F_z = matrix[:,4]*eqn[:,0] + matrix[:,5]*eqn[:,1] + matrix[:,2]*eqn[:,2]
 #
 F = DataArrayDouble.Meld([F_x,F_y,F_z])
+F[:] *= area_vector
 #
 ZeForce = DataArrayDouble(F.accumulate(),1,3)
 normalFace = DataArrayDouble(eqn.accumulate(),1,3)
@@ -120,3 +126,5 @@ f.setArray(new_dist_to_base_X)
 f.setName("dist")
 f.writeVTK("distEig.vtu")"""
 #mat*w[:,0]
+
+print("{:g}".format(ForceNormale[0,0]))
index 9ac9f26ba214562506005fff7e7882c9ed21e8ad..f9f43b93dd028e0ab5d9273c7338775f4ecbeb45 100644 (file)
@@ -702,7 +702,10 @@ vtkSmartPointer<vtkTable> ComputeTorseurCIH(vtkUnstructuredGrid* usgIn)
     F_y = ForceBuilder({ 3, 1, 5 }, matrix, eqn);
     F_z = ForceBuilder({ 4, 5, 2 }, matrix, eqn);
   }
+  //
+  //
   MCAuto<DataArrayDouble> F(DataArrayDouble::Meld({ F_x, F_y, F_z }));
+  F->multiplyEqual(area_vector);
   double ZeForce[3], normalFace[3];
   F->accumulate(ZeForce);
   eqn->accumulate(normalFace);