This commit is contained in:
parent
9e9ca9b7a0
commit
fb00505ed9
@ -1,77 +0,0 @@
|
|||||||
From 60ca94d7c2ff070631189216d2991ea8d59f80c7 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()
|
|
||||||
|
|
||||||
---
|
|
||||||
src/Mod/Fem/femmesh/femmesh2mesh.py | 4 ++--
|
|
||||||
src/Mod/Fem/femsolver/calculix/writer.py | 4 ++--
|
|
||||||
src/Mod/Fem/femsolver/z88/writer.py | 4 ++--
|
|
||||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/Mod/Fem/femmesh/femmesh2mesh.py b/src/Mod/Fem/femmesh/femmesh2mesh.py
|
|
||||||
index 52303f4f5de..9a3750e1468 100644
|
|
||||||
--- a/src/Mod/Fem/femmesh/femmesh2mesh.py
|
|
||||||
+++ b/src/Mod/Fem/femmesh/femmesh2mesh.py
|
|
||||||
@@ -92,7 +92,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 = {}
|
|
||||||
|
|
||||||
@@ -196,7 +196,7 @@ 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()
|
|
||||||
FreeCAD.Console.PrintMessage(
|
|
||||||
"Mesh by surface search method: {}\n".format(end_time - start_time)
|
|
||||||
)
|
|
||||||
diff --git a/src/Mod/Fem/femsolver/calculix/writer.py b/src/Mod/Fem/femsolver/calculix/writer.py
|
|
||||||
index 72abff35a92..42acd7b282e 100644
|
|
||||||
--- a/src/Mod/Fem/femsolver/calculix/writer.py
|
|
||||||
+++ b/src/Mod/Fem/femsolver/calculix/writer.py
|
|
||||||
@@ -97,7 +97,7 @@ def __init__(
|
|
||||||
)
|
|
||||||
|
|
||||||
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))
|
|
||||||
FreeCAD.Console.PrintLog(
|
|
||||||
@@ -115,7 +115,7 @@ def write_calculix_input_file(self):
|
|
||||||
self.write_calculix_one_input_file()
|
|
||||||
writing_time_string = (
|
|
||||||
"Writing time CalculiX input file: {} seconds"
|
|
||||||
- .format(round((time.clock() - timestart), 2))
|
|
||||||
+ .format(round((time.process_time() - timestart), 2))
|
|
||||||
)
|
|
||||||
if self.femelement_count_test is True:
|
|
||||||
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")
|
|
||||||
diff --git a/src/Mod/Fem/femsolver/z88/writer.py b/src/Mod/Fem/femsolver/z88/writer.py
|
|
||||||
index 57ac8be2f62..40229fd53e7 100644
|
|
||||||
--- a/src/Mod/Fem/femsolver/z88/writer.py
|
|
||||||
+++ b/src/Mod/Fem/femsolver/z88/writer.py
|
|
||||||
@@ -92,7 +92,7 @@ def __init__(
|
|
||||||
)
|
|
||||||
|
|
||||||
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:
|
|
||||||
@@ -109,7 +109,7 @@ def write_z88_input(self):
|
|
||||||
self.write_z88_solver_parameter()
|
|
||||||
writing_time_string = (
|
|
||||||
"Writing time input file: {} seconds"
|
|
||||||
- .format(round((time.clock() - timestart), 2))
|
|
||||||
+ .format(round((time.process_time() - timestart), 2))
|
|
||||||
)
|
|
||||||
FreeCAD.Console.PrintMessage(writing_time_string + " \n\n")
|
|
||||||
return self.dir_name
|
|
Loading…
x
Reference in New Issue
Block a user