Changeset 1172 for branches


Ignore:
Timestamp:
Sep 26, 2011 5:37:47 PM (12 years ago)
Author:
toby
Message:

fix/enhance rigid bodies some

Location:
branches/sandbox
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/sandbox/doc/expgui6A.html

    r1164 r1172  
    195195 <BR><img src="rb004.jpg" alt="Z-matrix RB input window">
    196196</DL>
    197   <H4>A.7.a4 Compute Cartesian coordinates from EXP file (fractional coordinates)</H4>
    198 <DL>
    199   Cartesian coordinates
    200 can also be determined from atoms in the EXP file.
    201   In order to generate Cartesian
    202 coordinates, the number of sites in the rigid body framework must be specified
    203 as well as the starting atom (remember rigid bodies are mapped consecutively).
     197<A name="fromEXP">
     198<H4>A.7.a4 Compute Cartesian coordinates from EXP file (fractional coordinates)</H4>
     199</A>
     200<DL>
     201  A rigid body can also be created directly by computing Cartesian coordinates
     202for atoms in the current EXP file.
     203  In order to do this, the number of atom sites in the rigid body framework must be specified
     204as well as the starting atom number (remember rigid bodies are mapped
     205  consecutively) using the window shown below.
    204206  Once the number of atoms in the body is
    205207set, the "Choose Start Atom" button is pressed. This creates buttons for
    206 all possible choices for the first atom to define the body. Once the starting
    207 atom is selected by pressing one of these button(s), the atoms to be used to
    208 define the rigid body framework have been determined. The user must than select
     208all possible choices for the first atom to define the body. The starting
     209atom is selected by pressing one of these button(s) and this defines
     210  the atoms to be used in the rigid body framework. The user must then
     211  select
    209212which atoms will be used to define the origin (the origin will be at the
    210 centroid of the atoms chosen) and must define the axes that will be used to
    211 generate the x-axis and the xy plane.
    212 The Cartesian coordinates can then be generated.
    213 Either the defined body can be determined and mapped (with the "Save and Map
    214 Rigid Body" button), or the Cartesian coordinates can exported to an
     213centroid of the atoms chosen) as well as define the axes that will be used to
     214generate the x-axis and the xy plane for the Cartesian coordinate system.
     215The Cartesian coordinates for the body that are generated can be exported to an
    215216ASCII text file (with the "Export Cartesian Coordinates"
    216 button).
    217   <BR><img src="rb005.jpg" alt="Fraction Coords RB input window">
     217button) for later use. More commonly, the "Save and Map
     218Rigid Body" button is used; this creates a new rigid body type and
     219  maps that body (<A href="#MapBody">see A.7.b2</A>) to the selected atoms in the phase.
     220 <BR><img src="rb005.jpg" alt="Fraction Coords RB input window">
    218221</DL>
    219222
     
    238241EXPGUI can invoke, if installed. It
    239242allows for the viewing of the rigid body to ensure it is correct before mapping
    240 and matches the ordering of the atoms in the EXP file. The plot below
    241   was obtained from the "Plot Rigid Body" button.
     243and matches the ordering of the atoms in the EXP file. Note that plots
     244  to not display atom types, since there is no type information
     245  associated with position in a rigid body. Atom types are determined
     246  by the atoms when the body is mapped. A sample plot
     247  obtained from the "Plot Rigid Body" button is shown below.
    242248  <BR><img src="rb007.png" alt="DRAWxtl screen">
    243249</DL>
    244 
     250<A name="MapBody">
    245251 <H4>A.7.b2 Map Rigid Body</H4>
    246 <DL>
     252</A><DL>
    247253The rigid body must be mapped to the
    248254crystal structure to define the constraint. This is done by pressing
    249255  the "Map Rigid Body" button, which raises the window below.
    250256  <BR><img src="rb008.png" alt="Map RB"><BR>
     257Note that when a rigid body is created from atoms already in the .EXP
     258  file (<A href="#fromEXP">see A.7.a4</A>), the "Save and Map" command
     259  performs this step automatically.
     260  <P>
    251261  In order to map the rigid body the user
    252262will need to specify the phase and the sequence number of the first atom in the
  • branches/sandbox/expgui

    r1165 r1172  
    33323332            "source  [file join $expgui(scriptdir) rigid.tcl]; MakeRBPane" \
    33333333            DisplayRB \
    3334             1  expguiRB.html ""}
     3334            1  expgui6A.html ""}
    33353335    {orientFrame  "MD Pref Orient" \
    33363336            MakeOrientPane \
  • branches/sandbox/gsascmds.tcl

    r1170 r1172  
    28652865            close $fp
    28662866            update
    2867             regexp {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
     2867            regexp -linestop {GNLS  RUN on (.*) +Total.*run *([0-9]+) } \
    28682868                    $testline a last cycles
    28692869            pack [label $expgui(FileInfoBox).2 -justify left \
  • branches/sandbox/rb.tcl

    r1152 r1172  
    141141    close $fp
    142142    #puts "[file join $expgui(gsasexe) geometry] $expgui(expfile) < geom.inp > geom.out"
     143    # Save any change sin the current exp file
     144    savearchiveexp
    143145    catch {
    144146        exec [file join $expgui(gsasexe) geometry] $expgui(expfile) < geom.inp > geom.out
     
    182184    if {[llength $origin] == 0 || [llength $Euler] == 0 || [llength $coordlist] == 0} {
    183185       puts "Error: run of GEOMETRY failed"
     186       error "Run of Program GEOMETRY failed, cannot continue"
    184187    }
    185188    return [list $origin $Euler $coordlist]
  • branches/sandbox/rigid.tcl

    r1171 r1172  
    366366     AddRigidBody $temp_mat $temp_car
    367367     RecordMacroEntry "AddRigidBody $temp_mat $temp_car" 0
    368 
     368    RecordMacroEntry "incr expgui(changed)" 0
    369369     incr ::expgui(changed)
    370370     destroy .nbt
     
    406406#    increment expgui
    407407     incr ::expgui(changed)
     408    RecordMacroEntry "incr expgui(changed)" 0
    408409     RB_Load_RBdata
    409410     RB_Control_Panel 0
     
    424425
    425426     #Rigid body mapping control panel along with matrix multipliers and damping factor labels
    426      grid [label  $con.rb_num -text "Rigid Body Type $bodnum"] -row 0 -column 0 -padx 5 -pady 5
     427    set n [lindex [ReadRigidBody $bodnum] 0]
     428    if {$n == 0} {
     429        set str "(not mapped)"
     430    } elseif {$n == 1} {
     431        set str "(mapped 1 time)"
     432    } else {
     433        set str "(mapped $n times)"
     434    }
     435     grid [label  $con.rb_num -text "Rigid Body Type $bodnum\n$str"] -row 0 -column 0 -padx 5 -pady 5
    427436     grid [button $con.rb_newmap -text "Map Body $bodnum" -command "RB_Map_New $bodnum" -width 18] -row 0 -column 1 -padx 5 -pady 5
    428437     grid [button $con.rb_unmap -text "Unmap Body $bodnum" -command "RB_Unmap $bodnum" -width 18] -row 0 -column 2 -padx 5 -pady 5
     
    799808   RunRecalcRBCoords
    800809   incr ::expgui(changed)
     810   RecordMacroEntry "incr expgui(changed)" 0
    801811   RB_Populate $::rb_notebook $::body_type
    802812   $::rb_notebook raise rb_body$::body_type
     
    917927        }
    918928        incr ::expgui(changed)
     929         RecordMacroEntry "incr expgui(changed)" 0
    919930        destroy $panel
    920931        set curpage [$::rb_notebook raise]
     
    12701281     RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
    12711282     ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp
    1272      RecordMacroEntry "SetRigidBodyVar $bodnum $temp_var $temp_damp" 0
     1283     RecordMacroEntry "ReplaceRigidBody $bodnum $temp_mat $temp_car $temp_var $temp_damp" 0
    12731284     #SetRigidBodyVar $bodnum $temp_var $temp_damp
    12741285     incr ::expgui(changed)
     1286    RecordMacroEntry "incr expgui(changed)" 0
    12751287     RB_Load_RBdata
    12761288     RB_Control_Panel $bodnum
     
    13981410        set temp1 [ExtractRigidBody $::rb_phase $::gcon_atoms $::gcon_start $::gcon_origin_list $vector1list $vector2list]
    13991411        if {[lindex $temp1 0] == {} || [lindex $temp1 1] == {} || [lindex $temp1 2] == {}} {
    1400    }
     1412            # an error occurred
     1413            return
     1414        }
    14011415
    14021416   set coordlist ""
     
    16281642
    16291643        set bodnum [AddRigidBody 1 $cartesian]
     1644     RecordMacroEntry "AddRigidBody 1 [list $cartesian]" 0
    16301645        # set ::rb_damp($bodnum,1) 0
    16311646        set ::rb_coord_num($bodnum,1) $::gcon_atoms
     
    16331648        MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]
    16341649        RecordMacroEntry "MapRigidBody $::rb_phase $bodnum $::gcon_start [lindex $temp1 0] [lindex $temp1 1]" 0
    1635         destroy .geometry
    1636         RB_Control_Panel 0
     1650     incr ::expgui(changed)
     1651     RecordMacroEntry "incr expgui(changed)" 0
     1652     destroy .geometry
     1653     RB_Control_Panel 0
    16371654}
    16381655
     
    19651982                       }
    19661983                       incr ::expgui(changed)
    1967                        #RecordMacroEntry "incr expgui(changed)" 0
     1984                       RecordMacroEntry "incr expgui(changed)" 0
    19681985
    19691986               }
Note: See TracChangeset for help on using the changeset viewer.