diff -urN oommf1.2a1/CHANGES oommf/CHANGES --- oommf1.2a1/CHANGES Tue May 29 21:53:31 2001 +++ oommf/CHANGES Tue May 29 20:27:58 2001 @@ -1,5 +1,48 @@ +========== OOMMF 1.2a2 released 2001/05/29 ========== +Significant changes since 1.2a1: + + * New features + - pimake: [Platform Intermediate] for cleaning up intermediate files + - pimake; [Platform Compile -def ...] + - mmDispSh: anti-alias support in plot_config + - avf2ppm: respects datascale value in plot_config + - mmSolve: revised nonuniform thickness effect on exchange + - mifConvert: handles random seed + - Oxsii: -problem and -exitondone command line options + - Oxsii: Removed Step and Stage monitors in interface + - Oc: enabled C writing to "stdout" console channel (Tcl 8.2+) + - Oc_AutoBuf: now reclaims buffer space when it's very big + - Oxs_CubicAnisotropy: revised calculation + - Oxs_EulerEvolve: rewrite of timestep size control + - Oxs_UniformExchange: improved performance and precision + - Oxs_UniaxialAnisotropy: separate handling of K >0 and K < 0. + - Oxs_StandardDriver: Offers delta_E output. + - Oxs_FFT, Oxs_Demag, Oxs_SimpleDemag: substantial rewrite, + especially of the FFT routines for greatly improved + performance and memory usage. + + * Bug fixes + - bootstrap: removed senseless options +console and +cwd + - mmDisp: lots of dead code removed + - any2ppm: can now specify output file using -o $filename + - mmSolve: workaround Tcl bug in reading of PPM mask files + - mmGraph (Ow_GraphWin): Key box upward creep, auto-limit + - Ow_EntryBox: Less shimmering - better precision + - Oc_Class: [uplevel 1] for less shimmering/better precision + - Oc: Rewrote several Tcl 7.x compatibility procs (fcopy) + - Net_Link: handle immediate closing of socket + - Net_Connection: Timeouts extended to 100 minutes to avoid + timing out during long solver initializations + + * New interfaces + - renamed class MyComplex -> Oxs_Complex + - Oxs_Ext::GetUIntInitValue() + - Oxs_ThreeVector::MakeUnit() + ========== OOMMF 1.2a1 released 2001/01/22 ========== Significant changes since 1.2a0: + + * MIF 2.0 format changes. 1.2a0 files are not valid in 1.2a1. * New applications: - avfdiff - compute differences of vector fields diff -urN oommf1.2a1/Changes.txt oommf/Changes.txt --- oommf1.2a1/Changes.txt Tue May 29 21:34:36 2001 +++ oommf/Changes.txt Tue May 29 21:34:17 2001 @@ -1,5 +1,48 @@ -========== OOMMF 1.2a1 released 2001/01/20 ========== +========== OOMMF 1.2a2 released 2001/05/29 ========== +Significant changes since 1.2a1: + + * New features + - pimake: [Platform Intermediate] for cleaning up intermediate files + - pimake; [Platform Compile -def ...] + - mmDispSh: anti-alias support in plot_config + - avf2ppm: respects datascale value in plot_config + - mmSolve: revised nonuniform thickness effect on exchange + - mifConvert: handles random seed + - Oxsii: -problem and -exitondone command line options + - Oxsii: Removed Step and Stage monitors in interface + - Oc: enabled C writing to "stdout" console channel (Tcl 8.2+) + - Oc_AutoBuf: now reclaims buffer space when it's very big + - Oxs_CubicAnisotropy: revised calculation + - Oxs_EulerEvolve: rewrite of timestep size control + - Oxs_UniformExchange: improved performance and precision + - Oxs_UniaxialAnisotropy: separate handling of K >0 and K < 0. + - Oxs_StandardDriver: Offers delta_E output. + - Oxs_FFT, Oxs_Demag, Oxs_SimpleDemag: substantial rewrite, + especially of the FFT routines for greatly improved + performance and memory usage. + + * Bug fixes + - bootstrap: removed senseless options +console and +cwd + - mmDisp: lots of dead code removed + - any2ppm: can now specify output file using -o $filename + - mmSolve: workaround Tcl bug in reading of PPM mask files + - mmGraph (Ow_GraphWin): Key box upward creep, auto-limit + - Ow_EntryBox: Less shimmering - better precision + - Oc_Class: [uplevel 1] for less shimmering/better precision + - Oc: Rewrote several Tcl 7.x compatibility procs (fcopy) + - Net_Link: handle immediate closing of socket + - Net_Connection: Timeouts extended to 100 minutes to avoid + timing out during long solver initializations + + * New interfaces + - renamed class MyComplex -> Oxs_Complex + - Oxs_Ext::GetUIntInitValue() + - Oxs_ThreeVector::MakeUnit() + +========== OOMMF 1.2a1 released 2001/01/22 ========== Significant changes since 1.2a0: + + * MIF 2.0 format changes. 1.2a0 files are not valid in 1.2a1. * New applications: - avfdiff - compute differences of vector fields diff -urN oommf1.2a1/README oommf/README --- oommf1.2a1/README Fri Jan 19 15:36:50 2001 +++ oommf/README Tue May 29 19:10:54 2001 @@ -1,8 +1,8 @@ README: OOMMF Object Oriented MicroMagnetic computing Framework -Release 1.2a1 +Release 1.2a2 - This file last modified on: $Date: 2001/01/19 20:36:50 $ + This file last modified on: $Date: 2001/05/29 23:10:54 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible @@ -31,7 +31,7 @@ with pre-compiled executables compatible with Tcl/Tk 8.3.x. Type the following commands at an MS-DOS Prompt to start using OOMMF: - unzip oommf12a1_20010120.zip + unzip oommf12a2_20010529.zip cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl @@ -39,7 +39,7 @@ For most OOMMF users on Unix, the following sequence of commands should upgrade, build, and run your OOMMF installation: - gunzip -c oommf12a1_20010120.tar.gz | tar xvf - + gunzip -c oommf12a2_20010529.tar.gz | tar xvf - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade diff -urN oommf1.2a1/Readme.txt oommf/Readme.txt --- oommf1.2a1/Readme.txt Tue May 29 21:34:35 2001 +++ oommf/Readme.txt Tue May 29 21:34:16 2001 @@ -1,8 +1,8 @@ README: OOMMF Object Oriented MicroMagnetic computing Framework -Release 1.2a1 +Release 1.2a2 - This file last modified on: $Date: 2001/01/19 20:36:50 $ + This file last modified on: $Date: 2001/05/29 23:10:54 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible @@ -31,7 +31,7 @@ with pre-compiled executables compatible with Tcl/Tk 8.3.x. Type the following commands at an MS-DOS Prompt to start using OOMMF: - unzip oommf12a1_20010120.zip + unzip oommf12a2_20010529.zip cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl @@ -39,7 +39,7 @@ For most OOMMF users on Unix, the following sequence of commands should upgrade, build, and run your OOMMF installation: - gunzip -c oommf12a1_20010120.tar.gz | tar xvf - + gunzip -c oommf12a2_20010529.tar.gz | tar xvf - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade diff -urN oommf1.2a1/app/mmarchive/appindex.tcl oommf/app/mmarchive/appindex.tcl --- oommf1.2a1/app/mmarchive/appindex.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmarchive/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name mmArchive - -version 1.2.0.1 + -version 1.2.0.2 -machine omfsh -file mmarchive.tcl -options {-tk 0} diff -urN oommf1.2a1/app/mmarchive/mmarchive.tcl oommf/app/mmarchive/mmarchive.tcl --- oommf1.2a1/app/mmarchive/mmarchive.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmarchive/mmarchive.tcl Tue May 29 13:47:19 2001 @@ -12,8 +12,8 @@ } Oc_Main SetAppName mmArchive -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_CommandLine Parse $argv diff -urN oommf1.2a1/app/mmdatatable/appindex.tcl oommf/app/mmdatatable/appindex.tcl --- oommf1.2a1/app/mmdatatable/appindex.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmdatatable/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name mmDataTable - -version 1.2.0.1 + -version 1.2.0.2 -machine omfsh -file mmdatatable.tcl } diff -urN oommf1.2a1/app/mmdatatable/mmdatatable.tcl oommf/app/mmdatatable/mmdatatable.tcl --- oommf1.2a1/app/mmdatatable/mmdatatable.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmdatatable/mmdatatable.tcl Tue May 29 13:47:19 2001 @@ -23,8 +23,8 @@ wm withdraw . Oc_Main SetAppName mmDataTable -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] diff -urN oommf1.2a1/app/mmdisp/makerules.tcl oommf/app/mmdisp/makerules.tcl --- oommf1.2a1/app/mmdisp/makerules.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmdisp/makerules.tcl Tue May 29 13:47:19 2001 @@ -52,13 +52,13 @@ puts $f [format { Oc_Application Define { -name mmDispSh - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -file "%s" } Oc_Application Define { -name conDispSh - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -file "%s" } @@ -117,6 +117,7 @@ DeleteFiles mmdisp.h mmdisp.tcl DeleteFiles avf2ave.cc avf2ovf.cc avf2vio.cc DeleteFiles avf2ppm.cc avf2ppm.tcl avf2ppm.def + DeleteFiles [file join scripts avf2ave.tcl] } } @@ -145,6 +146,8 @@ -dependencies {} -script [format { eval DeleteFiles [Platform Objects {%s} ] + eval DeleteFiles \ + [Platform Intermediate {condispsh mmdispsh}] } $allObjects] } diff -urN oommf1.2a1/app/mmdisp/misc.tcl oommf/app/mmdisp/misc.tcl --- oommf1.2a1/app/mmdisp/misc.tcl Fri Sep 15 20:01:23 2000 +++ oommf/app/mmdisp/misc.tcl Mon Mar 12 17:26:42 2001 @@ -3,12 +3,6 @@ # Various Tcl/Tk utility scripts for the OOMMF 2D display program # -# Procedure to append a bindtag at the end of a window's -# curreng bindtag list -proc OMF_AppendBindTag { win newtag } { - bindtags $win [concat [bindtags $win] $newtag] -} - # Automatically select/deselect entire text upon Entry widget FocusIn/Out #bind Entry {+%W selection from 0 ; %W selection to end } bind Entry {+%W selection clear} @@ -18,16 +12,6 @@ # but not the , which I _really_ dislike, so I reinstated # the latter on 97/9/26. -mjd -set omfStdNumericFormat "%4.2f" - -proc OMF_FormatNumber { var {fmt {}}} { - if { [string match {} $fmt] } { - global omfStdNumericFormat - set fmt $omfStdNumericFormat - } - return [format $fmt $var] -} - # Load input filter program options set omfMmdispFilter [list [list *.gz {gzip -dc}]] Oc_Option Get Input filters omfMmdispFilter @@ -118,147 +102,24 @@ set _mmdispcmds(TroughColor) [format "#%04X%04X%04X" $tempr $tempg $tempb] } -# Get a list of all descendents of a window (children, grandchildren, ...) -proc OMF_GetDescendentList { basewin } { - set winlist {} - set childlist [winfo children $basewin] - foreach w $childlist { - lappend winlist $w - eval lappend winlist [OMF_GetDescendentList $w] - } - return $winlist -} - -# Get a list of all current toplevel windows. If import -# $include_hidden is true, returns complete list. Otherwise -# returns only those toplevel windows that are visible (viewable). -proc OMF_GetTopLevelList { {include_hidden 0} } { - set toplist "." - foreach w [OMF_GetDescendentList .] { - if { [string compare $w [winfo toplevel $w]] == 0 } { - if { $include_hidden || [winfo viewable $w] } { - lappend toplist $w - } - } - } - return $toplist -} +# Removed - Can't find evidence that anything has used these in a long time. +# proc OMF_GetDescendentList args {} +# proc OMF_GetTopLevelList args {} +# proc OMF_AppendBindTag args {} # Push/Pop stack operators -proc OMF_Push { stackname newvalue } { - upvar $stackname stack - lappend stack $newvalue -} -proc OMF_Pop { stackname } { - # NOTE: Returns {} if stack is empty - upvar $stackname stack - if { ![info exists stack] } { return {} } - set size [llength $stack] - if { $size < 1 } { return {} } - incr size -1 - set top_elt [lindex $stack $size] - set stack [lreplace $stack $size $size] - return $top_elt -} - -# Check if $x is a valid base-ten number -proc OMF_IsNumber { x } { - # Returns 1 iff $x is a valid number - - # Don't allow octal representations - if { [regexp {^ *[-+]?0+ *$} "$x"] } { return 1 } ;# This is a 0 - if { [regexp {^ *[-+]?0[^.]*$} "$x"] } { return 0 } - - # If not octal, check for valid forms - if { [regexp {^ *[-+]?[0-9]+\.?[0-9]* *$} "$x"] } { return 1 } - if { [regexp {^ *[-+]?[0-9]*\.?[0-9]+ *$} "$x"] } { return 1 } +# Removed - Can't find evidence that anything has used these in a long time. +# proc OMF_Push args {} +# proc OMF_Pop args {} + +# Removed - the Ow_* widgets do their own validity checks +# proc OMF_MakeValidPosNumber args {} +# proc OMF_KeepValidPosNumber args {} +# proc OMF_MakeValidNumber args {} +# proc OMF_KeepValidNumber args {} - # Else, illegal form. - return 0 -} - -# Return a modified string by removing anything that is not -# 0-9 or '.', and keeping only first '.'. -# NOTE: This routine *may* return the string ".", which is -# *not* a legal number for most (any?) standard -# Tcl/Tk routines. This makes for more amiable -# interactive editing of a traced variable, however. -proc OMF_MakeValidPosNumber { string } { - regsub -all -nocase {[^0-9.]} $string {} stringfix - # Now remove all '.''s except the first. Do this by - # temporarily changing the first '.' to an 'x' - if {[regsub {\.} $stringfix {x} stringfix]} { - regsub -all {\.} $stringfix {} stringfix - regsub {x} $stringfix {.} stringfix - } - return $stringfix -} - -# A trace proc providing OMF_MakeValidPosNumber service. -proc OMF_KeepValidPosNumber { name elt op } { - global mmd_log - if { ![string match {} $elt] } { set name ${name}($elt) } - upvar $name x - if {![info exists x]} { - # Try global level - upvar #0 $name x - if {![info exists x]} { - $mmd_log Append "Error in proc OMF_KeepValidPosNumber, \ - run level #[info level]: \ - Unable to locate variable $name" - return {} - } - } - set x [OMF_MakeValidPosNumber $x] -} - -# Similar to OMF_MakeValidPosNumber, but allows a leading '-'. -# NOTE: This routine *may* return the string ".", which is -# *not* a legal number for most (any?) standard -# Tcl/Tk routines. This makes for more amiable -# interactive editing of a traced variable, however. -proc OMF_MakeValidNumber { string } { - regsub -all -nocase {[^-0-9.]} $string {} stringfix - # Now remove all '.''s except the first. Do this by - # temporarily changing the first '.' to an 'x' - if {[regsub {\.} $stringfix {x} stringfix]} { - regsub -all {\.} $stringfix {} stringfix - regsub {x} $stringfix {.} stringfix - } - # Next strip out any "-"'s except leading one, if any. - regexp -- {^(-?)(.*)} $stringfix junk prefix number - regsub -all -- {-} $number {} number - return $prefix$number -} - -# A trace proc providing OMF_MakeValidNumber service. -proc OMF_KeepValidNumber { name elt op } { - global mmd_log - if { ![string match {} $elt] } { set name ${name}($elt) } - upvar $name x - if {![info exists x]} { - # Try global level - upvar #0 $name x - if {![info exists x]} { - $mmd_log Append "Error in proc OMF_KeepValidNumber, \ - run level #[info level]: \ - Unable to locate variable $name" - return {} - } - } - set x [OMF_MakeValidNumber $x] -} - -# Checks if x & y would differ if converted the the omfStdNumericFormat. -# Used bindings to determine if the shadowed variable needs -# updating. Returns 1 iff x!=y after conversion. -proc OMF_StdFormatCompare { x y } { - global omfStdNumericFormat - set x [format $omfStdNumericFormat $x] - set y [format $omfStdNumericFormat $y] - if {$x==$y} { return 0 } - return 1 -} +# Removed - Can't find evidence that anything has used this in a long time. +# proc OMF_StdFormatCompare args {} # Converts width, height, xcenter & ycenter across rotations proc OMF_RotateDimensions { angle widthname heightname \ @@ -336,621 +197,37 @@ return 0 } -##### -# Info message dialog box (non-modal) -# The return value is the window designation -# Set import bitmap to "none" to get no bitmap -proc OMF_InfoDialog { message {title {}} {bitmap {}} {width {}} \ - {justification "left"} } { - # First make up a unique window name - set id 0 - set basename .omfInfoDialogWin - while { [winfo exists "$basename$id"] } { - if { $id > 200 } { - Ow_FatalError "Too many (>$id) open InfoDialog windows" - } - incr id - } - set window $basename$id - - if { {} == $title } { set title "Informational Message" } - - toplevel $window - wm group $window . - wm title $window "$title" - Ow_PositionChild $window - - global omfDialogWidth - if { {} == "$width" } { set width $omfDialogWidth } ;# Default width - - frame $window.top - frame $window.bottom - # Insert beam to insure minimum width - frame $window.top.beam -height 0 -width $width - pack $window.top.beam -side top - if { {} == $bitmap } { set bitmap info } - if { [string compare "none" $bitmap] != 0 } { - label $window.top.bitmap -bitmap $bitmap - pack $window.top.bitmap -side left -anchor w -padx 2m - } - - message $window.top.msg -width $width -text $message \ - -justify $justification - ## UNFORTUNATELY, the message widget doesn't support "selections". :-[ - - pack $window.top.msg -side left -fill both -expand 1 - - set current_focus [focus] - if { [string match {} $current_focus] } { - set current_focus "." - } else { - set current_focus [winfo toplevel [focus]] - } - button $window.bottom.btn -text "OK" \ - -command "OMF_SetFocus $current_focus $window; destroy $window" - - # Note: It is important to release focus _before_ - # destroying the window, as otherwise the focus can - # get misplaced. -mjd 2/97 - # Note 2: Forcing the focus against the window manager can - # make for some strangeness. With the above code, when the - # message box is closed, the focus jumps to the window that - # had the focus when the message box was created (or "."; - # OMF_SetFocus falls back to "." if the import window doesn't - # exist). I may decide to disable this in the future. -mjd 9/97 - wm protocol $window WM_DELETE_WINDOW "$window.bottom.btn invoke" - pack $window.bottom.btn -side top -expand 1 - pack $window.top $window.bottom -side top -fill both -expand 1 - Ow_SetIcon $window - - OMF_InfoDialogHelper $window - # WARNING WILL ROBINSON: This routine trys to control the - # focus in a sensible manner. To do this, it waits for - # $window.bottom.btn to become viewable, which may require - # event loop processing. This can cause REENTRANCY PROBLEMS - # IN EVENT BINDINGS. You have been warned. - - return $window -} - -proc OMF_InfoDialogHelper { window } { - if {![winfo exists $window.bottom.btn]} { - return - } - WaitVisible $window.bottom.btn - - set current_focus [focus] - if { [string match {} $current_focus] } { - set current_focus "." - } else { - set current_focus [winfo toplevel [focus]] - } - $window.bottom.btn configure \ - -command "OMF_SetFocus $current_focus $window; destroy $window" - focus $window.bottom.btn -} - +# Removed - Replaced by the proc Ow_Dialog +# proc OMF_InfoDialog args {} +# proc OMF_InfoDialogHelper args {} +# proc OMF_SetFocus args {} - -# Routine to direct mouse & keyboard focus to a specified -# top-level window, provided it is not iconified (or withdrawn). -# If called by a window "destroy" routine, it is important to -# call this _before_ the window is destroyed, as otherwise the -# focus may be "misplaced" (i.e., lost). Also if you specify -# the "other top-level window", then tlw will be raised with -# respect to that window. (Note: Linux/AXP + XFree is painfully -# slow on 'raise $tlw', but 'raise $tlw $otlw' is quick. -proc OMF_SetFocus { tlw {otlw ""} } { - if { ![winfo exists $tlw] } { set tlw "." } - set top [winfo toplevel $tlw] - if {[string compare [wm state $top] normal]==0} { - if {[string compare $otlw ""]!=0 && [winfo exists $otlw]} { - raise $top $otlw - } - focus [focus -lastfor $tlw] ;# Return focus to last window - # in $tlw that had focus - } -} - -# Convert .'s in $window to _'s, and extract everything up to -# the second underscore as a (per-call) ID that can be used to -# form global variable names. This proc assumes that $window -# begins with a leading '.'. This routine also extracts the -# base (up to second .) and extension part of $window -# NOTE: If "$id" is sent in place of $window, then this routine -# will return "$id" unaltered (i.e. "OMF_GetID $w" == -# "OMF_GetID [OMF_GetID $w]") -proc OMF_GetID { window {idname ""} {basename ""} {extname ""} } { - if { "$idname" != "" } { upvar $idname id } - if { "$basename" != "" } { upvar $basename base } - if { "$extname" != "" } { upvar $extname ext } - set base ""; - set id "$window" ;# If regexp doesn't match, we get $window back - regexp {^ *(\.[^.]*)(.*)$} "$window" full base ext - regsub -all {\.} "$base" _ id - return $id -} - -# OMF_EntryFollow copies $name to ${name}Entry -proc OMF_EntryFollow { name elt op } { - # Assumes $elt == "" - upvar #0 $name base - global mmd_log - if {![info exists base]} { - $mmd_log Append \ - "Error in OMF_EntryFollow; global variable ->$name<- does not exist" - return - } - upvar #0 ${name}Entry follower - if {![info exists follower]} { - $mmd_log Append -nonewline "Error in OMF_EntryFollow;" - $mmd_log Append " global variable ->${name}Entry<- does not exist" - return - } - set follower $base -} - -# OMF_ScaleFollow copies $name to ${name}Scale -proc OMF_ScaleFollow { name elt op } { - # Assumes $elt == "" - upvar #0 $name base - upvar #0 ${name}Scale follower - global mmd_log - if {![info exists base]} { - $mmd_log Append \ - "Error in OMF_ScaleFollow; global variable ->$name<- does not exist" - return - } - if {![info exists follower]} { - $mmd_log Append -nonewline "Error in OMF_ScaleFollow;" - $mmd_log Append " global variable ->${name}Scale<- does not exist" - return - } - set follower $base -} - -# OMF_ScaleEntryFollow copies $name to ' regsub {Scale$} "$name" "Entry" ' -proc OMF_ScaleEntryFollow { name elt op } { - # Assumes $elt == "" - upvar #0 $name base - global mmd_log - # Make sure this routine isn't be called from OMF_ScaleFollow, - # because in that case $name is "follower" - if { ![info exist base] } return - regsub {Scale$} "$name" "Entry" followername - upvar #0 $followername follower - if {![info exists follower]} { - $mmd_log Append -nonewline "Error in OMF_ScaleEntryFollow;" - $mmd_log Append " global variable ->$followername<- does not exist" - return - } - global omfStdNumericFormat - set follower [format $omfStdNumericFormat $base] -} +# Removed - Can't find evidence that anything has used this in a long time. +# proc OMF_GetID args {} # Produce an entry window collection: -# $framename, $framename.label, & $framename.value -# You also get $framename.scrx if '$scrollbar' is true. -# If you set "numeric" to non-zero, then the displayed value is held -# in a shadow variable called ${varname}Entry, at the global level. -# It is copied the "varname" upon a or a event, -# and the value from "varname" is copied back into ${varname}Entry on -# an event, or anytime "varname" changes. -# Note: Variables tied to entry widgets are at the global level. Also, -# bindings run at global level, so either way "varname" must be at -# the global level. -# If "numeric" is >0, then the value is kept a valid positive number -# (via OMF_KeepValidPosNumber), or if "numeric" <0 then it is kept at -# any valid number (via OMF_KeepValidNumber). -proc OMF_MakeEntryWindow { framename label labelwidth varname varwidth \ - scrollbar {relief "raised"} {numeric "0"}} { - global $varname - frame $framename -relief $relief -bd 2 - label $framename.label -text "$label" - if {[string compare $labelwidth ""]!=0} { - $framename.label configure -width $labelwidth -anchor e - } - entry $framename.value -relief sunken -bd 2 \ - -width $varwidth -bg [$framename.label cget -bg] - # The default color scheme under Tcl 8.0 + Windows makes - # labels a light gray, and entry backgrounds bright white. - # *I* think it looks pretty hideous... -mjd 97/10/3 - - OMF_AppendBindTag $framename.value omfCursorOverride - pack $framename.label -side left -anchor e - if { $scrollbar } { - $framename.value configure \ - -xscrollcommand "$framename.scrx set" - scrollbar $framename.scrx -bd 2 -troughcolor [TroughColor] \ - -orient horizontal -command "$framename.value xview" - pack $framename.scrx -side bottom -fill x - } - if { $numeric != 0 } { - global ${varname}Entry - $framename.value configure -textvariable ${varname}Entry \ - -justify right -font [Oc_Font Get bold] - if { $numeric > 0 } { - trace variable ${varname}Entry w OMF_KeepValidPosNumber - } else { - trace variable ${varname}Entry w OMF_KeepValidNumber - } - bind $framename.value \ - "set $varname \[set ${varname}Entry\]" - bind $framename.value \ - "set $varname \[set ${varname}Entry\]" - bind $framename.value \ - "set ${varname}Entry \[set $varname\]" - trace variable $varname w OMF_EntryFollow - } else { - $framename.value configure -textvariable $varname - } - pack $framename.value -fill x -expand 1 -side left -} - -# Produce a entry+scale window collection -proc OMF_MakeEntryScaleWindow {framename label labelwidth varname varwidth \ - scalewidth scalemin scalemax scalestep procname} { - # NOTE: varname *must* be a global variable name - # Make widgets - frame $framename -borderwidth 2 -relief ridge - frame $framename.col1 - frame $framename.col2 -bd 2 -relief sunken - label $framename.label -text $label -anchor e - if {[string compare $labelwidth {}]!=0} { - $framename.label configure -width $labelwidth - } - entry $framename.value -textvariable ${varname}Entry \ - -width $varwidth -bd 0 -justify right \ - -bg [$framename.label cget -bg] - # The default color scheme under Tcl 8.0 + Windows makes - # labels a light gray, and entry backgrounds bright white. - # *I* think it looks pretty hideous... -mjd 97/10/3 - - OMF_AppendBindTag $framename.value omfCursorOverride - - $framename.value configure -font [Oc_Font Get bold] - - scale $framename.scale -variable ${varname}Scale \ - -orient horizontal -troughcolor [TroughColor] -showvalue 0 \ - -length $scalewidth -from $scalemin -to $scalemax \ - -resolution $scalestep -bigincrement 0 -bd 0 - # Pack widgets - pack $framename.label -side left -in $framename.col1 - pack $framename.value -side left -in $framename.col2 - pack $framename.scale -side right -in $framename.col2 -fill x -expand 1 - pack $framename.col1 -side left - pack $framename.col2 -side right -fill x -expand 1 - # Bind widgets - bind $framename.value \ - "OMF_EntryScaleBinding $procname $varname" - bind $framename.value \ - "OMF_EntryScaleBinding $procname $varname 1" - bind $framename.value "OMF_EntryScaleEscapeBinding $varname" - bind $framename.scale \ - "OMF_EntryScaleButtonReleaseBinding %W %x %y $procname $varname" - # Note: tkCancelRepeat is an apparently undocumented call that turns - # off the auto-stepping feature initiated by a event in the - # scale trough. If this breaks in a new release of Tk, then another - # approach might be to try using "%W config -state disabled/normal" calls. - # - # Compatibility support for one way tkCancelRepeat might go away: - if {![llength [info commands tkCancelRepeat]]} { - tk::unsupported::ExposePrivateCommand tkCancelRepeat - } - bind $framename.scale \ - "tkCancelRepeat ; OMF_EntryScaleEscapeBinding $varname" - bind $framename.scale \ - "OMF_ScaleMotionBinding %W %x %y" - bind $framename.scale \ - "OMF_ScaleScaleBinding %W $procname $varname 0" - bind $framename.scale \ - "OMF_ScaleScaleBinding %W $procname $varname 1" - bind $framename.scale "OMF_EntryScaleEscapeBinding $varname" - bind $framename.scale "set ${varname}Scale \[%W get %x %y\]" - # Set traces - global $varname ${varname}Entry ${varname}Scale - ### Tie *Entry variables to *Scale variables - trace variable ${varname}Scale w OMF_ScaleEntryFollow - ### Tie *Entry & *Scale variables to base variables - trace variable $varname w OMF_EntryFollow - trace variable $varname w OMF_ScaleFollow - ### Make sure *Entry variable gets written in 'Standard Numeric Format' - if {![info exists $varname]} { set $varname 0.0 } - set $varname [OMF_FormatNumber [set $varname]] - set ${varname}Entry [set $varname] -} - -proc OMF_EntryScaleBinding { procname varname {stepcheck 0}} { - global $varname ${varname}Entry - # Make sure we got valid input from user - if { [OMF_IsNumber [set ${varname}Entry]] } { - if {!$stepcheck || [OMF_StdFormatCompare \ - [set $varname] [set ${varname}Entry]]} { - $procname [set ${varname}Entry] - } - } else { - set ${varname}Entry [set $varname] - } - set ${varname}Entry [OMF_FormatNumber [set $varname]] -} - -proc OMF_ScaleScaleBinding { widget procname varname {stepcheck 0}} { - upvar #0 $varname var - upvar #0 ${varname}Scale varscale - if {!$stepcheck || 2*abs($var-$varscale) > [$widget cget -resolution]} { - $procname $varscale - } -} - -proc OMF_EntryScaleEscapeBinding { varname } { - global $varname ${varname}Entry ${varname}Scale - global omfStdNumericFormat - set ${varname}Scale [set $varname] - set ${varname}Entry [format $omfStdNumericFormat [set $varname]] - # Note: Order is important here. There is a trace on ${varname}Scale - # that resets ${varname}Entry, and some Tcl/Tk interpreters - # will force ${varname}Scale to the nearest scale resolution - # step, which then gets copied to ${varname}Entry by the tracing. - # So we must set ${varname}Entry *after* ${varname}Scale. -} - -proc OMF_EntryScaleButtonReleaseBinding { w x y procname varname } { - # Updates $varname if button release was over slider or trough, - # otherwise calls OMF_EntryScaleEscapeBinding - global $varname ${varname}Entry ${varname}Scale - if {[string compare [$w identify $x $y] {}]!=0} { - $procname [set ${varname}Scale] - } else { - OMF_EntryScaleEscapeBinding $varname - } -} - -proc OMF_ScaleMotionBinding { w x y } { - if {[string compare [$w identify $x $y] {}]==0} {return -code break} -} +# Removed - Can't find evidence that anything has used this in a long time. +# proc OMF_MakeEntryWindow args {} +# proc OMF_EntryFollow args {} + +# Produce an entry+scale window collection +# Removed - These have now been replaced by the Oc_Class Ow_EntryScale +# proc OMF_MakeEntryScaleWindow args {} +# proc OMF_EntryScaleBinding args {} +# proc OMF_ScaleScaleBinding args {} +# proc OMF_EntryScaleEscapeBinding args {} +# proc OMF_EntryScaleButtonReleaseBinding args {} +# proc OMF_ScaleMotionBinding args {} +# proc OMF_ScaleEntryFollow args {} +# proc OMF_ScaleFollow args {} +# proc OMF_IsNumber args {} # Produce a radio box window collection -# Each elt of "args" is a label/value list. Any args elt -# with only 1 sub-element is automatically defined a value -# equivalent to its label, but all lowercase. -# Ex: OMF_MakeRadioList frame "Sample:" "" sample {} \ -# A {B 2} "C Button" {"Last button" 4} -# gets label/values of: A/a B/2 "C Button"/"c button" "Last button"/4 -proc OMF_MakeRadioList {framename rows center label labelwidth \ - varname tracename args} { - # Note: If you want centering inside the frame, do - # pack $framename.label -side left -anchor e -expand 1 - # and on the last button do - # pack $framename.r$j -side left -anchor w -expand 1 - frame $framename -borderwidth 2 -relief ridge - label $framename.label -text "$label" -anchor e - if {[string compare $labelwidth {}]!=0} { - $framename.label configure -width $labelwidth - } - if {$rows<2} { - pack $framename.label -side left - } else { - pack $framename.label -side top - } - if {$center} { - pack configure $framename.label -anchor e -expand 1 - } - set j 0 - foreach i $args { - if {[llength $i]>2} { - Ow_FatalError "Too long list element: $i" \ - "OMF_MakeRadioList Error" - } - set text "" - if {[llength $i]>0} { - set text [lindex $i 0] - } - if {[llength $i]>1} { - set value [lindex $i 1] - } else { - set value [string tolower $text] - } - radiobutton $framename.r$j -text $text -variable $varname \ - -value $value - if {$rows<2} { - pack $framename.r$j -side left -anchor w - } else { - pack $framename.r$j -side left -expand 1 - } - incr j - } - if {$center} { - pack configure $framename.r[expr {$j-1}] -expand 1 - } - if {[string compare $tracename {}]!=0} { - global $varname; trace variable $varname w $tracename - } -} - -# Converts a length specification of the form 4.5i (4.5 inches) to an -# equivalent length in specified units, and returns the converted length -# *without* a suffix. Valid units/suffixes are: c (cm), i (inch), m (mm), -# and p for printer's points (=1/72 inch). If no suffix is found then -# p is assumed. This is consistent with the interpretation used by Tk's -# canvas widget's 'postscript' command. The default output unit is -# centimeters. -proc OMF_ConvertUnits { length {newunits "c"}} { - set length [string trim $length] - if {![regexp {^(-?[0-9.]+)(.?)} $length match number dimension]} { - Ow_FatalError "Invalid length: $length" "OMF_ConvertToCm Error" - } - # Determine multiplier to convert to cm - switch -exact -- [string tolower $dimension] { - c { set multa 1. } - i { set multa 2.54 } - m { set multa 0.1 } - {} - - p { set multa [expr {2.54/72.}] } - default { - Ow_FatalError "Invalid dimension ($dimension) on length: \ - $length" "OMF_ConvertUnits Error" - } - } - # Determine multiplier to convert from cm to "newunits" - switch -exact -- [string tolower $newunits] { - c { set multb 1. } - i { set multb 1./2.54 } - m { set multb 10. } - {} - - p { set multb [expr {72./2.54}] } - default { - Ow_FatalError "Invalid output unit request: $newunits" \ - "OMF_ConvertUnits Error" - } - } - return [expr {$number*$multa*$multb}] -} +# Removed - Can't find evidence that anything has used this in a long time. +# proc OMF_MakeRadioList args {} # Print a canvas -# The input is an array including the following fields: -# canvas - name of canvas widget -# inname - name of file being displayed -# outname - name of output file or pipe -# orient - portrait | landscape -# size - output width *or* height (not both), in the format -# '-pagewidth 3.i' (3 inches width), or -# '-pageheight 5.c' (5 cm high), for example -# papertype - letter | legal | A4 | A3 -# clip - 1 | 0 (1=>print only displayed region of canvas) -# xmargin - left/right margin, with units. E.g.: 1.i -# ymargin - top/bottom margin, as above -# position - One of: c nw n ne e se s sw w -proc OMF_PrintCanvas { parr } { - upvar $parr popt - set errcode 0 - - # File overwrite check - set popt(outname) [string trim $popt(outname)] - if { "|" != [string index $popt(outname) 0] \ - && [file exists $popt(outname)] } { - # File is not a pipe, and already exists. - # Check with user before overwriting. - global ProgName - set response [Ow_Dialog 1 "$ProgName: Print Warning" \ - warning "Overwrite existing file $popt(outname)?" \ - {} "1" "Yes" "No"] - if { $response != 0 } { - # First (0'th) button (which is "Yes") _not_ selected - set errcode 1 - return $errcode - } - } - - # Set paper dimensions - switch -exact -- [string tolower $popt(papertype)] { - letter { set xmax 8.5i; set ymax 11i } - legal { set xmax 8.5i; set ymax 14i } - a4 { set xmax 21.c; set ymax 29.7c } - a3 { set xmax 29.7c; set ymax 42.c } - default { Ow_FatalError "Illegal papertype: $popt(papertype)" \ - "OMF_PrintCanvas Error" } - } - - # Calculate positioning (in cm) - set xmax [OMF_ConvertUnits $xmax] - set ymax [OMF_ConvertUnits $ymax] - set xmargin [OMF_ConvertUnits $popt(xmargin)] - set ymargin [OMF_ConvertUnits $popt(ymargin)] - if {[string compare "landscape" [string tolower $popt(orient)]]==0} { - # Rotation notes: If $rotate==1, then the 'page' coordinate system - # origin is moved to the upper lefthand corner of the page, with - # +x running down the page and +y running to the right. If you - # adopt this reference frame, then you can ignore the rotation - # and just pretend you are working from the start on a landscape'd - # page. The man page and online documentation - # http://www.sunlabs.com/tcl/development/man/TkCmd/canvas.n.html#M55 - # says "in rotated output the x-axis runs along the long dimension - # of the page (``landscape'' orientation)." This is true for - # the 'canvas' coordinate system, but not true for the 'page' - # coordinate system (adjusted with the -pagex & -pagey options). - set rotate 1 - set temp $xmargin ; set xmargin $ymargin; set ymargin $temp - } else { set rotate 0 } - # The following page offsets are used in conjuction - # with the '$canvas postscript -anchor' option - if {"$popt(position)"==""} { set $popt(position) "c" } ;# Safety - if {[string first "n" $popt(position)]>=0} { - # Position at top of page, minus margin - if {!$rotate} { - set yoff [expr {$ymax-$ymargin}] - } else { - set xoff $xmargin - } - } elseif {[string first "s" $popt(position)]>=0} { - # Position along page bottom margin - if {!$rotate} { - set yoff $ymargin - } else { - set xoff [expr {$xmax-$xmargin}] - } - } else { - # Top/bottom center - if {!$rotate} { - set yoff [expr {$ymax/2.}] - } else { - set xoff [expr {$xmax/2.}] - } - } - if {[string first "e" $popt(position)]>=0} { - # Position page right, minus margin - if {!$rotate} { - set xoff [expr {$xmax-$xmargin}] - } else { - set yoff [expr {$ymax-$ymargin}] - } - } elseif {[string first "w" $popt(position)]>=0} { - # Position page left, plus margin - if {!$rotate} { - set xoff $xmargin - } else { - set yoff $ymargin - } - } else { - # Left/right center - if {!$rotate} { - set xoff [expr {$xmax/2.}] - } else { - set yoff [expr {$ymax/2.}] - } - } - - # Setup crop options - if {$popt(crop)} { - set cropoptions {} - } else { - # Printing whole canvas - set sr [.canvas_frame.canvas cget -scrollregion] - set width [expr {[lindex $sr 2] - [lindex $sr 0]}] - set height [expr {[lindex $sr 3] - [lindex $sr 1]}] - set cropoptions "-x 0 -y 0 -width $width -height $height" - } - - - # Print - set output {} - set errmsg {} - if { [catch { - set output [open $popt(outname) w] - puts -nonewline $output \ - [eval $popt(canvas) postscript -colormode color \ - $popt(size) -pageanchor $popt(position) \ - -pagex ${xoff}c -pagey ${yoff}c -rotate $rotate \ - $cropoptions ] - } errmsg] } { - global ProgName - Ow_NonFatalError "Error printing to $popt(outname): $errmsg" \ - "$ProgName: Print Error" - set errcode 2 - } - catch { - if { ![string match {} $output] } { close $output } - } - - return $errcode -} +# Removed - This has now been replaced by the Oc_Class Ow_PrintDlg +# proc OMF_PrintCanvas args {} +# proc OMF_ConvertUnits args {} diff -urN oommf1.2a1/app/mmdisp/mmdispcmds.cc oommf/app/mmdisp/mmdispcmds.cc --- oommf1.2a1/app/mmdisp/mmdispcmds.cc Tue Jan 16 01:07:17 2001 +++ oommf/app/mmdisp/mmdispcmds.cc Thu Apr 26 11:34:05 2001 @@ -590,7 +590,10 @@ if(cptr!=NULL && *cptr!='\0') arrow_config.size=Nb_Atof(cptr); - + cptr=Tcl_GetVar2(interp,ab1("plot_config"),ab2("arrow,antialias"), + TCL_GLOBAL_ONLY); + if(cptr!=NULL && *cptr!='\0') + arrow_config.antialias=atoi(cptr); // Pixel plot configuration cptr=Tcl_GetVar2(interp,ab1("plot_config"),ab2("pixel,status"), @@ -1327,11 +1330,10 @@ " x"," y"," z", " m_x"," m_y"," m_z"); Tcl_Write(channel, buf, int(strlen(buf))); - REAL8m mult=scale; for(k=kmin;k @@ -173,8 +173,8 @@ source [file join [file dirname [info script]] counter.tcl] Oc_Main SetAppName mmHelp -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/19 15:42:24 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] diff -urN oommf1.2a1/app/mmlaunch/appindex.tcl oommf/app/mmlaunch/appindex.tcl --- oommf1.2a1/app/mmlaunch/appindex.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmlaunch/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name mmLaunch - -version 1.2.0.1 + -version 1.2.0.2 -machine omfsh -file mmlaunch.tcl } diff -urN oommf1.2a1/app/mmlaunch/mmlaunch.tcl oommf/app/mmlaunch/mmlaunch.tcl --- oommf1.2a1/app/mmlaunch/mmlaunch.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmlaunch/mmlaunch.tcl Tue May 29 13:47:19 2001 @@ -3,7 +3,7 @@ # An application which presents an interface for launching and # interconnecting other OOMMF applications. # -# Last modified on: $Date: 2001/01/18 23:51:50 $ +# Last modified on: $Date: 2001/05/29 17:47:19 $ # Last modified by: $Author: dgp $ # Support libraries @@ -16,8 +16,8 @@ wm withdraw . Oc_Main SetAppName mmLaunch -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] diff -urN oommf1.2a1/app/mmpe/appindex.tcl oommf/app/mmpe/appindex.tcl --- oommf1.2a1/app/mmpe/appindex.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmpe/appindex.tcl Tue May 29 13:47:19 2001 @@ -2,14 +2,14 @@ Oc_Application Define { -name mmProbEd -aliases mmpe - -version 1.2.0.1 + -version 1.2.0.2 -machine omfsh -file mmpe.tcl } Oc_Application Define { -name FileSource - -version 1.2.0.1 + -version 1.2.0.2 -machine omfsh -file filesource.tcl } diff -urN oommf1.2a1/app/mmpe/filesource.tcl oommf/app/mmpe/filesource.tcl --- oommf1.2a1/app/mmpe/filesource.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmpe/filesource.tcl Tue May 29 13:47:19 2001 @@ -7,8 +7,8 @@ wm withdraw . Oc_Main SetAppName FileSource -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] diff -urN oommf1.2a1/app/mmpe/mmpe.tcl oommf/app/mmpe/mmpe.tcl --- oommf1.2a1/app/mmpe/mmpe.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmpe/mmpe.tcl Tue May 29 13:47:19 2001 @@ -12,8 +12,8 @@ wm withdraw . Oc_Main SetAppName mmProbEd -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] diff -urN oommf1.2a1/app/mmsolve/any2ppm.tcl oommf/app/mmsolve/any2ppm.tcl --- oommf1.2a1/app/mmsolve/any2ppm.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmsolve/any2ppm.tcl Tue May 29 13:47:19 2001 @@ -11,7 +11,7 @@ Oc_ForceNoTkDefaultMessage Oc_Main SetAppName any2ppm -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Option console {} {} @@ -73,8 +73,8 @@ {} {#do nothing} {-} {set outchan stdout} default { - if {[catch {open $outname "w"} msg]} { - puts stderr "Unable to open output file $outname: $msg" + if {[catch {open $outSpec "w"} msg]} { + puts stderr "Unable to open output file $outSpec: $msg" incr errcount } else { set outchan $msg diff -urN oommf1.2a1/app/mmsolve/appindex.tcl oommf/app/mmsolve/appindex.tcl --- oommf1.2a1/app/mmsolve/appindex.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmsolve/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name any2ppm - -version 1.2.0.1 + -version 1.2.0.2 -machine filtersh -file any2ppm.tcl -mode fg diff -urN oommf1.2a1/app/mmsolve/fft.cc oommf/app/mmsolve/fft.cc --- oommf1.2a1/app/mmsolve/fft.cc Fri May 5 18:23:15 2000 +++ oommf/app/mmsolve/fft.cc Fri Mar 30 23:16:31 2001 @@ -38,11 +38,10 @@ if(vecsize>0) { if(Uforward!=(MyComplex *)NULL) delete[] Uforward; if(Uinverse!=(MyComplex *)NULL) delete[] Uinverse; - if(workspace!=(MyComplex *)NULL) delete[] workspace; if(permindex!=(int *)NULL) delete[] permindex; } vecsize=0; - Uforward=Uinverse=workspace=(MyComplex *)NULL; + Uforward=Uinverse=(MyComplex *)NULL; permindex=(int *)NULL; } @@ -68,8 +67,6 @@ if((Uforward=new MyComplex[size])==0) PlainError(1,"Error in FFT::Setup %s",ErrNoMem); if((Uinverse=new MyComplex[size])==0) - PlainError(1,"Error in FFT::Setup %s",ErrNoMem); - if((workspace=new MyComplex[size])==0) PlainError(1,"Error in FFT::Setup %s",ErrNoMem); #ifdef ORIG_CODE REALWIDE baseang= -2*PI/double(size); diff -urN oommf1.2a1/app/mmsolve/fft.h oommf/app/mmsolve/fft.h --- oommf1.2a1/app/mmsolve/fft.h Fri Sep 15 20:00:27 2000 +++ oommf/app/mmsolve/fft.h Fri Mar 30 23:16:31 2001 @@ -4,7 +4,7 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2000/09/16 00:00:27 $ + * Last modified on: $Date: 2001/03/31 04:16:31 $ * Last modified by: $Author: donahue $ */ @@ -113,7 +113,6 @@ int vecsize; enum Direction { forward, inverse }; MyComplex *Uforward,*Uinverse; - MyComplex *workspace; int *permindex; void Permute(MyComplex *vec); void BaseDecFreqForward(MyComplex *vec); @@ -122,7 +121,7 @@ public: FFT(void) { vecsize=0; - Uforward=Uinverse=workspace=(MyComplex *)NULL; + Uforward=Uinverse=(MyComplex *)NULL; permindex=(int *)NULL; } ~FFT(void); diff -urN oommf1.2a1/app/mmsolve/grid.cc oommf/app/mmsolve/grid.cc --- oommf1.2a1/app/mmsolve/grid.cc Tue Oct 10 14:13:41 2000 +++ oommf/app/mmsolve/grid.cc Mon Feb 26 11:28:29 2001 @@ -1766,7 +1766,7 @@ double AllowedSolverError=AllowedSpinError; while(1) { - AllowedSolverError=OC_MIN(AllowedSpinError,StepSize*maxtorque); + AllowedSolverError=OC_MIN(AllowedSpinError,0.2*StepSize*maxtorque); /// Error should never be larger than AllowedSpinError, but for /// small steps a more relevant comparison is relative to |m1-m|. /// (For small steps the first criterion is never triggered.) diff -urN oommf1.2a1/app/mmsolve/grid.h oommf/app/mmsolve/grid.h --- oommf1.2a1/app/mmsolve/grid.h Thu Jul 13 22:34:31 2000 +++ oommf/app/mmsolve/grid.h Fri Feb 2 14:53:04 2001 @@ -25,7 +25,7 @@ #endif #undef DEMAG_EDGE_CORRECTION // Enable for experimental demag edge corrections -#define ANIS_BDRY_ADJUSTMENT // Enable for experimental surface anistropy +#define ANIS_BDRY_ADJUSTMENT // Enable for experimental surface anisotropy #if defined(DEMAG_EDGE_CORRECTION) || defined(ANIS_BDRY_ADJUSTMENT) # define BDRY_CODE diff -urN oommf1.2a1/app/mmsolve/magelt.h oommf/app/mmsolve/magelt.h --- oommf1.2a1/app/mmsolve/magelt.h Mon Jul 17 00:47:05 2000 +++ oommf/app/mmsolve/magelt.h Fri Feb 2 14:54:20 2001 @@ -59,15 +59,13 @@ #define MAXMAGNGBRCNT 8 // Must be at least as large as MAGNGBRCNT // #defined in magelt.cc -// #define EXCHANGE_THICKNESS_ADJ(m1,m2) sqrt((m1)*(m2)) -#define EXCHANGE_THICKNESS_ADJ(m1,m2) OC_MIN(m1,m2) +// #define EXCHANGE_THICKNESS_ADJ(m1,m2) OC_MIN(m1,m2) +#define EXCHANGE_THICKNESS_ADJ(m1,m2) ((m1+m2)==0.?0.:2*m1*m2/(m1+m2)) /// EXCHANGE_THICKNESS_ADJ is exchange link weight adjustment factor. /// The inputs m1 & m2 should each be in [0,1]. This function should -/// have the properties outlined in NOTES II, 27-Apr-2000, p36, namely +/// have the properties outlined in NOTES II, 1-Feb-2001, p78, namely /// 1) EXCHANGE_THICKNESS_ADJ(m1,m2) = EXCHANGE_THICKNESS_ADJ(m2,m1) -/// 2) EXCHANGE_THICKNESS_ADJ(m,m) = m -/// 3) min(m1,m2) <= EXCHANGE_THICKNESS_ADJ(m1,m2) <= max(m1,m2) -/// 4) lim m2->0 EXCHANGE_THICKNESS_ADJ(m1,m2) = 0 +/// 2) min(m1,m2) <= EXCHANGE_THICKNESS_ADJ(m1,m2) <= 2m1.m2/(m1+m2) //////////////////////// MagElt Declaration ////////////////////////// diff -urN oommf1.2a1/app/mmsolve/makerules.tcl oommf/app/mmsolve/makerules.tcl --- oommf1.2a1/app/mmsolve/makerules.tcl Thu Jan 18 18:51:50 2001 +++ oommf/app/mmsolve/makerules.tcl Tue May 29 13:47:19 2001 @@ -63,7 +63,7 @@ puts $f [format { Oc_Application Define { -name mmSolve - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -file "%s" } @@ -73,7 +73,7 @@ puts $f [format { Oc_Application Define { -name mpirun - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -directory {} -file {%s} @@ -86,7 +86,7 @@ puts $f [format { Oc_Application Define { -name mmSolve - -version 1.2.0.1 + -version 1.2.0.2 -machine mpirun -file "%s" } @@ -102,7 +102,10 @@ MakeRule Define { -targets [Platform Executables mmsolve] -dependencies [concat [Platform Objects $objects] \ - [Platform StaticLibraries {vf nb oc}]] + [Platform StaticLibraries {vf nb oc}] \ + [list [file join .. .. pkg ow tclIndex] \ + [file join .. .. pkg net tclIndex] \ + tclIndex]] -script [format { Platform Link -obj {%s} \ -lib {vf nb oc tk} \ @@ -153,6 +156,7 @@ -dependencies {} -script [format { eval DeleteFiles [Platform Objects {%s}] + eval DeleteFiles [Platform Intermediate mmsolve] } $objects] } diff -urN oommf1.2a1/app/mmsolve/mms.tcl oommf/app/mmsolve/mms.tcl --- oommf1.2a1/app/mmsolve/mms.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/mms.tcl Tue May 29 13:47:19 2001 @@ -2,13 +2,13 @@ # # Master Tcl file for the mmsolve shell # -# Last modified on: $Date: 2001/01/18 23:51:51 $ +# Last modified on: $Date: 2001/05/29 17:47:19 $ # Last modified by: $Author: dgp $ Oc_CheckTclIndex mmSolve # NOTE: version number below must match that in ./mmsolve.h -package require -exact Mms 1.2.0.1 +package require -exact Mms 1.2.0.2 # Set up for autoloading of Oc extension commands set mms(library) [file dirname [info script]] diff -urN oommf1.2a1/app/mmsolve/mmsinit.cc oommf/app/mmsolve/mmsinit.cc --- oommf1.2a1/app/mmsolve/mmsinit.cc Tue Jul 25 11:21:49 2000 +++ oommf/app/mmsolve/mmsinit.cc Tue Mar 27 14:55:23 2001 @@ -94,8 +94,7 @@ #define MYBUFSIZE 15000 static char mybuf[MYBUFSIZE]; // Scratch space, used in particular to /// hold intermediate results being passed back to Tcl. -#define MYSTRFMT %.14999s // Make sure we don't overflow buffer. - +#define MYSTRFMT %s // Macros which take a list of conversion functions and return an argument // list where those functions are applied to elements of argv. @@ -131,7 +130,8 @@ static const char* Vec3Dtoa(Vec3D v) { // Converts a Vec3D to an ASCII character string. static char buf[256]; // Should be big enough! - sprintf(buf,FLTSTR" "FLTSTR" "FLTSTR,v.GetX(),v.GetY(),v.GetZ()); + Oc_Snprintf(buf, sizeof(buf), FLTSTR" "FLTSTR" "FLTSTR, + v.GetX(),v.GetY(),v.GetZ()); return buf; } static Vec3D atoVec3D(const char *buf) @@ -214,15 +214,8 @@ /* interp->result is only 200 bytes wide, so use */ \ /* Tcl_AppendResult instead of printing directly */ \ /* into interp->result. */ \ - sprintf(mybuf, OC_STRINGIFY(RFMT), \ + Oc_Snprintf(mybuf, sizeof(mybuf), OC_STRINGIFY(RFMT), \ RCVT(classPtr->METHOD ARG(NUMARGS,CVT,ERROR))); \ - mybuf[MYBUFSIZE-1]='\0'; /* Safety. */ \ - if(strlen(mybuf)>=MYBUFSIZE-1) { \ - /* Safety check */ \ - PlainError(1,"C to Tcl buffer overflow in mmsinit.cc, %s->%s()", \ - OC_STRINGIFY(CLASS_TCL_NAME),#METHOD); \ - Tcl_Exit(1); \ - } \ Tcl_ResetResult(interp); \ Tcl_AppendResult(interp,mybuf,(char *)NULL); \ if(errorcode>0) { \ @@ -460,7 +453,7 @@ Nx=Ny=0; // Just to keep some compilers quiet. classPtr->GetDimens(Nx,Ny); - sprintf(mybuf, "%4d %4d",Nx,Ny); + Oc_Snprintf(mybuf, sizeof(mybuf), "%4d %4d",Nx,Ny); Tcl_AppendResult(interp, mybuf, (char *)NULL); return TCL_OK; } @@ -487,8 +480,9 @@ exch=anis=demag=zeeman=total=0.0; // Just to keep compiler quiet. classPtr->GetEnergyDensities(exch,anis,demag,zeeman,total); - sprintf(mybuf,FLTSTR" "FLTSTR" "FLTSTR" "FLTSTR" "FLTSTR, - exch,anis,demag,zeeman,total); + Oc_Snprintf(mybuf, sizeof(mybuf), + FLTSTR" "FLTSTR" "FLTSTR" "FLTSTR" "FLTSTR, + exch, anis, demag, zeeman, total); Tcl_ResetResult(interp); Tcl_AppendResult(interp,mybuf,(char *)NULL); @@ -517,7 +511,7 @@ steps=rejects=energy_rejects=position_rejects=0; // Quiet compiler. classPtr->GetStepStats(steps,rejects,energy_rejects,position_rejects); - sprintf(mybuf,"%d %d %d %d", + Oc_Snprintf(mybuf, sizeof(mybuf), "%d %d %d %d", steps,rejects,energy_rejects,position_rejects); Tcl_ResetResult(interp); Tcl_AppendResult(interp,mybuf,(char *)NULL); @@ -557,7 +551,7 @@ (ClientData /*clientData*/, Tcl_Interp *interp, int /*argc*/, char **argv) { static char buf[256]; // Should be big enough - sprintf(buf,"rename %s {}",argv[0]); + Oc_Snprintf(buf, sizeof(buf), "rename %s {}",argv[0]); return Tcl_GlobalEval(interp, buf); } @@ -566,7 +560,7 @@ (ClientData /*clientData*/, Tcl_Interp *interp, int /*argc*/, char **argv) { static char buf[256]; // Should be big enough - sprintf(buf,"rename %s {}",argv[0]); + Oc_Snprintf(buf, sizeof(buf), "rename %s {}",argv[0]); return Tcl_GlobalEval(interp, buf); } @@ -740,7 +734,7 @@ } \ static int nextinstance = 0; \ char buf[200]; \ - sprintf(buf, "_%s%d", argv[0], nextinstance); \ + Oc_Snprintf(buf, sizeof(buf), "_%s%d", argv[0], nextinstance); \ if (Tcl_SetVar(interp, argv[2], buf, TCL_LEAVE_ERR_MSG) == NULL ) { \ return TCL_ERROR; \ } \ @@ -779,7 +773,7 @@ CLASS *classPtr = new CLASS(CNVT_FUNC1(argv[3])); \ static int nextinstance = 0; \ char buf[200]; \ - sprintf(buf, "_%s%d", argv[0], nextinstance); \ + Oc_Snprintf(buf, sizeof(buf), "_%s%d", argv[0], nextinstance); \ if (Tcl_SetVar(interp, argv[2], buf, TCL_LEAVE_ERR_MSG) == NULL ) { \ return TCL_ERROR; \ } \ diff -urN oommf1.2a1/app/mmsolve/mmsolve.h oommf/app/mmsolve/mmsolve.h --- oommf1.2a1/app/mmsolve/mmsolve.h Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/mmsolve.h Tue May 29 13:47:19 2001 @@ -26,7 +26,7 @@ #define MMSOLVE_MAJOR_VERSION 1 #define MMSOLVE_MINOR_VERSION 2 #define MMSOLVE_RELEASE_LEVEL 0 -#define MMSOLVE_RELEASE_SERIAL 1 +#define MMSOLVE_RELEASE_SERIAL 2 #define MMSOLVE_VERSION OC_MAKE_VERSION(MMSOLVE) diff -urN oommf1.2a1/app/mmsolve/procs.tcl oommf/app/mmsolve/procs.tcl --- oommf1.2a1/app/mmsolve/procs.tcl Thu Mar 11 16:28:25 1999 +++ oommf/app/mmsolve/procs.tcl Tue May 29 13:22:30 2001 @@ -9,6 +9,11 @@ # First open file directly set chanid [open $filename r] + # Would rather turn on large buffered, binary translation only + # after checking for the P3 header (see [fconfigure] below), + # but a bug in Tcl 8.1-8.3 prevents that. :( + fconfigure $chanid -translation binary \ + -buffering full -buffersize 250000 set var [read $chanid 2] if {![string match P3 $var]} { # Input file is not PPM P3 (ASCII) type. Send through filter. @@ -22,9 +27,9 @@ } set cmdLine [linsert $cmdLine 0 |] set chanid [open $cmdLine r] + fconfigure $chanid -translation binary \ + -buffering full -buffersize 250000 } - fconfigure $chanid -translation binary \ - -buffering full -buffersize 250000 append var [read $chanid] close $chanid } diff -urN oommf1.2a1/app/mmsolve/scripts/appindex.tcl oommf/app/mmsolve/scripts/appindex.tcl --- oommf1.2a1/app/mmsolve/scripts/appindex.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/scripts/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,6 +1,6 @@ Oc_Application Define { -name batchmaster - -version 1.2.0.1 + -version 1.2.0.2 -machine filtersh -file batchmaster.tcl -options {-tk 0} @@ -9,7 +9,7 @@ Oc_Application Define { -name batchslave - -version 1.2.0.1 + -version 1.2.0.2 -machine mmsolve -file batchslave.tcl -options {-tk 0} @@ -17,7 +17,7 @@ Oc_Application Define { -name batchsolve - -version 1.2.0.1 + -version 1.2.0.2 -machine mmsolve -file batchsolve.tcl -options {-tk 0} @@ -26,7 +26,7 @@ Oc_Application Define { -name mag2hfield - -version 1.2.0.1 + -version 1.2.0.2 -machine mmsolve -file mag2hfield.tcl -options {-tk 0} diff -urN oommf1.2a1/app/mmsolve/scripts/batchmaster.tcl oommf/app/mmsolve/scripts/batchmaster.tcl --- oommf1.2a1/app/mmsolve/scripts/batchmaster.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/scripts/batchmaster.tcl Tue May 29 13:47:19 2001 @@ -11,7 +11,7 @@ Oc_ForceNoTkDefaultMessage ;# Use stderr, not dialog to report errors Oc_Main SetAppName batchmaster -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Option [Oc_CommandLine Switch] { {task_script {} {Task definition file}} diff -urN oommf1.2a1/app/mmsolve/scripts/batchslave.tcl oommf/app/mmsolve/scripts/batchslave.tcl --- oommf1.2a1/app/mmsolve/scripts/batchslave.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/scripts/batchslave.tcl Tue May 29 13:47:19 2001 @@ -14,7 +14,7 @@ Oc_ForceNoTkDefaultMessage ;# Error messages to stderr, not dialog Oc_Main SetAppName batchslave -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Option [Oc_CommandLine Switch] { {host {} {Hostname to connect to master}} diff -urN oommf1.2a1/app/mmsolve/scripts/batchsolve.tcl oommf/app/mmsolve/scripts/batchsolve.tcl --- oommf1.2a1/app/mmsolve/scripts/batchsolve.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/scripts/batchsolve.tcl Tue May 29 13:47:19 2001 @@ -10,7 +10,7 @@ Oc_ForceNoTkDefaultMessage ;# use stderr, not dialog for messages Oc_Main SetAppName batchsolve -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Option interface { {flag {expr {![catch {expr {$flag && $flag}}]}} {= 0 or 1}} diff -urN oommf1.2a1/app/mmsolve/scripts/mag2hfield.tcl oommf/app/mmsolve/scripts/mag2hfield.tcl --- oommf1.2a1/app/mmsolve/scripts/mag2hfield.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve/scripts/mag2hfield.tcl Tue May 29 13:47:19 2001 @@ -6,7 +6,7 @@ package require Mms 1.1.1 Oc_Main SetAppName mag2hfield -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Option console {} {} diff -urN oommf1.2a1/app/mmsolve2d/appindex.tcl oommf/app/mmsolve2d/appindex.tcl --- oommf1.2a1/app/mmsolve2d/appindex.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve2d/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name mmSolve2D - -version 1.2.0.1 + -version 1.2.0.2 -machine mmsolve -file mmsolve2d.tcl -options {-tk 0} diff -urN oommf1.2a1/app/mmsolve2d/mmsolve2d.tcl oommf/app/mmsolve2d/mmsolve2d.tcl --- oommf1.2a1/app/mmsolve2d/mmsolve2d.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/mmsolve2d/mmsolve2d.tcl Tue May 29 13:47:19 2001 @@ -11,8 +11,8 @@ ## goes down. Oc_Main SetAppName mmSolve2D -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:51 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ diff -urN oommf1.2a1/app/omfsh/makerules.tcl oommf/app/omfsh/makerules.tcl --- oommf1.2a1/app/omfsh/makerules.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/omfsh/makerules.tcl Tue May 29 13:47:19 2001 @@ -36,13 +36,13 @@ puts $f [format { Oc_Application Define { -name omfsh - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -file "%s" } Oc_Application Define { -name filtersh - -version 1.2.0.1 + -version 1.2.0.2 -machine %s -file "%s" } @@ -108,6 +108,10 @@ MakeRule Define { -targets objclean -dependencies {} - -script {DeleteFiles [Platform Objects omfsh]} + -script { + DeleteFiles [Platform Objects omfsh] + eval DeleteFiles \ + [Platform Intermediate {omfsh filtersh}] + } } diff -urN oommf1.2a1/app/oxs/appindex.tcl oommf/app/oxs/appindex.tcl --- oommf1.2a1/app/oxs/appindex.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/oxs/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,14 +1,14 @@ Oc_Application Define { -name Oxsii - -version 1.2.0.1 + -version 1.2.0.2 -machine oxs -file oxsii.tcl } Oc_Application Define { -name MIFConvert - -version 1.2.0.1 + -version 1.2.0.2 -machine tclsh -file mifconvert.tcl -mode fg diff -urN oommf1.2a1/app/oxs/base/director.cc oommf/app/oxs/base/director.cc --- oommf1.2a1/app/oxs/base/director.cc Fri Jan 19 22:33:54 2001 +++ oommf/app/oxs/base/director.cc Fri Mar 30 23:19:11 2001 @@ -10,6 +10,7 @@ #include #include #include "oc.h" +#include "nb.h" #include "director.h" #include "driver.h" #include "simstate.h" @@ -28,12 +29,10 @@ /* End includes */ -int myEval(Tcl_Interp* interp,const string& cmd) +int myTclStringEval(Tcl_Interp* interp,const string& cmd) { - char* buf=new char[cmd.length()+1]; - strcpy(buf,cmd.c_str()); - int errcode=Tcl_Eval(interp,buf); - delete[] buf; + static Oc_AutoBuf buf; + int errcode=Tcl_Eval(interp,buf(cmd.c_str())); return errcode; } @@ -46,7 +45,8 @@ } Oxs_Director::Oxs_Director(Tcl_Interp *i) - : problem_count(0),problem_id(0),energy_calc_count(0), + : problem_count(0),problem_id(0), + random_number_seed(0),energy_calc_count(0), interp(i), safe_interp(NULL), driver(NULL), simulation_state_reserve_count(0), total_energy_output(this,"Director","Total energy","J",1, @@ -63,6 +63,19 @@ int Oxs_Director::ProbReset() { // Sets micromag problem to initial state energy_calc_count=0; // Reset GetEnergyDensity() call count + + // Initialize random number generator. This is also done, + // with the same seed, before Oxs_Ext object construction + // (cf. Oxs_Director::ProbInit()). + Oc_UnifRand(random_number_seed); + + // Feed the same seed into the safe interpreter + if(random_number_seed!=0) { + char dummy_buf[128]; + sprintf(dummy_buf,"srand %u",random_number_seed); + Tcl_Eval(safe_interp,dummy_buf); + } + // Run Init() on all Oxs_Ext's vector::iterator it = ext_obj.begin(); while(it!=ext_obj.end()) { @@ -74,19 +87,18 @@ int Oxs_Director::ProbRun(Tcl_Interp* use_interp, int argc, char** argv) { - string result; + static string result; int errorcode=1; if(driver==NULL) { result = "Problem not initialized (no driver identified)"; } else { errorcode = driver->Run(result,argc,argv,use_interp); } - - if (errorcode == 0) { - return myEval(use_interp, result); - } - Tcl_AppendResult(use_interp,result.c_str(),(char *)NULL); - return TCL_ERROR; + if (errorcode == 0) { + return myTclStringEval(use_interp,result); + } + Tcl_AppendResult(use_interp,result.c_str(),(char *)NULL); + return TCL_ERROR; } int Oxs_Director::ProbInit(const char* mif,const char* filename) @@ -101,7 +113,7 @@ // Create slave interpreter for mif object to use cmd = "interp create -safe"; - error_code=myEval(interp,cmd); + error_code=myTclStringEval(interp,cmd); if(error_code!=TCL_OK) return error_code; safe_interp_name = string(Tcl_GetStringResult(interp)); safe_interp = Tcl_GetSlave(interp,Oc_AutoBuf(safe_interp_name.c_str())); @@ -115,14 +127,36 @@ // Read file into Oxs_Mif object cmd = string(mif) + string(" Read ") + safe_interp_name + string(" [list ") + string(filename) + string(" ]"); - error_code=myEval(interp,cmd); + error_code=myTclStringEval(interp,cmd); if(error_code!=TCL_OK) { return error_code; } + // Get random number generator seed request, if any. + random_number_seed=0; + cmd = string(mif) + string(" GetMiscValue seed "); + error_code=myTclStringEval(interp,cmd); + if(error_code==TCL_OK) { + random_number_seed=static_cast + (strtoul(Tcl_GetStringResult(interp),NULL,10)); + } + Oc_UnifRand(random_number_seed); // This gets set again, + /// with the same seed, at the front of the Init() calls. + /// It really shouldn't be necessary here; all objects + /// are encouraged to do as much initialization as possible + /// (including random number calls) in their Init routines + /// (cf. Oxs_Director::ProbReset().) + + // Feed the same seed into the safe interpreter + if(random_number_seed!=0) { + char dummy_buf[128]; + sprintf(dummy_buf,"srand %u",random_number_seed); + Tcl_Eval(safe_interp,dummy_buf); + } + // Get list of spec blocks in mif object cmd = string(mif) + string(" GetSpecKeys"); - error_code=myEval(interp,cmd); + error_code=myTclStringEval(interp,cmd); if(error_code!=TCL_OK) return error_code; Oxs_SplitList arglist; @@ -142,7 +176,7 @@ for(i=0;i + (strtoul((*FindInitValue(key))[0].c_str(),NULL,10)); + DeleteInitValue(key); + return uivalue; +} + +UINT4m Oxs_Ext::GetUIntInitValue(const string& key, + UINT4m default_value) +{ + const vector* param = FindInitValue(key); + if(param==NULL) return default_value; + return GetUIntInitValue(key); +} + string Oxs_Ext::GetStringInitValue(const string& key) { CheckInitValueParamCount(key,1); diff -urN oommf1.2a1/app/oxs/base/ext.h oommf/app/oxs/base/ext.h --- oommf1.2a1/app/oxs/base/ext.h Thu Jan 18 18:35:39 2001 +++ oommf/app/oxs/base/ext.h Mon Feb 26 11:13:04 2001 @@ -181,15 +181,17 @@ REAL8m GetRealInitValue(const string& key); ThreeVector GetThreeVectorInitValue(const string& key); INT4m GetIntInitValue(const string& key); + UINT4m GetUIntInitValue(const string& key); string GetStringInitValue(const string& key); - // These are duplicates of the above, but instead returns + // These are duplicates of the above, but instead return // default_value instead of throwing an error if key is not // in init_strings. REAL8m GetRealInitValue(const string& key,REAL8m default_value); ThreeVector GetThreeVectorInitValue(const string& key, const ThreeVector& default_value); INT4m GetIntInitValue(const string& key,INT4m default_value); + UINT4m GetUIntInitValue(const string& key,UINT4m default_value); string GetStringInitValue(const string& key, const string& default_value); diff -urN oommf1.2a1/app/oxs/base/key.h oommf/app/oxs/base/key.h --- oommf1.2a1/app/oxs/base/key.h Fri Dec 15 19:53:21 2000 +++ oommf/app/oxs/base/key.h Tue Feb 20 20:05:11 2001 @@ -82,7 +82,7 @@ void Set(T* tptr); // Releases current locks, if any, sets ptr to tptr, /// and if tptr!=NULL sets a DEP lock on it. - Oxs_Key() : id(0), ptr(0), lock(INVALID) {} + Oxs_Key() : id(0), lock(INVALID), ptr(0) {} Oxs_Key(T* tptr) : id(0), ptr(0), lock(INVALID) { Set(tptr); } ~Oxs_Key() { Release(); } diff -urN oommf1.2a1/app/oxs/base/mif.tcl oommf/app/oxs/base/mif.tcl --- oommf1.2a1/app/oxs/base/mif.tcl Fri Nov 3 18:24:10 2000 +++ oommf/app/oxs/base/mif.tcl Tue Jan 30 20:21:40 2001 @@ -125,6 +125,7 @@ interp alias $safe_interp Specify {} $this SetSpec interp alias $safe_interp ClearSpec {} $this UnsetSpec interp alias $safe_interp Miscellaneous {} $this SetMisc + interp alias $safe_interp Report {} puts stderr # Source filestr set errcode [catch {$safe_interp eval $filestr} errmsg] diff -urN oommf1.2a1/app/oxs/base/output.h oommf/app/oxs/base/output.h --- oommf1.2a1/app/oxs/base/output.h Mon Dec 18 15:58:15 2000 +++ oommf/app/oxs/base/output.h Mon Jan 29 00:53:28 2001 @@ -274,7 +274,7 @@ // Write cache to file state->mesh->WriteOvf(filename, "Sample Oxs_VectorFieldOutput output", - "test","rectangular","binary","8", + "test","rectangular","text","%#.17g", &cache.value,NULL); Tcl_AppendResult(interp,filename,(char *)NULL); diff -urN oommf1.2a1/app/oxs/base/simstate.cc oommf/app/oxs/base/simstate.cc --- oommf1.2a1/app/oxs/base/simstate.cc Sun Dec 17 17:31:28 2000 +++ oommf/app/oxs/base/simstate.cc Tue Feb 20 20:05:11 2001 @@ -9,7 +9,7 @@ // Constructor Oxs_SimState::Oxs_SimState() - : stage_iteration_count(0),stage_number(0),iteration_count(0), + : stage_number(0),stage_iteration_count(0),iteration_count(0), last_timestep(0),elapsed_time(0), Ms(NULL),Ms_inverse(NULL),mesh(NULL) {} diff -urN oommf1.2a1/app/oxs/base/simstate.h oommf/app/oxs/base/simstate.h --- oommf1.2a1/app/oxs/base/simstate.h Sun Dec 17 17:31:28 2000 +++ oommf/app/oxs/base/simstate.h Mon Feb 26 11:13:55 2001 @@ -39,6 +39,7 @@ UINT4m iteration_count; // Total number of distinct spin configurations REAL8m last_timestep; // Seconds REAL8m elapsed_time; // Seconds + REAL8m delta_E; // Change in E between this and previous state. // It is the responsibility of any object using this Oxs_SimState // object to insure the validity of these pointers. diff -urN oommf1.2a1/app/oxs/base/threevector.cc oommf/app/oxs/base/threevector.cc --- oommf1.2a1/app/oxs/base/threevector.cc Fri Jan 19 22:34:30 2001 +++ oommf/app/oxs/base/threevector.cc Mon Feb 12 02:55:51 2001 @@ -36,6 +36,9 @@ { // Adjusts size to "mag". We assume MagSq() doesn't over/underflow. // This is probably okay for our intended uses, but if we want to // bullet-proof we should do some preemptive prescaling. + // Cf. James L. Blue, "A Portable Fortran Program to Find the + // Euclidean Norm of a Vector," ACM Transactions on Mathematical + // Software, 4, 15-23 (1978). REAL8m magsq=MagSq(); if(magsq<=0) { Random(mag); @@ -45,6 +48,43 @@ } } +void Oxs_ThreeVector::MakeUnit() +{ // Conceptually equivalent to SetMag(1.0), but + // with enhanced accuracy. + REAL8m magsq=MagSq(); + if(magsq<=0) { + Random(1.0); + magsq=MagSq(); + } + REAL8m error = 1-magsq; + if(fabs(error)<=2*REAL8_EPSILON) { + // In general, we can't do better than this, so we might as + // well stop. Moreover, kicking out on this condition helps + // limit "chatter," i.e., without this check repeated calls + // into this routine will yield slightly different results, + // causing (x,y,z) to wander around like a drunk looking for + // his house keys. + return; + } + else if(fabs(error)>CUBE_ROOT_REAL8_EPSILON) { + // Big error; fall back to making a sqrt evaluation. + // REAL8_EPSILON is about 2e-16 with IEEE floating pt, + // so CUBE_ROOT_REAL8_EPSILON is 6e-6. See mjd NOTES II, + // 10-Feb-2001, p 91. + REAL8m mult = 1.0/sqrt(magsq); + x*=mult; y*=mult; z*=mult; + magsq=MagSq(); + error = 1-magsq; + } + + // Do one Halley step (see mjd's NOTES II, 8-Feb-2001, p82) + // to improve accuracy to <= 2*REAL8_EPSILON + REAL8m adj = 2*error/(1+3*magsq); + x += adj*x; y += adj*y; z += adj*z; + /// v += adj*v produces smaller | ||v||^2 - 1 | than + /// v *= (1+adj). +} + void Oxs_ThreeVector::Random(REAL8m mag) { // Makes a random vector of size "mag" REAL8m r=2*Oc_UnifRand()-1; @@ -71,3 +111,4 @@ y=mag*sinphi*sintheta; z=mag*cosphi; } + diff -urN oommf1.2a1/app/oxs/base/threevector.h oommf/app/oxs/base/threevector.h --- oommf1.2a1/app/oxs/base/threevector.h Thu Aug 24 20:24:09 2000 +++ oommf/app/oxs/base/threevector.h Tue Jan 30 20:22:34 2001 @@ -49,7 +49,7 @@ REAL8m MagSq() const { return x*x+y*y+z*z; } void SetMag(REAL8m mag); // Adjusts size to "mag" void Random(REAL8m mag); // Makes a random vector of size "mag" - + void MakeUnit(); // High-precision version of SetMag(1.0) }; // Test operators on Oxs_ThreeVector's diff -urN oommf1.2a1/app/oxs/examples/octant.mif oommf/app/oxs/examples/octant.mif --- oommf1.2a1/app/oxs/examples/octant.mif Wed Dec 31 19:00:00 1969 +++ oommf/app/oxs/examples/octant.mif Mon Jan 29 23:39:30 2001 @@ -0,0 +1,81 @@ +# MIF 2.0 +proc SKIP { args } {} + +Specify Oxs_ScriptAtlas:octant { + xrange {-20e-9 20e-9} + yrange {-20e-9 20e-9} + zrange {-20e-9 20e-9} + regions { A B C D E F G H } + script { MyRegion 20e-9 } +} + +Specify Oxs_RectangularMesh:mesh { + cellsize {10e-9 10e-9 10e-9} + atlas :octant +} + +Specify Oxs_UniaxialAnisotropy { + K1 { Oxs_UniformScalarFieldInit { value 520e3 } } + axis { Oxs_AtlasVectorFieldInit { + atlas :octant + norm 1 + values { + { A -1 -1 -1 } + { B -1 -1 1 } + { C -1 1 -1 } + { D -1 1 1 } + { E 1 -1 -1 } + { F 1 -1 1 } + { G 1 1 -1 } + { H 1 1 1 } + } + } } +} + +Specify Oxs_UniformExchange:NiFe { + A 13e-12 +} + +Specify Oxs_EulerEvolve { + alpha 0.5 + start_dm 0.01 +} + +Specify Oxs_StandardDriver { + evolver Oxs_EulerEvolve + min_timestep 1e-18 + max_timestep 1e-9 + stopping_dm_dt 0.01 + mesh :mesh + Ms { Oxs_UniformScalarFieldInit { value 8e5 } } + m0 { Oxs_RandomVectorFieldInit { + min_norm 1 + max_norm 1 + } } +} + + +array set RegionArray { +0,0,0 0 +0,0,1 1 +0,1,0 2 +0,1,1 3 +1,0,0 4 +1,0,1 5 +1,1,0 6 +1,1,1 7 +} + +proc MyRegion { cellsize x y z xmin ymin zmin xmax ymax zmax } { + global RegionArray + set xindex [expr int(floor(($x-$xmin)/$cellsize))] + set yindex [expr int(floor(($y-$ymin)/$cellsize))] + set zindex [expr int(floor(($z-$zmin)/$cellsize))] + if {[catch { set id $RegionArray($xindex,$yindex,$zindex) }]} { + set id -1 + } + return $id +} + + + diff -urN oommf1.2a1/app/oxs/ext/atlasscalarfieldinit.cc oommf/app/oxs/ext/atlasscalarfieldinit.cc --- oommf1.2a1/app/oxs/ext/atlasscalarfieldinit.cc Tue Jan 16 18:20:41 2001 +++ oommf/app/oxs/ext/atlasscalarfieldinit.cc Tue Feb 20 20:05:11 2001 @@ -62,7 +62,7 @@ } // Fill out value vector with default value - int i; + unsigned int i; for(i=0;iGetRegionCount();i++) values.push_back(default_value); @@ -122,7 +122,7 @@ sprintf(buf,"Region count mismatch (%d != %d) in" " Oxs_ScalarFieldInit::FillMeshValue of object %s;" " Atlas %s region count changed after initialization.", - atlas->GetRegionCount(),values.size(), + atlas->GetRegionCount(),int(values.size()), InstanceName(),atlas->InstanceName()); } ThreeVector loc; diff -urN oommf1.2a1/app/oxs/ext/atlasvectorfieldinit.cc oommf/app/oxs/ext/atlasvectorfieldinit.cc --- oommf1.2a1/app/oxs/ext/atlasvectorfieldinit.cc Fri Jan 19 22:34:30 2001 +++ oommf/app/oxs/ext/atlasvectorfieldinit.cc Tue Feb 20 20:05:11 2001 @@ -68,7 +68,7 @@ if(set_norm) default_value.SetMag(norm); // Fill out value vector with default value - int i; + unsigned int i; for(i=0;iGetRegionCount();i++) values.push_back(default_value); @@ -131,7 +131,7 @@ sprintf(buf,"Region count mismatch (%d != %d) in" " Oxs_VectorFieldInit::FillMeshValue of object %s;" " Atlas %s region count changed after initialization.", - atlas->GetRegionCount(),values.size(), + atlas->GetRegionCount(),int(values.size()), InstanceName(),atlas->InstanceName()); } ThreeVector loc; diff -urN oommf1.2a1/app/oxs/ext/cubicanisotropy.cc oommf/app/oxs/ext/cubicanisotropy.cc --- oommf1.2a1/app/oxs/ext/cubicanisotropy.cc Mon Dec 18 19:50:30 2000 +++ oommf/app/oxs/ext/cubicanisotropy.cc Mon Jan 29 00:53:28 2001 @@ -104,22 +104,25 @@ // // Then the energy is // 2 2 2 2 2 2 - // k (a1 a2 + a1 a3 + a2 a3 ) + // K (a1 a2 + a1 a3 + a2 a3 ) // // and the field in say the u1 direction is - // 2 2 2 2 - // (a2 + a3 ) a1 . u1 = (a2 + a3 ) m1 + // 2 2 2 2 + // C (a2 + a3 ) a1 . u1 = C (a2 + a3 ) m1 + // + // where C = -2K/(MU0 Ms). // // In particular, note that // 2 2 2 // a3 = 1 - a1 - a2 // and - // m3 = m - m1 - m2 + // m3 = m - m1 - m2 // - // This shows that energy and field can be computed cheaply - // without explicitly calculating u3. (I don't know if these - // are as accurate as using the cross product, however. Someone - // should check this.) + // This shows that energy and field can be computed without + // explicitly calculating u3. However, the cross product + // evaluation to get u3 is not that expensive, and appears + // to be more accurate. At a minimum, in the above expressions + // one should at least insure that a3^2 is non-negative. REAL8m k = K1[i]; REAL8m field_mult = (-2/MU0)*k*Ms_inverse[i]; @@ -129,15 +132,16 @@ continue; } + ThreeVector u3 = u1; u3 ^= u2; REAL8m a1 = u1*m; REAL8m a1sq = a1*a1; REAL8m a2 = u2*m; REAL8m a2sq = a2*a2; - REAL8m a3sq = 1.0 - a1sq - a2sq; + REAL8m a3 = u3*m; REAL8m a3sq = a3*a3; energy[i] = k * (a1sq*a2sq+a1sq*a3sq+a2sq*a3sq); ThreeVector m1 = a1*u1; ThreeVector m2 = a2*u2; - ThreeVector m3 = m; m3 -= m1; m3 -= m2; + ThreeVector m3 = a3*u3; field[i] = (a2sq+a3sq)*m1; field[i] += (a1sq+a3sq)*m2; field[i] += (a1sq+a2sq)*m3; diff -urN oommf1.2a1/app/oxs/ext/demag.cc oommf/app/oxs/ext/demag.cc --- oommf1.2a1/app/oxs/ext/demag.cc Tue Jan 16 01:09:15 2001 +++ oommf/app/oxs/ext/demag.cc Tue May 29 16:00:36 2001 @@ -40,8 +40,10 @@ Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters : Oxs_Energy(name,newdtr,safe_interp,argstr), - xdim(0),ydim(0),zdim(0),totalsize(0), - pxdim(0),pydim(0),pzdim(0),ptotalsize(0),mesh_id(0), + rdimx(0),rdimy(0),rdimz(0), + cdimx(0),cdimy(0),cdimz(0),cstridey(0),cstridez(0), + mesh_id(0), + adimx(0),adimy(0),adimz(0),astridey(0),astridez(0), A00(NULL),A01(NULL),A02(NULL),A11(NULL),A12(NULL),A22(NULL), xcomp(NULL),ycomp(NULL),zcomp(NULL) { @@ -59,8 +61,11 @@ if(A11!=NULL) { delete[] A11; A11=NULL; } if(A12!=NULL) { delete[] A12; A12=NULL; } if(A22!=NULL) { delete[] A22; A22=NULL; } - xdim=ydim=zdim=totalsize=0; - pxdim=pydim=pzdim=ptotalsize=0; + rdimx=rdimy=rdimz=0; + cdimx=cdimy=cdimz=0; + cstridey=cstridez=0; + adimx=adimy=adimz=0; + astridey=astridez=0; } void Oxs_Demag::FillCoefficientArrays(const Oxs_Mesh* genmesh) const @@ -75,49 +80,65 @@ } // Fill dimension variables - xdim = mesh->DimX(); - ydim = mesh->DimY(); - zdim = mesh->DimZ(); - totalsize=xdim*ydim*zdim; - if(xdim==0 || ydim==0 || zdim==0) return; // Empty mesh! - if(totalsize < xdim || totalsize < ydim || totalsize < zdim) { - // Partial overflow check - string msg="UINT4m overflow in " + string(InstanceName()) - + ": Product xdim*ydim*zdim too big to fit in a UINT4m variable"; + rdimx = mesh->DimX(); + rdimy = mesh->DimY(); + rdimz = mesh->DimZ(); + if(rdimx==0 || rdimy==0 || rdimz==0) return; // Empty mesh! + + if(rdimx==1) { + string msg="Invalid input in FillCoefficientArrays of " + + string(InstanceName()) + + ": real x-dimension must be at least 2."; throw Oxs_Ext::Error(msg.c_str()); } - pxdim = NextPowerOfTwo(2*xdim); - pydim = NextPowerOfTwo(2*ydim); - pzdim = NextPowerOfTwo(2*zdim); - ptotalsize=pxdim*pydim*pzdim; - if(ptotalsize < pxdim || ptotalsize < pydim || ptotalsize < pzdim) { + cdimx = NextPowerOfTwo(2*rdimx)/2; + if(rdimy>1) cdimy = NextPowerOfTwo(2*rdimy); + else cdimy = 1; + if(rdimz>1) cdimz = NextPowerOfTwo(2*rdimz); + else cdimz = 1; + cstridey = cdimx + 1; // Pad by one to avoid cache line entanglement + cstridez = cstridey*cdimy; + + UINT4m ctotalsize=cstridez*cdimz; + UINT4m rtotalsize=2*ctotalsize; + if(rtotalsize<2*cdimx || rtotalsize(static_cast(xcomp)); + REALWIDE *rycomp = static_cast(static_cast(ycomp)); + REALWIDE *rzcomp = static_cast(static_cast(zcomp)); + UINT4m rstridey=2*cstridey; + UINT4m rstridez=2*cstridez; + // According (16) in Newell's paper, the demag field is given by // H = -N*M // where N is the "demagnetizing tensor," with components Nxx, Nxy, @@ -135,15 +156,8 @@ // is real and odd, then f^ is (pure) imaginary and odd. // As a result, the transform of each of the Axx interaction // matrices will be real, with the same even/odd properties. - // To reduce computation, we pack an Axx pair together before - // computing the FFT. For example, we let xcomp = A00 + i.A01. - // Then the FFT of xcomp will be A00^ + i.A01^, where both A00^ - // and A01^ are real. Similarly, we pack A02 and A11 into ycomp, - // and A12 and A22 into zcomp. - - UINT4m aindex,pindex,i,j,k; - UINT4m pxydim=pxdim*pydim; - UINT4m axydim=axdim*aydim; + + UINT4m index,i,j,k; REALWIDE dx = mesh->EdgeLengthX(); REALWIDE dy = mesh->EdgeLengthY(); @@ -159,90 +173,199 @@ REALWIDE scale = -1./(4*PI*dx*dy*dz); - for(pindex=0;pindex0) { - pindex = (pxdim-i)+j*pxdim+k*pxydim; - xcomp[pindex].Set(a00,-a01); - ycomp[pindex].Set(-a02,a11); - zcomp[pindex].Set(a12,a22); + UINT4m tindex = (2*cdimx-i)+j*rstridey+k*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=-a01; + rzcomp[tindex]=-a02; } if(j>0) { - pindex = i+(pydim-j)*pxdim+k*pxydim; - xcomp[pindex].Set(a00,-a01); - ycomp[pindex].Set(a02,a11); - zcomp[pindex].Set(-a12,a22); + UINT4m tindex = i+(cdimy-j)*rstridey+k*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=-a01; + rzcomp[tindex]=a02; } if(k>0) { - pindex = i+j*pxdim+(pzdim-k)*pxydim; - xcomp[pindex].Set(a00,a01); - ycomp[pindex].Set(-a02,a11); - zcomp[pindex].Set(-a12,a22); + UINT4m tindex = i+j*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=a01; + rzcomp[tindex]=-a02; } if(i>0 && j>0) { - pindex = (pxdim-i)+(pydim-j)*pxdim+k*pxydim; - xcomp[pindex].Set(a00,a01); - ycomp[pindex].Set(-a02,a11); - zcomp[pindex].Set(-a12,a22); + UINT4m tindex = (2*cdimx-i)+(cdimy-j)*rstridey+k*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=a01; + rzcomp[tindex]=-a02; } if(i>0 && k>0) { - pindex = (pxdim-i)+j*pxdim+(pzdim-k)*pxydim; - xcomp[pindex].Set(a00,-a01); - ycomp[pindex].Set(a02,a11); - zcomp[pindex].Set(-a12,a22); + UINT4m tindex = (2*cdimx-i)+j*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=-a01; + rzcomp[tindex]=a02; } if(j>0 && k>0) { - pindex = i+(pydim-j)*pxdim+(pzdim-k)*pxydim; - xcomp[pindex].Set(a00,-a01); - ycomp[pindex].Set(-a02,a11); - zcomp[pindex].Set(a12,a22); + UINT4m tindex = i+(cdimy-j)*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=-a01; + rzcomp[tindex]=-a02; } if(i>0 && j>0 && k>0) { - pindex = (pxdim-i)+(pydim-j)*pxdim+(pzdim-k)*pxydim; - xcomp[pindex].Set(a00,a01); - ycomp[pindex].Set(a02,a11); - zcomp[pindex].Set(a12,a22); + UINT4m tindex = (2*cdimx-i)+(cdimy-j)*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a00; + rycomp[tindex]=a01; + rzcomp[tindex]=a02; } } // Transform into frequency domain. - fft.Forward(pxdim,pydim,pzdim,xcomp); - fft.Forward(pxdim,pydim,pzdim,ycomp); - fft.Forward(pxdim,pydim,pzdim,zcomp); + fft.ForwardRealDataNoScale(xcomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); + fft.ForwardRealDataNoScale(ycomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); + fft.ForwardRealDataNoScale(zcomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); - // Copy results from xcomp into Axx. We only need store 1/8th + // Copy results from ?comp into A??. We only need store 1/8th // of the results because of symmetries. - for(k=0;k0) { + UINT4m tindex = (2*cdimx-i)+j*rstridey+k*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=a12; + rzcomp[tindex]=a22; + } + if(j>0) { + UINT4m tindex = i+(cdimy-j)*rstridey+k*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=-a12; + rzcomp[tindex]=a22; + } + if(k>0) { + UINT4m tindex = i+j*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=-a12; + rzcomp[tindex]=a22; + } + if(i>0 && j>0) { + UINT4m tindex = (2*cdimx-i)+(cdimy-j)*rstridey+k*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=-a12; + rzcomp[tindex]=a22; + } + if(i>0 && k>0) { + UINT4m tindex = (2*cdimx-i)+j*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=-a12; + rzcomp[tindex]=a22; + } + if(j>0 && k>0) { + UINT4m tindex = i+(cdimy-j)*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=a12; + rzcomp[tindex]=a22; + } + if(i>0 && j>0 && k>0) { + UINT4m tindex = (2*cdimx-i)+(cdimy-j)*rstridey+(cdimz-k)*rstridez; + rxcomp[tindex]=a11; + rycomp[tindex]=a12; + rzcomp[tindex]=a22; + } + } + + fft.ForwardRealDataNoScale(xcomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); + fft.ForwardRealDataNoScale(ycomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); + fft.ForwardRealDataNoScale(zcomp,2*cdimx,cdimy,cdimz, + cdimx,cdimy,cdimz,cstridey,cstridez); + + for(k=0;k& Ms = *(state.Ms); // Calculate FFT of Mx, My and Mz - UINT4m xydim=xdim*ydim; - UINT4m pxydim=pxdim*pydim; - UINT4m index,pindex; UINT4m i,j,k; - for(pindex=0;pindex(static_cast(xcomp)); + OXS_COMPLEX_REAL_TYPE* rycomp + = static_cast(static_cast(ycomp)); + OXS_COMPLEX_REAL_TYPE* rzcomp + = static_cast(static_cast(zcomp)); + + for(k=0;k0 + if(ksign == 1) { + aindex = k*astridez; + } else { + aindex = (adimz-1-k)*astridez+cdimx; + } + if(jsign != 1) aindex += (adimy-1)*astridey; + a00 = A00[aindex]; + a11 = A11[aindex]; + a22 = A22[aindex]; + a01 = A01[aindex]; + a02 = ksign*A02[aindex]; + a12 = ksign*A12[aindex]; + xbase[cindex] = a00*Mx + a01*My + a02*Mz; // Hx + ybase[cindex] = a01*Mx + a11*My + a12*Mz; // Hy + zbase[cindex] = a02*Mx + a12*My + a22*Mz; // Hz + } + // j==0, i>0 + if(ksign == 1) aindex = k*astridez; + else aindex = (adimz-1-k)*astridez; + if(jsign != 1) aindex += (adimy-1)*astridey; + for(i=1;i + OXS_COMPLEX_REAL_TYPE dot = spin[mindex]*field[mindex]; + energy[mindex] = mult * Ms[mindex] * dot; + ++mindex; ++rindex; } } - fft.Inverse(pxdim,pydim,pzdim,xcomp); - fft.Inverse(pxdim,pydim,pzdim,ycomp); - fft.Inverse(pxdim,pydim,pzdim,zcomp); - for(k=0;k - REAL8m mult = -0.5 * MU0; - for(index=0;index=rdimx, cdimy>=rdimy, cdimz>=rdimz + // cdim[xyz] should be powers of 2. + mutable UINT4m cstridey,cstridez; // Strides across complex data + // cstridey>=cdimx, cstridez>=cdimy*cstridey + // The stride sizes for the real arrays are just double the + // complex strides, except cstride1 and rstride1 are assumed + // to be 1. Total matrix size is effectively cdimz*cstridez + // Oxs_Complex elements, or twice that many "double" elements. + mutable UINT4m mesh_id; + // The A## arrays hold demag coefficients, transformed into // frequency domain. These are held long term. xcomp, // ycomp, and zcomp are used as temporary space, first to hold // the transforms of Mx, My, and Mz, then to store Hx, Hy, and // Hz. - mutable REAL8m *A00,*A01,*A02,*A11,*A12,*A22; - mutable MyComplex *xcomp,*ycomp,*zcomp; - mutable FFT3D fft; // All transforms are same size, so we need - /// only one FFT3D object. + mutable UINT4m adimx,adimy,adimz; + mutable UINT4m astridey,astridez; + mutable OXS_COMPLEX_REAL_TYPE *A00,*A01,*A02,*A11,*A12,*A22; + mutable Oxs_Complex *xcomp,*ycomp,*zcomp; + mutable Oxs_FFT3D fft; // All transforms are same size, so we need + /// only one Oxs_FFT3D object. void FillCoefficientArrays(const Oxs_Mesh* mesh) const; diff -urN oommf1.2a1/app/oxs/ext/eulerevolve.cc oommf/app/oxs/ext/eulerevolve.cc --- oommf1.2a1/app/oxs/ext/eulerevolve.cc Mon Jan 22 04:11:36 2001 +++ oommf/app/oxs/ext/eulerevolve.cc Tue May 29 15:59:54 2001 @@ -41,11 +41,25 @@ &Oxs_EulerEvolve::UpdateDerivedOutputs,newdtr) { // Process arguments - allowed_error = GetRealInitValue("error",90.0); - if(allowed_error<=0.0) allowed_error=1.0; - allowed_error *= PI*1e9/180.; // Convert from deg/ns to rad/s - - step_aggression = GetRealInitValue("aggression",0.9); + allowed_error_rate = GetRealInitValue("error_rate",-1); + if(allowed_error_rate>0.0) { + allowed_error_rate *= PI*1e9/180.; // Convert from deg/ns to rad/s + } + allowed_absolute_step_error + = GetRealInitValue("absolute_step_error",0.2); + if(allowed_absolute_step_error>0.0) { + allowed_absolute_step_error *= PI/180.; // Convert from deg to rad + } + allowed_relative_step_error + = GetRealInitValue("relative_step_error",0.2); + + step_headroom = GetRealInitValue("step_headroom",0.85); + if(step_headroom<=0.) { + string msg="Invalid initialization detected for object " + + string(InstanceName()) + + ": step_headroom value must be bigger than 0."; + throw Oxs_Ext::Error(msg.c_str()); + } gamma = GetRealInitValue("gamma",2.21e5); @@ -53,7 +67,7 @@ start_dm = GetRealInitValue("start_dm",0.01); - alpha = GetRealInitValue("alpha"); // alpha is required input + alpha = GetRealInitValue("alpha",0.5); VerifyAllInitArgsUsed(); } @@ -71,18 +85,18 @@ return 1; } + Oxs_EulerEvolve::~Oxs_EulerEvolve() {} - void Oxs_EulerEvolve::Calculate_dm_dt (const Oxs_Mesh& mesh_, const Oxs_MeshValue& Ms_, const Oxs_MeshValue& mxH_, const Oxs_MeshValue& spin_, Oxs_MeshValue& dm_dt_, - REAL8m& max_dm_dt_,REAL8m& dE_dt_) const + REAL8m& max_dm_dt_,REAL8m& dE_dt_,REAL8m& min_timestep_) const { // Imports: mesh_, Ms_, mxH_, spin_ // Exports: dm_dt_, max_dm_dt_, dE_dt_ UINT4m size = mesh_.Size(); // Assume all imports are compatible @@ -90,6 +104,7 @@ REAL8m coef2 = -fabs(alpha); ThreeVector scratch; REAL8m max_dm_dt_sq=0.0; + UINT4m max_index=0; REAL8m dm_dt_sq; REAL8m dE_dt_sum=0.0; dm_dt_.AdjustSize(&mesh_); @@ -109,15 +124,34 @@ scratch *= coef2; // |alpha.gamma|((mxH)xm) = -|alpha.gamma|(mx(mxH)) dm_dt_[i] += scratch; dm_dt_sq = dm_dt_[i].MagSq(); - if(dm_dt_sq>max_dm_dt_sq) max_dm_dt_sq=dm_dt_sq; + if(dm_dt_sq>max_dm_dt_sq) { + max_dm_dt_sq=dm_dt_sq; + max_index = i; + } } } max_dm_dt_ = sqrt(max_dm_dt_sq); dE_dt_ = -1 * MU0 * fabs(gamma*alpha) * dE_dt_sum; - return; -} + // Get bound on smallest stepsize that would actually + // change spin new_max_dm_dt_index: + REAL8m min_ratio = DBL_MAX/2.; + if(fabs(dm_dt_[max_index].x)>=1.0 || + min_ratio*fabs(dm_dt_[max_index].x) > fabs(spin_[max_index].x)) { + min_ratio = fabs(spin_[max_index].x/dm_dt_[max_index].x); + } + if(fabs(dm_dt_[max_index].y)>=1.0 || + min_ratio*fabs(dm_dt_[max_index].y) > fabs(spin_[max_index].y)) { + min_ratio = fabs(spin_[max_index].y/dm_dt_[max_index].y); + } + if(fabs(dm_dt_[max_index].z)>=1.0 || + min_ratio*fabs(dm_dt_[max_index].z) > fabs(spin_[max_index].z)) { + min_ratio = fabs(spin_[max_index].z/dm_dt_[max_index].z); + } + min_timestep_ = min_ratio * REAL8_EPSILON; + return; +} BOOL @@ -135,7 +169,7 @@ if(cstate.mesh->Id() != workstate.mesh->Id()) { throw Oxs_Ext::Error - ("EulerEvolve::Step: Oxs_Mesh not fixed across steps."); + ("Oxs_EulerEvolve::Step: Oxs_Mesh not fixed across steps."); } REAL8m stepsize = next_timestep; @@ -144,7 +178,7 @@ director->GetEnergyDensity(cstate,energy,&mxH,NULL); Calculate_dm_dt(*(cstate.mesh),*(cstate.Ms), mxH,cstate.spin, - dm_dt,max_dm_dt,dE_dt); + dm_dt,max_dm_dt,dE_dt,timestep_lower_bound); if(start_dm < sqrt(DBL_MAX/4) * max_dm_dt) { stepsize = start_dm / max_dm_dt; } else { @@ -153,21 +187,20 @@ state_id = cstate.Id(); } - // Negotiate with driver over size of next step + // Negotiate with driver over size of next step workstate.last_timestep=stepsize; + if(stepsizestepsize) { - // driver wants to force this stepsize + // Either driver wants to force this stepsize, + // or else suggested stepsize is smaller than + // timestep_lower_bound. forcestep=1; } stepsize = workstate.last_timestep; - if(stepsize*max_dm_dt* H_ptr = &new_H; + Oxs_MeshValue* H_ptr = NULL; if(total_H_field_output.GetCacheRequestCount()>0) { H_ptr = &total_H_field_output.cache.value; total_H_field_output.cache.state_id = 0; } director->GetEnergyDensity(nstate,new_energy,&mxH,H_ptr); - if(total_H_field_output.GetCacheRequestCount()>0) { + if(H_ptr!=NULL) { total_H_field_output.cache.state_id = nstate.Id(); } REAL8m dE=0.0; + REAL8m var_dE=0.0; for(i=0;iVolume(i); - } + REAL8m vol = nstate.mesh->Volume(i); + REAL8m e = energy[i]; + REAL8m new_e = new_energy[i]; + dE += (new_e - e) * vol; + var_dE += (new_e*new_e + e*e)*vol*vol; + } + var_dE *= 256*REAL8_EPSILON*REAL8_EPSILON/3.; // Variance, assuming + /// error in each energy[i] term is independent, uniformly + /// distributed, 0-mean, with range +/- 16*REAL8_EPSILON*energy[i]. + /// It would probably be better to get an error estimate directly + /// from each energy term. + + /**/ + workstate.delta_E = dE; // HACK ALERT!!! workstate is a pointer + /// into the locked-down nstate, which is not suppose to be + /// changed. Hopefully this problem will go away when simstate + /// evolves into a real container, that anybody can stick stuff + /// into (but not pull out or modify the contents once inserted). + /**/ // Get error estimate. See step size adjustment discussion in // MJD Notes II, p72 (18-Jan-2001). - REAL8m new_max_dm_dt,new_dE_dt; - Calculate_dm_dt(*(nstate.mesh), - *(nstate.Ms), - mxH,nstate.spin, - new_dm_dt,new_max_dm_dt,new_dE_dt); + REAL8m new_max_dm_dt,new_dE_dt,new_timestep_lower_bound; + Calculate_dm_dt(*(nstate.mesh),*(nstate.Ms), + mxH,nstate.spin,new_dm_dt, + new_max_dm_dt,new_dE_dt,new_timestep_lower_bound); REAL8m max_error=0; for(i=0;iVolume(i); - } - dE_dt_1 *= -1; // NOTES say this should be *MU0? - -#ifdef OLDE_CODE - // Now, use formula (5) in NOTES II, p69, 13-Dec-2000, to - // estimate ideal step size. - REAL8m a = 0.5*(dE_dt_1 - dE_dt); - REAL8m b = 0.2*dE*stepsize + 0.9*dE_dt - 0.1*dE_dt_1; - REAL8m t_ideal = 1.0; // This is relative to current step - if(a>0.0) { - t_ideal = 0.5; - if(-b>a) { - if(-b<2*a*max_step_increase) t_ideal = -b/(2*a); - else t_ideal = max_step_increase; - } - } -#else - // This seems to work slightly better: Fit using E at - // the two ends, and just dE_dt_1 (i.e., ignore dE_dt). - REAL8m a = dE_dt_1*stepsize - dE; - REAL8m b = 2*dE - dE_dt_1*stepsize; - REAL8m t_ideal = 1.0; // This is relative to current step - if(a>0.0) { - t_ideal = max_step_decrease; - if(-b>2*max_step_decrease*a) { - if(-b<2*max_step_increase*a) t_ideal = -b/(2*a); - else t_ideal = max_step_increase; - } - } -#endif - - // Check step and adjust next_timestep - if(!forcestep && - (dE>REAL8_EPSILON*fabs(total_energy) - || max_error>allowed_error || t_ideal<0.75)) { - if(dE>0.0) next_timestep=stepsize*max_step_decrease; - else { - next_timestep = 0.9*allowed_error/max_error; - if(next_timestep>t_ideal) next_timestep = t_ideal; + // Check step and adjust next_timestep. The relative error + // check is a bit fudged, because rather than limiting the + // relative error uniformly across the sample, we limit it + // only at the position that has the maximum absolute error + // (i.e., max_error is max *absolute* error). I haven't + // tested to see if uniformly limiting relative error is + // workable (it might be too restrictive for most purposes), + // but the present setup seems to solve the problem of convergence + // near equilibrium. -mjd, 2001-02-23. + // NOTE: Since all three error controls (error_rate, + // absolute_step_error, and relative_step_error) assume error + // grows linearly with step size, we can check up front to see + // which control is most restrictive, store that constraint in + // working_allowed_error, and then adjust the step size without + // regard to which control is being exercised. + REAL8m working_allowed_error + = max_step_increase*max_error/step_headroom; + if(allowed_error_rate>=0. + && working_allowed_error>allowed_error_rate) { + working_allowed_error=allowed_error_rate; + } + if(allowed_absolute_step_error>=0. + && stepsize*working_allowed_error>allowed_absolute_step_error) { + working_allowed_error=allowed_absolute_step_error/stepsize; + } + if(allowed_relative_step_error>=0. + && working_allowed_error>allowed_relative_step_error*max_dm_dt) { + working_allowed_error = allowed_relative_step_error * max_dm_dt; + } + if(!forcestep) { + next_timestep=1.0; // Size relative to current step + if(max_error>working_allowed_error) { + next_timestep = step_headroom*working_allowed_error/max_error; + } else if(dE>REAL8_EPSILON*fabs(total_energy) + && dE>0 && dE*dE>4*var_dE) { + // Energy check + next_timestep=0.5; + } + if(next_timestep<1.0) { + // Reject step if(next_timestept_ideal) next_timestep = t_ideal; + next_timestep = max_step_increase; + if(next_timestep*max_error>step_headroom*working_allowed_error) { + next_timestep = step_headroom*working_allowed_error/max_error; + } if(next_timestep0 && dm_dt_output.cache.state_id != state.Id()) { dm_dt_output.cache.state_id=state.Id(); } - max_dm_dt_output.cache.value *= 180e-9/PI; + max_dm_dt_output.cache.value *= (180e-9/PI); /// Convert from radians/second to deg/ns } max_dm_dt_output.cache.state_id @@ -379,5 +422,3 @@ total_H_field_output.cache.state_id = state.Id(); } } - - diff -urN oommf1.2a1/app/oxs/ext/eulerevolve.h oommf/app/oxs/ext/eulerevolve.h --- oommf1.2a1/app/oxs/ext/eulerevolve.h Mon Jan 22 04:11:36 2001 +++ oommf/app/oxs/ext/eulerevolve.h Mon Feb 26 11:18:50 2001 @@ -15,9 +15,34 @@ class Oxs_EulerEvolve:public Oxs_Evolver { private: - // Step control parameters - REAL8m allowed_error; - REAL8m step_aggression; + // Step size control parameters. Each may be disabled by setting + // to -1. There is an additional step size control that insures + // that energy is monotonically non-increasing (up to estimated + // rounding error). + REAL8m allowed_error_rate; // Step size is adjusted so + /// that the estimated maximum error (across all spins) divided + /// by the step size is smaller than this value. The units + /// internally are radians per second, converted from the value + /// specified in the input MIF file, which is in deg/sec. + + REAL8m allowed_absolute_step_error; // Similar to allowed_error_rate, + /// but without the step size adjustment. Internal units are + /// radians; MIF input units are degrees. + + REAL8m allowed_relative_step_error; // Step size is adjusted so that + /// the estimated maximum error (across all spins) divided by + /// [maximum dm/dt (across all spins) * step size] is smaller than + /// this value. This value is non-dimensional, representing the + /// allowed relative (proportional) error, presumably in (0,1). + + REAL8m step_headroom; // The 3 control parameters above can be + /// used to estimate the step size that would just fit the control + /// requirements. Because this is only an estimate, if the step size + /// is actually set to that value there is a good chance that the + /// requirement will not be met. So instead, we leave some headroom + /// by setting the step size to the computed value multiplied by + /// step_headroom. This is a non-dimensional quantity, which should + /// be in the range (0,1). // The total energy field in Oxs_SimState is computed by accumulating // the dE into the total energy from the previous state. It order to @@ -47,6 +72,8 @@ // Data cached from last state UINT4m state_id; REAL8m max_dm_dt; + REAL8m timestep_lower_bound; // Smallest timestep that can actually + /// change spin with max_dm_dt (due to REAL8_EPSILON restrictions). REAL8m dE_dt; REAL8m total_energy; REAL8m total_energy_change; @@ -73,9 +100,9 @@ const Oxs_MeshValue& mxH_, const Oxs_MeshValue& spin_, Oxs_MeshValue& dm_dt_, - REAL8m& max_dm_dt_,REAL8m& dE_dt_) const; + REAL8m& max_dm_dt_,REAL8m& dE_dt_,REAL8m& min_timestep_) const; /// Imports: mesh_, Ms_, mxH_, spin_ - /// Exports: dm_dt_, max_dm_dt_, dE_dt_ + /// Exports: dm_dt_, max_dm_dt_, max_dm_dt_index, dE_dt_ public: virtual const char* ClassName() const; // ClassName() is diff -urN oommf1.2a1/app/oxs/ext/fft.cc oommf/app/oxs/ext/fft.cc --- oommf1.2a1/app/oxs/ext/fft.cc Thu Sep 7 19:51:08 2000 +++ oommf/app/oxs/ext/fft.cc Mon May 14 19:42:36 2001 @@ -4,6 +4,7 @@ * */ +#include #include "nb.h" // For constants PI and SQRT1_2 #include "oxsexcept.h" #include "fft.h" @@ -17,106 +18,149 @@ //////////////////////////////////////////////////////////////////////// // 1D Complex FFT -void FFT::ReleaseMemory(void) const +int Oxs_FFT::PackCheck() +{ // Routine to Oxs_Complex packing restriction. Much of the FFT + // code relies on tight packing of two reals as 1 complex. It is + // hard to imagine this ever failing, but better safe than sorry. + // This routine returns 0 on success. + return (sizeof(Oxs_Complex)!=2*sizeof(OXS_FFT_REAL_TYPE)); +} + +void Oxs_FFT::ReleaseMemory(void) const { if(vecsize>0) { - if(Uforward!=(MyComplex *)NULL) delete[] Uforward; - if(Uinverse!=(MyComplex *)NULL) delete[] Uinverse; - if(workspace!=(MyComplex *)NULL) delete[] workspace; - if(permindex!=(int *)NULL) delete[] permindex; + if(Uforward!=(Oxs_Complex *)NULL) delete[] Uforward; + if(Uinverse!=(Oxs_Complex *)NULL) delete[] Uinverse; + if(permindex!=(int *)NULL) delete[] permindex; } vecsize=0; - Uforward=Uinverse=workspace=(MyComplex *)NULL; + vecsize_normalization=0.; // Dummy value + log2vecsize=-1; // Dummy value + Uforward=Uinverse=(Oxs_Complex *)NULL; permindex=(int *)NULL; + if(realdata_vecsize>0) { + if(realdata_wforward!=(Oxs_Complex *)NULL) delete[] realdata_wforward; + if(realdata_winverse!=(Oxs_Complex *)NULL) delete[] realdata_winverse; + } + realdata_vecsize=0; + realdata_wforward=realdata_winverse=(Oxs_Complex *)NULL; } -FFT::~FFT(void) +Oxs_FFT::~Oxs_FFT(void) { ReleaseMemory(); } -void FFT::Setup(int size) const -{ - if(size==vecsize) return; - if(size<1) { - char buf[512]; - Oc_Snprintf(buf,sizeof(buf),"Error in FFT::Setup(int): " - "Requested length (%d) must be >0",size); - OC_THROW(Oxs_BadParameter,buf); - } - int k; - // Check that size is power of 2 - for(k=size;k>2;k/=2) { - if(k%2!=0) { - char buf[512]; - Oc_Snprintf(buf,sizeof(buf),"Error in FFT::Setup(int): " - "Requested length (%d) is not a power of 2",size); - OC_THROW(Oxs_BadParameter,buf); +void Oxs_FFT::InitializeRealDataTransforms(int size) const +{ // Import size is the desired value for realdata_vecsize. + // This function is conceptually const. + if(realdata_vecsize==size) return; + if(realdata_vecsize>0) { + if(realdata_wforward!=(Oxs_Complex *)NULL) delete[] realdata_wforward; + if(realdata_winverse!=(Oxs_Complex *)NULL) delete[] realdata_winverse; + } + realdata_vecsize=0; + realdata_wforward=realdata_winverse=(Oxs_Complex *)NULL; + if(size>=4) { + if((realdata_winverse=new Oxs_Complex[size/4])==0) { + OC_THROW(Oxs_NoMem,"Out of memory error in " + "Oxs_FFT::InitializeRealDataTransforms(int)"); + } + if((realdata_wforward=new Oxs_Complex[size/4])==0) { + OC_THROW(Oxs_NoMem,"Out of memory error in " + "Oxs_FFT::InitializeRealDataTransforms(int)"); } + realdata_wforward[0].Set(0.5,0); + realdata_winverse[0].Set(1,0); + double baseang = -2*PI/double(size); + for(int k=1;k=8) { + realdata_winverse[size/8] = Oxs_Complex(SQRT1_2,SQRT1_2); + realdata_wforward[size/8] = Oxs_Complex(0.5*SQRT1_2,-0.5*SQRT1_2); + } + realdata_vecsize=size; } - ReleaseMemory(); - vecsize=size; +} - // Allocate and setup MyComplex arrays - if((Uforward=new MyComplex[size])==0) - OC_THROW(Oxs_NoMem,"Out of memory error in FFT::Setup"); - if((Uinverse=new MyComplex[size])==0) - OC_THROW(Oxs_NoMem,"Out of memory error in FFT::Setup"); - if((workspace=new MyComplex[size])==0) - OC_THROW(Oxs_NoMem,"Out of memory error in FFT::Setup"); -#ifdef ORIG_CODE - REALWIDE baseang= -2*PI/double(size); - Uforward[0]=Uinverse[0]=MyComplex(1,0); - REALWIDE x,y; - for(k=1;k1) { - Uforward[size/2]=Uinverse[size/2]=MyComplex(-1,0); - } -#else +void Oxs_FFT::FillRootsOfUnity(int size, + Oxs_Complex* forward, + Oxs_Complex* inverse) const +{ double baseang = -2*PI/double(size); - for(k=1;k1) { - Uforward[size/2]=Uinverse[size/2]=MyComplex(-1,0); + forward[size/2]=inverse[size/2]=Oxs_Complex(-1,0); } if(size>3) { - Uforward[size/4]=Uinverse[3*size/4]=MyComplex(0,-1); - Uforward[3*size/4]=Uinverse[size/4]=MyComplex(0,1); + forward[size/4] =inverse[3*size/4]=Oxs_Complex(0,-1); + forward[3*size/4]=inverse[size/4] =Oxs_Complex(0,1); } if(size>7) { double x=SQRT1_2; // 1/sqrt(2) double y=-x; - Uforward[size/8]=Uinverse[7*size/8]=MyComplex(x,y); - Uforward[3*size/8]=Uinverse[5*size/8]=MyComplex(-x,y); - Uforward[5*size/8]=Uinverse[3*size/8]=MyComplex(-x,-y); - Uforward[7*size/8]=Uinverse[size/8]=MyComplex(x,-y); + forward[size/8] = inverse[7*size/8] = Oxs_Complex(x,y); + forward[3*size/8] = inverse[5*size/8] = Oxs_Complex(-x,y); + forward[5*size/8] = inverse[3*size/8] = Oxs_Complex(-x,-y); + forward[7*size/8] = inverse[size/8] = Oxs_Complex(x,-y); } -#endif // ORIG_CODE +} + +void Oxs_FFT::Setup(int size) const +{ + if(size<1) { + char buf[512]; + sprintf(buf,"Error in Oxs_FFT::Setup(int): " + "Requested length (%d) must be >0",size); + OC_THROW(Oxs_BadParameter,buf); + } + int k; + int power_count=0; + // Check that size is power of 2 + for(k=size;k>=2;k/=2) { + if(k%2!=0) { + char buf[512]; + sprintf(buf,"Error in Oxs_FFT::Setup(int): " + "Requested length (%d) is not a power of 2",size); + OC_THROW(Oxs_BadParameter,buf); + } + power_count++; + } + ReleaseMemory(); + vecsize=size; + vecsize_normalization=1./double(vecsize); + log2vecsize=power_count; + + // Allocate and setup Oxs_Complex arrays + if((Uforward=new Oxs_Complex[size])==0) + OC_THROW(Oxs_NoMem,"Out of memory error in Oxs_FFT::Setup"); + if((Uinverse=new Oxs_Complex[size])==0) + OC_THROW(Oxs_NoMem,"Out of memory error in Oxs_FFT::Setup"); + FillRootsOfUnity(size,Uforward,Uinverse); // Allocate and setup (bit-reversal) permutation index if((permindex=new int[size])==0) - OC_THROW(Oxs_NoMem,"Out of memory error in FFT::Setup"); + OC_THROW(Oxs_NoMem,"Out of memory error in Oxs_FFT::Setup"); permindex[0]=0; int m,n; // The following code relies heavily on size==2^log2vecsize for(k=1,n=size>>1;k8) { + // General case + + Oxs_Complex* cvec = static_cast(vec); + ForwardDecFreqNoScale(csize,cvec); // Perform half-sized FFT + + // Unpack. See mjd NOTES I, 5-Nov-1996, p86. + if(realdata_vecsize!=size) InitializeRealDataTransforms(size); + OXS_FFT_REAL_TYPE a=cvec[0].re; + OXS_FFT_REAL_TYPE b=cvec[0].im; + cvec[0].Set(a+b,a-b); + cvec[csize/2].im *= -1; + int k=csize/2-1; + do { + OXS_FFT_REAL_TYPE resum = 0.5 * (cvec[k].re + cvec[csize-k].re); + OXS_FFT_REAL_TYPE rediff = (cvec[k].re - cvec[csize-k].re); + OXS_FFT_REAL_TYPE imdiff = 0.5 * (cvec[k].im - cvec[csize-k].im); + OXS_FFT_REAL_TYPE imsum = (cvec[k].im + cvec[csize-k].im); + + OXS_FFT_REAL_TYPE wx=realdata_wforward[k].re; + OXS_FFT_REAL_TYPE wy=realdata_wforward[k].im; + + OXS_FFT_REAL_TYPE temp1 = wx*imsum + wy*rediff; + OXS_FFT_REAL_TYPE temp2 = wy*imsum - wx*rediff; + + cvec[k].Set(resum+temp1,temp2+imdiff); + cvec[csize-k].Set(resum-temp1,temp2-imdiff); + } while((--k)>0); + } else if(size==8) { // Special case + Oxs_Complex* cvec = static_cast(static_cast(vec)); + ForwardDecFreqNoScale(4,cvec); // Perform half-sized FFT + + // Unpack. See mjd NOTES I, 5-Nov-1996, p86. + OXS_FFT_REAL_TYPE a=cvec[0].re; + OXS_FFT_REAL_TYPE b=cvec[0].im; + cvec[0].Set(a+b,a-b); + + OXS_FFT_REAL_TYPE resum = 0.5 * (cvec[1].re + cvec[3].re); + OXS_FFT_REAL_TYPE rediff = (cvec[1].re - cvec[3].re); + OXS_FFT_REAL_TYPE imdiff = 0.5 * (cvec[1].im - cvec[3].im); + OXS_FFT_REAL_TYPE imsum = (cvec[1].im + cvec[3].im); + + // Note: SQRT1_2 = 1./sqrt(2.) + OXS_FFT_REAL_TYPE temp1 = (imsum - rediff)*(0.5*SQRT1_2); + OXS_FFT_REAL_TYPE temp2 = (rediff + imsum)*(0.5*SQRT1_2); + + cvec[1].Set(resum+temp1,imdiff-temp2); + cvec[3].Set(resum-temp1,-imdiff-temp2); + + cvec[2].im *= -1; + + } else if(size==4) { // Special case + OXS_FFT_REAL_TYPE *rvec = static_cast(vec); + OXS_FFT_REAL_TYPE s02 = rvec[0]+rvec[2]; + rvec[2] = rvec[0]-rvec[2]; + OXS_FFT_REAL_TYPE s13 = rvec[1]+rvec[3]; + rvec[3] -= rvec[1]; + rvec[0]=s02+s13; + rvec[1]=s02-s13; + } else if(size==2) { // Special case + OXS_FFT_REAL_TYPE *rvec = static_cast(vec); + OXS_FFT_REAL_TYPE temp=rvec[0]; + rvec[0]+=rvec[1]; + rvec[1]=temp-rvec[1]; + } else if(size==1) { // NOP + } else { // size<2 + string msg="Invalid array dimensions in " + "Oxs_FFT::ForwardDecFreqRealDataNoScale(int,void*) const"; + OC_THROW(Oxs_BadParameter,msg.c_str()); } } -void FFT::InverseDecTime(int size,MyComplex *vec,FFT_REAL_TYPE divisor) const +void Oxs_FFT::InverseDecTime(int size,Oxs_Complex *vec) const { - if(divisor==0) divisor=(FFT_REAL_TYPE)size; - /// Default divisor on iFFT is 'size' - Setup(size); - Permute(vec); - BaseDecTimeInverse(vec); - if(divisor!=0. && divisor!=1.) { - MY_COMPLEX_REAL_TYPE mult=1./divisor; - for(int k=0;k(vec); + OXS_FFT_REAL_TYPE temp=cvec[0].im; // Handle special edge element + cvec[0].im = (cvec[0].re - temp); // packing. + cvec[0].re = (cvec[0].re + temp); + + if(size>8) { + // General case. + if(realdata_vecsize!=size) InitializeRealDataTransforms(size); + int k=0; + while((++k)(vec); + OXS_FFT_REAL_TYPE temp1=2*rvec[2]; + rvec[2]=rvec[0]-temp1; + rvec[0]+=temp1; + OXS_FFT_REAL_TYPE temp2=2*rvec[3]; + rvec[3]=rvec[1]+temp2; + rvec[1]-=temp2; } + // size==2 involves only edge elements, which are already handled. +} +void Oxs_FFT::InverseDecTimeRealData(int size,void *vec) const +{ // Performs iFFT on a conjugate symmetric complex sequence with + // default scaling, which is 1.0/size. To specify a different, + // explicit scaling, use the companion InverseDecTimeRealData(int, + // void *,OXS_FFT_REAL_TYPE) routine. + InverseDecTimeRealDataNoScale(size,vec); + OXS_FFT_REAL_TYPE *rvec=static_cast(vec); + if(size==2) { + for(int k=0;k4) { + OXS_FFT_REAL_TYPE scale=vecsize_normalization*0.5; + /// vecsize_normalization = 1.0/vecsize, where vecsize is the + /// length of the computed iFFT, which is size/2. + for(int k=0;k4 - for(blocksize=vecsize,blockcount=1;blocksize>4; + OXS_COMPLEX_REAL_TYPE *const dvec=(OXS_COMPLEX_REAL_TYPE *)vec; + OXS_COMPLEX_REAL_TYPE const *const U=(OXS_COMPLEX_REAL_TYPE *)Uforward; + OXS_COMPLEX_REAL_TYPE *v; + + // Blocksize>8 + int blocksize,blockcount; + for(blocksize=vecsize,blockcount=1;blocksize>8; blocksize/=4,blockcount*=4) { // Loop through double-step matrix multiplications - halfbs=blocksize/2; threehalfbs=blocksize+halfbs; + int halfbs=blocksize/2; + int threehalfbs=blocksize+halfbs; + int block,offset,uoff1; for(block=0,v=dvec;block2) { - blockcount=vecsize/4; - for(block=0,v=dvec;block2 + int blocksize=4; + int blockcount=vecsize/4; + int block; + for(block=0,v=dvec;block4 - for(blocksize=16,blockcount=vecsize/16;blocksize<=vecsize; - blocksize*=4,blockcount/=4) { - // Loop through double-step matric multiplications - halfbs=blocksize/2; threehalfbs=blocksize+halfbs; + blocksize*=4; + blockcount/=4; + OXS_COMPLEX_REAL_TYPE const *const U=(OXS_COMPLEX_REAL_TYPE *)Uinverse; + for(;blockcount>0;blocksize*=4,blockcount/=4) { + // Loop through double-step matrix multiplications + int halfbs=blocksize/2; // Half blocksize + int threehalfbs=blocksize+halfbs; // 3/2 blocksize + int offset,uoff1; for(block=0,v=dvec;block0 && scratch!=NULL) delete[] scratch; scratchsize=0; scratch=NULL; + scratch_stride=scratch_index=scratch_top_index=0; + + base_ptr=NULL; + base_stride=base_block_index=base_top_index=0; + buffer_input_size=buffer_output_size=buffer_full_size=0; + xfft.ReleaseMemory(); yfft.ReleaseMemory(); zfft.ReleaseMemory(); } -void FFT3D::AdjustScratchSize(UINT4m xsize,UINT4m ysize,UINT4m zsize) const +Oxs_FFT3D::~Oxs_FFT3D() +{ + ReleaseMemory(); +} + +void Oxs_FFT3D::AdjustScratchSize(UINT4m xsize,UINT4m ysize, + UINT4m zsize) const { UINT4m maxsize=xsize; if(ysize>maxsize) maxsize=ysize; if(zsize>maxsize) maxsize=zsize; + maxsize+=SCRATCH_BLOCK_PAD; // Add padding to avoid cache line conflicts + maxsize*=SCRATCH_BLOCK_SIZE; if(scratchsize0 && scratch!=NULL) delete[] scratch; scratchsize=maxsize; - scratch=new MyComplex[scratch_block_size*scratchsize]; + scratch=new Oxs_Complex[scratchsize]; } } +Oxs_Complex* +Oxs_FFT3D::SetupBlocking +(Oxs_Complex* base,UINT4m insize,UINT4m outsize,UINT4m fullsize, + UINT4m basestride,UINT4m baserows) const +{ + if(fullsizescratchsize) { + string msg="Array sized error in Oxs_FFT3D::SetupBlocking(): " + "Scratch buffer array too small."; + OC_THROW(Oxs_BadIndex,msg.c_str()); + } + + scratch_index=scratch_top_index=0; + return FillBlockBuffer(0); +} + +Oxs_Complex* Oxs_FFT3D::FillBlockBuffer(UINT4m block_index) const +{ // Fills scratch area from base+block_index + base_block_index=block_index; + scratch_index=0; + scratch_top_index=SCRATCH_BLOCK_SIZE; + if(block_index+scratch_top_index>base_top_index) { + scratch_top_index=base_top_index-block_index; + if(scratch_top_index<1) return NULL; // No more data + } + Oxs_Complex* bptr=base_ptr+block_index; + Oxs_Complex* sptr; + UINT4m i,j; + for(j=0;j1) { + aptr = arr; + for(k=0;k1) { + for(k=0;k1) { + aptr=arr; + for(j=0;j1) { + aptr=arr; + for(j=0;j1) { + for(k=0;k1) { + aptr = arr; + for(k=0;k(totalsize); + OXS_FFT_REAL_TYPE scale = 1./static_cast(totalsize); for(i=0;i2*csize1_out || rsize2_in>csize2_out + || rsize3_in>csize3_out + || csize1_out>cstride2 || csize2_out*cstride2>cstride3) { + string msg="Invalid input to " + "Oxs_FFT3D::ForwardRealDataScrambledNoScale()"; + OC_THROW(Oxs_BadParameter,msg.c_str()); + } + + if(csize1_out==0 || csize2_out==0 || csize3_out==0) + return; // Nothing to do + + UINT4m ctotalsize=cstride3*csize3_out; + /// Total length when interpreted as a Oxs_Complex array. + + if(ctotalsize(arr); + for(k=0;k(arr); + if(csize2_out>1) { + for(k=0;k1) { + cptr = SetupBlocking(carr, + rsize3_in,csize3_out,csize3_out, + cstride3,csize1_out); + // FFT for i=j=0; + zfft.ForwardDecFreqNoScale(csize3_out,cptr); + zfft.UnpackRealPairImage(csize3_out,cptr); + + // FFT for j=0, i>0 + for(i=1;i1) { + // FFT for 00 + for(i=1;icsize2_out/2 + for(j=csize2_out/2+1;j2*csize1_out || rsize2_in>csize2_out + || rsize3_in>csize3_out + || csize1_out>cstride2 || csize2_out*cstride2>cstride3) { + string msg="Invalid input to " + "Oxs_FFT3D::ForwardRealDataNoScale()"; + OC_THROW(Oxs_BadParameter,msg.c_str()); + } + + if(csize1_out==0 || csize2_out==0 || csize3_out==0) + return; // Nothing to do + + UINT4m ctotalsize=cstride3*csize3_out; + /// Total length when interpreted as a Oxs_Complex array. + + if(ctotalsize(arr); + for(k=0;k(arr); + if(csize2_out>1) { + for(k=0;k1) { + cptr = SetupBlocking(carr, + rsize3_in,csize3_out,csize3_out, + cstride3,csize1_out); + // FFT for i=j=0; + zfft.ForwardDecFreqNoScale(csize3_out,cptr); + zfft.UnpackRealPairImage(csize3_out,cptr); + + // FFT for j=0, i>0 + for(i=1;i1) { + // FFT for 00 + for(i=1;icsize2_out/2 + for(j=csize2_out/2+1;j2*csize1_in || rsize2_out>csize2_in + || rsize3_out>csize3_in + || csize1_in>cstride2 || csize2_in*cstride2>cstride3) { + string msg="Invalid input to " + "Oxs_FFT3D::InverseRealDataScrambledNoScale()"; + OC_THROW(Oxs_BadParameter,msg.c_str()); + } + + if(csize1_in==0 || csize2_in==0 || csize3_in==0) + return; // Nothing to do + + UINT4m ctotalsize=cstride3*csize3_in; + /// Total length when interpreted as a Oxs_Complex array. + + if(ctotalsize(arr); + + // Do 1D iFFT's in z-direction + // The (0,0,k) and (0,csize2_in/2,k) lines requires special + // packing. + + if(csize3_in>1) { + // iFFT for i=j=0; + cptr = SetupBlocking(carr,csize3_in,rsize3_out,csize3_in, + cstride3,csize1_in); + zfft.RepackRealPairImage(csize3_in,cptr); + zfft.InverseDecTimeNoScale(csize3_in,cptr); + + // iFFT for j=0, i>0 + for(i=1;i1) { + // iFFT for 00 + for(i=1;icsize2_in/2 + for(j=csize2_in/2+1;j1) { + for(k=0;k(arr); + for(k=0;k2*csize1_in || rsize2_out>csize2_in + || rsize3_out>csize3_in + || csize1_in>cstride2 || csize2_in*cstride2>cstride3) { + string msg="Invalid input to " + "Oxs_FFT3D::InverseRealDataNoScale()"; + OC_THROW(Oxs_BadParameter,msg.c_str()); + } + + if(csize1_in==0 || csize2_in==0 || csize3_in==0) + return; // Nothing to do + + UINT4m ctotalsize=cstride3*csize3_in; + /// Total length when interpreted as a Oxs_Complex array. + + if(ctotalsize(arr); + + // Do 1D iFFT's in z-direction + // The (0,0,k) and (0,csize2_in/2,k) lines requires special + // packing. + + if(csize3_in>1) { + // iFFT for i=j=0; + cptr = SetupBlocking(carr,csize3_in,rsize3_out,csize3_in, + cstride3,csize1_in); + zfft.RepackRealPairImage(csize3_in,cptr); + zfft.InverseDecTimeNoScale(csize3_in,cptr); + + // iFFT for j=0, i>0 + for(i=1;i1) { + // iFFT for 00 + for(i=1;icsize2_in/2 + for(j=csize2_in/2+1;j1) { + for(k=0;k(arr); + for(k=0;kN1/2, use the +// aforementioned conjugate relation. However, i==0 and i==N1/2 +// are special cases, which are packed together in the i==0 +// plane. This packing is difficult to describe; for details +// refer either directly to the FFT code, or else the utility +// routine Oxs_FFT3D::RetrievePackedIndex below, and also mjd's +// NOTES II, 27-Apr-2001, p 110-112. +Oxs_Complex +Oxs_FFT3D::RetrievePackedIndex +(Oxs_Complex* carr, + UINT4m csize1,UINT4m csize2,UINT4m csize3, + UINT4m cstride2,UINT4m cstride3, + UINT4m index1,UINT4m index2,UINT4m index3) const +{ +#ifndef NDEBUG + if(index1>=2*csize1 || index2>=csize2 || index3>=csize3) { + string msg="Index out of range in" + " Oxs_FFT3D::RetrievePackedIndex"; + OC_THROW(Oxs_BadIndex,msg.c_str()); + } +#endif + unsigned int take_conjugate=0; + if(0csize1) { + take_conjugate=1; + index1=2*csize1-index1; + if(index2>0) index2=csize2-index2; + if(index3>0) index3=csize3-index3; + } else if(index1==csize1) { + index1=0; + if(index2==0) { + if(index3==0 || 2*index3==csize3) { + return Oxs_Complex(carr[index3*cstride3].im,0.); + } else if(2*index30) index3=csize3-index3; + take_conjugate=1; + } else if(2*index2==csize2) { + if(index3==0 || 2*index3==csize3) { + return Oxs_Complex(carr[index2*cstride2+index3*cstride3].im,0.); + } else if(2*index3csize3) { + index3=csize3-index3; + take_conjugate=1; + } + } else if(2*index2>csize2) { + index2=csize2-index2; + if(index3>0) index3=csize3-index3; + take_conjugate=1; + } else if(2*index2==csize2) { + if(index3==0 || 2*index3==csize3) { + return Oxs_Complex(carr[index2*cstride2+index3*cstride3].re,0.); + } else if(2*index3>csize3) { + index3=csize3-index3; + take_conjugate=1; + } + } + } + } + + Oxs_Complex data = carr[index1 + index2*cstride2 + index3*cstride3]; + if(take_conjugate) data.im *= -1; + return data; } diff -urN oommf1.2a1/app/oxs/ext/fft.h oommf/app/oxs/ext/fft.h --- oommf1.2a1/app/oxs/ext/fft.h Thu Sep 7 19:51:08 2000 +++ oommf/app/oxs/ext/fft.h Mon May 14 19:42:36 2001 @@ -4,135 +4,348 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2000/09/07 23:51:08 $ + * Last modified on: $Date: 2001/05/14 23:42:36 $ * Last modified by: $Author: donahue $ */ #ifndef _FFT_H #define _FFT_H +#include "oc.h" // REALWIDE defn + /* End includes */ -typedef REALWIDE FFT_REAL_TYPE; +typedef REALWIDE OXS_FFT_REAL_TYPE; -#define USE_MYCOMPLEX +#define USE_OXSCOMPLEX -#ifdef USE_MYCOMPLEX -typedef FFT_REAL_TYPE MY_COMPLEX_REAL_TYPE; -class MyComplex { +#ifdef USE_OXSCOMPLEX +typedef OXS_FFT_REAL_TYPE OXS_COMPLEX_REAL_TYPE; +class Oxs_Complex { public: - MY_COMPLEX_REAL_TYPE re,im; - MyComplex() { re=im=0.0; } - MyComplex(MY_COMPLEX_REAL_TYPE x,MY_COMPLEX_REAL_TYPE y) { re=x; im=y; } - void Set(MY_COMPLEX_REAL_TYPE x,MY_COMPLEX_REAL_TYPE y) { re=x; im=y; } - friend inline MyComplex operator+(const MyComplex& a,const MyComplex& b); - friend inline MyComplex operator-(const MyComplex& a,const MyComplex& b); - friend inline MyComplex operator*(const MyComplex& a,const MyComplex& b); - friend inline MyComplex operator*(const MyComplex& a, - MY_COMPLEX_REAL_TYPE b); - friend inline MyComplex operator*(MY_COMPLEX_REAL_TYPE b,MyComplex& a); - MyComplex& operator+=(const MyComplex& b); - MyComplex& operator*=(const MyComplex& b); - MyComplex& operator*=(MY_COMPLEX_REAL_TYPE b); - inline MY_COMPLEX_REAL_TYPE real() const { return re; } - inline MY_COMPLEX_REAL_TYPE imag() const { return im; } + OXS_COMPLEX_REAL_TYPE re,im; + Oxs_Complex() { re=im=0.0; } + Oxs_Complex(OXS_COMPLEX_REAL_TYPE x,OXS_COMPLEX_REAL_TYPE y) { re=x; im=y; } + void Set(OXS_COMPLEX_REAL_TYPE x,OXS_COMPLEX_REAL_TYPE y) { re=x; im=y; } + friend inline Oxs_Complex operator+(const Oxs_Complex& a, + const Oxs_Complex& b); + friend inline Oxs_Complex operator-(const Oxs_Complex& a, + const Oxs_Complex& b); + friend inline Oxs_Complex operator*(const Oxs_Complex& a, + const Oxs_Complex& b); + friend inline Oxs_Complex operator*(const Oxs_Complex& a, + OXS_COMPLEX_REAL_TYPE b); + friend inline Oxs_Complex operator*(OXS_COMPLEX_REAL_TYPE b, + Oxs_Complex& a); + Oxs_Complex& operator+=(const Oxs_Complex& b); + Oxs_Complex& operator-=(const Oxs_Complex& b); + Oxs_Complex& operator*=(const Oxs_Complex& b); + Oxs_Complex& operator*=(OXS_COMPLEX_REAL_TYPE b); + inline OXS_COMPLEX_REAL_TYPE real() const { return re; } + inline OXS_COMPLEX_REAL_TYPE imag() const { return im; } }; -inline MyComplex operator*(const MyComplex& a,const MyComplex& b) -{ return MyComplex(a.re*b.re-a.im*b.im,a.re*b.im+a.im*b.re); } +inline Oxs_Complex operator*(const Oxs_Complex& a,const Oxs_Complex& b) +{ return Oxs_Complex(a.re*b.re-a.im*b.im,a.re*b.im+a.im*b.re); } -inline MyComplex operator+(const MyComplex& a,const MyComplex& b) -{ return MyComplex(a.re+b.re,a.im+b.im); } +inline Oxs_Complex operator+(const Oxs_Complex& a,const Oxs_Complex& b) +{ return Oxs_Complex(a.re+b.re,a.im+b.im); } -inline MyComplex operator-(const MyComplex& a,const MyComplex& b) -{ return MyComplex(a.re-b.re,a.im-b.im); } +inline Oxs_Complex operator-(const Oxs_Complex& a,const Oxs_Complex& b) +{ return Oxs_Complex(a.re-b.re,a.im-b.im); } -inline MyComplex operator*(const MyComplex& a,MY_COMPLEX_REAL_TYPE b) -{ return MyComplex(a.re*b,a.im*b); } +inline Oxs_Complex operator*(const Oxs_Complex& a,OXS_COMPLEX_REAL_TYPE b) +{ return Oxs_Complex(a.re*b,a.im*b); } -inline MyComplex operator*(MY_COMPLEX_REAL_TYPE b,MyComplex& a) -{ return MyComplex(a.re*b,a.im*b); } +inline Oxs_Complex operator*(OXS_COMPLEX_REAL_TYPE b,Oxs_Complex& a) +{ return Oxs_Complex(a.re*b,a.im*b); } -inline MyComplex& MyComplex::operator+=(const MyComplex& b) +inline Oxs_Complex& Oxs_Complex::operator+=(const Oxs_Complex& b) { re+=b.re; im+=b.im; return *this; } -inline MyComplex& MyComplex::operator*=(const MyComplex& b) +inline Oxs_Complex& Oxs_Complex::operator-=(const Oxs_Complex& b) +{ re-=b.re; im-=b.im; return *this; } + +inline Oxs_Complex& Oxs_Complex::operator*=(const Oxs_Complex& b) { - MY_COMPLEX_REAL_TYPE temp; + OXS_COMPLEX_REAL_TYPE temp; re=(temp=re)*b.re-im*b.im; im=im*b.re+temp*b.im; return *this; } -inline MyComplex& MyComplex::operator*=(MY_COMPLEX_REAL_TYPE b) +inline Oxs_Complex& Oxs_Complex::operator*=(OXS_COMPLEX_REAL_TYPE b) { re*=b; im*=b; return *this; } -/* typedef MyComplex Complex; */ +/* typedef Oxs_Complex Complex; */ /* NOTE: has a "#define Complex 0" line * (apparently associated with defining polygon * types) that can interfere with the preceding * typedef. So presently (28-April-97) I've (mjd) - * decided to use MyComplex throughout. If + * decided to use Oxs_Complex throughout. If * nothing else, this should make it easier to * modify Complex type usage later on. See, for - * example, the typedef in the !USE_MYCOMPLEX + * example, the typedef in the !USE_OXSCOMPLEX * #ifdef branch below. */ -#else /* !USE_MYCOMPLEX */ -typedef Complex MyComplex; -#endif /* USE_MYCOMPLEX */ +#else /* !USE_OXSCOMPLEX */ +typedef Complex Oxs_Complex; +#endif /* USE_OXSCOMPLEX */ -inline MyComplex conj(const MyComplex& a) +inline Oxs_Complex conj(const Oxs_Complex& a) { - return MyComplex(a.real(),-a.imag()); + return Oxs_Complex(a.real(),-a.imag()); } -class FFT { +inline OXS_FFT_REAL_TYPE Oxs_Conjugate(OXS_FFT_REAL_TYPE x) { return x; } +inline Oxs_Complex Oxs_Conjugate(Oxs_Complex x) { return conj(x); } + +class Oxs_FFT { // NOTE: All member functions except for constructor and // destructor are "conceptually const" private: + int PackCheck(); // Routine to Oxs_Complex packing restriction + mutable int vecsize; + mutable OXS_FFT_REAL_TYPE vecsize_normalization; // ==1/vecsize. + mutable int log2vecsize; // 2^log2vecsize == vecsize enum Direction { forward, inverse }; - mutable MyComplex *Uforward,*Uinverse; - mutable MyComplex *workspace; + mutable Oxs_Complex *Uforward,*Uinverse; + mutable int *permindex; - void Permute(MyComplex *vec) const; - void BaseDecFreqForward(MyComplex *vec) const; - void BaseDecTimeInverse(MyComplex *vec) const; + + void Permute(Oxs_Complex *vec) const; + + void BaseDecFreqForward(Oxs_Complex *vec) const; + void BaseDecTimeInverse(Oxs_Complex *vec) const; + + void FillRootsOfUnity(int size, + Oxs_Complex* forward, + Oxs_Complex* inverse) const; void Setup(int size) const; + + + // The "realdata" variables are used by the real FFT code. + // When initialized, the wforward (winverse) array holds + // the first (last) quarter of the roots of unity of order + // 2*vecsize. Use realdata_vecsize to tell if the wforward + // and winverse arrays are initialized: if realdata_vecsize + // == 2*vecsize, then they are. Otherwise call + // InitializeRealDataTransforms() to perform the + // initialization. + // NOTE 1: The length of the wforward and winverse arrays + // is readldata_vecsize/4, *NOT* realdata_vecsize. + // NOTE 2: For reasons of computational efficiency, + // realdata_wforward actually holds 0.5*(roots of unity); + // but realdata_winverse holds the unscaled roots. + mutable int realdata_vecsize; + mutable Oxs_Complex *realdata_wforward,*realdata_winverse; + void InitializeRealDataTransforms(int size) const; // Import size + /// is the desired value for realdata_vecsize. This routine is + /// conceptually const. public: - FFT() { - vecsize=0; - Uforward=Uinverse=workspace=(MyComplex *)NULL; - permindex=(int *)NULL; + Oxs_FFT() : + vecsize(0),vecsize_normalization(0.),log2vecsize(-1), + Uforward(NULL),Uinverse(NULL),permindex(NULL), + realdata_vecsize(0),realdata_wforward(NULL),realdata_winverse(NULL) + { + if(PackCheck()!=0) { + OC_THROW(Oxs_ProgramLogicError, + "Oxs_Complex structure packing failure" + " detected in Oxs_FFT::Oxs_FFT()"); + } } - ~FFT(); + ~Oxs_FFT(); void ReleaseMemory() const; // Conceptually const!? - void ForwardDecFreq(int size,MyComplex *vec, - FFT_REAL_TYPE divisor=0.) const; - void InverseDecTime(int size,MyComplex *vec, - FFT_REAL_TYPE divisor=0.) const; + + void ForwardDecFreqScrambledNoScale(int size,Oxs_Complex *vec) const { + if(size!=vecsize) Setup(size); + BaseDecFreqForward(vec); + } + void ForwardDecFreqNoScale(int size,Oxs_Complex *vec) const { + if(size==2) { + OXS_FFT_REAL_TYPE x0=vec[0].re; + OXS_FFT_REAL_TYPE y0=vec[0].im; + OXS_FFT_REAL_TYPE x1=vec[1].re; + OXS_FFT_REAL_TYPE y1=vec[1].im; + vec[0].Set(x0+x1,y0+y1); + vec[1].Set(x0-x1,y0-y1); + } else { + ForwardDecFreqScrambledNoScale(size,vec); + Permute(vec); + } + } + void ForwardDecFreq(int size,Oxs_Complex *vec) const { + // Default scaling, which is 1.0 + ForwardDecFreqNoScale(size,vec); + } + + void ForwardDecFreqRealDataNoScale(int size,void *vec) const; + /// Performs FFT on a real sequence. size must be a positive power of + /// two. The calculation is done in-place, where on return the array + /// should be interpreted as a complex array with real and imaginary + /// parts interleaved, except that ((Oxs_Complex*)vec)[0].re is the + /// 0-th element in the transform space (which is real because the + /// input is real), and ((Oxs_Complex*)vec)[0].im is the size/2-th + /// element in the transform space (which is also real for the same + /// reason). + /// The physical length on output is size/2 complex elements, but + /// this is sufficient to define the whole transform of length size + /// because in the transform space the array is conjugate symmentric + /// (since the input is real); this means that virtual element + /// + /// ((Oxs_Complex*)vec)[k] = conj(((Oxs_Complex*)vec)[size-k]) + /// + /// for size/2N1/2, use the + // aforementioned conjugate relation. However, i==0 and i==N1/2 + // are special cases, which are packed together in the i==0 + // plane. This packing is difficult to describe; for details + // refer either directly to the FFT code, or else the utility + // routine Oxs_FFT3D::RetrievePackedIndex. See also mjd's + // NOTES II, 27-Apr-2001, p 110-112. + void ForwardRealDataScrambledNoScale(void* arr, + UINT4m rsize1_in,UINT4m rsize2_in,UINT4m rsize3_in, + UINT4m csize1_out,UINT4m csize2_out,UINT4m csize3_out, + UINT4m cstride2,UINT4m cstride3) const; + + void ForwardRealDataNoScale(void* arr, + UINT4m rsize1_in,UINT4m rsize2_in,UINT4m rsize3_in, + UINT4m csize1_out,UINT4m csize2_out,UINT4m csize3_out, + UINT4m cstride2,UINT4m cstride3) const; + + void InverseRealDataScrambledNoScale(void* arr, + UINT4m rsize1_out,UINT4m rsize2_out,UINT4m rsize3_out, + UINT4m csize1_in,UINT4m csize2_in,UINT4m csize3_in, + UINT4m cstride2,UINT4m cstride3) const; + + void InverseRealDataNoScale(void* arr, + UINT4m rsize1_out,UINT4m rsize2_out,UINT4m rsize3_out, + UINT4m csize1_in,UINT4m csize2_in,UINT4m csize3_in, + UINT4m cstride2,UINT4m cstride3) const; + + Oxs_Complex RetrievePackedIndex(Oxs_Complex* carr, + UINT4m csize1,UINT4m csize2,UINT4m csize3, + UINT4m cstride2,UINT4m cstride3, + UINT4m index1,UINT4m index2,UINT4m index3) const; + }; #endif /* _FFT_H */ + + diff -urN oommf1.2a1/app/oxs/ext/filevectorfieldinit.cc oommf/app/oxs/ext/filevectorfieldinit.cc --- oommf1.2a1/app/oxs/ext/filevectorfieldinit.cc Sun Oct 8 21:38:01 2000 +++ oommf/app/oxs/ext/filevectorfieldinit.cc Sun Feb 11 00:47:58 2001 @@ -127,6 +127,8 @@ // Step through range and sample mesh, fitting // with zeroth order fit. + REAL8m valuescale = + file_mesh->GetValueMultiplier() * file_mesh->GetRelativeValueScale(); UINT4m size=mesh->Size(); for(UINT4m i=0;iCenter(i,center); @@ -137,10 +139,17 @@ file_pos.z=center.z; file_mesh->FindPreciseClosest(file_pos,file_lv); - value.x=file_lv.value.x; - value.y=file_lv.value.y; - value.z=file_lv.value.z; - if(set_norm) value.SetMag(norm); + if(set_norm) { + value.x=file_lv.value.x; + value.y=file_lv.value.y; + value.z=file_lv.value.z; + if(norm==1.0) value.MakeUnit(); + else value.SetMag(norm); + } else { + value.x=valuescale*file_lv.value.x; + value.y=valuescale*file_lv.value.y; + value.z=valuescale*file_lv.value.z; + } array[i]=value; } } diff -urN oommf1.2a1/app/oxs/ext/scriptatlas.cc oommf/app/oxs/ext/scriptatlas.cc --- oommf1.2a1/app/oxs/ext/scriptatlas.cc Wed Dec 31 19:00:00 1969 +++ oommf/app/oxs/ext/scriptatlas.cc Mon Jan 29 23:38:41 2001 @@ -0,0 +1,187 @@ +/* FILE: scriptatlas.cc -*-Mode: c++-*- + * + * Script atlas class, derived from OXS extension class. + * + */ + +#include + +#include "oc.h" +#include "nb.h" + +#include "scriptatlas.h" + +// Oxs_Ext registration support +OXS_EXT_REGISTER(Oxs_ScriptAtlas); + +/* End includes */ + + +// Constructor +Oxs_ScriptAtlas::Oxs_ScriptAtlas +( const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp_, // Safe interpreter + const char* argstr // MIF block argument string + ) : Oxs_Atlas(name,newdtr,safe_interp_,argstr), + safe_interp(safe_interp_) +#if (TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>0)) + ,objcmd_argc(0),objcmd(NULL) +#endif // Tcl version check +{ + // Process arguments. + CheckInitValueParamCount("xrange",2); + const vector& xrange = *FindInitValue("xrange"); + CheckInitValueParamCount("yrange",2); + const vector& yrange = *FindInitValue("yrange"); + CheckInitValueParamCount("zrange",2); + const vector& zrange = *FindInitValue("zrange"); + bounding_box.Set(xrange[0],xrange[1], + yrange[0],yrange[1], + zrange[0],zrange[1]); + DeleteInitValue("xrange"); + DeleteInitValue("yrange"); + DeleteInitValue("zrange"); + + const vector* regionlistptr = FindInitValue("regions"); + if(regionlistptr==NULL || regionlistptr->size()<1) { + string msg="No regions specified in input block for object " + + string(InstanceName()); + throw Oxs_Ext::Error(msg.c_str()); + } + region_name_list = *regionlistptr; + DeleteInitValue("regions"); + + const vector* scriptlistptr = FindInitValue("script"); + if(scriptlistptr==NULL) { + string msg="No script specified in input block for object " + + string(InstanceName()); + throw Oxs_Ext::Error(msg.c_str()); + } + script_list = *scriptlistptr; + DeleteInitValue("script"); + + VerifyAllInitArgsUsed(); + +#if (TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>0)) + // If eval obj is available, then initialize obj command structures + objcmd_argc=static_cast(script_list.size())+9; + objcmd = new Tcl_Obj*[objcmd_argc]; + UINT4m iarg; + for(iarg=0;iarg(script_list[iarg].size())); + } + objcmd[objcmd_argc-9] = Tcl_NewDoubleObj(0.); // Dummy value + objcmd[objcmd_argc-8] = Tcl_NewDoubleObj(0.); // "" + objcmd[objcmd_argc-7] = Tcl_NewDoubleObj(0.); // "" + objcmd[objcmd_argc-6] = Tcl_NewDoubleObj(bounding_box.GetMinX()); + objcmd[objcmd_argc-5] = Tcl_NewDoubleObj(bounding_box.GetMinY()); + objcmd[objcmd_argc-4] = Tcl_NewDoubleObj(bounding_box.GetMinZ()); + objcmd[objcmd_argc-3] = Tcl_NewDoubleObj(bounding_box.GetMaxX()); + objcmd[objcmd_argc-2] = Tcl_NewDoubleObj(bounding_box.GetMaxY()); + objcmd[objcmd_argc-1] = Tcl_NewDoubleObj(bounding_box.GetMaxZ()); + for(iarg=0;iarg 8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>0)) + if(objcmd!=NULL) { + for(UINT4m i=0;i=region_name_list.size()) return 1; + name = region_name_list[id]; + return 0; +} diff -urN oommf1.2a1/app/oxs/ext/scriptatlas.h oommf/app/oxs/ext/scriptatlas.h --- oommf1.2a1/app/oxs/ext/scriptatlas.h Wed Dec 31 19:00:00 1969 +++ oommf/app/oxs/ext/scriptatlas.h Mon Jan 29 23:38:41 2001 @@ -0,0 +1,71 @@ +/* FILE: scriptatlas.h -*-Mode: c++-*- + * + * Script atlas class, derived from Oxs_Atlas class. + * + */ + +#ifndef _OXS_SCRIPTATLAS +#define _OXS_SCRIPTATLAS + +#include +#include + +#include "ext.h" +#include "threevector.h" +#include "util.h" +#include "atlas.h" +/* End includes */ + +class Oxs_ScriptAtlas:public Oxs_Atlas { +private: + Tcl_Interp* const safe_interp; + Oxs_Box bounding_box; + vector region_name_list; + vector script_list; +#if (TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION==8 && TCL_MINOR_VERSION>0)) + // If eval obj is available, then initialize obj command structures + UINT4m objcmd_argc; + Tcl_Obj** objcmd; +#endif // Tcl version check +public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + virtual BOOL Init() { return 1; } + + Oxs_ScriptAtlas(const char* name, + Oxs_Director* newdtr, + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF block argument string + + ~Oxs_ScriptAtlas(); + + void GetWorldExtents(Oxs_Box &mybox) const { + mybox = bounding_box; + } + + INT4m GetRegionId(const ThreeVector& point) const; + /// Returns the id number for the first region in + /// "section_list" containing point. The return + /// value is -1 if the point is not contained in + /// the atlas. + + INT4m GetRegionId(const string& name) const; + /// Given a region id string (name), returns + /// the corresponding region id index. If + /// "name" is not included in the atlas, then + /// -1 is returned. + + INT4m GetRegionName(UINT4m id,string& name) const; + /// Given an id number, fills in "name" with + /// the corresponding region id string. Returns + /// 0 on success, 1 if id is invalid. + + UINT4m GetRegionCount() const { + return UINT4m(region_name_list.size()); + } + /// Valid RegionId numbers range from 0 to GetRegionCount -1, + /// inclusive. + +}; + +#endif // _OXS_SCRIPTATLAS diff -urN oommf1.2a1/app/oxs/ext/sectionatlas.cc oommf/app/oxs/ext/sectionatlas.cc --- oommf1.2a1/app/oxs/ext/sectionatlas.cc Tue Jan 16 23:56:26 2001 +++ oommf/app/oxs/ext/sectionatlas.cc Tue Feb 20 20:05:11 2001 @@ -52,7 +52,7 @@ if(name.compare("ignore")==0) continue; // Check that name isn't already used - for(int j=0;j* vsptr; // Temp pointer - number_of_stages=1; // Default value: 1 stage - vsptr = FindInitValue("number_of_stages"); - if(vsptr!=NULL) { - number_of_stages=GetIntInitValue("number_of_stages"); - } - - stage_iteration_limit=0; // Default value: no limit - vsptr = FindInitValue("stage_iteration_limit"); - if(vsptr!=NULL) { - stage_iteration_limit=GetIntInitValue("stage_iteration_limit"); - } - - total_iteration_limit=0; // Default value: no limit - vsptr = FindInitValue("total_iteration_limit"); - if(vsptr!=NULL) { - total_iteration_limit=GetIntInitValue("total_iteration_limit"); - } + number_of_stages = GetIntInitValue("number_of_stages",1); + stage_iteration_limit = GetIntInitValue("stage_iteration_limit",0); + total_iteration_limit = GetIntInitValue("total_iteration_limit",0); CheckInitValueParamCount("mesh",1); Oxs_Mesh* mesh = dynamic_cast @@ -132,6 +118,7 @@ istate.stage_number = 0; istate.last_timestep = 0.0; istate.elapsed_time = 0.0; + istate.delta_E = 0.0; istate.mesh = meshkey.GetPtr(); @@ -141,7 +128,7 @@ // Insure that all spins are unit vectors UINT4m size = istate.spin.Size(); - for(UINT4m i=0;i0) { - energy[i] = -k*(dot*dot-1.0); // Make easy axis zero energy - } else { + if(k<=0) { + // Easy plane (hard axis) + REAL8m dot = axis[i]*spin[i]; + field[i] = (field_mult*dot) * axis[i]; energy[i] = -k*dot*dot; // Easy plane is zero energy + } else { + // Easy axis case. For improved accuracy, we want to report + // energy as -k*(dot*dot-1), where dot = axis * spin. But + // dot*dot-1 suffers from bad loss of precision if spin is + // nearly parallel to axis. The are a couple of ways around + // this. Recall that both spin and axis are unit vectors. + // Then from the cross product: + // (axis x spin)^2 = 1 - dot*dot + // The cross product requires 6 mults and 3 adds, and + // the norm squared takes 3 mult and 2 adds + // => 9 mults + 5 adds. + // Another option is to use + // (axis - spin)^2 = 2*(1-dot) + // so 1 - dot*dot = t*(2-t) + // where t = 0.5*(axis-spin)^2. + // The op count here is + // => 5 mults + 6 adds. + // Another advantage to the second approach is you get 'dot', + // as opposed to dot*dot, which saves a sqrt if dot is needed. + // The downside is that if axis and spin are anti-parallel, + // then you want to use (axis+spin)^2 rather than (axis-spin)^2. + // Since we don't need a high accuracy 'dot', we just use + // the cross product formulation. (I did some single-spin test + // runs and the performance of the two methods was about the + // same.) -mjd, 28-Jan-2001 + ThreeVector temp = axis[i]; + REAL8m dot = temp*spin[i]; + field[i] = (field_mult*dot) * temp; + temp ^= spin[i]; + energy[i] = k*temp.MagSq(); } } } diff -urN oommf1.2a1/app/oxs/ext/uniformexchange.cc oommf/app/oxs/ext/uniformexchange.cc --- oommf1.2a1/app/oxs/ext/uniformexchange.cc Tue Jan 16 23:56:26 2001 +++ oommf/app/oxs/ext/uniformexchange.cc Mon May 14 19:40:57 2001 @@ -67,47 +67,65 @@ REAL8m wgty = -A/(mesh->EdgeLengthY()*mesh->EdgeLengthY()); REAL8m wgtz = -A/(mesh->EdgeLengthZ()*mesh->EdgeLengthZ()); - REAL8m hcoef = -2/MU0; + const REAL8m hcoef = -2/MU0; for(UINT4m z=0;zIndex(x,y,z); // Get base linear address - ThreeVector base = spin[i]; + REAL8m Msii = Ms_inverse[i]; if(Msii == 0.0) { energy[i]=0.0; field[i].Set(0.,0.,0.); continue; } + + ThreeVector base = spin[i]; + ThreeVector sum(0.,0.,0.); - if(z>0) { - UINT4m j = i-xydim; - if(Ms_inverse[j]!=0.0) sum += wgtz*(spin[j] - base); - } - if(y>0) { - UINT4m j = i-xdim; - if(Ms_inverse[j]!=0.0) sum += wgty*(spin[j] - base); - } if(x>0) { - UINT4m j = i-1; - if(Ms_inverse[j]!=0.0) sum += wgtx*(spin[j] - base); + if(Ms_inverse[i-1]!=0.0) sum = (spin[i-1] - base); } if(x0) { + UINT4m j = i-xdim; + if(Ms_inverse[j]!=0.0) temp = (spin[j] - base); } if(y0) { + UINT4m j = i-xydim; + if(Ms_inverse[j]!=0.0) temp = (spin[j] - base); } if(z 1.2a1 + ------------------------------------------- + +As part of the alpha development of the OOMMF 1.2 Oxs program, changes +have been made that render 1.2a0 MIF 2.0 files invalid in 1.2a1. While +the overall structure of the MIF 2.0 format (i.e., a Tcl script with a +collection of Specify blocks) is unchanged, some of the Oxs_Ext classes +(and their corresponding Specify blocks) have been renamed or removed, +and the Specify block internal structure has changed for others. The +most significant changes are highlighted below. The reader should refer +to the "Standard Oxs_Ext Child Classes" section of the Oxsii +documentation in the OOMMF User's Guide for further details. + +1) Most notably, the Oxs_Region and Oxs_RectangularRegion classes have + been renamed Oxs_Section and Oxs_RectangularSection, and their role + as descriptions for the overall problem geometry is now served by the + new Oxs_Atlas/Oxs_SectionAtlas classes. In particular, the + Oxs_RectangularMesh class now takes a reference to an Oxs_Atlas + rather than to an Oxs_Region. For example, in the 1.2a0 release a + MIF segment like this: + + ----------------------------------------------- + OLD 1.2a0 OLD 1.2a0 OLD 1.2a0 OLD 1.2a0 + ----------------------------------------------- + Specify Oxs_RectangularRegion:World { + xrange {0 310e-9} + yrange {0 310e-9} + zrange {0 40e-9} + } + + Specify Oxs_RectangularMesh:mesh { + cellsize {10e-9 10e-9 10e-9} + region Oxs_RectangularRegion:World + } + ----------------------------------------------- + 1.2a0 OLD 1.2a0 OLD 1.2a0 OLD 1.2a0 OLD + ----------------------------------------------- + + is changed in the 1.2a1 release to: + + ----------------------------------------------- + NEW 1.2a1 NEW 1.2a1 NEW 1.2a1 NEW 1.2a1 + ----------------------------------------------- + Specify Oxs_SectionAtlas:atlas { + world { Oxs_RectangularSection { + xrange {0 310e-9} + yrange {0 310e-9} + zrange {0 40e-9} + } } + } + + Specify Oxs_RectangularMesh:mesh { + cellsize {10e-9 10e-9 10e-9} + atlas Oxs_SectionAtlas:atlas + } + ----------------------------------------------- + 1.2a1 NEW 1.2a1 NEW 1.2a1 NEW 1.2a1 NEW + ----------------------------------------------- + + The immediate benefits of the introduction of the Oxs_Atlas class are + new atlas-based scalar and vector field initializers. See the User's + guide for details. + + +2) Several of 1.2a0 the Oxs_Energy terms required an Oxs_Mesh reference + in their Specify blocks: Oxs_SimpleDemag, Oxs_Demag, + Oxs_Exchange6Ngbr. This is no longer true. The only 1.2a1 Specify + block that requires (or allows) a mesh reference is the + Oxs_StandardDriver block. + + +3) The 1.2a0 Oxs_Exchange6Ngbr class has been renamed + Oxs_UniformExchange in 1.2a1. There is now a new Oxs_Exchange6Ngbr + class in 1.2a1 that has a completely different Specify block that + supports spatially varying exchange coefficient A. + + +4) The units on the dm/dt stopping criterion in the Oxs_StandardDriver + Specify block have been changed from radians/second to + degrees/nanosecond. + + +-mjd, 23-Jan-2001 diff -urN oommf1.2a1/app/oxs/mifconvert.tcl oommf/app/oxs/mifconvert.tcl --- oommf1.2a1/app/oxs/mifconvert.tcl Sun Jan 21 16:04:03 2001 +++ oommf/app/oxs/mifconvert.tcl Thu Apr 26 11:32:51 2001 @@ -84,7 +84,6 @@ set rid [string tolower $rid] # Strip comments from parameter list - set params [string trim $params] set templist [split $params "#"] set tempparams {} foreach piece $templist { @@ -98,7 +97,7 @@ puts stderr "Record $rid has invalid parameter list: $params" exit 4 } - set params $tempparams + set params [string trim $tempparams] # Store record id + parameter list in input list lappend inlist $rid $params @@ -210,7 +209,7 @@ puts $outfile "error {INCOMPLETE MIF FILE}" exit 5 } - if {![string match "constmag" $demag_type]} { + if {![string match -nocase "constmag" $demag_type]} { puts stderr "WARNING: Requested demag type, $demag_type,\ not supported. Using constmag instead." } @@ -426,9 +425,11 @@ ############################################################## # Write Miscellaneous block set basename [EatAllRecords inlist "baseoutputfilename"] +set randomseed [EatAllRecords inlist "randomizerseed"] puts $outfile " Miscellaneous { basename [list $basename] + seed [list $randomseed] }" ############################################################## diff -urN oommf1.2a1/app/oxs/oxsii.tcl oommf/app/oxs/oxsii.tcl --- oommf1.2a1/app/oxs/oxsii.tcl Fri Jan 19 22:34:30 2001 +++ oommf/app/oxs/oxsii.tcl Tue May 29 13:47:19 2001 @@ -12,8 +12,8 @@ # Application description boilerplate Oc_Main SetAppName Oxsii -Oc_Main SetVersion 1.2.0.1 -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/20 03:34:30 $} _ date +Oc_Main SetVersion 1.2.0.2 +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ @@ -22,14 +22,22 @@ OOMMF_eXtensible_Solver_Int.html]] # Process command line options -Oc_CommandLine Option restart { +#Oc_CommandLine Option restart { +# {flag {expr {![catch {expr {$flag && $flag}}]}} {= 0 or 1}} +# } { +# global restart_option; set restart_option $flag +#} {1 => use .log file to restart simulation} +#set restart_option 0 +Oc_CommandLine Option problem {filename} { + global problem autorun; set problem $filename; set autorun 1 +} {Load and run problem from } +set autorun 0 +Oc_CommandLine Option exitondone { {flag {expr {![catch {expr {$flag && $flag}}]}} {= 0 or 1}} } { - global restart_option; set restart_option $flag -} {1 => use .log file to restart simulation} -set restart_option 0 - -Oc_CommandLine Parse $argv + global exitondone; set exitondone $flag +} {1 => Exit Oxsii when problem solved; default=0} +set exitondone 0 ########################################################################## # Define the GUI of this app to be displayed remotely by clients of the @@ -46,7 +54,7 @@ append gui "[list Oc_Main SetPid [pid]]\n" append gui { -regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/20 03:34:30 $} _ date +regexp \\\044Date:(.*)\\\044 {$Date: 2001/05/29 17:47:19 $} _ date Oc_Main SetDate [string trim $date] # This won't cross different OOMMF installations nicely @@ -85,7 +93,7 @@ -dialog_title "[Oc_Main GetInstanceName]: Load Problem" \ -selection_title "Load MIF File..." \ -select_action_id LOAD \ - -filter *.mif \ + -filter [list *.mif *.mif2] \ -file_must_exist 1 \ -delete_callback_arg [list $btn entryconfigure $item -state normal] $btn entryconfigure $item -state disabled @@ -166,18 +174,6 @@ pack [label $statframe.val -textvariable status -anchor e] -side right -fill x pack $statframe -side top -fill x -share stage -set stageframe [frame $mf.stage] -pack [label $stageframe.l -text Stage: -anchor w -width 18] -side left -fill x -pack [label $stageframe.val -textvariable stage -anchor e] -side right -fill x -pack $stageframe -side top -fill x - -share step -set stepframe [frame $mf.step] -pack [label $stepframe.l -text Step: -anchor w] -side left -fill x -pack [label $stepframe.val -textvariable step -anchor e] -side right -fill x -pack $stepframe -side top -fill x - pack $mf -side top -fill both -expand 1 set oframe [frame .sopanel] @@ -721,7 +717,7 @@ set status UNINITIALIZED trace variable status w [list ChangeStatus $status] proc ChangeStatus {old args} { - global status stage step interface_state problem + global status interface_state problem if {[string match $old $status]} {return} trace vdelete status w [list ChangeStatus $old] trace variable status w [list ChangeStatus $status] @@ -731,21 +727,15 @@ # The initial state -- no problem loaded. # Also the state after any problem load fails, or # a problem is released. - set stage "" - set step "" set interface_state disabled } Loading... { - set stage "" - set step "" set interface_state disabled # Let interface get updated with above changes, then # call ProblemLoad after idle [list LoadProblem $problem] } Initializing... { - set stage "" - set step "" set interface_state disabled after idle Reset } @@ -765,7 +755,12 @@ after idle "catch {Oxs_Run}; set status Pause" } Done { - # do nothing ? + global exitondone + if {$exitondone} { + exit ;# will trigger ReleaseProblem, etc. + } else { + # do nothing ? + } } default {error "Status: $status not yet implemented"} } @@ -790,7 +785,7 @@ } proc LoadProblem {f} { - global status stage step + global status stage step autorun # We're about to release any loaded problem. Spread the word. Oc_EventHandler Generate Oxs Release Oxs_Mif New t @@ -809,6 +804,9 @@ } else { set stage 0 set step 0 + if {$autorun} { + after idle set status Run + } set status Pause } $t Delete @@ -848,7 +846,7 @@ # $problem is the file to load. trace variable problem w {uplevel #0 set status Loading... ;#} -# Interface monitors on Stage and Step counts +# Update Stage and Step counts for Oxs_Schedule Oc_EventHandler New _ Oxs Step [list set step %step] Oc_EventHandler New _ Oxs Step [list set stage %stage] @@ -928,6 +926,9 @@ ########################################################################## # Get Thread info from account server: proc AccountReady {acct} { + # Now that connections to servers are established, it's safe + # to process options and possibly start computing. + uplevel #0 {Oc_CommandLine Parse $argv} Oc_MakeNice set qid [$acct Send threads] Oc_EventHandler New _ $acct Reply$qid [list GetThreadsReply $acct] \ @@ -944,9 +945,7 @@ # thread list if {![lindex $threads 0]} { foreach triple [lrange $threads 1 end] { - Net_Thread New _ -hostname [$acct Cget -hostname] \ - -accountname [$acct Cget -accountname] \ - -pid [lindex $triple 1] + NewThread $acct [lindex $triple 1] } } } diff -urN oommf1.2a1/app/pimake/appindex.tcl oommf/app/pimake/appindex.tcl --- oommf1.2a1/app/pimake/appindex.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/pimake/appindex.tcl Tue May 29 13:47:19 2001 @@ -1,7 +1,7 @@ Oc_Application Define { -name pimake - -version 1.2.0.1 + -version 1.2.0.2 -machine tclsh -file pimake.tcl -mode fg diff -urN oommf1.2a1/app/pimake/pimake.tcl oommf/app/pimake/pimake.tcl --- oommf1.2a1/app/pimake/pimake.tcl Thu Jan 18 18:51:51 2001 +++ oommf/app/pimake/pimake.tcl Tue May 29 13:47:19 2001 @@ -138,7 +138,7 @@ wm withdraw . } Oc_Main SetAppName pimake -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 # Disable the -console option; we don't enter an event loop Oc_CommandLine Option console {} {} diff -urN oommf1.2a1/app/pimake/platform.tcl oommf/app/pimake/platform.tcl --- oommf1.2a1/app/pimake/platform.tcl Fri Aug 25 13:01:23 2000 +++ oommf/app/pimake/platform.tcl Tue Jan 23 15:21:33 2001 @@ -64,6 +64,23 @@ return $ret } + proc Intermediate {stemlist} { + set ret {} + if {[catch { + set scripts [$configuration GetValue script_filename_intermediate] + }]} { + return $ret + } + foreach script $scripts { + if {[string length $script]} { + foreach stem $stemlist { + lappend ret [file join $platformName [eval $script $stem]] + } + } + } + return $ret + } + proc Objects {stemlist} { set ret {} set script [$configuration GetValue script_filename_object] diff -urN oommf1.2a1/config/cache/aix.tcl oommf/config/cache/aix.tcl --- oommf1.2a1/config/cache/aix.tcl Thu Jun 15 18:38:38 2000 +++ oommf/config/cache/aix.tcl Wed May 9 20:49:34 2001 @@ -92,6 +92,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Compiler warnings: # Omitted: -Wshadow -Wredundant-decls @@ -119,6 +120,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Compiler warnings: # $config SetValue program_compiler_c++_option_warn {format "-qflag=w"} diff -urN oommf1.2a1/config/cache/cygtel.tcl oommf/config/cache/cygtel.tcl --- oommf1.2a1/config/cache/cygtel.tcl Tue Apr 4 14:17:58 2000 +++ oommf/config/cache/cygtel.tcl Wed May 9 20:49:34 2001 @@ -107,6 +107,7 @@ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "long double" diff -urN oommf1.2a1/config/cache/duxalp.tcl oommf/config/cache/duxalp.tcl --- oommf1.2a1/config/cache/duxalp.tcl Fri Oct 29 12:49:28 1999 +++ oommf/config/cache/duxalp.tcl Wed May 9 20:49:34 2001 @@ -86,6 +86,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "-w0"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} } elseif {[string match g++ $ccbasename]} { # ...for GNU g++ C++ compiler $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} @@ -107,6 +108,7 @@ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror \ -Wcast-align"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/hpux.tcl oommf/config/cache/hpux.tcl --- oommf1.2a1/config/cache/hpux.tcl Fri May 26 19:44:16 2000 +++ oommf/config/cache/hpux.tcl Wed May 9 20:49:34 2001 @@ -96,6 +96,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "+w1"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} } elseif {[string match aCC $ccbasename]} { # ...for HP-UX's compiler aCC. # NOTE: Debugging (-g) is incompatible with optimization. @@ -106,6 +107,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "+w"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # The HP aCC compiler doesn't currently (10/99) support the # 'using namespace std' directive. @@ -138,6 +140,7 @@ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror \ -Wcast-align"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/linalp-mpi.tcl oommf/config/cache/linalp-mpi.tcl --- oommf1.2a1/config/cache/linalp-mpi.tcl Mon Jan 24 02:24:29 2000 +++ oommf/config/cache/linalp-mpi.tcl Tue May 29 19:10:34 2001 @@ -94,6 +94,10 @@ # ...for GNU g++ C++ compiler $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} # $config SetValue program_compiler_c++_option_opt {format "\"-O6\""} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} @@ -111,6 +115,7 @@ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/linalp.tcl oommf/config/cache/linalp.tcl --- oommf1.2a1/config/cache/linalp.tcl Fri Oct 13 19:19:19 2000 +++ oommf/config/cache/linalp.tcl Tue May 29 19:10:34 2001 @@ -85,9 +85,14 @@ # $config SetValue program_compiler_c++_option_opt { # format "-O6 -ffast-math -funroll-loops -fomit-frame-pointer -mcpu=21164" # } +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Compiler warnings: # Omitted: -Wredundant-decls -Wshadow -Wcast-align @@ -116,8 +121,12 @@ program_compiler_c++_property_optimization_breaks_varargs 1 } elseif {[string match cxx $ccbasename]} { # ...for Compaq's cxx C++ compiler - $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} -# $config SetValue program_compiler_c++_option_opt {format "-fast"} +# $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} + $config SetValue program_compiler_c++_option_opt {format "-fast"} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out \ {format "-ptr linalp/tr -o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} @@ -126,6 +135,7 @@ { format "-w0 -verbose \ -msg_disable undpreid,novtbtritmp,boolexprconst,badmulchrcom" } $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type. (On Tru64 unix, # cxx supports a long double type, but this isn't supported on @@ -145,7 +155,8 @@ $config SetValue program_linker_uses_-L-l {1} } elseif {[string match cxx $lbasename]} { # ...for DU's cxx as linker - $config SetValue program_linker [list $lbasename -ptr linalp/tr] + $config SetValue program_linker \ + [list $lbasename -ptr linalp/tr] $config SetValue program_linker_option_obj {format \"%s\"} $config SetValue program_linker_option_out {format "-o \"%s\""} $config SetValue program_linker_option_lib {format \"%s\"} diff -urN oommf1.2a1/config/cache/lintel-mpi.tcl oommf/config/cache/lintel-mpi.tcl --- oommf1.2a1/config/cache/lintel-mpi.tcl Thu Oct 14 17:52:31 1999 +++ oommf/config/cache/lintel-mpi.tcl Tue May 29 19:10:34 2001 @@ -99,6 +99,10 @@ # ...for GNU g++ C++ compiler $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} # $config SetValue program_compiler_c++_option_opt {format "\"-O6\""} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} @@ -116,6 +120,7 @@ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "long double" diff -urN oommf1.2a1/config/cache/lintel.tcl oommf/config/cache/lintel.tcl --- oommf1.2a1/config/cache/lintel.tcl Mon Nov 8 10:39:22 1999 +++ oommf/config/cache/lintel.tcl Tue May 29 19:10:34 2001 @@ -83,6 +83,13 @@ # i486/i386 systems, and may complicate debugging. Uncomment the # following line to enable the Pentium-specific optimizations. # $config SetValue program_compiler_c++_option_opt {format "-O3 -malign-double -fomit-frame-pointer"} +# Or try this for PentiumPro systems. Try it both with and without +# -malign-double. +# $config SetValue program_compiler_c++_option_opt {format "-O4 -ffast-math -fomit-frame-pointer -march=pentiumpro -malign-double"} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} @@ -100,6 +107,7 @@ -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations \ -Wnested-externs -Woverloaded-virtual -Wsynth -Werror"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue \ diff -urN oommf1.2a1/config/cache/sgi-mpi.tcl oommf/config/cache/sgi-mpi.tcl --- oommf1.2a1/config/cache/sgi-mpi.tcl Thu Oct 14 17:52:31 1999 +++ oommf/config/cache/sgi-mpi.tcl Wed May 9 20:49:34 2001 @@ -96,6 +96,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "-fullwarn"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/sgi.tcl oommf/config/cache/sgi.tcl --- oommf1.2a1/config/cache/sgi.tcl Tue Dec 12 22:29:54 2000 +++ oommf/config/cache/sgi.tcl Tue May 29 19:10:34 2001 @@ -107,11 +107,16 @@ ## in the program_linker line below. Also, at least some versions ## of CC don't like the combination '-32 -Ofast', so you may have ## to avoid 'CC -32 -c' above in favor of 'CC -n32 -c'. +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "-fullwarn"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" @@ -136,6 +141,7 @@ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror \ -Wcast-align"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/solaris.tcl oommf/config/cache/solaris.tcl --- oommf1.2a1/config/cache/solaris.tcl Sat Nov 18 12:32:00 2000 +++ oommf/config/cache/solaris.tcl Tue May 29 19:10:34 2001 @@ -90,6 +90,10 @@ # ...for Sun WorkShop C++ compiler $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} # $config SetValue program_compiler_c++_option_opt {format "-fast"} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} @@ -97,6 +101,7 @@ # Compiler warnings: $config SetValue program_compiler_c++_option_warn {format "-xwe +w"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" @@ -106,6 +111,10 @@ $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} # $config SetValue program_compiler_c++_option_opt \ # {format "-O3 -ffast-math -mcpu=ultrasparc"} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} @@ -125,6 +134,7 @@ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror \ -Wcast-align"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/sunos.tcl oommf/config/cache/sunos.tcl --- oommf1.2a1/config/cache/sunos.tcl Tue Mar 28 18:19:56 2000 +++ oommf/config/cache/sunos.tcl Wed May 9 20:49:34 2001 @@ -86,6 +86,7 @@ $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" @@ -120,6 +121,7 @@ -Wnested-externs -Winline -Woverloaded-virtual -Wsynth -Werror \ -Wcast-align"} $config SetValue program_compiler_c++_option_debug {format "-g"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/unknown.tcl oommf/config/cache/unknown.tcl --- oommf1.2a1/config/cache/unknown.tcl Thu Oct 14 17:52:31 1999 +++ oommf/config/cache/unknown.tcl Wed May 9 20:49:34 2001 @@ -93,6 +93,7 @@ $config SetValue program_compiler_c++_option_out {format "-o \"%s\""} $config SetValue program_compiler_c++_option_src {format \"%s\"} $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/winalp.tcl oommf/config/cache/winalp.tcl --- oommf1.2a1/config/cache/winalp.tcl Wed Dec 20 16:53:49 2000 +++ oommf/config/cache/winalp.tcl Wed May 9 20:49:34 2001 @@ -89,6 +89,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"/I%s\""} $config SetValue program_compiler_c++_option_warn {format "/W2"} $config SetValue program_compiler_c++_option_debug {format "/MLd"} + $config SetValue program_compiler_c++_option_def {format "\"/D%s\""} # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" diff -urN oommf1.2a1/config/cache/wintel.tcl oommf/config/cache/wintel.tcl --- oommf1.2a1/config/cache/wintel.tcl Mon Jan 22 15:34:28 2001 +++ oommf/config/cache/wintel.tcl Tue May 29 19:10:34 2001 @@ -109,12 +109,17 @@ $config SetValue program_compiler_c++_option_opt {} # Maximum optimization # $config SetValue program_compiler_c++_option_opt {format "/G5 /Ox"} +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile $config SetValue program_compiler_c++_option_out {format "\"/Fo%s\""} $config SetValue program_compiler_c++_option_src {format "\"/Tp%s\""} $config SetValue program_compiler_c++_option_inc {format "\"/I%s\""} $config SetValue program_compiler_c++_option_warn {format "/W4"} # $config SetValue program_compiler_c++_option_debug {format "/MLd"} $config SetValue program_compiler_c++_option_debug {format "/Zi"} + $config SetValue program_compiler_c++_option_def {format "\"/D%s\""} # Use OOMMF supplied erf() error function $config SetValue program_compiler_c++_property_no_erf 1 @@ -142,6 +147,7 @@ $config SetValue program_compiler_c++_option_inc {format "\"-I%s\""} $config SetValue program_compiler_c++_option_warn {format "-w"} $config SetValue program_compiler_c++_option_debug {format "-v"} + $config SetValue program_compiler_c++_option_def {format "\"-D%s\""} # Use OOMMF supplied erf() error function $config SetValue program_compiler_c++_property_no_erf 1 @@ -150,6 +156,10 @@ # $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} $config SetValue program_compiler_c++_option_opt {format "-5 -Ox"} ## Where -5: pentium instructions, -Ox: fastest code +# NOTE: If you want good performance, be sure to edit ../local/options.tcl +# to include the line +# Oc_Option Add * Platform cflags {-def NDEBUG} +# so that the NDEBUG symbol is defined during compile # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" @@ -257,6 +267,12 @@ # a file name stem and evaluated returns the corresponding file name for # a static library on this platform $config SetValue script_filename_static_library {format %s.lib} + +# A list of partial Tcl commands (or scripts) which when completed by +# lappending a file name stem and evaluated returns the corresponding +# file name for an intermediate file produced by the linker on this platform +$config SetValue script_filename_intermediate [list {format %s.ilk} \ + {format %s.pdb}] ######################################################################## unset config diff -urN oommf1.2a1/doc/common/disclaimer-body.tex oommf/doc/common/disclaimer-body.tex --- oommf1.2a1/doc/common/disclaimer-body.tex Thu Aug 24 18:41:13 2000 +++ oommf/doc/common/disclaimer-body.tex Tue Feb 27 16:51:46 2001 @@ -13,7 +13,7 @@ characteristic. We would appreciate acknowledgement if the software is used. -Commercial equipment and software referred to on these pages is +Commercial equipment and software referred to on these pages are identified for informational purposes only, and does not imply recommendation of or endorsement by the National Institute of Standards and Technology, nor does it imply that the products so identified are diff -urN oommf1.2a1/doc/common/oommfhead.tex oommf/doc/common/oommfhead.tex --- oommf1.2a1/doc/common/oommfhead.tex Mon Nov 13 16:33:38 2000 +++ oommf/doc/common/oommfhead.tex Wed May 16 19:32:19 2001 @@ -14,6 +14,7 @@ %begin{latexonly} \ifx\undefined\pdfpagewidth % pdflatex command not in use + \else \usepackage[pdftex, colorlinks=true, citecolor=blue]{hyperref} \fi @@ -55,6 +56,7 @@ \setlength{\textwidth}{6.5in} \setlength{\oddsidemargin}{0in} +\setlength{\textheight}{8.5in} \begin{htmlonly} \HTMLset{myTODAY}{\today} diff -urN oommf1.2a1/doc/progman/ExtClassMain.obj oommf/doc/progman/ExtClassMain.obj --- oommf1.2a1/doc/progman/ExtClassMain.obj Wed Dec 31 19:00:00 1969 +++ oommf/doc/progman/ExtClassMain.obj Mon Feb 5 02:14:53 2001 @@ -0,0 +1,345 @@ +%TGIF 4.0.12 +state(1,37,100.000,0,128,1,8,0,3,2,2,6,0,1,0,1,1,'Times-Bold',1,195840,0,0,0,10,0,0,0,1,0,16,0,0,1,1,1,1,1408,1088,0,0,320,1). +% +% @(#)$Header: /home/cvs/cvsroot/itl/oommf/doc/progman/ExtClassMain.obj,v 1.1 2001/02/05 07:14:53 donahue Exp $ +% %W% +% +unit("1 pixel/pixel"). +color_info(13,65535,0,[ + "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, + "red", 65535, 0, 0, 65535, 0, 0, 1, + "green", 0, 65535, 0, 0, 65535, 0, 1, + "blue", 0, 0, 65535, 0, 0, 65535, 1, + "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, + "pink", 65535, 49931, 53052, 65535, 49344, 52171, 1, + "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, + "CadetBlue", 22885, 40569, 42649, 24415, 40606, 41120, 1, + "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, + "black", 0, 0, 0, 0, 0, 0, 1, + "DarkSlateGray", 10402, 19764, 18724, 12079, 20303, 20303, 1, + "gray", 48891, 48891, 48891, 48830, 48830, 48830, 1, + "DimGray", 27046, 27046, 27046, 26985, 26985, 26985, 1 +]). +script_frac("0.6"). +fg_bg_colors('blue','white'). +page(1,"",1). +poly('blue','',2,[ + 260,178,619,178],0,7,1,2938,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 1194,178,793,178],0,7,1,2939,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 498,690,655,690],1,7,1,2204,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 554,594,655,594],1,7,1,2207,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 523,786,655,786],1,7,1,2340,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 552,882,655,882],1,7,1,2629,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 752,594,657,594],1,7,1,2724,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 775,690,657,690],1,7,1,2787,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 742,786,657,786],1,7,1,2900,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 759,882,657,882],1,7,1,2901,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 261,282,261,179],1,7,1,1327,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 540,282,540,179],1,7,1,1388,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 1192,282,1192,176],1,7,1,1544,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 818,282,818,179],1,7,1,1562,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 1192,410,1192,330],1,7,1,1769,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 818,410,818,330],1,7,1,1791,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 261,410,261,330],1,7,1,1637,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',4,[ + 656,884,656,512,538,512,538,328],1,7,1,2181,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +group([ +text('magenta',384,576,1,1,1,265,37,252,30,7,0,0,0,0,2,265,37,0,0,"",0,0,0,1,606,[ +minilines(265,37,0,0,1,0,0,[ +mini_line(265,30,7,0,0,0,[ +str_block(0,265,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,265,30,7,0,-1,0,0,0,0,0, + "Oxs_SimpleDemag")]) +]) +])]), +box('black','',216,570,552,618,0,5,1,918,0,0,1,0,0,'5',1,[ +]) +], +3072,1,0,[ +]). +group([ +text('magenta',384,672,1,1,1,169,37,140,30,7,0,0,0,0,2,169,37,0,0,"",0,0,0,1,702,[ +minilines(169,37,0,0,1,0,0,[ +mini_line(169,30,7,0,0,0,[ +str_block(0,169,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,169,30,7,0,-1,0,0,0,0,0, + "Oxs_Demag")]) +]) +])]), +box('black','',272,666,496,714,0,5,1,944,0,0,1,0,0,'5',1,[ +]) +], +3075,1,0,[ +]). +group([ +text('magenta',384,768,1,1,1,208,37,152,30,7,0,0,0,0,2,208,37,0,0,"",0,0,0,1,798,[ +minilines(208,37,0,0,1,0,0,[ +mini_line(208,30,7,0,0,0,[ +str_block(0,208,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,208,30,7,0,-1,0,0,0,0,0, + "Oxs_UZeeman")]) +]) +])]), +box('black','',248,762,520,810,0,5,1,953,0,0,1,0,0,'5',1,[ +]) +], +3078,1,0,[ +]). +group([ +text('magenta',384,864,1,1,1,263,37,144,30,7,0,0,0,0,2,263,37,0,0,"",0,0,0,1,894,[ +minilines(263,37,0,0,1,0,0,[ +mini_line(263,30,7,0,0,0,[ +str_block(0,263,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,263,30,7,0,-1,0,0,0,0,0, + "Oxs_FixedZeeman")]) +]) +])]), +box('black','',216,858,552,906,0,5,1,954,0,0,1,0,0,'5',1,[ +]) +], +3081,1,0,[ +]). +group([ +text('magenta',960,576,1,1,1,329,37,154,30,7,0,0,0,0,2,329,37,0,0,"",0,0,0,1,606,[ +minilines(329,37,0,0,1,0,0,[ +mini_line(329,30,7,0,0,0,[ +str_block(0,329,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,329,30,7,0,-1,0,0,0,0,0, + "Oxs_UniformExchange")]) +]) +])]), +box('black','',752,570,1168,618,0,5,1,1013,0,0,1,0,0,'5',1,[ +]) +], +3104,1,0,[ +]). +group([ +text('magenta',960,672,1,1,1,297,37,138,30,7,0,0,0,0,2,297,37,0,0,"",0,0,0,1,702,[ +minilines(297,37,0,0,1,0,0,[ +mini_line(297,30,7,0,0,0,[ +str_block(0,297,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,297,30,7,0,-1,0,0,0,0,0, + "Oxs_Exchange6Ngbr")]) +]) +])]), +box('black','',776,666,1144,714,0,5,1,1012,0,0,1,0,0,'5',1,[ +]) +], +3107,1,0,[ +]). +group([ +text('magenta',960,768,1,1,1,348,37,148,30,7,0,0,0,0,2,348,37,0,0,"",0,0,0,1,798,[ +minilines(348,37,0,0,1,0,0,[ +mini_line(348,30,7,0,0,0,[ +str_block(0,348,30,7,0,-2,0,0,0,[ +str_seg('black','Times-Bold',1,195840,348,30,7,0,-2,0,0,0,0,0, + "Oxs_UniaxialAnisotropy")]) +]) +])]), +box('black','',744,762,1176,810,0,5,1,1001,0,0,1,0,0,'5',1,[ +]) +], +3110,1,0,[ +]). +group([ +text('magenta',960,864,1,1,1,314,37,240,30,7,0,0,0,0,2,314,37,0,0,"",0,0,0,1,894,[ +minilines(314,37,0,0,1,0,0,[ +mini_line(314,30,7,0,0,0,[ +str_block(0,314,30,7,0,-2,0,0,0,[ +str_seg('black','Times-Bold',1,195840,314,30,7,0,-2,0,0,0,0,0, + "Oxs_CubicAnisotropy")]) +]) +])]), +box('black','',760,858,1160,906,0,5,1,963,0,0,1,0,0,'5',1,[ +]) +], +3113,1,0,[ +]). +group([ +group([ +box('white','',616,154,792,202,1,4,1,1579,0,0,0,0,0,'4',1,[ +]), +box('red','',616,154,792,202,0,4,1,770,0,0,0,0,0,'4',1,[ +]) +], +3144,1,0,[ +]), +text('magenta',704,160,1,1,1,121,37,13,30,7,0,0,0,0,2,121,37,0,0,"",0,0,0,1,190,[ +minilines(121,37,0,0,1,0,0,[ +mini_line(121,30,7,0,0,0,[ +str_block(0,121,30,7,0,-1,0,0,0,[ +str_seg('red','Times-Bold',1,195840,121,30,7,0,-1,0,0,0,0,0, + "Oxs_Ext")]) +]) +])]) +], +3156,1,0,[ +]). +group([ +text('magenta',261,416,1,1,1,321,37,42,30,7,0,0,0,0,2,321,37,0,0,"",0,0,0,1,446,[ +minilines(321,37,0,0,1,0,0,[ +mini_line(321,30,7,0,0,0,[ +str_block(0,321,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,321,30,7,0,-1,0,0,0,0,0, + "Oxs_RectangularMesh")]) +]) +])]), +box('black','',61,410,461,458,0,5,1,776,0,0,1,0,0,'5',1,[ +]) +], +3169,1,0,[ +]). +group([ +text('magenta',818,416,1,1,1,296,37,44,30,7,0,0,0,0,2,296,37,0,0,"",0,0,0,1,446,[ +minilines(296,37,0,0,1,0,0,[ +mini_line(296,30,7,0,0,0,[ +str_block(0,296,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,296,30,7,0,-1,0,0,0,0,0, + "Oxs_StandardDriver")]) +]) +])]), +box('black','',634,410,1002,458,0,5,1,850,0,0,1,0,0,'5',1,[ +]) +], +3173,1,0,[ +]). +group([ +text('magenta',1192,416,1,1,1,247,37,46,30,7,0,0,0,0,2,247,37,0,0,"",0,0,0,1,446,[ +minilines(247,37,0,0,1,0,0,[ +mini_line(247,30,7,0,0,0,[ +str_block(0,247,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,247,30,7,0,-1,0,0,0,0,0, + "Oxs_EulerEvolve")]) +]) +])]), +box('black','',1032,410,1352,458,0,5,1,888,0,0,1,0,0,'5',1,[ +]) +], +3177,1,0,[ +]). +group([ +text('magenta',1192,288,1,1,1,183,37,36,30,7,0,0,0,0,2,183,37,0,0,"",0,0,0,1,318,[ +minilines(183,37,0,0,1,0,0,[ +mini_line(183,30,7,0,0,0,[ +str_block(0,183,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,183,30,7,0,-1,0,0,0,0,0, + "Oxs_Evolver")]) +]) +])]), +box('blue','',1080,282,1304,330,0,5,1,775,0,0,1,0,0,'5',1,[ +]) +], +3181,1,0,[ +]). +group([ +text('magenta',818,288,1,1,1,166,37,34,30,7,0,0,0,0,2,166,37,0,0,"",0,0,0,1,318,[ +minilines(166,37,0,0,1,0,0,[ +mini_line(166,30,7,0,0,0,[ +str_block(0,166,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,166,30,7,0,-1,0,0,0,0,0, + "Oxs_Driver")]) +]) +])]), +box('blue','',714,282,922,330,0,5,1,774,0,0,1,0,0,'5',1,[ +]) +], +3185,1,0,[ +]). +group([ +text('magenta',540,288,1,1,1,174,37,30,30,7,0,0,0,0,2,174,37,0,0,"",0,0,0,1,318,[ +minilines(174,37,0,0,1,0,0,[ +mini_line(174,30,7,0,0,0,[ +str_block(0,174,30,7,0,-2,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,174,30,7,0,-2,0,0,0,0,0, + "Oxs_Energy")]) +]) +])]), +box('blue','',428,282,652,330,0,5,1,773,0,0,1,0,0,'5',1,[ +]) +], +3189,1,0,[ +]). +group([ +text('magenta',261,288,1,1,1,148,37,32,30,7,0,0,0,0,2,148,37,0,0,"",0,0,0,1,318,[ +minilines(148,37,0,0,1,0,0,[ +mini_line(148,30,7,0,0,0,[ +str_block(0,148,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,148,30,7,0,-1,0,0,0,0,0, + "Oxs_Mesh")]) +]) +])]), +box('blue','',165,282,357,330,0,5,1,772,0,0,1,0,0,'5',1,[ +]) +], +3193,1,0,[ +]). diff -urN oommf1.2a1/doc/progman/ExtClassSupport.obj oommf/doc/progman/ExtClassSupport.obj --- oommf1.2a1/doc/progman/ExtClassSupport.obj Wed Dec 31 19:00:00 1969 +++ oommf/doc/progman/ExtClassSupport.obj Mon Feb 5 02:14:53 2001 @@ -0,0 +1,349 @@ +%TGIF 4.0.12 +state(1,37,100.000,128,192,0,4,1,1,2,0,6,0,1,0,1,1,'Times-Bold',1,195840,0,0,0,10,0,0,0,1,0,16,0,0,1,1,1,1,1408,1088,0,0,320,1). +% +% @(#)$Header: /home/cvs/cvsroot/itl/oommf/doc/progman/ExtClassSupport.obj,v 1.1 2001/02/05 07:14:53 donahue Exp $ +% %W% +% +unit("1 pixel/pixel"). +color_info(13,65535,0,[ + "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, + "red", 65535, 0, 0, 65535, 0, 0, 1, + "green", 0, 65535, 0, 0, 65535, 0, 1, + "blue", 0, 0, 65535, 0, 0, 65535, 1, + "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, + "pink", 65535, 49931, 53052, 65535, 49344, 52171, 1, + "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, + "CadetBlue", 22885, 40569, 42649, 24415, 40606, 41120, 1, + "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, + "black", 0, 0, 0, 0, 0, 0, 1, + "DarkSlateGray", 10402, 19764, 18724, 12079, 20303, 20303, 1, + "gray", 48891, 48891, 48891, 48830, 48830, 48830, 1, + "DimGray", 27046, 27046, 27046, 26985, 26985, 26985, 1 +]). +script_frac("0.6"). +fg_bg_colors('red','white'). +page(1,"",1). +poly('blue','',2,[ + 242,178,619,178],0,7,1,2938,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 1194,178,793,178],0,7,1,2939,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 524,282,524,179],1,7,1,1388,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 1192,282,1192,176],1,7,1,1544,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('blue','',2,[ + 862,282,862,179],1,7,1,1562,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 526,410,526,330],1,7,1,1791,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 244,661,244,330],1,7,1,1637,0,0,0,0,1,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +group([ +group([ +box('white','',616,154,792,202,1,4,1,1579,0,0,0,0,0,'4',1,[ +]), +box('red','',616,154,792,202,0,4,1,770,0,0,0,0,0,'4',1,[ +]) +], +3144,1,0,[ +]), +text('magenta',704,160,1,1,1,121,37,13,30,7,0,0,0,0,2,121,37,0,0,"",0,0,0,1,190,[ +minilines(121,37,0,0,1,0,0,[ +mini_line(121,30,7,0,0,0,[ +str_block(0,121,30,7,0,-1,0,0,0,[ +str_seg('red','Times-Bold',1,195840,121,30,7,0,-1,0,0,0,0,0, + "Oxs_Ext")]) +]) +])]) +], +3156,1,0,[ +]). +group([ +text('magenta',524,288,1,1,1,302,37,30,30,7,0,0,0,0,2,302,37,0,0,"",0,0,0,1,318,[ +minilines(302,37,0,0,1,0,0,[ +mini_line(302,30,7,0,0,0,[ +str_block(0,302,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,302,30,7,0,-1,0,0,0,0,0, + "Oxs_RegionIndicator")]) +]) +])]), +box('blue','',364,282,684,330,0,5,1,773,0,0,1,0,0,'5',1,[ +]) +], +3374,0,0,[ +]). +group([ +text('magenta',862,288,1,1,1,282,37,34,30,7,0,0,0,0,2,282,37,0,0,"",0,0,0,1,318,[ +minilines(282,37,0,0,1,0,0,[ +mini_line(282,30,7,0,0,0,[ +str_block(0,282,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,282,30,7,0,-1,0,0,0,0,0, + "Oxs_ScalarFieldInit")]) +]) +])]), +box('blue','',710,282,1014,330,0,5,1,774,0,0,1,0,0,'5',1,[ +]) +], +3377,0,0,[ +]). +group([ +text('magenta',1192,288,1,1,1,290,37,36,30,7,0,0,0,0,2,290,37,0,0,"",0,0,0,1,318,[ +minilines(290,37,0,0,1,0,0,[ +mini_line(290,30,7,0,0,0,[ +str_block(0,290,30,7,0,-1,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,290,30,7,0,-1,0,0,0,0,0, + "Oxs_VectorFieldInit")]) +]) +])]), +box('blue','',1032,282,1352,330,0,5,1,775,0,0,1,0,0,'5',1,[ +]) +], +3380,0,0,[ +]). +group([ +text('magenta',417,640,1,1,1,230,37,252,30,7,0,0,0,0,2,230,37,0,0,"",0,0,0,1,670,[ +minilines(230,37,0,0,1,0,0,[ +mini_line(230,30,7,0,0,0,[ +str_block(0,230,30,7,0,-2,0,0,0,[ +str_seg('black','Times-Bold',1,195840,230,30,7,0,-2,0,0,0,0,0, + "Oxs_ScriptAtlas")]) +]) +])]), +box('black','',289,634,545,682,0,5,1,918,0,0,0,0,0,'5',1,[ +]) +], +5108,1,0,[ +]). +group([ +text('magenta',449,544,1,1,1,298,37,42,30,7,0,0,0,0,2,298,37,0,0,"",0,0,0,1,574,[ +minilines(298,37,0,0,1,0,0,[ +mini_line(298,30,7,0,0,0,[ +str_block(0,298,30,7,0,-2,0,0,0,[ +str_seg('black','Times-Bold',1,195840,298,30,7,0,-2,0,0,0,0,0, + "Oxs_RegionListAtlas")]) +]) +])]), +box('black','',289,538,609,586,0,5,1,776,0,0,0,0,0,'5',1,[ +]) +], +5115,1,0,[ +]). +group([ +text('magenta',526,416,1,1,1,475,37,44,30,7,0,0,0,0,2,475,37,0,0,"",0,0,0,1,446,[ +minilines(475,37,0,0,1,0,0,[ +mini_line(475,30,7,0,0,0,[ +str_block(0,475,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,475,30,7,0,-1,0,0,0,0,0, + "Oxs_RectangularRegionIndicator")]) +]) +])]), +box('black','',274,410,778,458,0,5,1,850,0,0,0,0,0,'5',1,[ +]) +], +5121,0,0,[ +]). +group([ +text('magenta',838,496,1,1,1,355,37,154,30,7,0,0,0,0,2,355,37,0,0,"",0,0,0,1,526,[ +minilines(355,37,0,0,1,0,0,[ +mini_line(355,30,7,0,0,0,[ +str_block(0,355,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,355,30,7,0,-1,0,0,0,0,0, + "Oxs_AtlasScalarFieldInit")]) +]) +])]), +box('black','',646,490,1030,538,0,5,1,1013,0,0,0,0,0,'5',1,[ +]) +], +5134,1,0,[ +]). +group([ +text('magenta',508,784,1,1,1,343,37,152,30,7,0,0,0,0,2,343,37,0,0,"",0,0,0,1,814,[ +minilines(343,37,0,0,1,0,0,[ +mini_line(343,30,7,0,0,0,[ +str_block(0,343,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,343,30,7,0,-1,0,0,0,0,0, + "Oxs_FileVectorFieldInit")]) +]) +])]), +box('black','',324,778,692,826,0,5,1,953,0,0,0,0,0,'5',1,[ +]) +], +5137,1,0,[ +]). +group([ +text('magenta',830,592,1,1,1,368,37,138,30,7,0,0,0,0,2,368,37,0,0,"",0,0,0,1,622,[ +minilines(368,37,0,0,1,0,0,[ +mini_line(368,30,7,0,0,0,[ +str_block(0,368,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,368,30,7,0,-1,0,0,0,0,0, + "Oxs_ScriptScalarFieldInit")]) +]) +])]), +box('black','',630,586,1030,634,0,5,1,1012,0,0,0,0,0,'5',1,[ +]) +], +5143,1,0,[ +]). +group([ +text('magenta',814,688,1,1,1,403,37,148,30,7,0,0,0,0,2,403,37,0,0,"",0,0,0,1,718,[ +minilines(403,37,0,0,1,0,0,[ +mini_line(403,30,7,0,0,0,[ +str_block(0,403,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,403,30,7,0,-1,0,0,0,0,0, + "Oxs_UniformScalarFieldInit")]) +]) +])]), +box('black','',598,682,1030,730,0,5,1,1001,0,0,0,0,0,'5',1,[ +]) +], +5146,1,0,[ +]). +group([ +text('magenta',970,784,1,1,1,376,37,240,30,7,0,0,0,0,2,376,37,0,0,"",0,0,0,1,814,[ +minilines(376,37,0,0,1,0,0,[ +mini_line(376,30,7,0,0,0,[ +str_block(0,376,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,376,30,7,0,-1,0,0,0,0,0, + "Oxs_ScriptVectorFieldInit")]) +]) +])]), +box('black','',770,778,1170,826,0,5,1,963,0,0,0,0,0,'5',1,[ +]) +], +5149,0,0,[ +]). +group([ +text('magenta',508,880,1,1,1,363,37,140,30,7,0,0,0,0,2,363,37,0,0,"",0,0,0,1,910,[ +minilines(363,37,0,0,1,0,0,[ +mini_line(363,30,7,0,0,0,[ +str_block(0,363,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,363,30,7,0,-1,0,0,0,0,0, + "Oxs_AtlasVectorFieldInit")]) +]) +])]), +box('black','',308,874,708,922,0,5,1,944,0,0,0,0,0,'5',1,[ +]) +], +5140,0,0,[ +]). +group([ +text('magenta',970,880,1,1,1,411,37,4903,30,7,0,0,0,0,2,411,37,0,0,"",0,0,0,1,910,[ +minilines(411,37,0,0,1,0,0,[ +mini_line(411,30,7,0,0,0,[ +str_block(0,411,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,411,30,7,0,-1,0,0,0,0,0, + "Oxs_UniformVectorFieldInit")]) +]) +])]), +box('black','',746,874,1194,922,0,5,1,4904,0,0,0,0,0,'5',1,[ +]) +], +5152,0,0,[ +]). +poly('black','',2,[ + 508,829,508,873],0,7,1,8405,0,0,0,0,1,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 970,829,970,873],0,7,1,8407,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',3,[ + 1192,329,1192,849,508,849],2,7,1,8443,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 728,970,728,853],1,7,1,8459,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 1028,706,1074,706],1,7,1,8654,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 1028,610,1074,610],1,7,1,8662,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 1028,514,1074,514],1,7,1,8984,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',4,[ + 1076,707,1076,444,863,444,863,331],1,7,1,9096,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 288,658,245,658],1,7,1,9167,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 288,562,245,562],1,7,1,9171,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +group([ +poly('blue','',2,[ + 244,282,244,179],1,7,1,1327,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]), +group([ +text('magenta',244,288,1,1,1,144,37,32,30,7,0,0,0,0,2,144,37,0,0,"",0,0,0,1,318,[ +minilines(144,37,0,0,1,0,0,[ +mini_line(144,30,7,0,0,0,[ +str_block(0,144,30,7,0,-2,0,0,0,[ +str_seg('blue','Times-Bold',1,195840,144,30,7,0,-2,0,0,0,0,0, + "Oxs_Atlas")]) +]) +])]), +box('blue','',164,282,324,330,0,5,1,772,0,0,1,0,0,'5',1,[ +]) +], +3371,1,0,[ +]) +], +9351,0,0,[ +]). +group([ +text('magenta',728,976,1,1,1,488,37,144,30,7,0,0,0,1,2,488,37,0,0,"",0,0,0,1,1006,[ +minilines(488,37,0,0,1,0,0,[ +mini_line(488,30,7,0,0,0,[ +str_block(0,488,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,488,30,7,0,-1,0,0,0,0,0, + "Oxs_PlaneRandomVectorFieldInit")]) +]) +])]), +box('black','',464,970,992,1018,0,5,1,954,0,0,0,0,0,'5',1,[ +]) +], +9374,0,0,[ +]). diff -urN oommf1.2a1/doc/progman/OutputClass.obj oommf/doc/progman/OutputClass.obj --- oommf1.2a1/doc/progman/OutputClass.obj Wed Dec 31 19:00:00 1969 +++ oommf/doc/progman/OutputClass.obj Mon Feb 5 02:14:53 2001 @@ -0,0 +1,93 @@ +%TGIF 4.0.12 +state(1,37,100.000,0,0,2,16,0,9,2,2,6,0,1,0,1,1,'Times-Bold',1,195840,0,0,0,10,0,0,0,1,0,16,0,0,1,1,1,1,1408,1088,0,0,320,1). +% +% @(#)$Header: /home/cvs/cvsroot/itl/oommf/doc/progman/OutputClass.obj,v 1.1 2001/02/05 07:14:53 donahue Exp $ +% %W% +% +unit("1 pixel/pixel"). +color_info(13,65535,0,[ + "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, + "red", 65535, 0, 0, 65535, 0, 0, 1, + "green", 0, 65535, 0, 0, 65535, 0, 1, + "blue", 0, 0, 65535, 0, 0, 65535, 1, + "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, + "pink", 65535, 49931, 53052, 65535, 49344, 52171, 1, + "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, + "CadetBlue", 22885, 40569, 42649, 24415, 40606, 41120, 1, + "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, + "black", 0, 0, 0, 0, 0, 0, 1, + "DarkSlateGray", 10402, 19764, 18724, 12079, 20303, 20303, 1, + "gray", 48891, 48891, 48891, 48830, 48830, 48830, 1, + "DimGray", 27046, 27046, 27046, 26985, 26985, 26985, 1 +]). +script_frac("0.6"). +fg_bg_colors('black','white'). +page(1,"",1). +group([ +group([ +box('white','',572,430,764,486,1,4,1,1579,0,0,0,0,0,'4',1,[ +]), +box('red','',572,430,764,486,0,4,1,770,0,0,0,0,0,'4',1,[ +]) +], +3144,0,0,[ +]), +text('magenta',668,440,1,1,1,172,37,13,30,7,0,0,0,0,2,172,37,0,0,"",0,0,0,1,470,[ +minilines(172,37,0,0,1,0,0,[ +mini_line(172,30,7,0,0,0,[ +str_block(0,172,30,7,0,-1,0,0,0,[ +str_seg('red','Times-Bold',1,195840,172,30,7,0,-1,0,0,0,0,0, + "Oxs_Output")]) +]) +])]) +], +9829,1,0,[ +]). +group([ +text('magenta',459,573,2,1,1,264,74,32,30,7,0,0,0,0,2,264,74,0,0,"",0,0,0,1,603,[ +minilines(264,74,0,0,1,0,0,[ +mini_line(264,30,7,0,0,0,[ +str_block(0,264,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,264,30,7,0,-1,0,0,0,0,0, + "template ")]) +]), +mini_line(261,30,7,0,0,0,[ +str_block(0,261,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,261,30,7,0,-1,0,0,0,0,0, + "Oxs_ScalarOutput")]) +]) +])]), +box('black','',307,562,611,658,0,5,1,772,0,0,0,0,0,'5',1,[ +]) +], +9854,1,0,[ +]). +group([ +text('magenta',913,573,2,1,1,340,74,36,30,7,0,0,0,0,2,340,74,0,0,"",0,0,0,1,603,[ +minilines(340,74,0,0,1,0,0,[ +mini_line(264,30,7,0,0,0,[ +str_block(0,264,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,264,30,7,0,-1,0,0,0,0,0, + "template ")]) +]), +mini_line(340,30,7,0,0,0,[ +str_block(0,340,30,7,0,-1,0,0,0,[ +str_seg('black','Times-Bold',1,195840,340,30,7,0,-1,0,0,0,0,0, + "Oxs_VectorFieldOutput")]) +]) +])]), +box('black','',725,562,1101,658,0,5,1,775,0,0,0,0,0,'5',1,[ +]) +], +9858,1,0,[ +]). +poly('black','',2,[ + 780,562,747,486],1,7,1,1544,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). +poly('black','',2,[ + 556,562,589,486],1,7,1,10043,0,0,0,0,0,0,0,'7',1,0, + "0","",[ + 0,22,9,0,'22','9','0'],[0,22,9,0,'22','9','0'],[ +]). diff -urN oommf1.2a1/doc/progman/makerules.tcl oommf/doc/progman/makerules.tcl --- oommf1.2a1/doc/progman/makerules.tcl Mon Dec 11 19:55:57 2000 +++ oommf/doc/progman/makerules.tcl Tue May 29 19:09:54 2001 @@ -73,6 +73,14 @@ -targets maintainer-clean -dependencies distclean -script { + DeleteFiles progman progman.ps progman.pdf + } +} + +MakeRule Define { + -targets distclean + -dependencies {} + -script { eval DeleteFiles [glob -nocomplain *.aux] eval DeleteFiles [glob -nocomplain *.bbl] eval DeleteFiles [glob -nocomplain *.blg] @@ -83,10 +91,9 @@ eval DeleteFiles [glob -nocomplain *.log] eval DeleteFiles [glob -nocomplain *.out] eval DeleteFiles [glob -nocomplain *.toc] - DeleteFiles progman progman.ps progman.pdf } } - + MakeRule Define { -targets upgrade -script {DeleteFiles biblio.tex} diff -urN oommf1.2a1/doc/progman/progman.tex oommf/doc/progman/progman.tex --- oommf1.2a1/doc/progman/progman.tex Fri Jan 19 10:58:26 2001 +++ oommf/doc/progman/progman.tex Tue May 29 19:09:54 2001 @@ -20,7 +20,7 @@ Programming Manual\\[2ex] {\today} {}\\[2ex] -This manual documents release 1.2a1.\\[1ex] +This manual documents release 1.2a2.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date.\\[1ex] WARNING: This document in under construction. diff -urN oommf1.2a1/doc/userguide/cllaunch-body.tex oommf/doc/userguide/cllaunch-body.tex --- oommf1.2a1/doc/userguide/cllaunch-body.tex Thu Oct 5 18:15:05 2000 +++ oommf/doc/userguide/cllaunch-body.tex Mon Apr 23 15:28:38 2001 @@ -120,7 +120,7 @@ with the option \verb+-tk 0+. To run those applications that require \verb+-tk 1+ on a Unix system with no display, one might use \htmladdnormallinkfoot{Xvfb -}{http://www.sunworld.com/sunworldonline/swol-03-2000/swol-03-xvfb.html} +}{http://www.itworld.com/AppDev/1461/UIR000330xvfb/} \index{application!Xvfb}. \item[{\tt\bf -cwd directory}] diff -urN oommf1.2a1/doc/userguide/cmdutils-body.tex oommf/doc/userguide/cmdutils-body.tex --- oommf1.2a1/doc/userguide/cmdutils-body.tex Mon Jan 22 04:09:57 2001 +++ oommf/doc/userguide/cmdutils-body.tex Mon Apr 23 15:28:38 2001 @@ -43,7 +43,7 @@ must be available. This is not a problem on \Windows, where a desktop is always present, but on \Unix\ this means that an \X\ server must be running. The -\htmladdnormallinkfoot{\textit{Xvfb}}{http://www.sunworld.com/sunworldonline/swol-03-2000/swol-03-xvfb.html}\index{application!Xvfb} +\htmladdnormallinkfoot{\textit{Xvfb}}{http://www.itworld.com/AppDev/1461/UIR000330xvfb/}\index{application!Xvfb} virtual framebuffer can be used if desired. (Xvfb is an X server distributed with X11R6 that requires no display hardware or physical input devices.) diff -urN oommf1.2a1/doc/userguide/fileformats-body.tex oommf/doc/userguide/fileformats-body.tex --- oommf1.2a1/doc/userguide/fileformats-body.tex Mon Jan 22 04:09:57 2001 +++ oommf/doc/userguide/fileformats-body.tex Wed May 2 20:36:39 2001 @@ -670,11 +670,14 @@ The content of the \cd{Miscellaneous} block is structured as a \Tcl\ list with an even number of elements, consisting of key + value pairs. -The only key currently supported is \cd{basename}; the associated value -is used as a base for output name construction by some -of the data output routines. There is an example \cd{Miscellaneous} -block in the sample \MIF~2.0 file \hyperrefhtml{included below.}{in -Fig.~}{.}{fig:mif2sample} +The currently supported keys are \cd{basename} and \cd{seed}. The value +associated with \cd{basename} is used as a base for output name +construction by some of the data output routines. The value associated +with \cd{seed} is an integer used to initialize the random number +generator. Setting seed to 0 (the default) causes the effective seed to +be drawn from the system clock. There is an example +\cd{Miscellaneous} block in the sample \MIF~2.0 file +\hyperrefhtml{included below.}{in Fig.~}{.}{fig:mif2sample} \begin{codelisting}{p}{fig:mif2sample}{Example \MIF~2.0 file.}{sec:mif2format} \begin{verbatim} @@ -764,10 +767,10 @@ Specify Oxs_UZeeman:AppliedField " Hscale [expr 0.001/$MU0] Hrange { - 0 0 0 10 0 0 2 - 10 0 0 -10 0 0 2 - 0 0 0 0 10 0 4 - 1 1 1 5 5 5 0 + { 0 0 0 10 0 0 2 } + { 10 0 0 -10 0 0 2 } + { 0 0 0 0 10 0 4 } + { 1 1 1 5 5 5 0 } } " diff -urN oommf1.2a1/doc/userguide/install-body.tex oommf/doc/userguide/install-body.tex --- oommf1.2a1/doc/userguide/install-body.tex Fri Jan 19 22:32:21 2001 +++ oommf/doc/userguide/install-body.tex Tue May 29 19:30:09 2001 @@ -5,7 +5,7 @@ \OOMMF\ software is written in C++ and \Tcl. It uses the \Tcl-based \Tk\ Windowing Toolkit to create graphical user interfaces that are portable to many varieties of \Unix\ as well as Microsoft -\Windows\ 95/98/NT. +\Windows\ 9X/NT. \Tcl\ and \Tk\ must be installed before installing \OOMMF. \Tcl\ and \Tk\ are available for free @@ -39,7 +39,7 @@ \fn{wish}\index{application!wish}. Consult your \Tcl/\Tk\ documentation to determine the actual names of these programs on your platform (for example, -\fn{tclsh80.exe} or \fn{wish4.2}). +\fn{tclsh83.exe} or \fn{wish8.0}). \OOMMF\ applications communicate via TCP/IP\index{TCP/IP} network sockets. This means that \OOMMF\ requires\index{requirement!TCP/IP} @@ -56,15 +56,15 @@ application with command line option \hyperrefhtml{\texttt{\textbf{-tk 0}}}{\textsf{\textbf{-tk 0}} (see Sec.~}{)}{sec:cll} or use the -\htmladdnormallinkfoot{Xvfb}{http://www.sunworld.com/sunworldonline/swol-03-2000/swol-03-xvfb.html} +\htmladdnormallinkfoot{Xvfb}{http://www.itworld.com/AppDev/1461/UIR000330xvfb/} virtual frame buffer to stand in for them. \index{application!Xvfb|)} \index{requirement!disk~space|(} The \OOMMF\ source distribution unpacks into a directory tree containing -about 500 files and directories, occupying about 7 MB of storage. +about 700 files and directories, occupying about 9 MB of storage. Compiling and linking for each platform consumes approximately an -additional 7 MB of storage. The \OOMMF\ distribution containing +additional 16 MB of storage. The \OOMMF\ distribution containing \Windows\ executables unpacks into a directory tree occupying about 8 MB of storage. {\bf Note:} On a non-compressed {\tt FAT16} file system on a large disk, \OOMMF\ may take up much more disk space. This is because @@ -129,7 +129,7 @@ available in two formats. The first format is a gzipped tar file containing an archive of all the \OOMMF\ source code. The second format is a \fn{.zip} compressed archive containing source code and -pre-compiled executables for Microsoft \Windows\ 95/98/NT running on an +pre-compiled executables for Microsoft \Windows\ 9X/NT running on an x86-based microprocessor system. Each \Windows\ binary distribution is compatible with only a particular sequence of releases of \Tcl/\Tk. We release one \Windows\ binary distribution compatible @@ -146,7 +146,7 @@ For the first format, unpack the distribution archive using gunzip and tar: \begin{verbatim} -gunzip -c oommf11b0_20000404.tar.gz | tar xvf - +gunzip -c oommf12a2_20010529.tar.gz | tar xvf - \end{verbatim} For the other format(s), you will need a utility program to unpack the @@ -158,7 +158,7 @@ \htmladdnormallinkfoot{UnZip}{http://ftp.freesoftware.com/pub/infozip/UnZip.html}. Using your utility, unpack the \fn{.zip} archive, e.g. \begin{verbatim} -unzip oommf11b0_20000404.zip +unzip oommf12a2_20010529_83.zip \end{verbatim} For either distribution format, the unpacking sequence creates a @@ -197,17 +197,17 @@ here is the typical output on a Linux/Alpha system: \begin{verbatim} $ tclsh oommf.tcl +platform -<24537> oommf.tcl 1.2.0.1 info: -OOMMF release 1.2.0.1 +<24537> oommf.tcl 1.2.0.2 info: +OOMMF release 1.2.0.2 Platform Name: linalp Tcl name for OS: Linux 2.2.16-3 C++ compiler: /usr/bin/g++ Tcl configuration file: /usr/local/lib/tclConfig.sh tclsh: /usr/local/bin/tclsh8.3 -Tcl release: 8.3.2 (config) 8.3.2 (running) +Tcl release: 8.3.3 (config) 8.3.3 (running) Tk configuration file: /usr/local/lib/tkConfig.sh wish: /usr/local/bin/wish8.3 -Tk release: 8.3.2 (config) 8.3.2 (running) +Tk release: 8.3.3 (config) 8.3.3 (running) \end{verbatim} If \cd{oommf.tcl +platform} doesn't print a summary like that, it @@ -529,6 +529,32 @@ may be used instead. Complete instructions are in the file \fn{config/options.tcl}. +\subsubsection{Optimization}\label{sec:optimize} + +In the interest of successful compiling of a usable software package +``out of the box'', the default configuration for \OOMMF\ does not +attempt to make achieve much in terms of optimization. However, +in each platform's configuration file (for example, +\fn{config/cache/wintel.tcl}), there are alternative values +for the configuration's optimization flags, available as comments. +Edit the configuration file to replace the more safely portable, +but rather slow choice with another choice that provides better +computing performance. In \fn{config/cache/wintel.tcl}), the +alternative optimization flags for the MSVC++ compiler are +defined with the line: +\begin{verbatim} +$config SetValue program_compiler_c++_option_opt {format "/G5 /Ox"} +\end{verbatim} + +The extensible solver, OXS, compiles by default in a way to support +debugging. This reduces computation performance. To compile OXS +without debugging support, define the symbol \cd{NDEBUG} globally +during \fn{pimake}'s compile by adding the following line of local +customization to the file \fn{config/local/options.tcl}: +\begin{verbatim} +Oc_Option Add * Platform cflags {-def NDEBUG} +\end{verbatim} + \subsubsection{Managing \OOMMF\ Platform Names}\label{sec:platformNames} \index{platform!names|(} @@ -674,10 +700,11 @@ The \htmladdnormallinkfoot{Cygwin Project}{http://sourceware.cygnus.com/cygwin/} is a free port of -the GNU development environment to \Windows\ NT, 95, and 98, which +the GNU development environment to \Windows\ NT, and 9X, which includes the GNU C++ compiler gcc and a port of \Tcl/\Tk. \OOMMF\ -has been tested against the Beta~20.1 release of Cygwin, and sample -\fn{config/names/cygtel.tcl} and \fn{config/cache/cygtel.tcl} files are +has been successfully built and tested within the Cygwin environment, +and sample \fn{config/names/cygtel.tcl} and +\fn{config/cache/cygtel.tcl} files are included in the \OOMMF\ distribution. Use the \cd{cygtclsh80.exe} program as your \fn{tclsh} program when configuring, building, and launching \OOMMF\ software. diff -urN oommf1.2a1/doc/userguide/latex2html-init oommf/doc/userguide/latex2html-init --- oommf1.2a1/doc/userguide/latex2html-init Thu Aug 24 18:41:13 2000 +++ oommf/doc/userguide/latex2html-init Mon Jan 22 20:38:52 2001 @@ -14,13 +14,15 @@ } elsif ($title eq "Quick Start: Example OOMMF Session") { $title = "quickstart"; } elsif ($title eq "File Formats") { - $title = "fileformats" + $title = "fileformats"; + } elsif ($title =~ /.*mifconvert.*/) { + $title = "mifconvert"; } elsif ($title =~ /Vector field format.*/) { - $title = "vectorfieldformat" + $title = "vectorfieldformat"; } elsif ($title =~ /Bibliography.*/) { - $title = "bibliography" + $title = "bibliography"; } elsif ($title =~ /Index/) { - $title = "docindex" + $title = "docindex"; } else { my $small_words = "a|an|and|of|on|the|"; my $to_underscore = '\s+|:|/|\(|\)|<|>'; @@ -29,7 +31,7 @@ $title =~ s/$to_underscore/_/go; $title =~ s/_+/_/go; $title =~ s/(^_|_$)//go; -# $title = "N${cth_count}_$title" +# $title = "N${cth_count}_$title"; } return "$title"; diff -urN oommf1.2a1/doc/userguide/makerules.tcl oommf/doc/userguide/makerules.tcl --- oommf1.2a1/doc/userguide/makerules.tcl Mon Dec 11 19:55:57 2000 +++ oommf/doc/userguide/makerules.tcl Tue May 29 19:09:54 2001 @@ -73,6 +73,14 @@ -targets maintainer-clean -dependencies distclean -script { + DeleteFiles userguide userguide.ps userguide.pdf + } +} + +MakeRule Define { + -targets distclean + -dependencies {} + -script { eval DeleteFiles [glob -nocomplain *.aux] eval DeleteFiles [glob -nocomplain *.bbl] eval DeleteFiles [glob -nocomplain *.blg] @@ -83,10 +91,11 @@ eval DeleteFiles [glob -nocomplain *.log] eval DeleteFiles [glob -nocomplain *.out] eval DeleteFiles [glob -nocomplain *.toc] - DeleteFiles userguide userguide.ps userguide.pdf + eval DeleteFiles [glob -nocomplain \ + [file join userguide images.*]] } } - + MakeRule Define { -targets upgrade -script {eval DeleteFiles \ diff -urN oommf1.2a1/doc/userguide/mmprobed-body.tex oommf/doc/userguide/mmprobed-body.tex --- oommf1.2a1/doc/userguide/mmprobed-body.tex Thu Aug 24 18:41:13 2000 +++ oommf/doc/userguide/mmprobed-body.tex Tue May 29 19:09:54 2001 @@ -8,7 +8,7 @@ The application \app{mmProbEd}\index{application!mmProbEd} provides a user interface for creating and editing micromagnetic problem descriptions in the \hyperrefhtml{{\em Micromagnetic Input Format} -(\MIF)}{{\em Micromagnetic Input Format} (\MIF) +(\MIF 1.1)}{{\em Micromagnetic Input Format} (\MIF 1.1) (Sec.~}{)}{sec:mifformat}\index{file!mif}. \app{mmProbEd} also acts as a server, supplying problem descriptions to running micromagnetic solvers. @@ -36,8 +36,9 @@ \OOMMF\ release in the directory \fn{app/mmpe/examples}. At startup, \app{mmProbEd} loads the problem contained in \fn{app/mmpe/init.mif} as an initial problem. Note: When loading a -file, \app{mmProbEd} discards comments and records it does not -understand. Use the \hyperrefhtml{\app{FileSource} application}{{\bf +file, \app{mmProbEd} discards comments and moves records it does not +understand to the bottom of its output file. +Use the \hyperrefhtml{\app{FileSource} application}{{\bf FileSource} application (Sec.}{)}{sec:filesource} to serve unmodified problem descriptions. diff -urN oommf1.2a1/doc/userguide/mmsolve2d-body.tex oommf/doc/userguide/mmsolve2d-body.tex --- oommf1.2a1/doc/userguide/mmsolve2d-body.tex Thu Aug 24 18:41:13 2000 +++ oommf/doc/userguide/mmsolve2d-body.tex Tue May 29 19:09:54 2001 @@ -393,7 +393,7 @@ \index{platform!Windows!network socket bug|(} A bug in the network traffic handling code\index{network~socket} of -\Tcl\ on \Windows\ 95 and \Windows\ 98 systems can sometimes interfere +\Tcl\ on \Windows\ 9X systems can sometimes interfere with communications between the control interface of \app{mmSolve2D} and the actual computation engine. If \app{mmSolve2D} is sending out data to two or more data display services every iteration, the network @@ -403,6 +403,6 @@ time the solver stops iterating. This bug first appeared in \Tcl\ release 8.0.3, and remained through \Tcl\ release 8.1.1. It is fixed in \Tcl\ releases 8.2 and later, which we recommend for \OOMMF\ users on -\Windows\ 95 or \Windows\ 98 systems. Other platforms do not have this +\Windows\ 9X systems. Other platforms do not have this problem. \index{platform!Windows!network socket bug|)} diff -urN oommf1.2a1/doc/userguide/overview-body.tex oommf/doc/userguide/overview-body.tex --- oommf1.2a1/doc/userguide/overview-body.tex Thu Aug 24 18:41:13 2000 +++ oommf/doc/userguide/overview-body.tex Tue May 29 19:09:54 2001 @@ -23,7 +23,7 @@ portability. In order to allow the code to run on a wide variety of systems, we are writing the interface and glue code in \Tcl/\Tk. This enables our code to operate across a wide range of Unix platforms, -\Windows~NT, and \Windows~95/98. +\Windows~NT, and \Windows~9X. The code may actually be modified at 3 distinct levels. At the top level, individual programs interact via well-defined protocols across @@ -41,15 +41,22 @@ \htmladdnormallink{\app{mmDisp}}{http://math.nist.gov/oommf/mmdisp/mmdisp.html}\index{application!mmDisp}. A \htmladdnormallinkfoot{working release}{http://math.nist.gov/oommf/software.html} of the complete OOMMF -project is now available. This includes a problem editor, a 2D -micromagnetic solver\index{simulation!2D}, and several display widgets, +project was first released in October, 1998. It included a problem editor, +a 2D micromagnetic solver\index{simulation!2D}, and several display widgets, including an updated version of \app{mmDisp}. The solver can be controlled by an {\hyperrefhtml{interactive interface}{interactive interface (Sec.~}{)}{sec:mmsolve2d}}, or through a sophisticated {\hyperrefhtml{batch control system}{batch control system (Sec.~}{)}{sec:obs}}. -The solver is based on a micromagnetic code that +The current development version, \OOMMF\ 1.2, includes OXS, the +\OOMMF\ eXtensible Solver. OXS offers users of \OOMMF\ the ability +to extend OXS with their own modules. The details of programming +an OXS extension module are found in the +\htmladdnormallinkfoot{OOMMF Programming Manual +}{http://math.nist.gov/oommf/doc/}. + +The original 2D solver was based on a micromagnetic code that \htmladdnormallink{Mike Donahue}{http://math.nist.gov/\~{}MDonahue} and \htmladdnormallink{Bob McMichael}{mailto:rmcmichael@nist.gov} @@ -59,9 +66,12 @@ self-magnetostatic (demag) field\index{field!demag}. Anisotropy, applied field\index{field!applied}, and initial magnetization\index{magnetization!initial} can be varied pointwise, and -arbitrarily shaped elements\index{boundary} can be modeled. We are -currently working on a full 3D\index{simulation!3D} version of this -code suitable for modeling layered materials. +arbitrarily shaped elements\index{boundary} can be modeled. + +The extensible nature of the OXS solver means that its capabilities +may be varied as necessary for the problem to be solved. OXS modules +distributed as part of \OOMMF\ support the full 3D\index{simulation!3D} +simulations suitable for modeling layered materials. {\samepage If you want to receive e-mail\index{e-mail} diff -urN oommf1.2a1/doc/userguide/oxsii-body.tex oommf/doc/userguide/oxsii-body.tex --- oommf1.2a1/doc/userguide/oxsii-body.tex Mon Jan 22 04:09:57 2001 +++ oommf/doc/userguide/oxsii-body.tex Tue May 29 19:09:54 2001 @@ -25,9 +25,20 @@ \btn{oxsii} button on \htmlref{mmLaunch}{sec:mmlaunch}, or from the command line via \begin{verbatim} -tclsh oommf.tcl oxsii [standard options] +tclsh oommf.tcl oxsii [standard options] [-problem file] [-exitondone <0|1>] \end{verbatim} +\begin{description} +\item[{\tt\bf -problem file}] + Load and solve the problem found in {\em file}, which must be + in the \MIF~2.0 format. + +\item[{\tt\bf -exitondone $<$0\pipe 1$>$}] + Whether to exit after solution of the problem is complete. + Default is to keep running, awaiting the interactive selection + of another problem to be solved. +\end{description} + Since \app{oxsii}\index{mmLaunch~user~interface} does not present any user interface window of its own, it depends on \app{mmLaunch}\index{application!mmLaunch} to provide an interface on @@ -84,7 +95,7 @@ input \hyperrefhtml{\MIF~2.0 file.}{\MIF~2.0 file (Sec.~}{).}{sec:mif2format} The reader will find the sample file presented in \hyperrefhtml{that section}{Fig.~}{ of that -section}{fig:mif2sample} to be a helpful adjuct to the material +section}{fig:mif2sample} to be a helpful adjunct to the material presented below. This section describes the \cd{Oxs\_Ext} classes available in the @@ -100,8 +111,8 @@ \ssechead{Regions} Regions describe geometric volumes of space. OXS recognizes -``sections,'', which define single regions of space, and -``atlases,'', which are conceptually collections of sections. At +``sections,'' which define single regions of space, and +``atlases,'' which are conceptually collections of sections. At present only one type of each is supported: \begin{description} \item[Oxs\_RectangularSection:] An axes parallel rectangular @@ -257,7 +268,7 @@ region-1 region-2 A12 }
...
{ - region-m region-n Amn } + region-m region-n Amn } }
}

\end{rawhtml} @@ -420,7 +431,8 @@ a simulation as a whole is considered complete when either the stage count reaches \textbf{number\_of\_stages} or the total number of steps taken reaches \textbf{total\_iteration\_limit}. Both of these are -optional parameters with default value 0, meaning no limit. \textbf{Ms} +optional parameters with default values of 1 and 0, respectively. In +both cases 0 is interpreted as meaning no limit. \textbf{Ms} specifies the saturation magnetization distribution, in A/m. \textbf{m0} is the initial spin configuration. These should be unit vectors, specified using an embedded vector field initializer object. @@ -552,7 +564,7 @@

values {
{ region1_reference v1x v1y v1z } -
{ region2_reference +
{ region2_reference v2x v2y v2z }
...
} diff -urN oommf1.2a1/doc/userguide/userguide.tex oommf/doc/userguide/userguide.tex --- oommf1.2a1/doc/userguide/userguide.tex Sun Jan 21 15:42:41 2001 +++ oommf/doc/userguide/userguide.tex Tue May 29 19:09:54 2001 @@ -21,7 +21,7 @@ User's Guide\\[2ex] {\today} {}\\[2ex] -This manual documents release 1.2a1.\\[1ex] +This manual documents release 1.2a2.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date. @@ -35,7 +35,7 @@ to be portable, flexible, and extensible, with a user-friendly graphical interface. The code is written in C++ and Tcl/Tk. Target systems include a wide range of \Unix\ platforms, \Windows~NT, and -\Windows~95/98. +\Windows~9X. \end{abstract} \vspace*{\fill} \par diff -urN oommf1.2a1/makerules.tcl oommf/makerules.tcl --- oommf1.2a1/makerules.tcl Tue Jul 28 22:50:21 1998 +++ oommf/makerules.tcl Wed Feb 14 16:34:36 2001 @@ -11,5 +11,67 @@ # ######################################################################## -# Default rules cover everything +MakeRule Define { + -targets all + -script {Recursive all} +} +# Be sure a 'make distclean' is done in ext before 'make upgrade' +# tries to remove the files there, if that makes sense +set dep "" +if {[file readable [file join ext makerules.tcl]]} { + set dep [file join ext distclean] +} + +# Set of files under ext subdirectory in old releases of OOMMF that +# 'make upgrade' should remove. +set toDelete { + if {if.cc if.h makerules.tcl version.h} + nb {array.cc array.h bucket.cc bucket.h dstring.cc dstring.h + errhandlers.cc errhandlers.h evoc.cc evoc.h functions.cc + functions.h list.cc list.h makerules.tcl nb.cc nb.h + stopwatch.cc stopwatch.h vector.cc vector.h version.h + xpfloat.cc xpfloat.h} + net {account.tcl accountGui.tcl connection.tcl fewtest.tcl + host.tcl hostGui.tcl link.tcl makerules.tcl net.tcl + omfExport.tcl pkgIndex.tcl protocol.tcl server.tcl + thread.tcl threadGui.tcl} + oc {application.tcl autobuf.cc autobuf.h bug.tcl bug75.tcl + bug76.tcl bug80.tcl bug81.tcl byte.cc byte.h class.tcl + commandline.tcl config.tcl console.tcl custom.tcl + eventhandler.tcl exec.tcl font.tcl imports.cc imports.h + log.tcl main.tcl makerules.tcl messages.cc messages.h + nop.tcl nullchannel.cc nullchannel.h oc.cc oc.h oc.tcl + option.tcl person.tcl pkgIndex.tcl procs.tcl tclIndex + tempfile.tcl url.tcl varinfo.cc version.h} + ow {charinfo.tcl dirselect.tcl entrybox.tcl entryscale.tcl + filedlg.tcl fileselect.tcl graphwin.tcl listbox.tcl + log.tcl makerules.tcl multibox.tcl omficon.xbm omfmask.xbm + ow.tcl pkgIndex.tcl printdlg.tcl procs.tcl selectbox.tcl} + vf {fileio.cc fileio.h makerules.tcl mesh.cc mesh.h ptsearch.cc + ptsearch.h vecfile.cc vecfile.h vecfile.tcl version.h + vf.cc vf.h vf.tcl} +} + +MakeRule Define [format { + -targets upgrade + -dependencies {%s} + -script { + Recursive upgrade + DeleteFiles [file join ext net threads host.tcl] + DeleteFiles [file join ext net threads account.tcl] + catch {file delete [file join ext net threads]} + foreach {d l} {%s} { + foreach f $l { + DeleteFiles [file join ext $d $f] + } + catch {file delete [file join ext $d]} + } + DeleteFiles [file join ext makerules.tcl] + DeleteFiles [file join ext pkgIndex.tcl] + catch {file delete ext} + unset d l f + } +} $dep $toDelete] + +unset dep toDelete diff -urN oommf1.2a1/oommf.tcl oommf/oommf.tcl --- oommf1.2a1/oommf.tcl Fri Jan 19 10:41:27 2001 +++ oommf/oommf.tcl Tue May 29 13:47:19 2001 @@ -123,9 +123,14 @@ wm withdraw . } Oc_Main SetAppName oommf.tcl -Oc_Main SetVersion 1.2.0.1 +Oc_Main SetVersion 1.2.0.2 Oc_CommandLine Switch + +# Disable the default command line options that don't make sense for +# the bootstrap program +Oc_CommandLine Option console {} {} +Oc_CommandLine Option cwd {} {} + Oc_CommandLine Option fg {} {global bg; set bg 0} \ "Run app in foreground; block until it completes" Oc_CommandLine Option bg {} {global bg; set bg 1} \ diff -urN oommf1.2a1/pkg/if/version.h oommf/pkg/if/version.h --- oommf1.2a1/pkg/if/version.h Thu Jan 18 18:51:51 2001 +++ oommf/pkg/if/version.h Tue May 29 13:47:19 2001 @@ -4,7 +4,7 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2001/01/18 23:51:51 $ + * Last modified on: $Date: 2001/05/29 17:47:19 $ * Last modified by: $Author: dgp $ */ @@ -19,6 +19,6 @@ #define IF_MAJOR_VERSION 1 #define IF_MINOR_VERSION 2 #define IF_RELEASE_LEVEL 0 -#define IF_RELEASE_SERIAL 1 +#define IF_RELEASE_SERIAL 2 #endif /* _IF_VERSION */ diff -urN oommf1.2a1/pkg/nb/dstring.h oommf/pkg/nb/dstring.h --- oommf1.2a1/pkg/nb/dstring.h Sun Jan 14 16:37:47 2001 +++ oommf/pkg/nb/dstring.h Mon Mar 26 18:29:01 2001 @@ -4,7 +4,7 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2001/01/14 21:37:47 $ + * Last modified on: $Date: 2001/03/26 23:29:01 $ * Last modified by: $Author: donahue $ */ @@ -57,7 +57,9 @@ // are called. // Length *not* including trailing null character. - size_t Length(void) const { return strlen(str); } + size_t Length() const { return strlen(str); } + + size_t GetCapacity() const { return bufsize; } // For debugging // Append functions; grows str as needed. The char version appends // up to the first '\0' character or maxlen, which ever happens first. diff -urN oommf1.2a1/pkg/nb/evoc.cc oommf/pkg/nb/evoc.cc --- oommf1.2a1/pkg/nb/evoc.cc Thu Sep 7 19:48:02 2000 +++ oommf/pkg/nb/evoc.cc Mon May 14 19:36:48 2001 @@ -4,7 +4,7 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2000/09/07 23:48:02 $ + * Last modified on: $Date: 2001/05/14 23:36:48 $ * Last modified by: $Author: donahue $ */ @@ -362,38 +362,40 @@ // since Windows was started static Oc_TimeVal cpu_accum(CLOCKS_PER_SEC,(unsigned long)clock_t(-1)); static Oc_TimeVal cpu_last(CLOCKS_PER_SEC,(unsigned long)clock_t(-1)); - Oc_TimeVal cpu_now(cpu_last); - cpu_now.ticks=clock(); - if(cpu_now.ticksbufsize) { + if(needsize>bufsize || + (bufsize>reclaim_bound && bufsize/reclaim_proportion>needsize)) { if(bufsize>0) delete[] str; bufsize=needsize; str=new char[bufsize]; - if(str==0) - panic((char *)"No memory in Oc_AutoBuf::Dup"); + if(str==0) panic((char *)"No memory in Oc_AutoBuf::Dup"); } strcpy(str,const_str); } diff -urN oommf1.2a1/pkg/oc/autobuf.h oommf/pkg/oc/autobuf.h --- oommf1.2a1/pkg/oc/autobuf.h Wed Oct 25 15:39:08 2000 +++ oommf/pkg/oc/autobuf.h Fri Mar 30 23:17:15 2001 @@ -5,7 +5,7 @@ * * NOTICE: Please see the file ../../LICENSE * - * Last modified on: $Date: 2000/10/25 19:39:08 $ + * Last modified on: $Date: 2001/03/31 04:17:15 $ * Last modified by: $Author: donahue $ */ @@ -17,6 +17,8 @@ class Oc_AutoBuf { private: + static const size_t reclaim_bound; + static const size_t reclaim_proportion; size_t bufsize; // Length of buffer pointed to by str. ( >= strlen(str)+1.) char *str; void Dup(const char* const_str); diff -urN oommf1.2a1/pkg/oc/bug75.tcl oommf/pkg/oc/bug75.tcl --- oommf1.2a1/pkg/oc/bug75.tcl Fri Aug 25 13:01:25 2000 +++ oommf/pkg/oc/bug75.tcl Sat Apr 28 03:41:12 2001 @@ -2,8 +2,8 @@ # # Patches for Tcl 7.5 / Tk 4.1 # -# Last modified on: $Date: 2000/08/25 17:01:25 $ -# Last modified by: $Author: donahue $ +# Last modified on: $Date: 2001/04/28 07:41:12 $ +# Last modified by: $Author: dgp $ # # This file contains Tcl code which when sourced in a Tcl 7.5 interpreter # will patch bugs in Tcl 7.5 fixed in later versions of Tcl. It is not @@ -22,37 +22,36 @@ # needed. rename file Tcl7.5_file proc file {option args} { - switch -exact -- $option { - c - - co - - cop - - copy { + switch -glob -- $option { + c* { + if {[string first $option copy] != 0} { + return [uplevel [list Tcl7.5_file $option] $args] + } # Translate -force into -f if {[string match -force [lindex $args 0]]} { set args [lreplace $args 0 0 -f] } uplevel exec cp $args } - de - - del - - dele - - delet - - delete { + de* { + if {[string first $option delete] != 0} { + return [uplevel [list Tcl7.5_file $option] $args] + } if {[string match -force [lindex $args 0]]} { set args [lreplace $args 0 0 -f] } catch {uplevel exec rm $args} } - mk - - mkd - - mkdi - - mkdir { + mk* { + if {[string first $option mkdir] != 0} { + return [uplevel [list Tcl7.5_file $option] $args] + } uplevel exec mkdir $args } - ren - - rena - - renam - - rename { + ren* { + if {[string first $option rename] != 0} { + return [uplevel [list Tcl7.5_file $option] $args] + } if {[string match -force [lindex $args 0]]} { set args [lreplace $args 0 0 -f] } @@ -181,46 +180,50 @@ return -code error "invalid command name \"$name\"" } - # The subcommands remove was added to the Tk command 'grid' in Tk - # version 4.1. The option -pad was also added to the subcommands - # columnconfigure and rowconfigure. The syntax of the bbox - # subcommand also changed in a backward compatible way. - # Also, [grid ...