Skip to content
Snippets Groups Projects
Commit 6585b12e authored by whimsial's avatar whimsial
Browse files

updated assembly

Tried reconfiguring the dictionary with connector to ipMT correspondance. The alternative list based solution has to be tested yet
parent bc07c5af
No related branches found
No related tags found
No related merge requests found
...@@ -96,6 +96,7 @@ def pick_vertices(ConnectorData, **kwargs): ...@@ -96,6 +96,7 @@ def pick_vertices(ConnectorData, **kwargs):
v2 = [] v2 = []
connector_point1 = [] connector_point1 = []
connector_point2 = [] connector_point2 = []
# TODO: Resolve the issue with ipMT and connector sorting
print(len(ConnectorDataSorted1)) print(len(ConnectorDataSorted1))
for value in ConnectorDataSorted1: for value in ConnectorDataSorted1:
for index in range(len(a.instances[value[1][0]])): for index in range(len(a.instances[value[1][0]])):
...@@ -197,34 +198,3 @@ def connect_nodes(MTname1, MTname2, connectorname, i, modelname, a, MTnumber): ...@@ -197,34 +198,3 @@ def connect_nodes(MTname1, MTname2, connectorname, i, modelname, a, MTnumber):
region = mdb.models[modelname].rootAssembly.sets[ConnectionRegion] region = mdb.models[modelname].rootAssembly.sets[ConnectionRegion]
csa = a.SectionAssignment(sectionName=SectionName, csa = a.SectionAssignment(sectionName=SectionName,
region=region) region=region)
def connect_ipMT_pair( MTname1, MTname2, pos1, pos2, **kwargs ):
"""
Connect two ipMTs via MT connectors. The connectors are attached to each ipMT at the
partition points
:param MTname1: name of the 1-st ipMT of the pair to be connected
:param MTname2 name of the 2-nd ipMT of the pair to be connected
:param pos1: (x, y, z) of the 1-st ipMT of the pair to be connected
:param pos2: (x, y, z) of the 2-nd ipMT of the pair to be connected
:param kwargs: dictionary -> keyword arguments
:return:
"""
modelname = kwargs['modelname']
# Make each ipMT independent
a = ah.return_assembly(**kwargs)
a.makeIndependent(instances=(a.instances[MTname1],))
a.makeIndependent(instances=(a.instances[MTname2],))
# Generate partition points coordinates
z1, z2 = generate_connector_positions(pos1, pos2, **kwargs)
# Partition ipMT pair using generated partition points
partition_names1, partition_names2 = partiotion_MT_pair( MTname1, MTname2, z1, z2, **kwargs )
# Add and position connectors
connectornames = position_connectors(pos1, pos2, MTname1, MTname2, z1, **kwargs)
# Attach connectors
# attach_connectors(connectornames, MTname1, MTname2, **kwargs)
...@@ -74,23 +74,6 @@ def add_and_position_astral_mts(**kwargs): ...@@ -74,23 +74,6 @@ def add_and_position_astral_mts(**kwargs):
return aMTnames, kwargs return aMTnames, kwargs
# def partition_microtubules( **kwargs ):
# ipMTnames = kwargs['ipMTnames']
# modelname = kwargs['modelname']
#
# # Partition each MT in the collection of ipMTs
# for name in ipMTnames:
# p = mdb.models[modelname].parts[name]
# e = p.edges
# pickedEdges = e.getSequenceFromMask(mask=('[#1 ]',), )
# p.PartitionEdgeByParam(edges=pickedEdges, parameter=0.5)
# p = mdb.models[modelname].parts[name]
# p.regenerate()
#
# a = ac.return_assembly(**kwargs)
# a.regenerate()
def assign_ipMTs(**kwargs): def assign_ipMTs(**kwargs):
# Create dictionary to store MT metadata # Create dictionary to store MT metadata
MTdata = {'MTnames': [], MTdata = {'MTnames': [],
...@@ -205,6 +188,7 @@ def assign_ipMTs(**kwargs): ...@@ -205,6 +188,7 @@ def assign_ipMTs(**kwargs):
MTname6, (pos6[0], pos6[1], z65[index], z65_global[index])]}) MTname6, (pos6[0], pos6[1], z65[index], z65_global[index])]})
# Create partitions that correspond to connector attachment sites # Create partitions that correspond to connector attachment sites
# TODO: Think if it is possible to use lists instead of dictionaries for simplicity
MTpoints = {} MTpoints = {}
for i in range(len(MTdata['MTnames'])): for i in range(len(MTdata['MTnames'])):
MTpoints.update({str(i+1): []}) MTpoints.update({str(i+1): []})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment