1 # Remeshing with MG-Adapt
7 from salome.smesh import smeshBuilder
8 smesh = smeshBuilder.New()
13 # Test 1 : remeshing with a local size, surface
14 #--- Creation of the object for the adaptation ---
15 objet_adapt = smesh.Adaptation('MG_Adapt')
18 objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.01.med"))
20 objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.01.adapt.med"))
22 #--- Creation of the hypothesis ---
23 hypo = smesh.CreateAdaptationHypothesis()
25 hypo.setSizeMapType('Local')
26 hypo.setSizeMapFieldName('TAILLE')
27 hypo.setTimeStepRankLast()
28 hypo.setOptionValue("adaptation", "surface")
30 #--- Link between hypothesis and object ---
31 objet_adapt.AddHypothesis(hypo)
33 #--- Compute without publication
34 err = objet_adapt.Compute(False)
41 # Test 2 : remeshing with a background size, volume
42 #--- Creation of the object for the adaptation ---
43 objet_adapt = smesh.Adaptation('MG_Adapt')
46 objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.02.med"))
47 #--- Background mesh ---
48 objet_adapt.setMEDFileBackground(rootdir, "maill.size.02.med"))
50 objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.02.adapt.med"))
52 #--- Creation of the hypothesis ---
53 hypo = smesh.CreateAdaptationHypothesis()
55 hypo.setSizeMapType('Background')
56 hypo.setSizeMapFieldName('TAILLE')
57 hypo.setTimeStepRank(1,1)
58 hypo.setOptionValue("adaptation", "both")
60 #--- Link between hypothesis and object ---
61 objet_adapt.AddHypothesis(hypo)
63 #--- Compute without publication
64 err = objet_adapt.Compute(False)