cohérence des tests sur MG_Adapt

This commit is contained in:
GERALD NICOLAS 2021-02-16 09:01:50 +01:00
parent ec94d246d7
commit 5ba7997f9e
3 changed files with 1 additions and 69 deletions

View File

@ -1,68 +0,0 @@
# Remeshing with MG-Adapt
import os
import salome
salome.salome_init()
import SMESH
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
# directory
rootdir = ...
# Test 1 : remeshing with a local size, surface
#--- Creation of the object for the adaptation ---
objet_adapt = smesh.Adaptation('MG_Adapt')
#--- Initial mesh ---
objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.01.med"))
#--- Final mesh ---
objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.01.adapt.med"))
#--- Creation of the hypothesis ---
hypo = smesh.CreateAdaptationHypothesis()
# Options
hypo.setSizeMapType('Local')
hypo.setSizeMapFieldName('TAILLE')
hypo.setTimeStepRankLast()
hypo.setOptionValue("adaptation", "surface")
#--- Link between hypothesis and object ---
objet_adapt.AddHypothesis(hypo)
#--- Compute without publication
err = objet_adapt.Compute(False)
#--- Clean
del objet_adapt
# Test 2 : remeshing with a background size, volume
#--- Creation of the object for the adaptation ---
objet_adapt = smesh.Adaptation('MG_Adapt')
#--- Initial mesh ---
objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.02.med"))
#--- Background mesh ---
objet_adapt.setMEDFileBackground(rootdir, "maill.size.02.med"))
#--- Final mesh ---
objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.02.adapt.med"))
#--- Creation of the hypothesis ---
hypo = smesh.CreateAdaptationHypothesis()
# Options
hypo.setSizeMapType('Background')
hypo.setSizeMapFieldName('TAILLE')
hypo.setTimeStepRank(1,1)
hypo.setOptionValue("adaptation", "both")
#--- Link between hypothesis and object ---
objet_adapt.AddHypothesis(hypo)
#--- Compute without publication
err = objet_adapt.Compute(False)
#--- Clean
del objet_adapt

View File

@ -45,6 +45,7 @@ SET(BAD_TESTS
radial_prism_3d_algo.py
test_smeshplugin_mg_tetra_parallele.py
test_smeshplugins.py
MGAdaptTests_without_session.py
)
SET(GOOD_TESTS
@ -188,7 +189,6 @@ SET(GOOD_TESTS
set(SESSION_FREE_TESTS
basic_geom_smesh_without_session.py
basic_shaper_smesh_without_session.py
MGAdaptTests.py
)
SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} ${SESSION_FREE_TESTS} testme.py)