From 9160677ff330541e6c96fd0b2d6d4ca9933a07e3 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 14 Nov 2020 19:00:51 +0100 Subject: [PATCH] no need for special damask class (no action=extend) --- processing/post/addCompatibilityMismatch.py | 2 +- processing/post/addDisplacement.py | 2 +- processing/post/addSchmidfactors.py | 2 +- processing/pre/geom_fromDREAM3D.py | 2 +- processing/pre/geom_fromMinimalSurface.py | 2 +- processing/pre/geom_fromOsteonGeometry.py | 2 +- processing/pre/mentat_pbcOnBoxMesh.py | 38 ++++++++++----------- processing/pre/mentat_spectralBox.py | 2 +- processing/pre/seeds_fromDistribution.py | 2 +- processing/pre/seeds_fromPokes.py | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/processing/post/addCompatibilityMismatch.py b/processing/post/addCompatibilityMismatch.py index 0e7d3ea42..9a2bd1a5b 100755 --- a/processing/post/addCompatibilityMismatch.py +++ b/processing/post/addCompatibilityMismatch.py @@ -136,7 +136,7 @@ def shapeMismatch(size,F,nodes,centres): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ +parser = OptionParser(usage='%prog options [ASCIItable(s)]', description = """ Add column(s) containing the shape and volume mismatch resulting from given deformation gradient. Operates on periodic three-dimensional x,y,z-ordered data sets. diff --git a/processing/post/addDisplacement.py b/processing/post/addDisplacement.py index a6cff86ab..069d923e8 100755 --- a/processing/post/addDisplacement.py +++ b/processing/post/addDisplacement.py @@ -16,7 +16,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ +parser = OptionParser(usage='%prog options [ASCIItable(s)]', description = """ Add displacments resulting from deformation gradient field. Operates on periodic three-dimensional x,y,z-ordered data sets. Outputs at cell centers or cell nodes (into separate file). diff --git a/processing/post/addSchmidfactors.py b/processing/post/addSchmidfactors.py index 8f43308cb..10f2443be 100755 --- a/processing/post/addSchmidfactors.py +++ b/processing/post/addSchmidfactors.py @@ -98,7 +98,7 @@ slipSystems = { # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [ASCIItable(s)]', description = """ +parser = OptionParser(usage='%prog options [ASCIItable(s)]', description = """ Add columns listing Schmid factors (and optional trace vector of selected system) for given Euler angles. """, version = scriptID) diff --git a/processing/pre/geom_fromDREAM3D.py b/processing/pre/geom_fromDREAM3D.py index eca837455..eb4fe443e 100755 --- a/processing/pre/geom_fromDREAM3D.py +++ b/processing/pre/geom_fromDREAM3D.py @@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [DREAM.3Dfile(s)]', description = """ +parser = OptionParser(usage='%prog options [DREAM.3Dfile(s)]', description = """ Converts DREAM.3D file. Input can be cell data (direct pointwise takeover) or grain data (individual grains are segmented). Requires orientation data as quaternion. diff --git a/processing/pre/geom_fromMinimalSurface.py b/processing/pre/geom_fromMinimalSurface.py index eb0cdcc3b..5f58d960c 100755 --- a/processing/pre/geom_fromMinimalSurface.py +++ b/processing/pre/geom_fromMinimalSurface.py @@ -17,7 +17,7 @@ minimal_surfaces = list(damask.Geom._minimal_surface.keys()) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile]', description = """ +parser = OptionParser(usage='%prog options [geomfile]', description = """ Generate a bicontinuous structure of given type. """, version = scriptID) diff --git a/processing/pre/geom_fromOsteonGeometry.py b/processing/pre/geom_fromOsteonGeometry.py index 0b6d48001..51aca3056 100755 --- a/processing/pre/geom_fromOsteonGeometry.py +++ b/processing/pre/geom_fromOsteonGeometry.py @@ -17,7 +17,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [geomfile]', description = """ +parser = OptionParser(usage='%prog options [geomfile]', description = """ Generate description of an osteon enclosing the Harvesian canal and separated by interstitial tissue. The osteon phase is lamellar with a twisted plywood structure. Its fiber orientation is oscillating by +/- amplitude within one period. diff --git a/processing/pre/mentat_pbcOnBoxMesh.py b/processing/pre/mentat_pbcOnBoxMesh.py index 3677a5efa..e03a4e5c5 100755 --- a/processing/pre/mentat_pbcOnBoxMesh.py +++ b/processing/pre/mentat_pbcOnBoxMesh.py @@ -30,11 +30,11 @@ def parseMFD(dat): # lines that start with a space are numerical data if line[0] == ' ': formatted[section]['els'].append([]) - + # grab numbers nums = re.split(r'\s+', line.strip()) - - for num in nums: + + for num in nums: # floating point has format ' -x.xxxxxxxxxxxxe+yy' # scientific notation is used for float if (len(num) >= 4) and (num[-4] == 'e'): @@ -47,7 +47,7 @@ def parseMFD(dat): else: formatted[section]['els'].append([]) formatted[section]['els'][-1] = line - + else: # Not in a section, we are looking for a =beg= now search = re.search(r'=beg=\s+(\d+)\s\((.*?)\)', line) if search is not None: # found start of a new section @@ -60,7 +60,7 @@ def parseMFD(dat): section += 1 formatted.append({'label': '', 'uid': -2, 'els': []}) # make dummy section to store unrecognized data formatted[section]['els'].append(line) - + return formatted def asMFD(mfd_data): @@ -93,14 +93,14 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to 'max': np.zeros(3,dtype='d'), 'delta': np.zeros(3,dtype='d'), } - + mfd_dict = {} for i in range(len(mfd_data)): mfd_dict[mfd_data[i]['label']] = i NodeCoords = np.array(mfd_data[mfd_dict['nodes']]['els'][1::4])[:,1:4] - Nnodes = NodeCoords.shape[0] - + Nnodes = NodeCoords.shape[0] + box['min'] = NodeCoords.min(axis=0) # find the bounding box box['max'] = NodeCoords.max(axis=0) box['delta'] = box['max']-box['min'] @@ -131,7 +131,7 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to elif (key[base[coord]] == "%.8e"%box['max'][coord]): # compare to max of bounding box (i.e. is on outer face?) Nmax += 1 # count outer (front) face membership maxFlag[coord] = True # remember face membership (for linked nodes) - + if Nmin > 0: # node is on a back face # prepare for any non-existing entries in the data structure if key['x'] not in baseNode.keys(): @@ -140,17 +140,17 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to baseNode[key['x']][key['y']] = {} if key['z'] not in baseNode[key['x']][key['y']].keys(): baseNode[key['x']][key['y']][key['z']] = 0 - + baseNode[key['x']][key['y']][key['z']] = node+1 # remember the base node id if Nmax > 0 and Nmax >= Nmin: # node is on at least as many front than back faces if any([maxFlag[i] and active[i] for i in range(3)]): linkNodes.append({'id': node+1,'coord': NodeCoords[node], 'faceMember': [maxFlag[i] and active[i] for i in range(3)]}) - + mfd_data[mfd_dict['entities']]['els'][0][0] += len(linkNodes) * 3 - + baseCorner = baseNode["%.8e"%box['min'][0]]["%.8e"%box['min'][1]]["%.8e"%box['min'][2]] # detect ultimate base node - + links = {'uid': 1705, 'label': 'links', 'els': [[7,0],[9,0]]} linkID = 0 for node in linkNodes: # loop over all linked nodes @@ -165,7 +165,7 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to for dof in [1,2,3]: tied_node = node['id'] nterms = 1 + nLinks - + linkID += 1 # Link header links['els'].append('link{0}\n'.format(linkID)) @@ -173,10 +173,10 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to links['els'].append([0]) links['els'].append([0]) links['els'].append([0, 0, 0, tied_node]) - + # these need to be put in groups of four link_payload = [dof, 0, nterms] - + # Individual node contributions (node, dof, coef.) for i in range(nterms): if i == nLinks: @@ -190,7 +190,7 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to link_payload.append(1.0 - nLinks) else: link_payload.append(1.0) - + # Needs to be formatted 4 data points per row, character width of 20, so 80 total for j in range(0, len(link_payload), 4): links['els'].append(link_payload[j:j+4]) @@ -206,9 +206,9 @@ def add_servoLinks(mfd_data,active=[True,True,True]): # directions on which to #-------------------------------------------------------------------------------------------------- # MAIN -#-------------------------------------------------------------------------------------------------- +#-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(usage='%prog options [file[s]]', description = """ Set up servo linking to achieve periodic boundary conditions for a regular hexahedral mesh. Use *py_connection to operate on model presently opened in MSC.Mentat. """, version = scriptID) diff --git a/processing/pre/mentat_spectralBox.py b/processing/pre/mentat_spectralBox.py index 7d78cb973..57c2644c2 100755 --- a/processing/pre/mentat_spectralBox.py +++ b/processing/pre/mentat_spectralBox.py @@ -168,7 +168,7 @@ def initial_conditions(material): # MAIN #-------------------------------------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(usage='%prog options [file[s]]', description = """ Generate MSC.Marc FE hexahedral mesh from geom file. """, version = scriptID) diff --git a/processing/pre/seeds_fromDistribution.py b/processing/pre/seeds_fromDistribution.py index 375f33ad3..1f20db995 100755 --- a/processing/pre/seeds_fromDistribution.py +++ b/processing/pre/seeds_fromDistribution.py @@ -164,7 +164,7 @@ class myThread (threading.Thread): # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(usage='%prog options [file[s]]', description = """ Monte Carlo simulation to produce seed file that gives same size distribution like given geometry file. """, version = scriptID) diff --git a/processing/pre/seeds_fromPokes.py b/processing/pre/seeds_fromPokes.py index 887d76392..67acf0f6b 100755 --- a/processing/pre/seeds_fromPokes.py +++ b/processing/pre/seeds_fromPokes.py @@ -16,7 +16,7 @@ scriptID = ' '.join([scriptName,damask.version]) # MAIN # -------------------------------------------------------------------- -parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """ +parser = OptionParser(usage='%prog options [file[s]]', description = """ Create seeds file by poking at 45 degree through given geom file. Mimics APS Beamline 34-ID-E DAXM poking.