Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get format dict for geometries no mid #944

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kratos.gid/scripts/Writing/WriteGeometries.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ proc write::printGeometryConnectivities {group etype nnodes} {
# increase indent (allows folding in text editor)
incr ::write::current_mdpa_indent_level
# Prepare the formats dict
set formats [GetFormatDict $group 0 $nnodes]
set formats [GetFormatDict $group "" $nnodes]
# Write the connectivities
GiD_WriteCalculationFile connectivities $formats
# decrease indent
Expand Down
12 changes: 9 additions & 3 deletions kratos.gid/scripts/Writing/Writing.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,18 @@ proc write::transformGroupName {groupid} {

# Warning! Indentation must be set before calling here!
proc write::GetFormatDict { groupid mid num} {
set s [mdpaIndent]

variable formats_dict
set id_f [dict get $formats_dict ID]
set mid_f [dict get $formats_dict MAT_ID]

set s [mdpaIndent]
set f "${s}$id_f [format $mid_f $mid] [string repeat "$id_f " $num]\n"
set mid_str ""
if {$mid ne ""} {
set mid_f [dict get $formats_dict MAT_ID]
set mid_str [format $mid_f $mid]
}

set f "${s}$id_f $mid_str [string repeat "$id_f " $num]\n"
return [dict create $groupid $f]
}

Expand Down