From 81be62cae56f33ba2de631159b6005a1031ae8a7 Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Wed, 22 Apr 2020 07:48:50 +0200 Subject: [PATCH] FEM: ccx writer, splitted inp file, code improvements, but no changes in file writing --- src/Mod/Fem/femsolver/calculix/writer.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index c1671aee3ae3..d4eb11620af4 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -106,8 +106,7 @@ def write_calculix_one_input_file(self): # mesh self.femmesh.writeABAQUS(self.file_name, 1, False) - - # reopen file with "append" and add the analysis definition + # reopen file with "append" and add all the rest inpfile = codecs.open(self.file_name, "a", encoding="utf-8") inpfile.write("\n\n") @@ -173,22 +172,12 @@ def write_calculix_one_input_file(self): def write_calculix_splitted_input_file(self): - # mesh - # reopen file with "append" and add the analysis definition - # first open file with "write" to ensure - # that each new iteration of writing of inputfile starts in new file - # first open file with "write" to ensure - # that the .writeABAQUS also writes in inputfile - inpfileMain = open(self.file_name, "w") - inpfileMain.close() - inpfileMain = open(self.file_name, "a") - inpfileMain.write("\n\n") - - # write nodes and elements name = self.file_name[:-4] include_name = self.main_file_name[:-4] # mesh + inpfileMain = open(self.file_name, "w", encoding="utf-8") + inpfileMain.write("\n\n") inpfileMain.write("\n***********************************************************\n") inpfileMain.write("**Nodes and Elements\n") inpfileMain.write("** written by femmesh.writeABAQUS\n")