def writeMAPinput(dictValeur, filename):
"""
"""
- #print("je rentre dans writeMAPinput")
- #print (dictValeur)
- #print("-"*80)
config = RawConfigParser()
config.add_section("c_solver_constitutive_law_0d")
if dictValeur["constitutive_law_parameters_status"]=="Existing":
filename = os.path.abspath(os.path.splitext(filename)[0] + ".input")
with open(filename,'w') as f_out :
config.write(f_out)
- print("je sauvegarde les inputs dans " + filename)
- #os.system("head " + filename)
+ print("Saving MAP input into " + filename)
def writeXMLmaterialparameters(param_dico, output_filename=None):
"""
"""
- #print("je rentre dans writeXMLmaterialparameters")
-
param_list = ParametersList()
param_list.add_law(param_dico["Parameters"]["constitutive_law_formulation"])
if param_dico["Parameters"].has_key("Description"):
os.getenv('OLDPWD'), param_dico["constitutive_law_parameters_new"])
writer = ParametersListWriter(output_filename)
writer.write(param_list)
- print("je sauvegarde les parametres dans " + output_filename)
+ print("Saving material parameters into " + output_filename)
def writeXMLexperiences(exp_dico, output_filename=None):
"""
"""
- #print("je rentre dans writeXMLexperiences")
- #for i, j in exp_dico.iteritems():
- #print(i,j)
root = ET.Element("Experiences")
root.set("map-version", getVersion())
for iel in [iel for iel in exp_dico["Experiences"].values()
if isinstance(iel, dict)]:
- #print("."*80)
- #for i, j in iel.iteritems():
- #print(i,j)
exp = ET.SubElement(root, "Experience")
exp.set("name", iel["ExperienceName"])
exp.set("type", iel["Type"])
os.getenv('OLDPWD'), exp_dico["exp_filename_list_new"])
xmlstr = minidom.parseString(ET.tostring(root)).toprettyxml(indent=" ")
- #print xmlstr
+
with open(output_filename,'w') as f_out :
f_out.write(xmlstr)
- print("je sauvegarde le plan d'experience dans " + output_filename)
+ print("Saving experimental plan into " + output_filename)
def add_source(root, iel, section_name, var_name):
source_elem.text = str(var["Variable"]["b_source_value"]["Value"])
def run(listeParam):
- os.chdir(os.getenv('OLDPWD'))
+ if os.getenv('OLDPWD'):
+ os.chdir(os.getenv('OLDPWD'))
listeParam[0].saveFile()
command = "map -r sappli run -n c_solver_constitutive_law_0d -i "
command += os.path.splitext(listeParam[0].fichier)[0]+".input"
# - appelable depuis un item valide uniquement
# - toolTip
dict_commandes={
- 'MAP_input_file':((run,"run",('editor',),False,True,"lance run"),),
+ 'MAP_input_file':((run, "run", ('editor',) ,False, True, "lance run"),),
}