Skip to content

Commit

Permalink
FEM: ccx writer, splitted inp file, code improvements, but no changes…
Browse files Browse the repository at this point in the history
… in file writing
  • Loading branch information
berndhahnebach committed Apr 22, 2020
1 parent 25e3004 commit 81be62c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/Mod/Fem/femsolver/calculix/writer.py
Expand Up @@ -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")

Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 81be62c

Please sign in to comment.