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)
38 # Test 2 : remeshing with a background size, volume
39 #--- Creation of the object for the adaptation ---
40 objet_adapt = smesh.Adaptation('MG_Adapt')
43 objet_adapt.setMEDFileIn(os.path.join(rootdir, "maill.02.med"))
44 #--- Background mesh ---
45 objet_adapt.setMEDFileBackground(rootdir, "maill.size.02.med"))
47 objet_adapt.setMEDFileOut(os.path.join(rootdir, "maill.02.adapt.med"))
49 #--- Creation of the hypothesis ---
50 hypo = smesh.CreateAdaptationHypothesis()
52 hypo.setSizeMapType('Background')
53 hypo.setSizeMapFieldName('TAILLE')
54 hypo.setTimeStepRank(1,1)
55 hypo.setOptionValue("adaptation", "both")
57 #--- Link between hypothesis and object ---
58 objet_adapt.AddHypothesis(hypo)
60 #--- Compute without publication
61 err = objet_adapt.Compute(False)