diff --git a/PRIVATE b/PRIVATE index c9eed7180..d8ab8056d 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit c9eed718041d098d7695871c1b123eae950b141d +Subproject commit d8ab8056d6245ce42bec8953de9af1d7754867cf diff --git a/lib/damask/config/material.py b/lib/damask/config/material.py index a56c5d976..b070e986f 100644 --- a/lib/damask/config/material.py +++ b/lib/damask/config/material.py @@ -267,3 +267,14 @@ class Material(): if newlen is not oldlen: print('Length of value was changed from %i to %i!'%(oldlen,newlen)) + def add_value(self, part=None, + section=None, + key=None, + value=None): + if not isinstance(value,list): + if not isinstance(value,str): + value = '%s'%value + value = [value] + print('adding %s:%s:%s with value %s '%(part.lower(),section.lower(),key.lower(),value)) + self.data[part.lower()][section.lower()][key.lower()] = value + self.data[part.lower()][section.lower()]['__order__'] += [key.lower()]