no need for special damask class (no action=extend)

This commit is contained in:
Martin Diehl 2020-11-14 19:00:51 +01:00
parent 764aacf2a1
commit 9160677ff3
10 changed files with 28 additions and 28 deletions

View File

@ -136,7 +136,7 @@ def shapeMismatch(size,F,nodes,centres):
# MAIN # 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. 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. Operates on periodic three-dimensional x,y,z-ordered data sets.

View File

@ -16,7 +16,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # 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. Add displacments resulting from deformation gradient field.
Operates on periodic three-dimensional x,y,z-ordered data sets. Operates on periodic three-dimensional x,y,z-ordered data sets.
Outputs at cell centers or cell nodes (into separate file). Outputs at cell centers or cell nodes (into separate file).

View File

@ -98,7 +98,7 @@ slipSystems = {
# MAIN # 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. Add columns listing Schmid factors (and optional trace vector of selected system) for given Euler angles.
""", version = scriptID) """, version = scriptID)

View File

@ -14,7 +14,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # 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 Converts DREAM.3D file. Input can be cell data (direct pointwise takeover) or grain data (individual
grains are segmented). Requires orientation data as quaternion. grains are segmented). Requires orientation data as quaternion.

View File

@ -17,7 +17,7 @@ minimal_surfaces = list(damask.Geom._minimal_surface.keys())
# MAIN # 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. Generate a bicontinuous structure of given type.
""", version = scriptID) """, version = scriptID)

View File

@ -17,7 +17,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # 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. Generate description of an osteon enclosing the Harvesian canal and separated by interstitial tissue.
The osteon phase is lamellar with a twisted plywood structure. The osteon phase is lamellar with a twisted plywood structure.
Its fiber orientation is oscillating by +/- amplitude within one period. Its fiber orientation is oscillating by +/- amplitude within one period.

View File

@ -30,11 +30,11 @@ def parseMFD(dat):
# lines that start with a space are numerical data # lines that start with a space are numerical data
if line[0] == ' ': if line[0] == ' ':
formatted[section]['els'].append([]) formatted[section]['els'].append([])
# grab numbers # grab numbers
nums = re.split(r'\s+', line.strip()) nums = re.split(r'\s+', line.strip())
for num in nums: for num in nums:
# floating point has format ' -x.xxxxxxxxxxxxe+yy' # floating point has format ' -x.xxxxxxxxxxxxe+yy'
# scientific notation is used for float # scientific notation is used for float
if (len(num) >= 4) and (num[-4] == 'e'): if (len(num) >= 4) and (num[-4] == 'e'):
@ -47,7 +47,7 @@ def parseMFD(dat):
else: else:
formatted[section]['els'].append([]) formatted[section]['els'].append([])
formatted[section]['els'][-1] = line formatted[section]['els'][-1] = line
else: # Not in a section, we are looking for a =beg= now else: # Not in a section, we are looking for a =beg= now
search = re.search(r'=beg=\s+(\d+)\s\((.*?)\)', line) search = re.search(r'=beg=\s+(\d+)\s\((.*?)\)', line)
if search is not None: # found start of a new section if search is not None: # found start of a new section
@ -60,7 +60,7 @@ def parseMFD(dat):
section += 1 section += 1
formatted.append({'label': '', 'uid': -2, 'els': []}) # make dummy section to store unrecognized data formatted.append({'label': '', 'uid': -2, 'els': []}) # make dummy section to store unrecognized data
formatted[section]['els'].append(line) formatted[section]['els'].append(line)
return formatted return formatted
def asMFD(mfd_data): 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'), 'max': np.zeros(3,dtype='d'),
'delta': np.zeros(3,dtype='d'), 'delta': np.zeros(3,dtype='d'),
} }
mfd_dict = {} mfd_dict = {}
for i in range(len(mfd_data)): for i in range(len(mfd_data)):
mfd_dict[mfd_data[i]['label']] = i mfd_dict[mfd_data[i]['label']] = i
NodeCoords = np.array(mfd_data[mfd_dict['nodes']]['els'][1::4])[:,1:4] 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['min'] = NodeCoords.min(axis=0) # find the bounding box
box['max'] = NodeCoords.max(axis=0) box['max'] = NodeCoords.max(axis=0)
box['delta'] = box['max']-box['min'] 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?) 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 Nmax += 1 # count outer (front) face membership
maxFlag[coord] = True # remember face membership (for linked nodes) maxFlag[coord] = True # remember face membership (for linked nodes)
if Nmin > 0: # node is on a back face if Nmin > 0: # node is on a back face
# prepare for any non-existing entries in the data structure # prepare for any non-existing entries in the data structure
if key['x'] not in baseNode.keys(): 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']] = {} baseNode[key['x']][key['y']] = {}
if key['z'] not in baseNode[key['x']][key['y']].keys(): 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']] = 0
baseNode[key['x']][key['y']][key['z']] = node+1 # remember the base node id 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 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)]): 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)]}) 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 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 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]]} links = {'uid': 1705, 'label': 'links', 'els': [[7,0],[9,0]]}
linkID = 0 linkID = 0
for node in linkNodes: # loop over all linked nodes 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]: for dof in [1,2,3]:
tied_node = node['id'] tied_node = node['id']
nterms = 1 + nLinks nterms = 1 + nLinks
linkID += 1 linkID += 1
# Link header # Link header
links['els'].append('link{0}\n'.format(linkID)) 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]) links['els'].append([0])
links['els'].append([0, 0, 0, tied_node]) links['els'].append([0, 0, 0, tied_node])
# these need to be put in groups of four # these need to be put in groups of four
link_payload = [dof, 0, nterms] link_payload = [dof, 0, nterms]
# Individual node contributions (node, dof, coef.) # Individual node contributions (node, dof, coef.)
for i in range(nterms): for i in range(nterms):
if i == nLinks: 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) link_payload.append(1.0 - nLinks)
else: else:
link_payload.append(1.0) link_payload.append(1.0)
# Needs to be formatted 4 data points per row, character width of 20, so 80 total # 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): for j in range(0, len(link_payload), 4):
links['els'].append(link_payload[j:j+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 # 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. 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. Use *py_connection to operate on model presently opened in MSC.Mentat.
""", version = scriptID) """, version = scriptID)

View File

@ -168,7 +168,7 @@ def initial_conditions(material):
# MAIN # 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. Generate MSC.Marc FE hexahedral mesh from geom file.
""", version = scriptID) """, version = scriptID)

View File

@ -164,7 +164,7 @@ class myThread (threading.Thread):
# MAIN # 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. Monte Carlo simulation to produce seed file that gives same size distribution like given geometry file.
""", version = scriptID) """, version = scriptID)

View File

@ -16,7 +16,7 @@ scriptID = ' '.join([scriptName,damask.version])
# MAIN # 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. Create seeds file by poking at 45 degree through given geom file.
Mimics APS Beamline 34-ID-E DAXM poking. Mimics APS Beamline 34-ID-E DAXM poking.