Skip to content

Commit

Permalink
Coincident nodes at elems: method not working as planned
Browse files Browse the repository at this point in the history
  • Loading branch information
haavahk committed Jul 1, 2021
1 parent 9fee9a3 commit d42fe4e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/ada/fem/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,26 @@ def _sort(self):
self._group_by_types()
self.renumber()

def merge_with_coincident_nodes(self):
from ada.core.containers import Nodes

def remove_duplicate_nodes():
new_nodes = [n for n in elem.nodes if len(n.refs) > 0]
elem.nodes.clear()
elem.nodes.extend(new_nodes)

"""
This does not work according to plan. It seems like it is deleting more and more from the model for each
iteration
"""
elem_list = list(filter(lambda x: len(x.nodes) > len([n for n in x.nodes if len(n.refs) > 0]), self._elements))
for elem in elem_list:
remove_duplicate_nodes()
if len(elem.nodes) < 2:
self.remove(elem)
else:
elem._shape = None


class FemSections:
"""
Expand Down

0 comments on commit d42fe4e

Please sign in to comment.