Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2
FreeCAD
0001-fem-use-time.process_time-instead-of-remov...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-fem-use-time.process_time-instead-of-removed-time.cl.patch of Package FreeCAD
From 96af5fea1fab074e93011078974fd24fff1068f8 Mon Sep 17 00:00:00 2001 From: looooo <sppedflyer@gmail.com> Date: Tue, 14 Jan 2020 13:45:35 +0100 Subject: [PATCH] fem: use time.process_time instead of removed time.clock() [rebased on 0.18.4 branch] --- src/Mod/Fem/femmesh/femmesh2mesh.py | 4 ++-- src/Mod/Fem/femsolver/calculix/writer.py | 9 +++++++-- src/Mod/Fem/femsolver/z88/writer.py | 8 ++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/Mod/Fem/femmesh/femmesh2mesh.py b/src/Mod/Fem/femmesh/femmesh2mesh.py index 9c0b4f1b9..e6159f2c7 100644 --- a/src/Mod/Fem/femmesh/femmesh2mesh.py +++ b/src/Mod/Fem/femmesh/femmesh2mesh.py @@ -90,7 +90,7 @@ def femmesh_2_mesh(myFemMesh, myResults=None): # This code generates a dict and a faceCode for each face of all elements # All faceCodes are than sorted. - start_time = time.clock() + start_time = time.process_time() faceCodeList = [] faceCodeDict = {} @@ -194,6 +194,6 @@ def femmesh_2_mesh(myFemMesh, myResults=None): output_mesh.extend(triangle) # print('my 2. triangle: ', triangle) - end_time = time.clock() + end_time = time.process_time() print('Mesh by surface search method: ', end_time - start_time) return output_mesh diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py index e9d9e9bae..33302cefa 100644 --- a/src/Mod/Fem/femsolver/calculix/writer.py +++ b/src/Mod/Fem/femsolver/calculix/writer.py @@ -69,12 +69,17 @@ class FemInputWriterCcx(FemInputWriter.FemInputWriter): FreeCAD.Console.PrintMessage('FemInputWriterCcx --> self.file_name --> ' + self.file_name + '\n') def write_calculix_input_file(self): - timestart = time.clock() + timestart = time.process_time() + FreeCAD.Console.PrintMessage("Start writing CalculiX input file\n") + FreeCAD.Console.PrintMessage("Write ccx input file to: {}\n".format(self.file_name)) if self.solver_obj.SplitInputWriter is True: self.write_calculix_splitted_input_file() else: self.write_calculix_one_input_file() - writing_time_string = "Writing time input file: " + str(round((time.clock() - timestart), 2)) + " seconds" + writing_time_string = ( + "Writing time CalculiX input file: {} seconds" + .format(round((time.process_time() - timestart), 2)) + ) if self.femelement_count_test is True: FreeCAD.Console.PrintMessage(writing_time_string + ' \n\n') return self.file_name diff --git a/src/Mod/Fem/femsolver/z88/writer.py b/src/Mod/Fem/femsolver/z88/writer.py index e141ab9f0..cdcaff63b 100644 --- a/src/Mod/Fem/femsolver/z88/writer.py +++ b/src/Mod/Fem/femsolver/z88/writer.py @@ -61,7 +61,7 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter): FreeCAD.Console.PrintMessage('FemInputWriterZ88 --> self.file_name --> ' + self.file_name + '\n') def write_z88_input(self): - timestart = time.clock() + timestart = time.process_time() if not self.femnodes_mesh: self.femnodes_mesh = self.femmesh.Nodes if not self.femelement_table: @@ -76,7 +76,11 @@ class FemInputWriterZ88(FemInputWriter.FemInputWriter): self.write_z88_integration_properties() self.write_z88_memory_parameter() self.write_z88_solver_parameter() - FreeCAD.Console.PrintMessage("Writing time input file: " + str(time.clock() - timestart) + ' \n\n') + writing_time_string = ( + "Writing time input file: {} seconds" + .format(round((time.process_time() - timestart), 2)) + ) + FreeCAD.Console.PrintMessage(writing_time_string + " \n\n") return self.dir_name def set_z88_elparam(self): -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor