]> SALOME platform Git repositories - modules/homard.git/commitdiff
Salome HOME
Merge branch 'V9_12_BR'
authorjfa <jfa@opencascade.com>
Sat, 13 Jan 2024 00:06:22 +0000 (00:06 +0000)
committerjfa <jfa@opencascade.com>
Sat, 13 Jan 2024 00:06:22 +0000 (00:06 +0000)
src/tests/Test/CMakeLists.txt
src/tests/Test/CTestTestfileInstall.cmake
src/tests/Test/test_2d_1d_mesh.py [new file with mode: 0644]
src/tool/AP_Conversion/pcmano.F
src/tool/ES_HOMARD/esecen.F
src/tool/ES_MED/esemm1.F
src/tool/Utilitaire/utad05.F

index 08bb134970a8fff99b152ac5b961857f120cdf60..cb620a85c23e9e5a6f39122a010e5116a1f43c24 100644 (file)
@@ -32,6 +32,7 @@ SET(HOMARD_TEST_FILES
   tutorial_5.py
   tutorial_6.py
   test_util.py
+  test_2d_1d_mesh.py
 )
 
 INSTALL(FILES ${HOMARD_TEST_FILES}
@@ -39,4 +40,4 @@ INSTALL(FILES ${HOMARD_TEST_FILES}
 
 INSTALL(FILES CTestTestfileInstall.cmake
         DESTINATION ${SALOME_HOMARD_INSTALL_TEST}
-        RENAME CTestTestfile.cmake)
\ No newline at end of file
+        RENAME CTestTestfile.cmake)
index 0e1eafcb2e0598b1491c00b938d9002ac37732ac..1618d8de1f15db5f20dfa0ea87c23083e8733325 100644 (file)
@@ -36,6 +36,7 @@ tutorial_3
 tutorial_4
 tutorial_5
 tutorial_6
+test_2d_1d_mesh
 )
 
 FOREACH(tfile ${HOMARD_TEST_FILES})
diff --git a/src/tests/Test/test_2d_1d_mesh.py b/src/tests/Test/test_2d_1d_mesh.py
new file mode 100644 (file)
index 0000000..a1ac556
--- /dev/null
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+
+###
+### This file is generated automatically by SALOME v9.11.0 with dump python functionality
+###
+
+import sys
+import salome
+from os import path
+import shutil
+from MEDLoader import *
+
+salome.salome_init()
+import salome_notebook
+notebook = salome_notebook.NoteBook()
+
+import tempfile
+tmp_folder = tempfile.mkdtemp()
+print("Temporary folder", tmp_folder)
+
+# Create mesh
+mesh_name = "mesh"
+
+arr = DataArrayDouble(list(range(10)))
+mesh = MEDCouplingUMesh(mesh_name, 1)
+
+
+coords = [0.,0., 1.,0., 2.,0., 3.,0., 4.,0., 5.,0., 6.,0., 7.,0.]
+
+mesh.allocateCells(7)
+
+for i in range(7):
+    mesh.insertNextCell(NORM_SEG2, [i,i+1])
+
+mesh.finishInsertingCells()
+
+coordsArr=DataArrayDouble(coords, len(coords)//2, 2)
+
+mesh.setCoords(coordsArr)
+mesh.setMeshDimension(2)
+
+mesh_file = path.join(tmp_folder, "mesh_2d_1d.med")
+#mesh_file = "mesh_2d_1d.med"
+
+WriteMesh(mesh_file, mesh, True)
+print("mesh_file ", mesh_file)
+
+###
+### HOMARD component
+###
+
+import HOMARD
+homard = salome.lcc.FindOrLoadComponent('FactoryServer','HOMARD')
+homard.UpdateStudy()
+#
+# Creation of the hypotheses
+# ==========================
+# Creation of the hypothesis Hypo_1
+Hypo_1 = homard.CreateHypothesis("Hypo_1")
+Hypo_1.SetUnifRefinUnRef(1)
+#
+# Creation of the cases
+# =====================
+# Creation of the case Case_1
+Case_1 = homard.CreateCase("Case_1", mesh_name, mesh_file)
+Case_1.SetDirName(tmp_folder)
+Case_1.SetConfType(0)
+Case_1.SetExtType(0)
+#
+# Creation of the iterations
+# ==========================
+# Creation of the iteration Iter_1
+Iter_1 = Case_1.NextIteration("Iter_1")
+Iter_1.AssociateHypo("Hypo_1")
+Iter_1.SetMeshName(mesh_name)
+refined_mesh = path.join(tmp_folder, "maill.01.med")
+Iter_1.SetMeshFile(refined_mesh)
+print("refined_mesh ", refined_mesh)
+codret = Iter_1.Compute(1, 1)
+
+ref_mesh = ReadUMeshFromFile(refined_mesh)
+coords = ref_mesh.getCoords()
+y_coords = coords.getValues()[1::2]
+
+## Checking that Y values are still zeros
+assert all([val<1e-8 for val in y_coords]), y_coords
+
+shutil.rmtree(tmp_folder)
index 4080530353a1da759ea67ff1e757c1a319af03e2..68086f261058d7f00218c122ed315a0138bae898 100644 (file)
@@ -302,6 +302,11 @@ c
           lenolo = nnosho(lenoeu)
           coonca(lenoeu,1) = coonoe(lenolo,1)
   221   continue
+        if(dimcst.eq.2) then
+          do 2223 , lenoeu = 1 , nbnoto
+            coonca(lenoeu,2) = 0.d0
+ 2223     continue
+        endif
 c
       elseif ( sdim.eq.2 ) then
 c
index 430ed3f5bafd8ea8468358f5ddb9209bbda40925..302093c52769194c40e1d1729d3d38d5bd167d17 100644 (file)
@@ -130,7 +130,7 @@ c
       texte(1,5) = '(/,''... '',a)'
 c
       texte(2,4) = '(''. Writings of meshes.'')'
-      texte(2,4) = '(/,''... '',a)'
+      texte(2,5) = '(/,''... '',a)'
 c
 #include "impr03.h"
 c
index 45ac3fca4e889a98a998b63fd2d15723f3ef2167..288adb607e045084fce4cf4b727ff9fa6d677721 100644 (file)
@@ -947,7 +947,9 @@ c                 12345678901234567890123456789012
       endif
 #ifdef _DEBUG_HOMARD_
       write (ulsort,texte(langue,3)) 'UTINMA', nompro
+      write (ulsort,'(A)') 'TEST2'
 #endif
+      write (ulsort,'(A)') 'TEST'
       call utinma ( iaux, saux32,
      >              sdimca, mdimca, degre,
      >              nbnoto, jaux, jaux, jaux,
index 8eecea448e3496cdff37b99aff6a79e2d3b71082..fbba31947ddf011dfa3776cd961eca9f9e3f06d8 100644 (file)
@@ -126,7 +126,7 @@ c
       texte(1,10) = '(''Nouveau nombre de noeuds : '',i10)'
 c
       texte(2,4) = '(''Adresses for nodes'')'
-      texte(2,6) = '(''Error codes'',20i3)'
+      texte(2,8) = '(''Error codes'',20i3)'
       texte(2,9) = '(''Old number of nodes : '',i10)'
       texte(2,10) = '(''New number of nodes : '',i10)'
 c