Traction boundary conditions in spd/tcl files

Hi,
I would like to set traction boundary conditions (ts1, ts2, tn) for a 3D problem. The traction is applied to element surface and, in spd file, I specify:

[spd file]

For my input file, I need to write the following information:

  • Number of elements (element faces) specified by traction boundary conditions.
  • Node numbers (connectivity information) on the loaded face
  • Value of normal traction

[tcl file]
customlib::WriteString “Traction Boundary Conditions”
customlib::WriteString “nsurface/ie connectivites Tn "
set list2 [list “Trac_Bc”]
set condition_formats [list {”%10d" “element” “id”} {“%10d” “element” “connectivities”} {“%13.5e” “property” “Tn”}]
set format_tn [customlib::GetElementsFormats $list2 $condition_formats]
set number_of_loaded_elements [GiD_WriteCalculationFile elements -count $format_tn]
customlib::WriteConnectivities $list2 $format_tn “” active

Could you please point out what I am missing here?

Kenji Furui

=== SOLVED ===
I’ve solved the problem I posted on the forum. In the spd file, I set ovm = “face_element” as follows:

Then, in the tcl file, the following code is used for writing # of element faces loaded by Trac_Bc,the element number, node ids, and associated traction values (Ts1,Ts2, and Tn) in the input file.

customlib::WriteString “(X) Traction Boundary Conditions”
customlib::WriteString “nsurface/ie Tn "
set list2 [list “Trac_Bc”]
set condition_formats_trac [list {”%10d" “element” “id”} {“%13.5e” “property” “Tn”}]
set formats_trac [customlib::GetElementsFormats $list2 $condition_formats_trac]
set number_of_elements_trac [GiD_WriteCalculationFile elements -count $formats_trac]
customlib::WriteString $number_of_elements_trac
set document [$::gid_groups_conds::doc documentElement]
set xpath “./condition[@n = ‘Trac_Bc’ ]/group”
set groups [$document selectNodes $xpath]
foreach group $groups {
set group_name [get_domnode_attribute $group n]
set Ts1_node [$group selectNodes “./value[@n = ‘Ts1’]”]
set Ts1_value [get_domnode_attribute $Ts1_node v]
set Ts2_node [$group selectNodes “./value[@n = ‘Ts2’]”]
set Ts2_value [get_domnode_attribute $Ts2_node v]
set Tn_node [$group selectNodes “./value[@n = ‘Tn’]”]
set Tn_value [get_domnode_attribute $Tn_node v]
GiD_WriteCalculationFile elements -elements_faces faces -print_faces_conecs [dict create $group_name “%d %d %d %d %d $Ts1_value $Ts2_value $Tn_value\n”]
}