Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Some conditions require be drawn not in global coordinates, but in the local coordinates of the surface or the line, for example a pressure is usually defined with a single scalar value and is assumed to be normal to the surface where is applied (and positive mean in the same direction of this normal and negative in opposite direction)

Instead a generic

orientation="local"

it is possible to use a more specialized value

orientation="loads"

In this case the proc instead to do OpenGL drawing actions simply must return a dict with the keys

load_type=local

load_vector=$load_local_direction (3 real values of the direction vector)

Code Block
languagexml
  <condition n="pressure_3d" pn="Pressure" ov="surface" ovm="" icon="select" help="Set pressure value (considered direction: opposite to the geometry normal)" groups_icon="groupCreated">
    <value n="value" pn="Value" v="0.0" units="Pa" unit_magnitude="P" help="Load value" string_is="double" icon="data"/>
    <symbol proc="ConditionSymbols::draw_loads_surface_pressure" orientation="loads"/>
  </condition>
Code Block
languagetcl
proc ConditionSymbols::draw_loads_surface_pressure { values_list } {
    foreach item $values_list {
        lassign $item key value unit
        set data($key) $value
        #set unit($key) $unit
    }
    set modulus $data(value)    
    if { $modulus > 0 } {
        set load_local_direction [list 0 0 -1] ;#considered positive pointing oposite to local normal
    } elseif { $modulus < 0 } {
        set load_local_direction [list 0 0 1] ;#considered positive pointing oposite to local normal
    } else {
        #the value could be set by other function field, intead as modulus, consider like positive modulus
        set load_local_direction [list 0 0 -1]
    }
    set dictionary [dict create load_type local load_vector $load_local_direction]    
    return $dictionary
}

and GiD will draw it

e.g in this example assigned to a surface of a volume with pressure positive.

(positive values are considered pointing inside the volume.)

...