-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fea: add support for sets export to sesam and auto-clean duplicate no…
…des upon meshing finalization. And significantly improve auto-merge coincident nodes method
- Loading branch information
Showing
13 changed files
with
118 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from __future__ import annotations | ||
|
||
from os import write | ||
from typing import TYPE_CHECKING | ||
|
||
from ada.fem.formats.sesam.write.write_utils import write_ff | ||
|
||
if TYPE_CHECKING: | ||
from ada import FEM | ||
|
||
|
||
def sets_str(fem: FEM) -> str: | ||
out_str = "" | ||
|
||
for i, fs in enumerate(fem.sets.sets): | ||
out_str += write_ff("TDSETNAM", [(4, i, 100 + len(fs.name), 0), (fs.name,)]) | ||
nfield = len(fs.members) + 5 | ||
mem_ids = [mem.id for mem in fs.members] | ||
if fs.type == "elset": | ||
istype = 2 | ||
else: | ||
istype = 1 | ||
|
||
start = 0 | ||
card_idx = 0 | ||
if nfield > 1024: | ||
num_cards = int(nfield / 1019) | ||
for card_idx in range(1, num_cards + 1): | ||
mem_ids_local = mem_ids[start : card_idx * 1019] | ||
remainder_mem_ids = [] | ||
for k in range(3, len(mem_ids_local), 4): | ||
remainder_mem_ids.append(mem_ids_local[k : k + 4]) | ||
out_str += write_ff( | ||
"GSETMEMB", [(1024, i, card_idx, istype), (0, *mem_ids_local[:3]), *remainder_mem_ids] | ||
) | ||
start = card_idx * 1019 | ||
|
||
card_idx += 1 | ||
length = nfield - start | ||
if length < 4: | ||
out_str += write_ff("GSETMEMB", [(length, i, card_idx, istype), (0, *mem_ids[start : start + length])]) | ||
else: | ||
mem_ids_local = mem_ids[start : start + length - 5] | ||
remainder_mem_ids = [] | ||
for k in range(3, len(mem_ids_local), 4): | ||
remainder_mem_ids.append(mem_ids_local[k : k + 4]) | ||
out_str += write_ff( | ||
"GSETMEMB", [(len(mem_ids_local) + 5, i, card_idx, istype), (0, *mem_ids_local[:3]), *remainder_mem_ids] | ||
) | ||
|
||
return out_str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters