From 7b3d1204fab4277ee2a9b24872bc7af4757a9ea0 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 3 Jul 2020 07:29:31 +0200 Subject: [PATCH] easier to use --- python/damask/_result.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/damask/_result.py b/python/damask/_result.py index 6c3e751f1..205b3a0f8 100644 --- a/python/damask/_result.py +++ b/python/damask/_result.py @@ -466,6 +466,11 @@ class Result: return f[self.get_dataset_location('orientation')[0]].attrs['Lattice'].astype('str') # np.bytes_ to string + def enable_user_function(self,func): + globals()[func.__name__]=func + print(f'Function {func.__name__} enabled in add_calculation.') + + def read_dataset(self,path,c=0,plain=False): """ Dataset for all points/cells.