diff -crN oommf-1.2a0/CHANGES oommf/CHANGES *** oommf-1.2a0/CHANGES Sat Nov 18 15:57:53 2000 --- oommf/CHANGES Fri Jan 19 15:56:13 2001 *************** *** 1,3 **** --- 1,23 ---- + ========== OOMMF 1.2a1 released 2001/01/20 ========== + Significant changes since 1.2a0: + + * New applications: + - avfdiff - compute differences of vector fields + - avf2odt - extract features of vector fields (formerly avf2ave) + + * New documentation + - New directory config/notes contains test scripts and configuration + notes helpful in debugging OOMMF problems + + * Expanded platform support + - Added configure tests for needed network support + - Work around for broken map<> in some STLs. + + * New features + - mmDisp: File|Open menu item + - mmDataTable: File|Reset menu item + - Oxsii: Closing interface using [X] button now exits solver + ========== OOMMF 1.2a0 released 2000/11/18 ========== Significant changes since 1.1b0: diff -crN oommf-1.2a0/Changes.txt oommf/Changes.txt *** oommf-1.2a0/Changes.txt Mon Jan 22 17:21:31 2001 --- oommf/Changes.txt Mon Jan 22 17:21:45 2001 *************** *** 1,3 **** --- 1,23 ---- + ========== OOMMF 1.2a1 released 2001/01/20 ========== + Significant changes since 1.2a0: + + * New applications: + - avfdiff - compute differences of vector fields + - avf2odt - extract features of vector fields (formerly avf2ave) + + * New documentation + - New directory config/notes contains test scripts and configuration + notes helpful in debugging OOMMF problems + + * Expanded platform support + - Added configure tests for needed network support + - Work around for broken map<> in some STLs. + + * New features + - mmDisp: File|Open menu item + - mmDataTable: File|Reset menu item + - Oxsii: Closing interface using [X] button now exits solver + ========== OOMMF 1.2a0 released 2000/11/18 ========== Significant changes since 1.1b0: diff -crN oommf-1.2a0/README oommf/README *** oommf-1.2a0/README Sat Nov 18 15:06:31 2000 --- oommf/README Fri Jan 19 15:36:50 2001 *************** *** 1,8 **** README: OOMMF Object Oriented MicroMagnetic computing Framework ! Release 1.2a0 ! This file last modified on: $Date: 2000/11/18 20:06:31 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible --- 1,8 ---- README: OOMMF Object Oriented MicroMagnetic computing Framework ! Release 1.2a1 ! This file last modified on: $Date: 2001/01/19 20:36:50 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible *************** *** 31,37 **** 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 oommf12a0_20001118.zip cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl --- 31,37 ---- 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 cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl *************** *** 39,45 **** For most OOMMF users on Unix, the following sequence of commands should upgrade, build, and run your OOMMF installation: ! gunzip -c oommf12a0_20001118.tar.gz | tar xvf - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade --- 39,45 ---- 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 - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade diff -crN oommf-1.2a0/Readme.txt oommf/Readme.txt *** oommf-1.2a0/Readme.txt Mon Jan 22 17:21:31 2001 --- oommf/Readme.txt Mon Jan 22 17:21:47 2001 *************** *** 1,8 **** README: OOMMF Object Oriented MicroMagnetic computing Framework ! Release 1.2a0 ! This file last modified on: $Date: 2000/11/18 20:06:31 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible --- 1,8 ---- README: OOMMF Object Oriented MicroMagnetic computing Framework ! Release 1.2a1 ! This file last modified on: $Date: 2001/01/19 20:36:50 $ OOMMF is a project in the Mathematical and Computational Sciences Division (MCSD) of ITL/NIST aimed at developing portable, extensible *************** *** 31,37 **** 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 oommf12a0_20001118.zip cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl --- 31,37 ---- 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 cd oommf tclsh83 oommf.tcl pimake upgrade tclsh83 oommf.tcl *************** *** 39,45 **** For most OOMMF users on Unix, the following sequence of commands should upgrade, build, and run your OOMMF installation: ! gunzip -c oommf12a0_20001118.tar.gz | tar xvf - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade --- 39,45 ---- 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 - cd oommf oommf.tcl pimake distclean oommf.tcl pimake upgrade diff -crN oommf-1.2a0/app/mmarchive/appindex.tcl oommf/app/mmarchive/appindex.tcl *** oommf-1.2a0/app/mmarchive/appindex.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmarchive/appindex.tcl Thu Jan 18 18:51:50 2001 *************** *** 1,7 **** Oc_Application Define { -name mmArchive ! -version 1.2.0.0 -machine omfsh -file mmarchive.tcl -options {-tk 0} --- 1,7 ---- Oc_Application Define { -name mmArchive ! -version 1.2.0.1 -machine omfsh -file mmarchive.tcl -options {-tk 0} diff -crN oommf-1.2a0/app/mmarchive/mmarchive.tcl oommf/app/mmarchive/mmarchive.tcl *** oommf-1.2a0/app/mmarchive/mmarchive.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmarchive/mmarchive.tcl Thu Jan 18 18:51:50 2001 *************** *** 12,19 **** } Oc_Main SetAppName mmArchive ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/04/06 06:34:02 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_CommandLine Parse $argv --- 12,19 ---- } Oc_Main SetAppName mmArchive ! Oc_Main SetVersion 1.2.0.1 ! regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/18 23:51:50 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_CommandLine Parse $argv *************** *** 91,98 **** global conn_head_width ;# Column header widths global conn_data_fmt ;# Format list for data ! set basewidth 15 ;# Default column width ! set basefmt "%- 15.8g" ;# Base format for table body # Create "tripdata" array that maps labels to values foreach trip $triples { --- 91,98 ---- global conn_head_width ;# Column header widths global conn_data_fmt ;# Format list for data ! set basewidth 20 ;# Default column width ! set basefmt "%- 20.17g" ;# Base format for table body # Create "tripdata" array that maps labels to values foreach trip $triples { diff -crN oommf-1.2a0/app/mmdatatable/appindex.tcl oommf/app/mmdatatable/appindex.tcl *** oommf-1.2a0/app/mmdatatable/appindex.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmdatatable/appindex.tcl Thu Jan 18 18:51:50 2001 *************** *** 1,7 **** Oc_Application Define { -name mmDataTable ! -version 1.2.0.0 -machine omfsh -file mmdatatable.tcl } --- 1,7 ---- Oc_Application Define { -name mmDataTable ! -version 1.2.0.1 -machine omfsh -file mmdatatable.tcl } diff -crN oommf-1.2a0/app/mmdatatable/mmdatatable.tcl oommf/app/mmdatatable/mmdatatable.tcl *** oommf-1.2a0/app/mmdatatable/mmdatatable.tcl Thu Aug 24 18:42:37 2000 --- oommf/app/mmdatatable/mmdatatable.tcl Thu Jan 18 18:51:50 2001 *************** *** 23,32 **** wm withdraw . Oc_Main SetAppName mmDataTable ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/08/24 22:42:37 $} _ date Oc_Main SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: donahue $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup donahue] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 23,32 ---- 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 SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup donahue] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ *************** *** 57,65 **** --- 57,118 ---- } bind . {+Die %W} + proc InitArrayDefaults {} { + global fmt justify select displaylist + set fmt(default) "%g" ;# Default format + set justify(default) "l" ;# Default justification + label .dummylabel + set select(offback) [.dummylabel cget -background] + set select(offfore) [.dummylabel cget -foreground] + destroy .dummylabel + text .dummytext + set select(onback) [.dummytext cget -selectbackground] + set select(onfore) [.dummytext cget -selectforeground] + destroy .dummytext + set displaylist {} + } + + proc Reset {} { + # First destroy display panels and "Data" menu entries + global panel + foreach win [winfo children $panel] { + grid forget $win + destroy $win + } + + # Clear "Data" menu + global dmenu + $dmenu delete 0 end + + # Empty global arrays + foreach arr [list unit fmt justify value fmtvalue \ + onoff select displaylist] { + global $arr + if {[info exists $arr]} { + unset $arr + } + } + + # Re-initialize default array values + InitArrayDefaults + + # I (mjd, 12-2000) think this is a bug in pack: when the + # last panel is removed, the display doesn't get resized. + # The following hack is a workaround. + if {[llength $displaylist]==0} { + $panel configure -height 1 -width 1 + $panel configure -height 0 -width 0 + } + + # Set geometry to autosize + wm geometry . {} + } + set menubar .mb foreach {fmenu dmenu omenu hmenu} \ [Ow_MakeMenubar . $menubar File Data Options Help] {} + $fmenu add command -label "Reset" -command { Reset } -underline 0 + $fmenu add separator $fmenu add command -label "Exit" -command { Die . } -underline 1 $dmenu configure -tearoff 1 -title "Data: [Oc_Main GetInstanceName]" $omenu add command -label "Format..." -underline 0 \ *************** *** 215,220 **** --- 268,281 ---- while {[set index [lsearch -exact $displaylist $label]]>=0} { set displaylist [lreplace $displaylist $index $index] } + + # I (mjd, 12-2000) think this is a bug in pack: when the + # last panel is removed, the display doesn't get resized. + # The following hack is a workaround. + if {[llength $displaylist]==0} { + $panel configure -height 1 -width 1 + $panel configure -height 0 -width 0 + } } wm geometry . {} ;# Set geometry to autosize } *************** *** 379,396 **** # applied to new labels. The select array includes elts "onfore/back" and # "offfore/back" which are the selected & deselected fore/background colors. # ! global unit fmt value fmtvalue onoff select displaylist ! set fmt(default) "%g" ;# Default format ! set justify(default) "l" ;# Default justification ! label .dummylabel ! set select(offback) [.dummylabel cget -background] ! set select(offfore) [.dummylabel cget -foreground] ! destroy .dummylabel ! text .dummytext ! set select(onback) [.dummytext cget -selectbackground] ! set select(onfore) [.dummytext cget -selectforeground] ! destroy .dummytext ! set displaylist {} proc CompressLabel { lbl } { regsub -all "\[ \r\t\n\]" $lbl {} foo --- 440,446 ---- # applied to new labels. The select array includes elts "onfore/back" and # "offfore/back" which are the selected & deselected fore/background colors. # ! InitArrayDefaults proc CompressLabel { lbl } { regsub -all "\[ \r\t\n\]" $lbl {} foo diff -crN oommf-1.2a0/app/mmdisp/makerules.tcl oommf/app/mmdisp/makerules.tcl *** oommf-1.2a0/app/mmdisp/makerules.tcl Fri Aug 25 13:01:23 2000 --- oommf/app/mmdisp/makerules.tcl Thu Jan 18 18:51:50 2001 *************** *** 52,64 **** puts $f [format { Oc_Application Define { -name mmDispSh ! -version 1.2.0.0 -machine %s -file "%s" } Oc_Application Define { -name conDispSh ! -version 1.2.0.0 -machine %s -file "%s" } --- 52,64 ---- puts $f [format { Oc_Application Define { -name mmDispSh ! -version 1.2.0.1 -machine %s -file "%s" } Oc_Application Define { -name conDispSh ! -version 1.2.0.1 -machine %s -file "%s" } diff -crN oommf-1.2a0/app/mmdisp/mmdispcmds.cc oommf/app/mmdisp/mmdispcmds.cc *** oommf-1.2a0/app/mmdisp/mmdispcmds.cc Tue Sep 5 14:12:52 2000 --- oommf/app/mmdisp/mmdispcmds.cc Tue Jan 16 01:07:17 2001 *************** *** 18,23 **** --- 18,26 ---- /* End includes */ + #define MY_MESH_ARRAY_SIZE 2 + static Vf_Mesh* myMeshArray[MY_MESH_ARRAY_SIZE]; + static int activeMeshId = 0; static Vf_Mesh *myMesh; static DisplayFrame myFrame; *************** *** 62,67 **** --- 65,124 ---- return coords; } + int SelectActiveMesh(ClientData,Tcl_Interp *interp,int argc,char** argv) + { + Tcl_ResetResult(interp); + if(argc!=2) { + sprintf(buf,"SelectActiveMesh must be called with 1 argument:" + " Mesh Id to make active (%d arguments passed)",argc-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + int meshId = atoi(argv[1]); + if(meshId<0 || meshId>=MY_MESH_ARRAY_SIZE) { + sprintf(buf,"Invalid mesh id request: %d; should be between 0 and %d", + meshId,MY_MESH_ARRAY_SIZE-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + + int oldId = activeMeshId; + activeMeshId = meshId; + myMesh = myMeshArray[activeMeshId]; + + strncpy(buf,"%d",oldId); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_OK; + } + + int DifferenceMesh(ClientData,Tcl_Interp *interp,int argc,char** argv) + { + Tcl_ResetResult(interp); + if(argc!=2) { + sprintf(buf,"DifferenceMesh must be called with 1 argument: " + "Mesh Id to subtract from active mesh (%d arguments passed)", + argc-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + int meshId = atoi(argv[1]); + if(meshId<0 || meshId>=MY_MESH_ARRAY_SIZE) { + sprintf(buf,"Invalid mesh id request: %d; should be between 0 and %d", + meshId,MY_MESH_ARRAY_SIZE-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + + // Difference meshes here + if((*myMeshArray[activeMeshId]).SubtractMesh(*myMeshArray[meshId])!=0) { + sprintf(buf,"Meshes aren't compatible"); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + + return TCL_OK; + } + int GetMeshType(ClientData,Tcl_Interp *interp,int argc,char**) { Tcl_ResetResult(interp); *************** *** 78,83 **** --- 135,161 ---- return TCL_OK; } + int IsRegularMesh(ClientData,Tcl_Interp *interp,int argc,char**) + { + Tcl_ResetResult(interp); + if(argc!=1) { + sprintf(buf,"IsRegularMesh must be called with no arguments" + " (%d arguments passed)",argc-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + const char *name=myMesh->GetMeshType(); + int regular=0; + if(strcmp(name,"Vf_GridVec3f")==0 || + strcmp(name,"Vf_EmptyMesh")==0) { + // Known regular meshes + regular=1; + } // Otherwise assume irregular + sprintf(buf,"%d",regular); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_OK; + } + int GetVecColor(ClientData,Tcl_Interp *interp,int argc,char** argv) { Tcl_ResetResult(interp); *************** *** 278,300 **** Tcl_AppendResult(interp,buf,(char *)NULL); return TCL_ERROR; } ! delete myMesh; if(argv[1]==NULL || argv[1][0]=='\0') { // Null request ! myMesh=new Vf_EmptyMesh(); } else { Vf_FileInput *vffreader = Vf_FileInput::NewReader(argv[1]); if(vffreader==NULL) { // Unknown file type ! myMesh=new Vf_EmptyMesh(); } else { // Reader found for file argv[1] ! myMesh=vffreader->NewMesh(); delete vffreader; ! if(myMesh==NULL) myMesh=new Vf_EmptyMesh(); // Safety } } myFrame.SetMesh(myMesh); REAL4m width=Nb_Atof(argv[2]); --- 356,394 ---- Tcl_AppendResult(interp,buf,(char *)NULL); return TCL_ERROR; } + if(activeMeshId<0 || activeMeshId>=MY_MESH_ARRAY_SIZE) { + sprintf(buf, + "PROGRAMMING ERROR: activeMeshId=%d is out-of-range: [0,%d]", + activeMeshId,MY_MESH_ARRAY_SIZE-1); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } + if(myMesh!=myMeshArray[activeMeshId]) { + sprintf(buf, + "PROGRAMMING ERROR: myMesh not in sync with myMeshArray."); + Tcl_AppendResult(interp,buf,(char *)NULL); + return TCL_ERROR; + } ! delete myMeshArray[activeMeshId]; ! myMeshArray[activeMeshId]=myMesh=NULL; // Safety if(argv[1]==NULL || argv[1][0]=='\0') { // Null request ! myMeshArray[activeMeshId]=new Vf_EmptyMesh(); } else { Vf_FileInput *vffreader = Vf_FileInput::NewReader(argv[1]); if(vffreader==NULL) { // Unknown file type ! myMeshArray[activeMeshId]=new Vf_EmptyMesh(); } else { // Reader found for file argv[1] ! myMeshArray[activeMeshId]=vffreader->NewMesh(); delete vffreader; ! if(myMeshArray[activeMeshId]==NULL) ! myMeshArray[activeMeshId]=new Vf_EmptyMesh(); // Safety } } + myMesh = myMeshArray[activeMeshId]; myFrame.SetMesh(myMesh); REAL4m width=Nb_Atof(argv[2]); *************** *** 747,753 **** { Tcl_ResetResult(interp); if(argc != 2) { ! sprintf(buf,"WriteMesh must be called with" " 1 argument: filename" " (%d arguments passed)",argc-1); Tcl_AppendResult(interp,buf,(char *)NULL); --- 841,847 ---- { Tcl_ResetResult(interp); if(argc != 2) { ! sprintf(buf,"WriteMeshDeprecatedVIOFormat must be called with" " 1 argument: filename" " (%d arguments passed)",argc-1); Tcl_AppendResult(interp,buf,(char *)NULL); *************** *** 772,778 **** else { Vf_VioFileOutput vfo; if(vfo.WriteMesh(myMesh,fptr,NULL)!=0) { ! sprintf(buf,"WriteMesh error"); Tcl_AppendResult(interp,buf,(char *)NULL); errcode=TCL_ERROR; } --- 866,872 ---- else { Vf_VioFileOutput vfo; if(vfo.WriteMesh(myMesh,fptr,NULL)!=0) { ! sprintf(buf,"WriteMeshDeprecatedVIOFormat error"); Tcl_AppendResult(interp,buf,(char *)NULL); errcode=TCL_ERROR; } *************** *** 843,942 **** int WriteMeshAverages(ClientData, Tcl_Interp *interp, int argc, char** argv) { ! Tcl_Channel channel; ! int mode; ! Tcl_ResetResult(interp); ! if(argc!=2) { ! sprintf(buf,"WriteMeshAverages must be called with 1 argument:" ! " an output channel (%d arguments passed)",argc-1); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! if ((channel = Tcl_GetChannel(interp, argv[1], &mode)) == NULL) { ! return TCL_ERROR; ! } ! if (!(mode & TCL_WRITABLE)) { ! sprintf(buf,"%s is not a writable channel", argv[1]); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } // Is this a rectangular mesh? ! if(strcmp(myMesh->GetMeshType(),"Vf_GridVec3f")!=0) { ! sprintf(buf,"Invalid mesh type: %s\n",myMesh->GetMeshType()); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! // Downcast ! Vf_GridVec3f& grid = *((Vf_GridVec3f *)myMesh); ! // Collect and print x-data ! int i,j,k,isize,jsize,ksize; ! grid.GetDimens(isize,jsize,ksize); ! if(isize<1 || jsize<1 || ksize<1) { ! sprintf(buf,"Bad mesh dimensions: %d %d %d",isize,jsize,ksize); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! Nb_Vec3 *m=new Nb_Vec3[isize]; ! for(i=0;i base=grid.GetBasePoint(); ! Nb_Vec3 step=grid.GetGridStep(); ! double mult=(1./double(jsize*ksize)); ! sprintf(buf,"# Averages across x axis (%d points each)\n", jsize*ksize); Tcl_Write(channel, buf, int(strlen(buf))); ! for(i=0;i[jsize]; ! for(j=0;j[isize]; ! for(k=0;k6) { ! sprintf(buf,"WriteMeshAverages must be called with 5 or 6 arguments:" ! " an output channel, average type" ! " (one of space|plane|line|point)," ! " axis selection (x|y|z)," ! " range selection (6-tuple)," ! " and an optional descriptor string" ! " (%d arguments passed)",argc-1); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! if ((channel = Tcl_GetChannel(interp, argv[1], &mode)) == NULL) { ! return TCL_ERROR; ! } ! if (!(mode & TCL_WRITABLE)) { ! sprintf(buf,"%s is not a writable channel", argv[1]); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! ! // Averaging type ! enum { point, line, plane, space } avetype = space; ! if(strcmp(argv[2],"point")==0) { ! avetype = point; ! } else if(strcmp(argv[2],"line")==0) { ! avetype = line; ! } else if(strcmp(argv[2],"plane")==0) { ! avetype = plane; ! } else if(strcmp(argv[2],"space")!=0) { ! sprintf(buf,"Invalid type string: %s;" ! " Should be one of point, line, plane or space", ! argv[2]); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! ! // Average type axis spec ! if(argv[3][1]!='\0' || ! (argv[3][0]!='x' && argv[3][0]!='y' && argv[3][0]!='z')) { ! sprintf(buf,"Invalid axis spec: %s;" ! " Should be x, y, or z", ! argv[3]); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! char axis = argv[3][0]; // Is this a rectangular mesh? ! if(strcmp(myMesh->GetMeshType(),"Vf_GridVec3f")!=0) { ! sprintf(buf,"Invalid mesh type: %s\n",myMesh->GetMeshType()); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! // Downcast ! Vf_GridVec3f& grid = *((Vf_GridVec3f *)myMesh); ! REAL8m scale=grid.GetValueMultiplier() ! * grid.GetRelativeValueScale(); ! // Check dimensions ! int i,j,k,isize,jsize,ksize; ! grid.GetDimens(isize,jsize,ksize); ! if(isize<1 || jsize<1 || ksize<1) { ! sprintf(buf,"Bad mesh dimensions: %d %d %d",isize,jsize,ksize); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! ! double mult=0.; ! Nb_Vec3 base=grid.GetBasePoint(); ! Nb_Vec3 step=grid.GetGridStep(); ! ! // Range select ! int range_arr_size; ! char** range_arr; ! if (Tcl_SplitList(interp,argv[4],&range_arr_size,&range_arr)!=TCL_OK) { ! return TCL_ERROR; ! } ! if(range_arr_size!=6) { ! Tcl_Free((char *)range_arr); ! sprintf(buf,"Range list has %d != 6 elements",range_arr_size); ! Tcl_AppendResult(interp,buf,(char *)NULL); ! return TCL_ERROR; ! } ! REAL8m xmin = base.x - step.x/2.; ! REAL8m ymin = base.y - step.y/2.; ! REAL8m zmin = base.z - step.z/2.; ! REAL8m xmax = base.x + (isize-0.5)*step.x; ! REAL8m ymax = base.y + (jsize-0.5)*step.y; ! REAL8m zmax = base.z + (ksize-0.5)*step.z; ! if(xmin>xmax) { REAL8m temp=xmin; xmin=xmax; xmax=temp; } ! if(ymin>ymax) { REAL8m temp=ymin; ymin=ymax; ymax=temp; } ! if(zmin>zmax) { REAL8m temp=zmin; zmin=zmax; zmax=temp; } ! if(strcmp("-",range_arr[0])!=0) { ! REAL8m temp = Nb_Atof(range_arr[0]); ! if(temp>xmin) xmin=temp; ! } ! if(strcmp("-",range_arr[1])!=0) { ! REAL8m temp = Nb_Atof(range_arr[1]); ! if(temp>ymin) ymin=temp; ! } ! if(strcmp("-",range_arr[2])!=0) { ! REAL8m temp = Nb_Atof(range_arr[2]); ! if(temp>zmin) zmin=temp; ! } ! if(strcmp("-",range_arr[3])!=0) { ! REAL8m temp = Nb_Atof(range_arr[3]); ! if(tempxmax || ymin>ymax || zmin>zmax) { ! // Nothing to do. ! sprintf(buf,"## Empty range\n"); Tcl_Write(channel, buf, int(strlen(buf))); ! return TCL_OK; ! /// NOTE: Checking here on the ?min/?max float values ! /// protects against some overflow conditions on the ! /// parallel integer constructions below ! } ! int imin=0,imax=isize; ! if(step.x>0) { ! imin = int(ceil((xmin - base.x)/step.x)); ! imax = int(floor((xmax - base.x)/step.x)); ! } else if(step.x<0) { ! imin = int(ceil((xmax - base.x)/step.x)); ! imax = int(floor((xmin - base.x)/step.x)); ! } ! ++imax; ! if(imin<0) imin = 0; ! if(imax>isize) imax = isize; ! int icount = imax - imin; ! ! int jmin=0,jmax=jsize; ! if(step.y>0) { ! jmin = int(ceil((ymin - base.y)/step.y)); ! jmax = int(floor((ymax - base.y)/step.y)); ! } else if(step.y<0) { ! jmin = int(ceil((ymax - base.y)/step.y)); ! jmax = int(floor((ymin - base.y)/step.y)); ! } ! ++jmax; ! if(jmin<0) jmin = 0; ! if(jmax>jsize) jmax = jsize; ! int jcount = jmax - jmin; ! ! int kmin=0,kmax=ksize; ! if(step.z>0) { ! kmin = int(ceil((zmin - base.z)/step.z)); ! kmax = int(floor((zmax - base.z)/step.z)); ! } else if(step.z<0) { ! kmin = int(ceil((zmax - base.z)/step.z)); ! kmax = int(floor((zmin - base.z)/step.z)); ! } ! ++kmax; ! if(kmin<0) kmin = 0; ! if(kmax>ksize) kmax = ksize; ! int kcount = kmax - kmin; ! ! if(icount<1 || jcount<1 || kcount<1) { ! // Nothing to do ! sprintf(buf,"## Empty range\n"); ! Tcl_Write(channel, buf, int(strlen(buf))); ! return TCL_OK; ! } ! // Print ODT file header ! sprintf(buf,"# ODT 1.0\n"); ! Tcl_Write(channel, buf, int(strlen(buf))); ! if(argc==6) { ! sprintf(buf,"## Description: %s\n",argv[5]); Tcl_Write(channel, buf, int(strlen(buf))); ! } ! unsigned int volume_point_count = icount*jcount*kcount; ! sprintf(buf, ! "## Active volume: (%.15g,%.15g,%.15g) x (%.15g,%.15g,%.15g)\n" ! "## Cell size: %.15g x %.15g x %.15g\n" ! "## Cells in active volume: %d\n", ! xmin,ymin,zmin,xmax,ymax,zmax, ! fabs(step.x),fabs(step.y),fabs(step.z), ! volume_point_count); ! Tcl_Write(channel, buf, int(strlen(buf))); ! ! sprintf(buf,"#\n# Table Start\n"); ! Tcl_Write(channel, buf, int(strlen(buf))); ! ! Nb_Vec3 m; ! ! if(avetype==space) { ! // Volume average ! colhdrfmt = Nb_DString("# Columns: %-25s %-25s %-25s\n") ! + Nb_DString("# Units: {} {} {}\n"); ! linefmt = Nb_DString(NUMFMT) ! + Nb_DString(" ") + Nb_DString(NUMFMT) ! + Nb_DString(" ") + Nb_DString(NUMFMT) ! + Nb_DString("\n"); ! sprintf(buf,"# Title: Average across active volume\n"); ! Tcl_Write(channel, buf, int(strlen(buf))); ! sprintf(buf,colhdrfmt, ! " m_x"," m_y"," m_z"); Tcl_Write(channel, buf, int(strlen(buf))); ! m.Set(0.,0.,0.); ! for(k=kmin;k --- 16,22 ---- # v--Edit here if necessary \ exec wish "$0" ${1+"$@"} # ! # Last modified on: $Date: 2001/01/19 15:42:24 $ # Last modified by: $Author: dgp $ # # Usage: omfsh mmhelp.tcl *************** *** 173,180 **** source [file join [file dirname [info script]] counter.tcl] Oc_Main SetAppName mmHelp ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/10/05 22:11:47 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] --- 173,180 ---- 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 SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] *************** *** 1994,1999 **** --- 1994,2011 ---- _OMFHB_GoHistory $_omfhb_g(current$textwidget) $textwidget } + # proc Open textwidget + # Open a file. + proc _OMFHB_Open {textwidget} { + global _omfhb_g omfhb_debug + if {$omfhb_debug} {puts Open} + set f [tk_getOpenFile -filetypes {{HTML {.html .htm}} {{All files} {*}}} \ + -parent $textwidget] + if {[string length $f]} { + _OMFHB_GoToUrl [Oc_Url FromFilename $f] "" $textwidget + } + } + # proc GoToURL url fragment textwidget # Go to a URL, managing browser history as we go. proc _OMFHB_GoToUrl {url fragment textwidget} { *************** *** 2161,2166 **** --- 2173,2180 ---- pack $fmb $nmb $omb -side left -in $menubar pack $menubar -side top -fill x } + $_omfhb_g(fmenu$tw) add command -label "Open..." \ + -command [list _OMFHB_Open $tw] -underline 0 $_omfhb_g(fmenu$tw) add command -label "Refresh" \ -command [list _OMFHB_Refresh $tw] -underline 0 $_omfhb_g(fmenu$tw) add separator diff -crN oommf-1.2a0/app/mmlaunch/appindex.tcl oommf/app/mmlaunch/appindex.tcl *** oommf-1.2a0/app/mmlaunch/appindex.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmlaunch/appindex.tcl Thu Jan 18 18:51:50 2001 *************** *** 1,7 **** Oc_Application Define { -name mmLaunch ! -version 1.2.0.0 -machine omfsh -file mmlaunch.tcl } --- 1,7 ---- Oc_Application Define { -name mmLaunch ! -version 1.2.0.1 -machine omfsh -file mmlaunch.tcl } diff -crN oommf-1.2a0/app/mmlaunch/mmlaunch.tcl oommf/app/mmlaunch/mmlaunch.tcl *** oommf-1.2a0/app/mmlaunch/mmlaunch.tcl Thu Aug 24 18:42:37 2000 --- oommf/app/mmlaunch/mmlaunch.tcl Thu Jan 18 18:51:50 2001 *************** *** 3,10 **** # An application which presents an interface for launching and # interconnecting other OOMMF applications. # ! # Last modified on: $Date: 2000/08/24 22:42:37 $ ! # Last modified by: $Author: donahue $ # Support libraries package require Ow --- 3,10 ---- # 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 by: $Author: dgp $ # Support libraries package require Ow *************** *** 16,25 **** wm withdraw . Oc_Main SetAppName mmLaunch ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/08/24 22:42:37 $} _ date Oc_Main SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: donahue $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 16,25 ---- 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 SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ diff -crN oommf-1.2a0/app/mmpe/appindex.tcl oommf/app/mmpe/appindex.tcl *** oommf-1.2a0/app/mmpe/appindex.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmpe/appindex.tcl Thu Jan 18 18:51:50 2001 *************** *** 2,15 **** Oc_Application Define { -name mmProbEd -aliases mmpe ! -version 1.2.0.0 -machine omfsh -file mmpe.tcl } Oc_Application Define { -name FileSource ! -version 1.2.0.0 -machine omfsh -file filesource.tcl } --- 2,15 ---- Oc_Application Define { -name mmProbEd -aliases mmpe ! -version 1.2.0.1 -machine omfsh -file mmpe.tcl } Oc_Application Define { -name FileSource ! -version 1.2.0.1 -machine omfsh -file filesource.tcl } diff -crN oommf-1.2a0/app/mmpe/filesource.tcl oommf/app/mmpe/filesource.tcl *** oommf-1.2a0/app/mmpe/filesource.tcl Thu Aug 24 18:42:37 2000 --- oommf/app/mmpe/filesource.tcl Thu Jan 18 18:51:50 2001 *************** *** 7,16 **** wm withdraw . Oc_Main SetAppName FileSource ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/08/24 22:42:37 $} _ date Oc_Main SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: donahue $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup donahue] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 7,16 ---- 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 SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup donahue] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ diff -crN oommf-1.2a0/app/mmpe/mmpe.tcl oommf/app/mmpe/mmpe.tcl *** oommf-1.2a0/app/mmpe/mmpe.tcl Thu Aug 24 18:42:37 2000 --- oommf/app/mmpe/mmpe.tcl Thu Jan 18 18:51:50 2001 *************** *** 12,21 **** wm withdraw . Oc_Main SetAppName mmProbEd ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/08/24 22:42:37 $} _ date Oc_Main SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: donahue $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup jeicke] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 12,21 ---- 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 SetDate [string trim $date] ! # regexp \\\044Author:(.*)\\\044 {$Author: dgp $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] Oc_Main SetAuthor [Oc_Person Lookup jeicke] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ diff -crN oommf-1.2a0/app/mmsolve/any2ppm.tcl oommf/app/mmsolve/any2ppm.tcl *** oommf-1.2a0/app/mmsolve/any2ppm.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmsolve/any2ppm.tcl Thu Jan 18 18:51:50 2001 *************** *** 11,17 **** Oc_ForceNoTkDefaultMessage Oc_Main SetAppName any2ppm ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Option console {} {} --- 11,17 ---- Oc_ForceNoTkDefaultMessage Oc_Main SetAppName any2ppm ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Option console {} {} diff -crN oommf-1.2a0/app/mmsolve/appindex.tcl oommf/app/mmsolve/appindex.tcl *** oommf-1.2a0/app/mmsolve/appindex.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmsolve/appindex.tcl Thu Jan 18 18:51:50 2001 *************** *** 1,7 **** Oc_Application Define { -name any2ppm ! -version 1.2.0.0 -machine filtersh -file any2ppm.tcl -mode fg --- 1,7 ---- Oc_Application Define { -name any2ppm ! -version 1.2.0.1 -machine filtersh -file any2ppm.tcl -mode fg diff -crN oommf-1.2a0/app/mmsolve/makerules.tcl oommf/app/mmsolve/makerules.tcl *** oommf-1.2a0/app/mmsolve/makerules.tcl Thu Apr 6 02:34:02 2000 --- oommf/app/mmsolve/makerules.tcl Thu Jan 18 18:51:50 2001 *************** *** 63,69 **** puts $f [format { Oc_Application Define { -name mmSolve ! -version 1.2.0.0 -machine %s -file "%s" } --- 63,69 ---- puts $f [format { Oc_Application Define { -name mmSolve ! -version 1.2.0.1 -machine %s -file "%s" } *************** *** 73,79 **** puts $f [format { Oc_Application Define { -name mpirun ! -version 1.2.0.0 -machine %s -directory {} -file {%s} --- 73,79 ---- puts $f [format { Oc_Application Define { -name mpirun ! -version 1.2.0.1 -machine %s -directory {} -file {%s} *************** *** 86,92 **** puts $f [format { Oc_Application Define { -name mmSolve ! -version 1.1.1.0 -machine mpirun -file "%s" } --- 86,92 ---- puts $f [format { Oc_Application Define { -name mmSolve ! -version 1.2.0.1 -machine mpirun -file "%s" } diff -crN oommf-1.2a0/app/mmsolve/mms.tcl oommf/app/mmsolve/mms.tcl *** oommf-1.2a0/app/mmsolve/mms.tcl Mon May 15 16:14:41 2000 --- oommf/app/mmsolve/mms.tcl Thu Jan 18 18:51:51 2001 *************** *** 2,14 **** # # Master Tcl file for the mmsolve shell # ! # Last modified on: $Date: 2000/05/15 20:14:41 $ # 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.0 # Set up for autoloading of Oc extension commands set mms(library) [file dirname [info script]] --- 2,14 ---- # # Master Tcl file for the mmsolve shell # ! # Last modified on: $Date: 2001/01/18 23:51:51 $ # 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 # Set up for autoloading of Oc extension commands set mms(library) [file dirname [info script]] diff -crN oommf-1.2a0/app/mmsolve/mmsolve.h oommf/app/mmsolve/mmsolve.h *** oommf-1.2a0/app/mmsolve/mmsolve.h Thu Apr 6 02:34:02 2000 --- oommf/app/mmsolve/mmsolve.h Thu Jan 18 18:51:51 2001 *************** *** 26,32 **** #define MMSOLVE_MAJOR_VERSION 1 #define MMSOLVE_MINOR_VERSION 2 #define MMSOLVE_RELEASE_LEVEL 0 ! #define MMSOLVE_RELEASE_SERIAL 0 #define MMSOLVE_VERSION OC_MAKE_VERSION(MMSOLVE) --- 26,32 ---- #define MMSOLVE_MAJOR_VERSION 1 #define MMSOLVE_MINOR_VERSION 2 #define MMSOLVE_RELEASE_LEVEL 0 ! #define MMSOLVE_RELEASE_SERIAL 1 #define MMSOLVE_VERSION OC_MAKE_VERSION(MMSOLVE) diff -crN oommf-1.2a0/app/mmsolve/scripts/appindex.tcl oommf/app/mmsolve/scripts/appindex.tcl *** oommf-1.2a0/app/mmsolve/scripts/appindex.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/mmsolve/scripts/appindex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,6 **** Oc_Application Define { -name batchmaster ! -version 1.2.0.0 -machine filtersh -file batchmaster.tcl -options {-tk 0} --- 1,6 ---- Oc_Application Define { -name batchmaster ! -version 1.2.0.1 -machine filtersh -file batchmaster.tcl -options {-tk 0} *************** *** 9,15 **** Oc_Application Define { -name batchslave ! -version 1.2.0.0 -machine mmsolve -file batchslave.tcl -options {-tk 0} --- 9,15 ---- Oc_Application Define { -name batchslave ! -version 1.2.0.1 -machine mmsolve -file batchslave.tcl -options {-tk 0} *************** *** 17,23 **** Oc_Application Define { -name batchsolve ! -version 1.2.0.0 -machine mmsolve -file batchsolve.tcl -options {-tk 0} --- 17,23 ---- Oc_Application Define { -name batchsolve ! -version 1.2.0.1 -machine mmsolve -file batchsolve.tcl -options {-tk 0} *************** *** 26,32 **** Oc_Application Define { -name mag2hfield ! -version 1.2.0.0 -machine mmsolve -file mag2hfield.tcl -options {-tk 0} --- 26,32 ---- Oc_Application Define { -name mag2hfield ! -version 1.2.0.1 -machine mmsolve -file mag2hfield.tcl -options {-tk 0} diff -crN oommf-1.2a0/app/mmsolve/scripts/batchmaster.tcl oommf/app/mmsolve/scripts/batchmaster.tcl *** oommf-1.2a0/app/mmsolve/scripts/batchmaster.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/mmsolve/scripts/batchmaster.tcl Thu Jan 18 18:51:51 2001 *************** *** 11,17 **** Oc_ForceNoTkDefaultMessage ;# Use stderr, not dialog to report errors Oc_Main SetAppName batchmaster ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Option [Oc_CommandLine Switch] { {task_script {} {Task definition file}} --- 11,17 ---- Oc_ForceNoTkDefaultMessage ;# Use stderr, not dialog to report errors Oc_Main SetAppName batchmaster ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Option [Oc_CommandLine Switch] { {task_script {} {Task definition file}} diff -crN oommf-1.2a0/app/mmsolve/scripts/batchslave.tcl oommf/app/mmsolve/scripts/batchslave.tcl *** oommf-1.2a0/app/mmsolve/scripts/batchslave.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/mmsolve/scripts/batchslave.tcl Thu Jan 18 18:51:51 2001 *************** *** 14,20 **** Oc_ForceNoTkDefaultMessage ;# Error messages to stderr, not dialog Oc_Main SetAppName batchslave ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Option [Oc_CommandLine Switch] { {host {} {Hostname to connect to master}} --- 14,20 ---- Oc_ForceNoTkDefaultMessage ;# Error messages to stderr, not dialog Oc_Main SetAppName batchslave ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Option [Oc_CommandLine Switch] { {host {} {Hostname to connect to master}} diff -crN oommf-1.2a0/app/mmsolve/scripts/batchsolve.tcl oommf/app/mmsolve/scripts/batchsolve.tcl *** oommf-1.2a0/app/mmsolve/scripts/batchsolve.tcl Wed Sep 6 15:37:54 2000 --- oommf/app/mmsolve/scripts/batchsolve.tcl Thu Jan 18 18:51:51 2001 *************** *** 10,16 **** Oc_ForceNoTkDefaultMessage ;# use stderr, not dialog for messages Oc_Main SetAppName batchsolve ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Option interface { {flag {expr {![catch {expr {$flag && $flag}}]}} {= 0 or 1}} --- 10,16 ---- Oc_ForceNoTkDefaultMessage ;# use stderr, not dialog for messages Oc_Main SetAppName batchsolve ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Option interface { {flag {expr {![catch {expr {$flag && $flag}}]}} {= 0 or 1}} diff -crN oommf-1.2a0/app/mmsolve/scripts/mag2hfield.tcl oommf/app/mmsolve/scripts/mag2hfield.tcl *** oommf-1.2a0/app/mmsolve/scripts/mag2hfield.tcl Thu Jul 13 22:34:31 2000 --- oommf/app/mmsolve/scripts/mag2hfield.tcl Thu Jan 18 18:51:51 2001 *************** *** 6,12 **** package require Mms 1.1.1 Oc_Main SetAppName mag2hfield ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Option console {} {} --- 6,12 ---- package require Mms 1.1.1 Oc_Main SetAppName mag2hfield ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Option console {} {} diff -crN oommf-1.2a0/app/mmsolve2d/appindex.tcl oommf/app/mmsolve2d/appindex.tcl *** oommf-1.2a0/app/mmsolve2d/appindex.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/mmsolve2d/appindex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,7 **** Oc_Application Define { -name mmSolve2D ! -version 1.2.0.0 -machine mmsolve -file mmsolve2d.tcl -options {-tk 0} --- 1,7 ---- Oc_Application Define { -name mmSolve2D ! -version 1.2.0.1 -machine mmsolve -file mmsolve2d.tcl -options {-tk 0} diff -crN oommf-1.2a0/app/mmsolve2d/mmsolve2d.tcl oommf/app/mmsolve2d/mmsolve2d.tcl *** oommf-1.2a0/app/mmsolve2d/mmsolve2d.tcl Wed Sep 6 15:37:54 2000 --- oommf/app/mmsolve2d/mmsolve2d.tcl Thu Jan 18 18:51:51 2001 *************** *** 11,18 **** ## goes down. Oc_Main SetAppName mmSolve2D ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/09/06 19:37:54 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 11,18 ---- ## 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 SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ diff -crN oommf-1.2a0/app/omfsh/makerules.tcl oommf/app/omfsh/makerules.tcl *** oommf-1.2a0/app/omfsh/makerules.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/omfsh/makerules.tcl Thu Jan 18 18:51:51 2001 *************** *** 36,48 **** puts $f [format { Oc_Application Define { -name omfsh ! -version 1.2.0.0 -machine %s -file "%s" } Oc_Application Define { -name filtersh ! -version 1.2.0.0 -machine %s -file "%s" } --- 36,48 ---- puts $f [format { Oc_Application Define { -name omfsh ! -version 1.2.0.1 -machine %s -file "%s" } Oc_Application Define { -name filtersh ! -version 1.2.0.1 -machine %s -file "%s" } diff -crN oommf-1.2a0/app/oxs/appindex.tcl oommf/app/oxs/appindex.tcl *** oommf-1.2a0/app/oxs/appindex.tcl Fri Nov 3 19:07:52 2000 --- oommf/app/oxs/appindex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,21 **** Oc_Application Define { - -name oxsi - -version 1.2.0.0 - -machine oxs - -file oxsi.tcl - } - - Oc_Application Define { -name Oxsii ! -version 1.2.0.0 -machine oxs -file oxsii.tcl } Oc_Application Define { ! -name mifconvert ! -version 1.2.0.0 -machine tclsh -file mifconvert.tcl -mode fg --- 1,14 ---- Oc_Application Define { -name Oxsii ! -version 1.2.0.1 -machine oxs -file oxsii.tcl } Oc_Application Define { ! -name MIFConvert ! -version 1.2.0.1 -machine tclsh -file mifconvert.tcl -mode fg diff -crN oommf-1.2a0/app/oxs/base/atlas.cc oommf/app/oxs/base/atlas.cc *** oommf-1.2a0/app/oxs/base/atlas.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/base/atlas.cc Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,25 ---- + /* FILE: atlas.cc -*-Mode: c++-*- + * + * Atlas class, derived from OXS extension class. + * + */ + + #include "atlas.h" + + /* End includes */ + + + // Constructors + Oxs_Atlas::Oxs_Atlas + ( const char* name, // Child instance id + Oxs_Director* newdtr // App director + ) : Oxs_Ext(name,newdtr) + {} + + Oxs_Atlas::Oxs_Atlas + ( 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_Ext(name,newdtr,safe_interp,argstr) + {} diff -crN oommf-1.2a0/app/oxs/base/atlas.h oommf/app/oxs/base/atlas.h *** oommf-1.2a0/app/oxs/base/atlas.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/base/atlas.h Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,54 ---- + /* FILE: atlas.h -*-Mode: c++-*- + * + * Abstract atlas class, derived from OXS extension class. + * + */ + + #ifndef _OXS_ATLAS + #define _OXS_ATLAS + + #include + + #include "ext.h" + #include "threevector.h" + #include "util.h" + /* End includes */ + + class Oxs_Atlas:public Oxs_Ext { + protected: + Oxs_Atlas(const char* name, // Child instance id + Oxs_Director* newdtr); // App director + Oxs_Atlas(const char* name, + Oxs_Director* newdtr, + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF block argument string + public: + virtual ~Oxs_Atlas() {} + + virtual void GetWorldExtents(Oxs_Box &mybox) const =0; + /// Fills mybox with bounding box for the atlas + + virtual INT4m GetRegionId(const ThreeVector& point) const =0; + /// Returns the id number for the first region in + /// "region_list" containing point. The return + /// value is -1 if the point is not contained in + /// the atlas. + + virtual INT4m GetRegionId(const string& name) const =0; + /// Given a region id string (name), returns + /// the corresponding region id index. If + /// "name" is not included in the atlas, then + /// -1 is returned. + + virtual INT4m GetRegionName(UINT4m id,string& name) const =0; + /// Given an id number, fills in "name" with + /// the corresponding region id string. Returns + /// 0 on success, 1 if id is invalid. + + virtual UINT4m GetRegionCount() const =0; + /// Valid RegionId numbers range from 0 to GetRegionCount -1, + /// inclusive. + + }; + + #endif // _OXS_ATLAS diff -crN oommf-1.2a0/app/oxs/base/director.cc oommf/app/oxs/base/director.cc *** oommf-1.2a0/app/oxs/base/director.cc Tue Nov 7 14:04:37 2000 --- oommf/app/oxs/base/director.cc Fri Jan 19 22:33:54 2001 *************** *** 4,10 **** * */ ! #undef REPORT_CONSTRUCT_TIMES // #def this to get timing report on stderr #include #include --- 4,10 ---- * */ ! #undef REPORT_CONSTRUCT_TIMES // #define this to get timing report on stderr #include #include *************** *** 46,65 **** } Oxs_Director::Oxs_Director(Tcl_Interp *i) ! : problem_count(0),problem_id(0), interp(i), safe_interp(NULL), driver(NULL), total_energy_output(this,"Director","Total energy","J",1, &Oxs_Director::UpdateOutputs), total_field_output(this,"Director","Total field","A/m",1, &Oxs_Director::UpdateOutputs), // MS VC++ 6.0 requires fully qualified member names - simulation_state_reserve_count(0) { Tcl_CreateExitHandler((Tcl_ExitProc *) ExitProc, (ClientData) this); } int Oxs_Director::ProbReset() { // Sets micromag problem to initial state // Run Init() on all Oxs_Ext's vector::iterator it = ext_obj.begin(); while(it!=ext_obj.end()) { --- 46,68 ---- } Oxs_Director::Oxs_Director(Tcl_Interp *i) ! : problem_count(0),problem_id(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, &Oxs_Director::UpdateOutputs), total_field_output(this,"Director","Total field","A/m",1, &Oxs_Director::UpdateOutputs), + energy_calc_count_output(this,"Director","Energy calc count","",0, + &Oxs_Director::FillEnergyCalcCountOutput) // MS VC++ 6.0 requires fully qualified member names { Tcl_CreateExitHandler((Tcl_ExitProc *) ExitProc, (ClientData) this); } int Oxs_Director::ProbReset() { // Sets micromag problem to initial state + energy_calc_count=0; // Reset GetEnergyDensity() call count // Run Init() on all Oxs_Ext's vector::iterator it = ext_obj.begin(); while(it!=ext_obj.end()) { *************** *** 69,88 **** return TCL_OK; } ! int Oxs_Director::ProbRun(Tcl_Interp* interp, int argc, char** argv) { string result; int errorcode=1; if(driver==NULL) { result = "Problem not initialized (no driver identified)"; } else { ! errorcode = driver->Run(result,argc,argv,interp); } if (errorcode == 0) { ! return myEval(interp, result); } ! Tcl_AppendResult(interp,result.c_str(),(char *)NULL); return TCL_ERROR; } --- 72,91 ---- return TCL_OK; } ! int Oxs_Director::ProbRun(Tcl_Interp* use_interp, int argc, char** argv) { 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; } *************** *** 162,168 **** catch (Oxs_Ext::Error& err) { Release(); // Delete any Oxs_Ext objects already constructed Tcl_AppendResult(interp,"Oxs_Ext initialization error---", ! err.msg,(char *)NULL); if(bad_specs.length()>0) { Tcl_AppendResult(interp,"\nUnrecognized Specify Blocks---", bad_specs.c_str(),(char *)NULL); --- 165,171 ---- catch (Oxs_Ext::Error& err) { Release(); // Delete any Oxs_Ext objects already constructed Tcl_AppendResult(interp,"Oxs_Ext initialization error---", ! err.msg.c_str(),(char *)NULL); if(bad_specs.length()>0) { Tcl_AppendResult(interp,"\nUnrecognized Specify Blocks---", bad_specs.c_str(),(char *)NULL); *************** *** 219,224 **** --- 222,228 ---- // Register director outputs RegisterOutput(&total_energy_output); RegisterOutput(&total_field_output); + RegisterOutput(&energy_calc_count_output); // Run Init() on all Oxs_Ext's ProbReset(); *************** *** 246,251 **** --- 250,258 ---- if(IsRegisteredOutput(&total_field_output)) { DeregisterOutput(&total_field_output); } + if(IsRegisteredOutput(&energy_calc_count_output)) { + DeregisterOutput(&energy_calc_count_output); + } driver=NULL; // Make sure we don't use this pointer anymore. *************** *** 485,506 **** } } int Oxs_Director::Output(const char* output_token, ! Tcl_Interp* interp, int argc,char** argv) { if(driver==NULL) { ! Tcl_AppendResult(interp,"No driver specified\n",(char *)NULL); return TCL_ERROR; } const Oxs_SimState* state=driver->GetCurrentState(); if(state==NULL) { ! Tcl_AppendResult(interp,"Current state not initialized\n", (char *)NULL); return TCL_ERROR; } Oxs_Output* obj = InterpretOutputToken(output_token); ! return obj->Output(state,interp,argc,argv); } int --- 492,558 ---- } } + Oxs_Output* Oxs_Director::FindOutputObject(const char* regexp) const + { // C++ interface for searching the output object list. This routine + // matches the import regexp against the output objects list. If a + // unique match is found, then a pointer to that object is returned. + // Otherwise, a NULL pointer is returned. The match is performed + // using the Tcl regexp engine. Since this routine will typically + // check through the entire list of output objects, ideally this + // routine is called after problem initialization, and the result is + // cached until the problem is released. + + // Get internal representation for regexp + if(safe_interp==NULL) { + OC_THROW(Oxs_BadPointer,"Safe interpreter not initialized in " + "Oxs_Director::FindOutputObject()"); + } + Tcl_RegExp rp = Tcl_RegExpCompile(safe_interp,Oc_AutoBuf(regexp)); + if(rp==NULL) { + string msg = "Invalid regular expression in " + "Oxs_Director::FindOutputObject(): "; + msg += string(Tcl_GetStringResult(interp)); + OC_THROW(Oxs_BadParameter,msg); + } + Oxs_Output* matched_obj=NULL; + size_t size = output_obj.size(); + for(size_t i=0;iGetCurrentState(); if(state==NULL) { ! Tcl_AppendResult(use_interp,"Current state not initialized\n", (char *)NULL); return TCL_ERROR; } Oxs_Output* obj = InterpretOutputToken(output_token); ! return obj->Output(state,use_interp,argc,argv); } int *************** *** 525,556 **** } ! // GetTotalEnergyAndmxH: Note that the return is mxH, as opposed to MxH. // This relieves this routine from needing to know what Ms is, and saves // an unneeded multiplication (since the evolver is just going to divide // it back out again to calculate dm/dt (as opposed again to dM/dt)). // The returned energy array is average energy density for the ! // corresponding cell in J/m^3; mxH is in A/m. ! void Oxs_Director::GetTotalEnergyAndmxH (const Oxs_SimState& state, Oxs_MeshValue& energy, ! Oxs_MeshValue& mxH ) { // Allocate scratch space as needed temp_energy.AdjustSize(state.mesh); temp_field.AdjustSize(state.mesh); Oxs_MeshValue* field_cache = NULL; if(total_field_output.GetCacheRequestCount()>0) { total_field_output.cache.state_id=0; field_cache = &total_field_output.cache.value; field_cache->AdjustSize(state.mesh); } const Oxs_MeshValue* temp_energy_used=NULL; const Oxs_MeshValue* temp_field_used=NULL; const Oxs_MeshValue& spin = state.spin; - /// For convenience UINT4m i; UINT4m vecsize = state.mesh->Size(); --- 577,623 ---- } ! // GetEnergyDensity: Note that mxH is returned, as opposed to MxH. // This relieves this routine from needing to know what Ms is, and saves // an unneeded multiplication (since the evolver is just going to divide // it back out again to calculate dm/dt (as opposed again to dM/dt)). // The returned energy array is average energy density for the ! // corresponding cell in J/m^3; mxH is in A/m. Any of mxH or H may be ! // NULL, which disables assignment for that variable. ! void Oxs_Director::GetEnergyDensity (const Oxs_SimState& state, Oxs_MeshValue& energy, ! Oxs_MeshValue* mxH_req, ! Oxs_MeshValue* H_req ) { + // Update call count + ++energy_calc_count; + // Allocate scratch space as needed temp_energy.AdjustSize(state.mesh); temp_field.AdjustSize(state.mesh); + energy.AdjustSize(state.mesh); + if(mxH_req!=NULL) mxH_req->AdjustSize(state.mesh); + if(H_req!=NULL) H_req->AdjustSize(state.mesh); + + Oxs_MeshValue* H_fill = H_req; Oxs_MeshValue* field_cache = NULL; if(total_field_output.GetCacheRequestCount()>0) { total_field_output.cache.state_id=0; field_cache = &total_field_output.cache.value; field_cache->AdjustSize(state.mesh); + if(H_fill==NULL) H_fill = field_cache; } + /// If field is requested by both H_req and total_field_output, + /// then fill H_req first, and copy to field_cache at end. + + const Oxs_MeshValue* temp_energy_used=NULL; const Oxs_MeshValue* temp_field_used=NULL; + // For convenience const Oxs_MeshValue& spin = state.spin; UINT4m i; UINT4m vecsize = state.mesh->Size(); *************** *** 559,600 **** (*it)->GetEnergyAndField(state, temp_energy,temp_energy_used, temp_field,temp_field_used); ! if(field_cache!=NULL) { ! *field_cache = *temp_field_used; ! } ! for(i=0;iGetEnergyAndField(state, temp_energy,temp_energy_used, temp_field,temp_field_used); ! if(field_cache!=NULL) { ! *field_cache += *temp_field_used; ! } ! for(i=0;iGetEnergyAndField(state, temp_energy,temp_energy_used, temp_field,temp_field_used); ! energy = *temp_energy_used; ! if(H_fill!=NULL) *H_fill = *temp_field_used; ! if(mxH_req!=NULL) { ! Oxs_MeshValue& mxH = *mxH_req; ! for(i=0;iGetEnergyAndField(state, temp_energy,temp_energy_used, temp_field,temp_field_used); ! energy += *temp_energy_used; ! if(H_fill!=NULL) *H_fill += *temp_field_used; ! if(mxH_req!=NULL) { ! Oxs_MeshValue& mxH = *mxH_req; ! ThreeVector torque; ! for(i=0;i energy(state.mesh); ! Oxs_MeshValue mxH(state.mesh); ! GetTotalEnergyAndmxH(state,energy,mxH); } --- 687,701 ---- if(state.Id()==0) { // Safety return; } Oxs_MeshValue energy(state.mesh); ! GetEnergyDensity(state,energy,NULL,NULL); ! } ! void Oxs_Director::FillEnergyCalcCountOutput(const Oxs_SimState& state) ! { ! energy_calc_count_output.cache.state_id=state.Id(); ! energy_calc_count_output.cache.value ! = static_cast(energy_calc_count); } diff -crN oommf-1.2a0/app/oxs/base/director.h oommf/app/oxs/base/director.h *** oommf-1.2a0/app/oxs/base/director.h Fri Nov 3 18:24:10 2000 --- oommf/app/oxs/base/director.h Sun Dec 17 17:31:28 2000 *************** *** 42,47 **** --- 42,50 ---- /// if not problem is zero. Otherwise should equal problem_count. /// NB: ProbRun is disabled if problem_id==0. + UINT4m energy_calc_count; // Number of times GetEnergyDensity + /// has been called in current problem run. + Tcl_Interp* const interp; // Safe interpreter, which is a slave of interp. This is *************** *** 66,78 **** /// to a container if in the future we want to support multiple /// drivers in one problem run. - // Outputs maintained by the director. These are conceptually - // public, but are specified private to force clients to use the - // output_map interface. - void UpdateOutputs(const Oxs_SimState&); - Oxs_ScalarOutput total_energy_output; - Oxs_VectorFieldOutput total_field_output; - // Array of held simulation states. See discussion below concerning // ReserveSimulationStateRequest() and GetNewSimulationState(). This // array "owns" the simulations states, i.e., is responsible for their --- 69,74 ---- *************** *** 91,96 **** --- 87,101 ---- mutable Oxs_MeshValue temp_energy; mutable Oxs_MeshValue temp_field; + // Outputs maintained by the director. These are conceptually + // public, but are specified private to force clients to use the + // output_map interface. + void UpdateOutputs(const Oxs_SimState&); + void FillEnergyCalcCountOutput(const Oxs_SimState&); + Oxs_ScalarOutput total_energy_output; + Oxs_VectorFieldOutput total_field_output; + Oxs_ScalarOutput energy_calc_count_output; + public: Oxs_Director(Tcl_Interp* interp_); ~Oxs_Director(); // Non-virtual. Oxs_Director is not intended to *************** *** 141,157 **** string& owner_name,string& output_name, string& output_type,string& output_units) const; ! void GetTotalEnergyAndmxH(const Oxs_SimState& state, ! Oxs_MeshValue& energy, ! Oxs_MeshValue& mxH ! ); ! /// Note that the return is mxH, as opposed to MxH. This /// relieves this routine from needing to know what Ms is, /// and saves an unneeded multiplication (since the evolver /// is just going to divide it back out again to calculate /// dm/dt (as opposed again to dM/dt)). The returned energy /// array is average energy density for the corresponding cell ! /// in J/m^3; mxH is in A/m. // SIMULATION STATE MANAGEMENT: During construction, each Oxs_Ext // object that wants to create and/or hold simulation states should --- 146,175 ---- string& owner_name,string& output_name, string& output_type,string& output_units) const; ! Oxs_Output* FindOutputObject(const char* regexp) const; ! /// C++ interface for searching the output object list. This routine ! /// matches the import regexp against the output objects list. If a ! /// unique match is found, then a pointer to that object is returned. ! /// Otherwise, a NULL pointer is returned. The match is performed ! /// using the Tcl regexp engine. Since this routine will typically ! /// check through the entire list of output objects, ideally this ! /// routine is called after problem initialization, and the result is ! /// cached until the problem is released. ! ! ! void GetEnergyDensity(const Oxs_SimState& state, ! Oxs_MeshValue& energy, ! Oxs_MeshValue* mxH_req, ! Oxs_MeshValue* H_req ! ); ! /// Note that mxH is returned, as opposed to MxH. This /// relieves this routine from needing to know what Ms is, /// and saves an unneeded multiplication (since the evolver /// is just going to divide it back out again to calculate /// dm/dt (as opposed again to dM/dt)). The returned energy /// array is average energy density for the corresponding cell ! /// in J/m^3; mxH is in A/m. Any of mxH or H may be NULL, ! /// which disables assignment for that variable. // SIMULATION STATE MANAGEMENT: During construction, each Oxs_Ext // object that wants to create and/or hold simulation states should diff -crN oommf-1.2a0/app/oxs/base/driver.cc oommf/app/oxs/base/driver.cc *** oommf-1.2a0/app/oxs/base/driver.cc Tue Nov 7 18:59:19 2000 --- oommf/app/oxs/base/driver.cc Mon Dec 18 18:39:55 2000 *************** *** 114,129 **** result = Tcl_GetStringResult(interp); Tcl_ResetResult(interp); return 1; } // Setup for next stage director->GetNewSimulationState(next_state); Oxs_SimState& nstate = next_state.GetWriteReference(); ! nstate = current_state.GetReadReference(); ! nstate.valid_state=0; // max_dm_dt is probably incorrect. ! // For this reason keep the same iteration_count. ! nstate.stage_iteration_count=0; nstate.stage_number++; next_state.GetReadReference(); // Release write lock current_state = next_state; } --- 114,134 ---- result = Tcl_GetStringResult(interp); Tcl_ResetResult(interp); return 1; + } else { + // Script completed successfully. Don't run it again. + // However, we want to return to break out of this + // while loop and return to Tcl's event loop, so place + // in result a script that does nothing to force that return. + result = "\n"; } // Setup for next stage director->GetNewSimulationState(next_state); Oxs_SimState& nstate = next_state.GetWriteReference(); ! nstate = current_state.GetReadReference(); // Copy data nstate.stage_number++; + nstate.stage_iteration_count=0; + // Spins are the same, so keep the same iteration_count. (???) next_state.GetReadReference(); // Release write lock current_state = next_state; } diff -crN oommf-1.2a0/app/oxs/base/energy.cc oommf/app/oxs/base/energy.cc *** oommf-1.2a0/app/oxs/base/energy.cc Thu Oct 26 17:57:46 2000 --- oommf/app/oxs/base/energy.cc Mon Jan 22 04:11:36 2001 *************** *** 8,23 **** /* End includes */ // Constructors Oxs_Energy::Oxs_Energy ( const char* name, // Child instance id Oxs_Director* newdtr // App director ! ) : Oxs_Ext(name,newdtr), energy_sum_output(this,InstanceName(),"Energy","J",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr), field_output(this,InstanceName(),"Field","A/m",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr) ! /// MS VC++ 6.0 requires fully qualified member names {} Oxs_Energy::Oxs_Energy --- 8,37 ---- /* End includes */ + void Oxs_Energy::FillCalcCountOutput(const Oxs_SimState& state) + { + calc_count_output.cache.state_id = state.Id(); + calc_count_output.cache.value = static_cast(calc_count); + } + // Constructors Oxs_Energy::Oxs_Energy ( const char* name, // Child instance id Oxs_Director* newdtr // App director ! ) : Oxs_Ext(name,newdtr),calc_count(0), ! calc_count_output(this,InstanceName(),"Calc count","",0, ! &Oxs_Energy::FillCalcCountOutput,newdtr), energy_sum_output(this,InstanceName(),"Energy","J",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr), field_output(this,InstanceName(),"Field","A/m",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr) ! // MS VC++ 6.0 requires fully qualified member names ! // The energy_sum_output and field_output initialization above ! // is potentially suspect because they require pointers to *this, ! // which is not yet fully constructed. In actual fact, the *this ! // is not dereferenced in the output object constructors, so it ! // will work okay, but it is probably better if eventually ! // initialization of these objects gets moved to Init(). {} Oxs_Energy::Oxs_Energy *************** *** 25,41 **** Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr // MIF block argument string ! ) : Oxs_Ext(name,newdtr,safe_interp,argstr), energy_sum_output(this,InstanceName(),"Energy","J",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr), field_output(this,InstanceName(),"Field","A/m",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr) ! /// MS VC++ 6.0 requires fully qualified member names {} //Destructor Oxs_Energy::~Oxs_Energy() {} // Standard output object update interface void Oxs_Energy::UpdateStandardOutputs(const Oxs_SimState& state) --- 39,73 ---- Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr // MIF block argument string ! ) : Oxs_Ext(name,newdtr,safe_interp,argstr),calc_count(0), ! calc_count_output(this,InstanceName(),"Calc count","",0, ! &Oxs_Energy::FillCalcCountOutput,newdtr), energy_sum_output(this,InstanceName(),"Energy","J",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr), field_output(this,InstanceName(),"Field","A/m",1, ! &Oxs_Energy::UpdateStandardOutputs,newdtr) ! // MS VC++ 6.0 requires fully qualified member names ! // The energy_sum_output and field_output initialization above ! // is potentially suspect because they require pointers to *this, ! // which is not yet fully constructed. In actual fact, the *this ! // is not dereferenced in the output object constructors, so it ! // will work okay, but it is probably better if eventually ! // initialization of these objects gets moved to Init(). {} //Destructor Oxs_Energy::~Oxs_Energy() {} + // Default problem initializer routine. This sets up default + // output objects, so any child that redefines this function + // will probably want to embed a call to this Init() inside + // the child specific version. + BOOL Oxs_Energy::Init() + { + calc_count=0; + return 1; + } + // Standard output object update interface void Oxs_Energy::UpdateStandardOutputs(const Oxs_SimState& state) *************** *** 80,85 **** --- 112,119 ---- const Oxs_MeshValue* &field_used ) { + ++calc_count; + Oxs_MeshValue* energy_buffer = &energy_provided; Oxs_MeshValue* field_buffer = &field_provided; diff -crN oommf-1.2a0/app/oxs/base/energy.h oommf/app/oxs/base/energy.h *** oommf-1.2a0/app/oxs/base/energy.h Tue Oct 24 18:58:53 2000 --- oommf/app/oxs/base/energy.h Mon Jan 22 04:11:36 2001 *************** *** 16,21 **** --- 16,28 ---- /* End includes */ class Oxs_Energy:public Oxs_Ext { + private: + // Track and make available for output count of number + // of times GetEnergyAndField() have been called in + // current problem run. + UINT4m calc_count; + Oxs_ScalarOutput calc_count_output; + void FillCalcCountOutput(const Oxs_SimState&); protected: Oxs_Energy(const char* name, // Child instance id Oxs_Director* newdtr); // App director *************** *** 55,60 **** --- 62,73 ---- public: virtual ~Oxs_Energy(); + + // Default problem initializer routine. This sets up default + // output objects, so any child that redefines this function + // will probably want to embed a call to this Init() inside + // the child specific version. + virtual BOOL Init(); void GetEnergyAndField(const Oxs_SimState& state, Oxs_MeshValue& energy_provided, diff -crN oommf-1.2a0/app/oxs/base/ext.cc oommf/app/oxs/base/ext.cc *** oommf-1.2a0/app/oxs/base/ext.cc Tue Nov 14 18:20:04 2000 --- oommf/app/oxs/base/ext.cc Thu Jan 18 18:35:39 2001 *************** *** 16,22 **** /* End includes */ ! Oxs_Ext::~Oxs_Ext() {} Oxs_Ext::Oxs_Ext(const char* idname,Oxs_Director* dtr) : instanceId(idname), director(dtr) {} --- 16,30 ---- /* End includes */ ! Oxs_Ext::~Oxs_Ext() ! { ! #ifdef OC_STL_MAP_BROKEN_EMPTY_DELETE ! // Some STL implementations (MVC++ 6.0 on Windows/Alpha) have a bug ! // that causes a hang if init_strings is destroyed when ! // empty. To work around this, we just insert a dummy element. ! init_strings[string("foo")].push_back(string("bar")); ! #endif ! } Oxs_Ext::Oxs_Ext(const char* idname,Oxs_Director* dtr) : instanceId(idname), director(dtr) {} *************** *** 170,175 **** --- 178,191 ---- return value; } + REAL8m Oxs_Ext::GetRealInitValue(const string& key, + REAL8m default_value) + { + const vector* param = FindInitValue(key); + if(param==NULL) return default_value; + return GetRealInitValue(key); + } + ThreeVector Oxs_Ext::GetThreeVectorInitValue(const string& key) { CheckInitValueParamCount(key,3); *************** *** 182,187 **** --- 198,212 ---- return vec; } + ThreeVector + Oxs_Ext::GetThreeVectorInitValue(const string& key, + const ThreeVector& default_value) + { + const vector* param = FindInitValue(key); + if(param==NULL) return default_value; + return GetThreeVectorInitValue(key); + } + INT4m Oxs_Ext::GetIntInitValue(const string& key) { CheckInitValueParamCount(key,1); *************** *** 190,195 **** --- 215,228 ---- return ivalue; } + INT4m Oxs_Ext::GetIntInitValue(const string& key, + INT4m default_value) + { + const vector* param = FindInitValue(key); + if(param==NULL) return default_value; + return GetIntInitValue(key); + } + string Oxs_Ext::GetStringInitValue(const string& key) { CheckInitValueParamCount(key,1); *************** *** 198,208 **** return str; } BOOL Oxs_Ext::DeleteInitValue(const string& key) { // Removes the specified key-value pair from init_strings. // Returns 1 on success, 0 if key was not found in init_strings. ! return static_cast(init_strings.erase(key)); } void Oxs_Ext::VerifyAllInitArgsUsed() --- 231,255 ---- return str; } + string Oxs_Ext::GetStringInitValue(const string& key, + const string& default_value) + { + const vector* param = FindInitValue(key); + if(param==NULL) return default_value; + return GetStringInitValue(key); + } + BOOL Oxs_Ext::DeleteInitValue(const string& key) { // Removes the specified key-value pair from init_strings. // Returns 1 on success, 0 if key was not found in init_strings. ! // It seems that 'init_strings.erase(key)' should work here, but ! // this produces a NULL-pointer de-reference under MVC++ 6.0 on ! // Windows/Alpha. So we just use find() and erase(it) instead. ! map >::iterator it = init_strings.find(key); ! if(it==init_strings.end()) return 0; ! init_strings.erase(it); ! return 1; } void Oxs_Ext::VerifyAllInitArgsUsed() diff -crN oommf-1.2a0/app/oxs/base/ext.h oommf/app/oxs/base/ext.h *** oommf-1.2a0/app/oxs/base/ext.h Tue Nov 14 18:20:04 2000 --- oommf/app/oxs/base/ext.h Thu Jan 18 18:35:39 2001 *************** *** 183,198 **** INT4m GetIntInitValue(const string& key); string GetStringInitValue(const string& key); public: struct Error { ! const char* msg; Error(const char* errmsg) : msg(errmsg) { // Eventually Oxs_Ext errors should be caught // at the Tcl script level, and handled or // presented to the user from there. Until this // is coded, though, just echo all Error object // messages to stderr. ! fprintf(stderr,"Oxs_Ext ERROR: %s\n",errmsg); } }; const char* InstanceName() const { return instanceId.c_str(); } --- 183,210 ---- INT4m GetIntInitValue(const string& key); string GetStringInitValue(const string& key); + // These are duplicates of the above, but instead returns + // 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); + string GetStringInitValue(const string& key, + const string& default_value); + + public: struct Error { ! public: ! const string msg; Error(const char* errmsg) : msg(errmsg) { // Eventually Oxs_Ext errors should be caught // at the Tcl script level, and handled or // presented to the user from there. Until this // is coded, though, just echo all Error object // messages to stderr. ! fprintf(stderr,"Oxs_Ext ERROR: %s\n",msg.c_str()); } }; const char* InstanceName() const { return instanceId.c_str(); } diff -crN oommf-1.2a0/app/oxs/base/key.h oommf/app/oxs/base/key.h *** oommf-1.2a0/app/oxs/base/key.h Wed Oct 4 20:33:12 2000 --- oommf/app/oxs/base/key.h Fri Dec 15 19:53:21 2000 *************** *** 73,81 **** friend class Oxs_ConstKey; private: UINT4m id; - T* ptr; enum Lock_Held { DEP, READ, WRITE, INVALID } lock; // lock==INVALID iff id==0 and ptr==NULL public: void Release(); // Release lock and go into the INVALID state. --- 73,81 ---- friend class Oxs_ConstKey; private: UINT4m id; enum Lock_Held { DEP, READ, WRITE, INVALID } lock; // lock==INVALID iff id==0 and ptr==NULL + T* ptr; public: void Release(); // Release lock and go into the INVALID state. diff -crN oommf-1.2a0/app/oxs/base/lock.cc oommf/app/oxs/base/lock.cc *** oommf-1.2a0/app/oxs/base/lock.cc Wed Sep 20 16:59:59 2000 --- oommf/app/oxs/base/lock.cc Tue Jan 16 01:09:15 2001 *************** *** 40,47 **** } else { // Take the next valid id if((obj_id = ++id_count)==0) { ! // Wrap around. Might want to issue a warning. ! obj_id = ++id_count; } } } --- 40,48 ---- } else { // Take the next valid id if((obj_id = ++id_count)==0) { ! obj_id = ++id_count; // Safety ! // Wrap around. For now make this fatal. ! OC_THROW(Oxs_BadLock,"Lock count id overflow."); } } } diff -crN oommf-1.2a0/app/oxs/base/output.h oommf/app/oxs/base/output.h *** oommf-1.2a0/app/oxs/base/output.h Wed Oct 25 16:37:38 2000 --- oommf/app/oxs/base/output.h Mon Dec 18 15:58:15 2000 *************** *** 95,100 **** --- 95,102 ---- private: T* owner; const GetScalar getscalar; + /// Without the typedef, this would be + /// void (T::* const getscalar)(const Oxs_SimState&) // Disable copy constructor by declaring it without defining it. Oxs_ScalarOutput(const Oxs_ScalarOutput &); *************** *** 103,114 **** Oxs_ScalarOutput(T* owner_, const char* owner_name_,const char* output_name_, const char* output_units_, ! BOOL cache_support_,const GetScalar& member_function, ! Oxs_Director* director_=NULL); ! // Note: The import owner_ is used to set the data member owner, // but is not otherwised used inside the Oxs_ScalarOutput constructor. // In particular, this means that the calling T object can safely pass // in its 'this' pointer from its constructor. // Public data member for result drop-off/storage. // The owner should test GetCacheRequestCount() inside the output --- 105,130 ---- Oxs_ScalarOutput(T* owner_, const char* owner_name_,const char* output_name_, const char* output_units_, ! BOOL cache_support_,const GetScalar member_function, ! Oxs_Director* director_=NULL) ! : Oxs_Output(owner_name_,output_name_,"scalar",output_units_, ! cache_support_,director_), ! owner(owner_), ! getscalar(member_function) ! { ! cache.value=0; // Safety ! CacheRequestIncrement(1); // Temporary measure: until /**/ ! /// cache management is implemented in Tcl interface, /**/ ! /// enable caching on all scalar outputs. /**/ ! } ! // Note 1: The import owner_ is used to set the data member owner, // but is not otherwised used inside the Oxs_ScalarOutput constructor. // In particular, this means that the calling T object can safely pass // in its 'this' pointer from its constructor. + // Note 2: If the implementation of this function is given outside + // the class definition body, then Microsoft VC++ 5.0 chokes on the + // pointer-to-member-function T::*, and dies with "internal compiler + // error." // Public data member for result drop-off/storage. // The owner should test GetCacheRequestCount() inside the output *************** *** 120,126 **** // The owner getscalar() function can assume on entry that the // cache value stored here is invalid, but it may become valid // during the lifetime of the getscalar() call (if getscalar() ! // calls some other function that makes a SetCacheValue() call). }; //////////////////////// --- 136,142 ---- // The owner getscalar() function can assume on entry that the // cache value stored here is invalid, but it may become valid // during the lifetime of the getscalar() call (if getscalar() ! // calls some other function that sets the cache). }; //////////////////////// *************** *** 130,135 **** --- 146,153 ---- private: T* owner; const GetVectorField getvectorfield; + /// Without the typedef, this would be + /// void (T::* const getvectorfield)(const Oxs_SimState&) // Disable copy constructor by declaring it without defining it. Oxs_VectorFieldOutput(const Oxs_VectorFieldOutput &); *************** *** 139,150 **** const char* owner_name_,const char* output_name_, const char* output_units_, BOOL cache_support_, ! const GetVectorField& member_function, ! Oxs_Director* director_=NULL); ! // Note: The import owner_ is used to set the data member owner, // but is not otherwised used inside the Oxs_VectorFieldOutput ! // constructor. In particular, this means that the calling T ! // object can safely pass in its 'this' pointer from its constructor. // Public data member for result drop-off/storage. // The owner should test GetCacheRequestCount() inside the output --- 157,177 ---- const char* owner_name_,const char* output_name_, const char* output_units_, BOOL cache_support_, ! const GetVectorField member_function, ! Oxs_Director* director_=NULL) ! : Oxs_Output(owner_name_,output_name_,"vector field",output_units_, ! cache_support_,director_), ! owner(owner_), ! getvectorfield(member_function) ! {} ! // Note 1: The import owner_ is used to set the data member owner, // but is not otherwised used inside the Oxs_VectorFieldOutput ! // constructor. In particular, this means that the calling T ! // object can safely pass in its 'this' pointer from its constructor. ! // Note 2: If the implementation of this function is given outside ! // the class definition body, then Microsoft VC++ 5.0 chokes on the ! // pointer-to-member-function T::*, and dies with "internal compiler ! // error." // Public data member for result drop-off/storage. // The owner should test GetCacheRequestCount() inside the output *************** *** 168,195 **** ////////////////////////////////////////////////////////////// // Oxs_ScalarOutput definitions template - Oxs_ScalarOutput::Oxs_ScalarOutput - (T* owner_, // Embedding object pointer - const char* owner_name_, // Embedding object instance name - const char* output_name_, // Name of output - const char* output_units_, // Output units (e.g., A/m) - BOOL cache_support_, // Provide cache support? - const GetScalar& member_function, // Member function to call to get output - Oxs_Director* director_) - : Oxs_Output(owner_name_,output_name_,"scalar",output_units_, - cache_support_,director_), - owner(owner_), - getscalar(member_function) - { - cache.value=0; // Safety - } - - template int Oxs_ScalarOutput::Output (const Oxs_SimState* state, // State to get output for Tcl_Interp* interp, // Tcl interpreter int argc,char** /* argv */) // Args { if(argc!=0) { Tcl_AppendResult(interp, "wrong # of args: should be none", (char *) NULL); --- 195,206 ---- ////////////////////////////////////////////////////////////// // Oxs_ScalarOutput definitions template int Oxs_ScalarOutput::Output (const Oxs_SimState* state, // State to get output for Tcl_Interp* interp, // Tcl interpreter int argc,char** /* argv */) // Args { + Tcl_ResetResult(interp); if(argc!=0) { Tcl_AppendResult(interp, "wrong # of args: should be none", (char *) NULL); *************** *** 225,251 **** ////////////////////////////////////////////////////////////// // Oxs_VectorFieldOutput definitions template - Oxs_VectorFieldOutput::Oxs_VectorFieldOutput - (T* owner_, // Embedding object pointer - const char* owner_name_, // Embedding object instance name - const char* output_name_, // Name of output - const char* output_units_, // Output units (e.g., A/m) - BOOL cache_support_, // Provide cache support? - const GetVectorField& member_function, // Member function to - /// call to get output - Oxs_Director* director_) - : Oxs_Output(owner_name_,output_name_,"vector field",output_units_, - cache_support_,director_), - owner(owner_), - getvectorfield(member_function) - {} - - template int Oxs_VectorFieldOutput::Output (const Oxs_SimState* state, // State to get output for Tcl_Interp* interp, // Tcl interpreter int argc,char** argv) // Args { if(argc!=1) { Tcl_AppendResult(interp, "wrong # of args: should be 1: filename", (char *) NULL); --- 236,247 ---- ////////////////////////////////////////////////////////////// // Oxs_VectorFieldOutput definitions template int Oxs_VectorFieldOutput::Output (const Oxs_SimState* state, // State to get output for Tcl_Interp* interp, // Tcl interpreter int argc,char** argv) // Args { + Tcl_ResetResult(interp); if(argc!=1) { Tcl_AppendResult(interp, "wrong # of args: should be 1: filename", (char *) NULL); diff -crN oommf-1.2a0/app/oxs/base/oxsexcept.h oommf/app/oxs/base/oxsexcept.h *** oommf-1.2a0/app/oxs/base/oxsexcept.h Fri Oct 20 19:34:17 2000 --- oommf/app/oxs/base/oxsexcept.h Sun Dec 17 17:31:28 2000 *************** *** 89,94 **** --- 89,100 ---- Oxs_NoMem(string text) : Oxs_Exception(text) {} }; + // Error reported by Tcl interpreter + class Oxs_TclError : public Oxs_Exception { + public: + Oxs_TclError(string text) : Oxs_Exception(text) {} + + }; #endif // _OXS_EXCEPT diff -crN oommf-1.2a0/app/oxs/base/region.cc oommf/app/oxs/base/region.cc *** oommf-1.2a0/app/oxs/base/region.cc Thu Aug 24 20:24:09 2000 --- oommf/app/oxs/base/region.cc Wed Dec 31 19:00:00 1969 *************** *** 1,27 **** - /* FILE: region.cc -*-Mode: c++-*- - * - * Abstract region class, derived from OXS extension class. - * - */ - - #include - - #include "region.h" - - /* End includes */ - - - // Constructors - Oxs_Region::Oxs_Region - ( const char* name, // Child instance id - Oxs_Director* newdtr // App director - ) : Oxs_Ext(name,newdtr) - {} - - Oxs_Region::Oxs_Region - ( 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_Ext(name,newdtr,safe_interp,argstr) - {} --- 0 ---- diff -crN oommf-1.2a0/app/oxs/base/region.h oommf/app/oxs/base/region.h *** oommf-1.2a0/app/oxs/base/region.h Thu Aug 24 20:24:09 2000 --- oommf/app/oxs/base/region.h Wed Dec 31 19:00:00 1969 *************** *** 1,27 **** - /* FILE: region.h -*-Mode: c++-*- - * - * Abstract region class, derived from OXS extension class. - * - */ - - #ifndef _OXS_REGION - #define _OXS_REGION - - #include "ext.h" - #include "util.h" - /* End includes */ - - class Oxs_Region:public Oxs_Ext { - protected: - Oxs_Region(const char* name, // Child instance id - Oxs_Director* newdtr); // App director - Oxs_Region(const char* name, - Oxs_Director* newdtr, - Tcl_Interp* safe_interp, // Safe interpreter - const char* argstr); // MIF block argument string - public: - virtual void GetExtents(Oxs_Box &mybox) const =0; - }; - - - #endif // _OXS_REGION --- 0 ---- diff -crN oommf-1.2a0/app/oxs/base/section.cc oommf/app/oxs/base/section.cc *** oommf-1.2a0/app/oxs/base/section.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/base/section.cc Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,26 ---- + /* FILE: section.cc -*-Mode: c++-*- + * + * Abstract section class, derived from OXS extension class. + * + */ + + #include "section.h" + + /* End includes */ + + + // Constructors + Oxs_Section::Oxs_Section + ( const char* name, // Child instance id + Oxs_Director* newdtr // App director + ) : Oxs_Ext(name,newdtr) + {} + + Oxs_Section::Oxs_Section + ( 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_Ext(name,newdtr,safe_interp,argstr) + {} + diff -crN oommf-1.2a0/app/oxs/base/section.h oommf/app/oxs/base/section.h *** oommf-1.2a0/app/oxs/base/section.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/base/section.h Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,31 ---- + /* FILE: section.h -*-Mode: c++-*- + * + * Abstract section class, derived from OXS extension class. + * + */ + + #ifndef _OXS_SECTION + #define _OXS_SECTION + + #include "ext.h" + #include "threevector.h" + #include "util.h" + /* End includes */ + + class Oxs_Section:public Oxs_Ext { + protected: + Oxs_Section(const char* name, // Child instance id + Oxs_Director* newdtr); // App director + Oxs_Section(const char* name, + Oxs_Director* newdtr, + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF block argument string + public: + virtual ~Oxs_Section() {} + virtual void GetExtents(Oxs_Box &mybox) const =0; + virtual BOOL IsIn(const ThreeVector& point) const =0; + /// Returns 1 if point is inside region, 0 otherwise. + }; + + + #endif // _OXS_REGION diff -crN oommf-1.2a0/app/oxs/base/simstate.cc oommf/app/oxs/base/simstate.cc *** oommf-1.2a0/app/oxs/base/simstate.cc Tue Sep 19 22:02:19 2000 --- oommf/app/oxs/base/simstate.cc Sun Dec 17 17:31:28 2000 *************** *** 9,17 **** // Constructor Oxs_SimState::Oxs_SimState() ! : valid_state(0),last_timestep(0),elapsed_time(0), ! max_dm_dt(0),total_energy(0), ! iteration_count(0),stage_iteration_count(0),stage_number(0), Ms(NULL),Ms_inverse(NULL),mesh(NULL) {} --- 9,16 ---- // Constructor Oxs_SimState::Oxs_SimState() ! : stage_iteration_count(0),stage_number(0),iteration_count(0), ! last_timestep(0),elapsed_time(0), Ms(NULL),Ms_inverse(NULL),mesh(NULL) {} diff -crN oommf-1.2a0/app/oxs/base/simstate.h oommf/app/oxs/base/simstate.h *** oommf-1.2a0/app/oxs/base/simstate.h Mon Oct 23 00:22:18 2000 --- oommf/app/oxs/base/simstate.h Sun Dec 17 17:31:28 2000 *************** *** 32,50 **** Oxs_SimState(); ~Oxs_SimState(); ! BOOL valid_state; // Set this to false when building up a ! /// state in pieces, or for trial states where error is found ! /// to be too big. ! ! // The following elements should eventually be wrapped up in a // STL map array, and indexed by name. REAL8m last_timestep; // Seconds REAL8m elapsed_time; // Seconds - REAL8m max_dm_dt; // Radians/sec (Note: m, not M) - REAL8m total_energy; // Joules - UINT4m iteration_count; // Total number of iterations - UINT4m stage_iteration_count; // Number of iterations for this stage - UINT4m stage_number; // Stage index // It is the responsibility of any object using this Oxs_SimState // object to insure the validity of these pointers. --- 32,44 ---- Oxs_SimState(); ~Oxs_SimState(); ! // The following elements should perhaps be wrapped up in a // STL map array, and indexed by name. + UINT4m stage_number; // Stage index + UINT4m stage_iteration_count; // Number of iterations for this stage + UINT4m iteration_count; // Total number of distinct spin configurations REAL8m last_timestep; // Seconds REAL8m elapsed_time; // Seconds // It is the responsibility of any object using this Oxs_SimState // object to insure the validity of these pointers. *************** *** 56,58 **** --- 50,54 ---- }; #endif // _OXS_SIMSTATE + + diff -crN oommf-1.2a0/app/oxs/base/threevector.cc oommf/app/oxs/base/threevector.cc *** oommf-1.2a0/app/oxs/base/threevector.cc Thu Aug 24 20:24:09 2000 --- oommf/app/oxs/base/threevector.cc Fri Jan 19 22:34:30 2001 *************** *** 70,73 **** x=mag*sinphi*costheta; y=mag*sinphi*sintheta; z=mag*cosphi; ! } --- 70,73 ---- x=mag*sinphi*costheta; y=mag*sinphi*sintheta; z=mag*cosphi; ! } diff -crN oommf-1.2a0/app/oxs/base/util.cc oommf/app/oxs/base/util.cc *** oommf-1.2a0/app/oxs/base/util.cc Thu Aug 24 20:24:09 2000 --- oommf/app/oxs/base/util.cc Tue Jan 16 01:09:15 2001 *************** *** 8,13 **** --- 8,14 ---- #include "nb.h" #include "oc.h" + #include "threevector.h" #include "util.h" /* End includes */ *************** *** 85,88 **** --- 86,127 ---- z0p=Nb_Atof(sz0.c_str()); z1p=Nb_Atof(sz1.c_str()); Set(x0p,x1p,y0p,y1p,z0p,z1p); + } + + INT4m Oxs_Box::Expand(const Oxs_Box& other) + { // Expands *this as necessary to contain region specified by "other". + // Returns 1 if *this is enlarged, 0 if other was already contained in + // *this. + INT4m expanded=0; + if(other.x0>other.x1) return 0; // "other" is an empty box + if(x0>x1) { + // *this is an empty box + *this = other; + return 1; + } + if(other.x0x1) { x1 = other.x1; expanded=1; } + if(other.y1>y1) { y1 = other.y1; expanded=1; } + if(other.z1>z1) { z1 = other.z1; expanded=1; } + return expanded; + } + + BOOL Oxs_Box::IsIn(const ThreeVector& point) + { + if(point.xx1 || + point.yy1 || + point.zz1) return 0; + return 1; + } + + BOOL Oxs_Box::IsContained(const Oxs_Box& other) + { + if(other.x0>other.x1) return 1; // "other" is an empty box + if(x0>x1) return 0; // *this is an empty box + if(other.x0x1 || + other.y0y1 || + other.z0z1) return 0; + return 1; } diff -crN oommf-1.2a0/app/oxs/base/util.h oommf/app/oxs/base/util.h *** oommf-1.2a0/app/oxs/base/util.h Wed Sep 20 16:59:59 2000 --- oommf/app/oxs/base/util.h Tue Jan 16 01:09:15 2001 *************** *** 11,16 **** --- 11,18 ---- #include #include "oc.h" + #include "threevector.h" + OC_USE_STD_NAMESPACE; // Specify std namespace, if supported /* End includes */ *************** *** 50,56 **** REAL8m x0,x1,y0,y1,z0,z1; // Box corner coordinates. /// This Set function insures that x0<=x1, y0<=y1, z0<=z1. public: ! Oxs_Box() : x0(0.),x1(0.),y0(0.),y1(0.),z0(0.),z1(0.) {} void Set(REAL8m x0p,REAL8m x1p,REAL8m y0p,REAL8m y1p, REAL8m z0p,REAL8m z1p); --- 52,58 ---- REAL8m x0,x1,y0,y1,z0,z1; // Box corner coordinates. /// This Set function insures that x0<=x1, y0<=y1, z0<=z1. public: ! Oxs_Box() : x0(0.),x1(-1.),y0(0.),y1(-1.),z0(0.),z1(-1.) {} void Set(REAL8m x0p,REAL8m x1p,REAL8m y0p,REAL8m y1p, REAL8m z0p,REAL8m z1p); *************** *** 58,63 **** --- 60,79 ---- void Set(const string& sx0,const string& sx1, const string& sy0,const string& sy1, const string& sz0,const string& sz1); + + // An empty box is identified by the condition x0>x1. + void MakeEmpty() { + x0 = y0 = z0 = 0.0; + x1 = y1 = z1 = -1.0; + } + + BOOL Expand(const Oxs_Box& other); // Expands *this as + /// necessary to contain region specified by "other". + /// Returns 1 if *this is enlarged, 0 if other was + /// already contained in *this. + + BOOL IsIn(const ThreeVector& point); + BOOL IsContained(const Oxs_Box& other); REAL8m GetMinX() const { return x0; } REAL8m GetMaxX() const { return x1; } diff -crN oommf-1.2a0/app/oxs/examples/ellipsoid.mif oommf/app/oxs/examples/ellipsoid.mif *** oommf-1.2a0/app/oxs/examples/ellipsoid.mif Mon Oct 16 00:18:24 2000 --- oommf/app/oxs/examples/ellipsoid.mif Tue Jan 16 23:56:26 2001 *************** *** 4,18 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_RectangularRegion:World { ! xrange {0 240e-9} ! yrange {0 80e-9} ! zrange {0 40e-9} } Specify Oxs_RectangularMesh:mesh { cellsize {2.5e-9 2.5e-9 2.5e-9} ! region Oxs_RectangularRegion:World } # Uniaxial anistropy --- 4,20 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_SectionAtlas:atlas { ! world { Oxs_RectangularSection { ! xrange {0 240e-9} ! yrange {0 80e-9} ! zrange {0 40e-9} ! } } } Specify Oxs_RectangularMesh:mesh { cellsize {2.5e-9 2.5e-9 2.5e-9} ! atlas :atlas } # Uniaxial anistropy *************** *** 25,39 **** } # Exchange ! Specify Oxs_Exchange6Ngbr { A 1.3e-11 - mesh :mesh } # Demag ! Specify Oxs_Demag { ! mesh :mesh ! } # Evolver Specify Oxs_EulerEvolve { --- 27,38 ---- } # Exchange ! Specify Oxs_UniformExchange { A 1.3e-11 } # Demag ! Specify Oxs_Demag {} # Evolver Specify Oxs_EulerEvolve { *************** *** 47,53 **** evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 100e-9 ! stopping_dm_dt 1 mesh :mesh number_of_stages 1 stage_iteration_limit 0 --- 46,52 ---- evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 100e-9 ! stopping_dm_dt 0.01 mesh :mesh number_of_stages 1 stage_iteration_limit 0 diff -crN oommf-1.2a0/app/oxs/examples/exchspring.mif oommf/app/oxs/examples/exchspring.mif *** oommf-1.2a0/app/oxs/examples/exchspring.mif Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/examples/exchspring.mif Sun Jan 21 16:02:06 2001 *************** *** 0 **** --- 1,95 ---- + # MIF 2.0 + # Description: Exchange spring example + set pi [expr 4*atan(1.0)] + set mu0 [expr 4*$pi*1e-7] + proc SKIP { args } {} + + Specify Oxs_SectionAtlas:atlas { + top { Oxs_RectangularSection { + xrange {0 300e-9} + yrange {0 300e-9} + zrange {49e-9 98e-9} + } } + bottom { Oxs_RectangularSection { + xrange {0 300e-9} + yrange {0 300e-9} + zrange {0 49e-9} + } } + world { Oxs_RectangularSection { + xrange {0 300e-9} + yrange {0 300e-9} + zrange {0 98e-9} + } } + } + + Specify Oxs_RectangularMesh:mesh { + cellsize {10e-9 10e-9 7e-9} + atlas :atlas + } + + Specify Oxs_Exchange6Ngbr:NiFe { + atlas :atlas + A { + { top top 13e-12 } + { top bottom 20e-12 } + { bottom bottom 30e-12 } + } + } + + Specify Oxs_UniaxialAnisotropy { + K1 { Oxs_AtlasScalarFieldInit { + atlas :atlas + values { + { top 0 } + { bottom 520e3 } + } + }} + axis { Oxs_UniformVectorFieldInit { + norm 1 + vector {1 0 0} + } } + } + + Specify Oxs_UZeeman " + Hscale [expr 0.001/$mu0] + Hrange { + { 0 0 0 500 50 0 10 } + { 500 50 0 -500 -50 0 20 } + { -500 -50 0 500 50 0 20 } + } + " + + Specify Oxs_Demag {} + + Specify Oxs_EulerEvolve:evolver { + alpha 0.5 + start_dm 0.01 + } + + Specify Oxs_StandardDriver { + evolver :evolver + min_timestep 1e-18 + max_timestep 1e-9 + ignore {1 deg/ns = 17453293 rad/sec; If Ms=8.6e5, and lambda is small, + then mxh=1e-6 translates into dm/dt = 2e5 rad/sec = 0.01 deg/ns} + stopping_dm_dt 1 + mesh :mesh + number_of_stages 76 + stage_iteration_limit 0 + total_iteration_limit 0 + Ms { Oxs_AtlasScalarFieldInit { + atlas :atlas + values { + {top 860e3} + {bottom 1400e3} + } + }} + m0 { Oxs_AtlasVectorFieldInit { + atlas :atlas + norm 1 + values { + { top -1 10 0 } + { bottom 10 1 0 } + } + }} + } diff -crN oommf-1.2a0/app/oxs/examples/sample.mif oommf/app/oxs/examples/sample.mif *** oommf-1.2a0/app/oxs/examples/sample.mif Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/examples/sample.mif Sun Jan 21 16:02:06 2001 *************** *** 3,33 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_RectangularRegion:World { ! xrange {1e-9 301e-9} ! yrange {0 200e-9} ! zrange {-1d-9 19e-9} } Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! region Oxs_RectangularRegion:World } ! Specify Oxs_UniaxialAnisotropy:Cobalt { ! K1 { Oxs_UniformScalarFieldInit { value 530e3 } } ! axis { Oxs_UniformVectorFieldInit { norm 1 vector {0 1 0} } } } ! Specify Oxs_Exchange6Ngbr:NiFe { A 13e-12 - mesh :mesh } ! Specify Oxs_UZeeman:Wilma " Hscale [expr 0.001/$mu0] Hrange { { 0 0 0 10 0 0 2 } --- 3,38 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_SectionAtlas:atlas { ! world { Oxs_RectangularSection { ! xrange {1e-9 301e-9} ! yrange {0 200e-9} ! zrange {-1d-9 19e-9} ! }} } Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! atlas :atlas } ! Specify Oxs_CubicAnisotropy:Nickel { ! K1 { Oxs_UniformScalarFieldInit { value -4.5e3 } } ! axis1 { Oxs_UniformVectorFieldInit { ! norm 1 ! vector {1 0 0} ! } } ! axis2 { Oxs_UniformVectorFieldInit { norm 1 vector {0 1 0} } } } ! Specify Oxs_UniformExchange:NiFe { A 13e-12 } ! SKIP Specify Oxs_UZeeman:Wilma " Hscale [expr 0.001/$mu0] Hrange { { 0 0 0 10 0 0 2 } *************** *** 37,45 **** } " ! Specify Oxs_SimpleDemag { ! mesh :mesh ! } Specify Oxs_EulerEvolve { alpha 0.5 --- 42,57 ---- } " ! Specify Oxs_UZeeman " ! Hscale [expr 0.001/$mu0] ! Hrange { ! { 0 0 0 100 0 0 10 } ! { 100 0 0 -100 0 0 20 } ! { -100 0 0 100 0 0 20 } ! } ! " ! ! Specify Oxs_SimpleDemag {} Specify Oxs_EulerEvolve { alpha 0.5 *************** *** 50,58 **** evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 1 mesh :mesh ! number_of_stages 11 stage_iteration_limit 0 total_iteration_limit 0 Ms { Oxs_UniformScalarFieldInit { value 8e5 } } --- 62,72 ---- evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! ignore {1 deg/ns = 17453293 rad/sec; If Ms=8.6e5, and lambda is small, ! then mxh=1e-6 translates into dm/dt = 2e5 rad/sec = 0.01 deg/ns} ! stopping_dm_dt 0.01 mesh :mesh ! number_of_stages 51 stage_iteration_limit 0 total_iteration_limit 0 Ms { Oxs_UniformScalarFieldInit { value 8e5 } } diff -crN oommf-1.2a0/app/oxs/examples/spinvalve.mif oommf/app/oxs/examples/spinvalve.mif *** oommf-1.2a0/app/oxs/examples/spinvalve.mif Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/examples/spinvalve.mif Sun Jan 21 16:02:06 2001 *************** *** 0 **** --- 1,96 ---- + # MIF 2.0 + # Description: Spin valve example + set pi [expr 4*atan(1.0)] + set mu0 [expr 4*$pi*1e-7] + proc SKIP { args } {} + + Specify Oxs_SectionAtlas:atlas { + top { Oxs_RectangularSection { + xrange {0 500e-9} + yrange {0 250e-9} + zrange {6e-9 9e-9} + } } + spacer { Oxs_RectangularSection { + xrange {0 500e-9} + yrange {0 250e-9} + zrange {3e-9 6e-9} + } } + bottom { Oxs_RectangularSection { + xrange {0 500e-9} + yrange {0 250e-9} + zrange {0 3e-9} + } } + world { Oxs_RectangularSection { + xrange {0 500e-9} + yrange {0 250e-9} + zrange {0 9e-9} + } } + } + + Specify Oxs_RectangularMesh:mesh { + cellsize {5e-9 5e-9 3e-9} + atlas :atlas + } + + Specify Oxs_Exchange6Ngbr:NiFe { + atlas :atlas + default_A 30e-12 + A { + { spacer spacer 0 } + { spacer top 0 } + { spacer bottom 0 } + } + } + + # Add biasing field to bottom layer. 40e3 A/m \approx 500 Oe. + Specify Oxs_FixedZeeman:Bias { + field { Oxs_AtlasVectorFieldInit { + atlas :atlas + default_value {0. 0. 0.} + values { + { bottom 40e3 0. 0. } + } + }} + } + + # Stepped applied field + Specify Oxs_UZeeman " + Hscale [expr 0.001/$mu0] + Hrange { + { 0 0 0 500 0 0 25 } + { 500 0 0 -500 0 0 25 } + { -500 0 0 500 0 0 25 } + } + " + + Specify Oxs_Demag {} + + Specify Oxs_EulerEvolve { + alpha 0.5 + start_dm 0.01 + } + + Specify Oxs_StandardDriver { + evolver Oxs_EulerEvolve + min_timestep 1e-18 + max_timestep 1e-9 + ignore {1 deg/ns = 17453293 rad/sec; If Ms=8.6e5, and lambda is small, + then mxh=1e-6 translates into dm/dt = 2e5 rad/sec = 0.01 deg/ns} + stopping_dm_dt .01 + mesh :mesh + number_of_stages 76 + stage_iteration_limit 0 + total_iteration_limit 0 + Ms { Oxs_AtlasScalarFieldInit { + atlas :atlas + default_value 0 + values { + {top 1400e3} + {bottom 1400e3} + } + }} + m0 { Oxs_UniformVectorFieldInit { + norm 1 + vector {10 1 0} + }} + } diff -crN oommf-1.2a0/app/oxs/examples/square.mif oommf/app/oxs/examples/square.mif *** oommf-1.2a0/app/oxs/examples/square.mif Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/examples/square.mif Tue Jan 16 23:56:26 2001 *************** *** 3,22 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! 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 } ! Specify Oxs_Exchange6Ngbr:NiFe { A 13e-12 - mesh :mesh } Specify Oxs_UZeeman " --- 3,23 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! 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 :atlas } ! Specify Oxs_UniformExchange:NiFe { A 13e-12 } Specify Oxs_UZeeman " *************** *** 26,34 **** } " ! Specify Oxs_SimpleDemag { ! mesh :mesh ! } Specify Oxs_EulerEvolve { alpha 0.5 --- 27,33 ---- } " ! Specify Oxs_SimpleDemag {} Specify Oxs_EulerEvolve { alpha 0.5 *************** *** 39,45 **** evolver Oxs_EulerEvolve min_timestep 1e-15 max_timestep 10e-9 ! stopping_dm_dt 1e5 mesh :mesh number_of_stages 3 stage_iteration_limit 250 --- 38,44 ---- evolver Oxs_EulerEvolve min_timestep 1e-15 max_timestep 10e-9 ! stopping_dm_dt 0.01 mesh :mesh number_of_stages 3 stage_iteration_limit 250 diff -crN oommf-1.2a0/app/oxs/examples/squarecubic.mif oommf/app/oxs/examples/squarecubic.mif *** oommf-1.2a0/app/oxs/examples/squarecubic.mif Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/examples/squarecubic.mif Tue Jan 16 23:56:26 2001 *************** *** 3,22 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! 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 } ! Specify Oxs_Exchange6Ngbr:NiFe { A 13e-12 - mesh :mesh } Specify Oxs_UZeeman " --- 3,23 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! 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 :atlas } ! Specify Oxs_UniformExchange:NiFe { A 13e-12 } Specify Oxs_UZeeman " *************** *** 26,34 **** } " ! Specify Oxs_SimpleDemag { ! mesh :mesh ! } Specify Oxs_EulerEvolve { alpha 0.5 --- 27,33 ---- } " ! Specify Oxs_SimpleDemag {} Specify Oxs_EulerEvolve { alpha 0.5 *************** *** 39,47 **** evolver Oxs_EulerEvolve min_timestep 1e-15 max_timestep 10e-9 ! stopping_dm_dt 1e5 mesh Oxs_RectangularMesh ! number_of_stages 1 stage_iteration_limit 2500 total_iteration_limit 0 Ms { Oxs_UniformScalarFieldInit { value 8e5 } } --- 38,46 ---- evolver Oxs_EulerEvolve min_timestep 1e-15 max_timestep 10e-9 ! stopping_dm_dt 0.01 mesh Oxs_RectangularMesh ! number_of_stages 3 stage_iteration_limit 2500 total_iteration_limit 0 Ms { Oxs_UniformScalarFieldInit { value 8e5 } } diff -crN oommf-1.2a0/app/oxs/examples/stdprob1.mif oommf/app/oxs/examples/stdprob1.mif *** oommf-1.2a0/app/oxs/examples/stdprob1.mif Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/examples/stdprob1.mif Tue Jan 16 23:56:26 2001 *************** *** 4,28 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_RectangularRegion:World { ! xrange {0 2e-6} ! yrange {0 1e-6} ! zrange {0 20e-9} } Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! region Oxs_RectangularRegion:World } ! Specify Oxs_Exchange6Ngbr { A 13e-12 - mesh :mesh } ! Specify Oxs_Demag { ! mesh :mesh ! } Specify Oxs_UZeeman " Hscale [expr 0.001/$mu0] --- 4,27 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_SectionAtlas:atlas { ! world { Oxs_RectangularSection { ! xrange {0 2e-6} ! yrange {0 1e-6} ! zrange {0 20e-9} ! } } } Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! atlas :atlas } ! Specify Oxs_UniformExchange { A 13e-12 } ! Specify Oxs_Demag {} Specify Oxs_UZeeman " Hscale [expr 0.001/$mu0] *************** *** 40,46 **** evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 1 mesh :mesh number_of_stages 1 stage_iteration_limit 0 --- 39,45 ---- evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 0.01 mesh :mesh number_of_stages 1 stage_iteration_limit 0 diff -crN oommf-1.2a0/app/oxs/examples/stdprob3.mif oommf/app/oxs/examples/stdprob3.mif *** oommf-1.2a0/app/oxs/examples/stdprob3.mif Thu Nov 9 20:12:10 2000 --- oommf/app/oxs/examples/stdprob3.mif Tue Jan 16 23:56:26 2001 *************** *** 4,19 **** set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_RectangularRegion:World { ! xrange {0 45e-9} ! yrange {0 45e-9} ! zrange {0 45e-9} } Specify Oxs_RectangularMesh:mesh { cellsize {3e-9 3e-9 3e-9} ignore {cellsize {1.4516129e-9 1.4516129e-9 1.4516129e-9}} ! region Oxs_RectangularRegion:World } # Uniaxial anistropy --- 4,21 ---- set mu0 [expr 4*$pi*1e-7] proc SKIP { args } {} ! Specify Oxs_SectionAtlas:atlas { ! world { Oxs_RectangularSection { ! xrange {0 45e-9} ! yrange {0 45e-9} ! zrange {0 45e-9} ! } } } Specify Oxs_RectangularMesh:mesh { cellsize {3e-9 3e-9 3e-9} ignore {cellsize {1.4516129e-9 1.4516129e-9 1.4516129e-9}} ! atlas :atlas } # Uniaxial anistropy *************** *** 26,40 **** } # Exchange ! Specify Oxs_Exchange6Ngbr { A 17.735281e-12 - mesh :mesh } # Demag ! Specify Oxs_Demag { ! mesh :mesh ! } # Evolver Specify Oxs_EulerEvolve { --- 28,39 ---- } # Exchange ! Specify Oxs_UniformExchange { A 17.735281e-12 } # Demag ! Specify Oxs_Demag {} # Evolver Specify Oxs_EulerEvolve { *************** *** 57,63 **** evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 1 mesh :mesh number_of_stages 1 stage_iteration_limit 0 --- 56,62 ---- evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 0.01 mesh :mesh number_of_stages 1 stage_iteration_limit 0 diff -crN oommf-1.2a0/app/oxs/ext/atlasscalarfieldinit.cc oommf/app/oxs/ext/atlasscalarfieldinit.cc *** oommf-1.2a0/app/oxs/ext/atlasscalarfieldinit.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/atlasscalarfieldinit.cc Tue Jan 16 18:20:41 2001 *************** *** 0 **** --- 1,141 ---- + /* FILE: atlasscalarfieldinit.cc -*-Mode: c++-*- + * + * Atlas scalar field initializer, derived from Oxs_ScalarFieldInit + * class. + * + */ + + #include + + #include "oc.h" + #include "nb.h" + + #include "util.h" + #include "threevector.h" + #include "meshvalue.h" + #include "director.h" + #include "atlas.h" + #include "atlasscalarfieldinit.h" + #include "energy.h" // Needed to make MSVC++ 5 happy + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_AtlasScalarFieldInit); + + /* End includes */ + + // Constructor + Oxs_AtlasScalarFieldInit::Oxs_AtlasScalarFieldInit( + const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp_, // Safe interpreter + const char* argstr) // MIF input block parameters + : Oxs_ScalarFieldInit(name,newdtr,safe_interp_,argstr) + { + // Process arguments + CheckInitValueParamCount("atlas",1); + const string& atlasname = (*FindInitValue("atlas"))[0]; + Oxs_Ext* tempobj = director->FindExtObject(atlasname); + if(tempobj==NULL) { + string msg=string("Unable to identify Oxs_Atlas object with name ") + + atlasname; + throw Oxs_Ext::Error(msg.c_str()); + } + Oxs_Atlas* atlas + = dynamic_cast(tempobj); + if(atlas==NULL) { + string msg=string("Object ") + + atlasname + + string(" is not an Oxs_Atlas."); + throw Oxs_Ext::Error(msg.c_str()); + } + atlaskey.Set(atlas); // Dependency lock is held until *this is deleted. + DeleteInitValue("atlas"); + + // Optional "default_value"; default is 0. + REAL8m default_value=0.0; + const vector* vsptr = FindInitValue("default_value"); + if(vsptr!=NULL) { + CheckInitValueParamCount("default_value",1); + default_value + = Nb_Atof((*FindInitValue("default_value"))[0].c_str()); + DeleteInitValue("default_value"); + } + + // Fill out value vector with default value + int i; + for(i=0;iGetRegionCount();i++) + values.push_back(default_value); + + // Get and fill value vector with non-default values + vsptr = FindInitValue("values"); + if(vsptr==NULL || vsptr->size()<1) { + string msg = "MIF input block for \"" + + string(InstanceName()) + + "\" missing specification for parameter \"values\""; + throw Oxs_Ext::Error(msg.c_str()); + } + Oxs_SplitList name_value; + for(i=0;isize();i++) { + name_value.Split((*vsptr)[i].c_str()); + if( name_value.Count() != 2) { + char buf[1024]; + Oc_Snprintf(buf,sizeof(buf), + "Error in MIF input block for \"%s\";" + " values[%d] sub-list must be a 2 element list," + " { region_name value }" + " (actual sub-list size: %d)", + InstanceName(),i,name_value.Count()); + throw Oxs_Ext::Error(buf); + } + INT4m region_id = atlas->GetRegionId(name_value[0]); + if(region_id<0) { + char buf[1024]; + Oc_Snprintf(buf,sizeof(buf), + "Error in MIF input block for \"%s\";" + " First entry in name_value[%d] sub-list, \"%s\"," + " is not a known region in atlas \"%s\"", + InstanceName(),i,name_value[0],atlas->InstanceName()); + throw Oxs_Ext::Error(buf); + } + values[region_id] = Nb_Atof(name_value[1]); + } + DeleteInitValue("values"); + + VerifyAllInitArgsUsed(); + } + + BOOL Oxs_AtlasScalarFieldInit::Init() + { return 1; } + + void + Oxs_AtlasScalarFieldInit::FillMeshValue + (const Oxs_Mesh* mesh, + Oxs_MeshValue& array) const + { + // Fill array with values based on atlas regions + UINT4m i; + UINT4m size=mesh->Size(); + array.AdjustSize(mesh); + const Oxs_Atlas* atlas = atlaskey.GetPtr(); + if(atlas->GetRegionCount() != values.size()) { + char buf[1024]; + 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(), + InstanceName(),atlas->InstanceName()); + } + ThreeVector loc; + for(i=0;iCenter(i,loc); + INT4m id = atlas->GetRegionId(loc); + if(id<0) { + char buf[1024]; + sprintf(buf,"Mesh point %d, (%g,%g,%g), outside atlas %s", + i,loc.x,loc.y,loc.z,atlas->InstanceName()); + throw Oxs_Ext::Error(buf); + } else { + array[i] = values[id]; + } + } + } diff -crN oommf-1.2a0/app/oxs/ext/atlasscalarfieldinit.h oommf/app/oxs/ext/atlasscalarfieldinit.h *** oommf-1.2a0/app/oxs/ext/atlasscalarfieldinit.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/atlasscalarfieldinit.h Tue Jan 16 01:09:15 2001 *************** *** 0 **** --- 1,42 ---- + /* FILE: atlasscalarfieldinit.h -*-Mode: c++-*- + * + * Atlas scalar field initializer, derived from Oxs_ScalarFieldInit + * class. + * + */ + + #ifndef _OXS_ATLASSCALARFIELDINIT + #define _OXS_ATLASSCALARFIELDINIT + + #include + #include + + #include "oc.h" + + #include "atlas.h" + #include "scalarfieldinit.h" + + /* End includes */ + + class Oxs_AtlasScalarFieldInit:public Oxs_ScalarFieldInit { + private: + Oxs_Key atlaskey; + vector values; + public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + virtual BOOL Init(); + Oxs_AtlasScalarFieldInit + (const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF input block parameters + + virtual ~Oxs_AtlasScalarFieldInit() {} + + virtual void FillMeshValue(const Oxs_Mesh* mesh, + Oxs_MeshValue& array) const; + + }; + + #endif // _OXS_ATLASSCALARFIELDINIT diff -crN oommf-1.2a0/app/oxs/ext/atlasvectorfieldinit.cc oommf/app/oxs/ext/atlasvectorfieldinit.cc *** oommf-1.2a0/app/oxs/ext/atlasvectorfieldinit.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/atlasvectorfieldinit.cc Fri Jan 19 22:34:30 2001 *************** *** 0 **** --- 1,150 ---- + /* FILE: atlasvectorfieldinit.cc -*-Mode: c++-*- + * + * Atlas vector field initializer, derived from Oxs_VectorFieldInit + * class. + * + */ + + #include + + #include "oc.h" + #include "nb.h" + + #include "util.h" + #include "threevector.h" + #include "meshvalue.h" + #include "director.h" + #include "atlas.h" + #include "atlasvectorfieldinit.h" + #include "energy.h" // Needed to make MSVC++ 5 happy + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_AtlasVectorFieldInit); + + /* End includes */ + + // Constructor + Oxs_AtlasVectorFieldInit::Oxs_AtlasVectorFieldInit( + const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp_, // Safe interpreter + const char* argstr) // MIF input block parameters + : Oxs_VectorFieldInit(name,newdtr,safe_interp_,argstr) + { + // Process arguments + CheckInitValueParamCount("atlas",1); + const string& atlasname = (*FindInitValue("atlas"))[0]; + Oxs_Ext* tempobj = director->FindExtObject(atlasname); + if(tempobj==NULL) { + string msg=string("Unable to identify Oxs_Atlas object with name ") + + atlasname; + throw Oxs_Ext::Error(msg.c_str()); + } + Oxs_Atlas* atlas + = dynamic_cast(tempobj); + if(atlas==NULL) { + string msg=string("Object ") + + atlasname + + string(" is not an Oxs_Atlas."); + throw Oxs_Ext::Error(msg.c_str()); + } + atlaskey.Set(atlas); // Dependency lock is held until *this is deleted. + DeleteInitValue("atlas"); + + BOOL set_norm=0; + REAL8m norm=0.; + const vector* normlist = FindInitValue("norm"); + if(normlist!=NULL) { + set_norm = 1; + norm = GetRealInitValue("norm"); + } + + // Optional "default_value"; default is (0.,0.,0.) + ThreeVector default_value(0.,0.,0.); + const vector* vsptr = FindInitValue("default_value"); + if(vsptr!=NULL) { + default_value = GetThreeVectorInitValue("default_value"); + } + if(set_norm) default_value.SetMag(norm); + + // Fill out value vector with default value + int i; + for(i=0;iGetRegionCount();i++) + values.push_back(default_value); + + // Get and fill value vector with non-default values + vsptr = FindInitValue("values"); + if(vsptr==NULL || vsptr->size()<1) { + string msg = "MIF input block for \"" + + string(InstanceName()) + + "\" missing specification for parameter \"values\""; + throw Oxs_Ext::Error(msg.c_str()); + } + Oxs_SplitList name_value; + for(i=0;isize();i++) { + name_value.Split((*vsptr)[i].c_str()); + if( name_value.Count() != 4) { + char buf[1024]; + Oc_Snprintf(buf,sizeof(buf), + "Error in MIF input block for \"%s\";" + " values[%d] sub-list must be a 4 element list," + " { region_name value.x value.y value.z }" + " (actual sub-list size: %d)", + InstanceName(),i,name_value.Count()); + throw Oxs_Ext::Error(buf); + } + INT4m region_id = atlas->GetRegionId(name_value[0]); + if(region_id<0) { + char buf[1024]; + Oc_Snprintf(buf,sizeof(buf), + "Error in MIF input block for \"%s\";" + " First entry in name_value[%d] sub-list, \"%s\"," + " is not a known region in atlas \"%s\"", + InstanceName(),i,name_value[0],atlas->InstanceName()); + throw Oxs_Ext::Error(buf); + } + values[region_id] = ThreeVector(Nb_Atof(name_value[1]), + Nb_Atof(name_value[2]), + Nb_Atof(name_value[3])); + if(set_norm) values[region_id].SetMag(norm); + } + DeleteInitValue("values"); + + VerifyAllInitArgsUsed(); + } + + BOOL Oxs_AtlasVectorFieldInit::Init() + { return 1; } + + void + Oxs_AtlasVectorFieldInit::FillMeshValue + (const Oxs_Mesh* mesh, + Oxs_MeshValue& array) const + { + // Fill array with values based on atlas regions + UINT4m i; + UINT4m size=mesh->Size(); + array.AdjustSize(mesh); + const Oxs_Atlas* atlas = atlaskey.GetPtr(); + if(atlas->GetRegionCount() != values.size()) { + char buf[1024]; + 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(), + InstanceName(),atlas->InstanceName()); + } + ThreeVector loc; + for(i=0;iCenter(i,loc); + INT4m id = atlas->GetRegionId(loc); + if(id<0) { + char buf[1024]; + sprintf(buf,"Mesh point %d, (%g,%g,%g), outside atlas %s", + i,loc.x,loc.y,loc.z,atlas->InstanceName()); + throw Oxs_Ext::Error(buf); + } else { + array[i] = values[id]; + } + } + } diff -crN oommf-1.2a0/app/oxs/ext/atlasvectorfieldinit.h oommf/app/oxs/ext/atlasvectorfieldinit.h *** oommf-1.2a0/app/oxs/ext/atlasvectorfieldinit.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/atlasvectorfieldinit.h Tue Jan 16 01:09:15 2001 *************** *** 0 **** --- 1,41 ---- + /* FILE: atlasvectorfieldinit.h -*-Mode: c++-*- + * + * Atlas vector field initializer, derived from Oxs_VectorFieldInit + * class. + * + */ + + #ifndef _OXS_ATLASVECTORFIELDINIT + #define _OXS_ATLASVECTORFIELDINIT + + #include + #include + + #include "oc.h" + + #include "atlas.h" + #include "vectorfieldinit.h" + + /* End includes */ + + class Oxs_AtlasVectorFieldInit:public Oxs_VectorFieldInit { + private: + Oxs_Key atlaskey; + vector values; + public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + virtual BOOL Init(); + Oxs_AtlasVectorFieldInit + (const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF input block parameters + + virtual ~Oxs_AtlasVectorFieldInit() {} + + virtual void FillMeshValue(const Oxs_Mesh* mesh, + Oxs_MeshValue& array) const; + }; + + #endif // _OXS_ATLASVECTORFIELDINIT diff -crN oommf-1.2a0/app/oxs/ext/cubicanisotropy.cc oommf/app/oxs/ext/cubicanisotropy.cc *** oommf-1.2a0/app/oxs/ext/cubicanisotropy.cc Wed Nov 1 20:49:14 2000 --- oommf/app/oxs/ext/cubicanisotropy.cc Mon Dec 18 19:50:30 2000 *************** *** 46,54 **** VerifyAllInitArgsUsed(); } - BOOL Oxs_CubicAnisotropy::Init() - { return 1; } - void Oxs_CubicAnisotropy::GetEnergyAndField (const Oxs_SimState& state, Oxs_MeshValue& energy, --- 46,51 ---- diff -crN oommf-1.2a0/app/oxs/ext/cubicanisotropy.h oommf/app/oxs/ext/cubicanisotropy.h *** oommf-1.2a0/app/oxs/ext/cubicanisotropy.h Wed Nov 1 20:49:14 2000 --- oommf/app/oxs/ext/cubicanisotropy.h Mon Dec 18 19:50:30 2000 *************** *** 34,40 **** public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_CubicAnisotropy(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 34,39 ---- diff -crN oommf-1.2a0/app/oxs/ext/demag.cc oommf/app/oxs/ext/demag.cc *** oommf-1.2a0/app/oxs/ext/demag.cc Tue Oct 24 16:36:48 2000 --- oommf/app/oxs/ext/demag.cc Tue Jan 16 01:09:15 2001 *************** *** 41,69 **** 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), A00(NULL),A01(NULL),A02(NULL),A11(NULL),A12(NULL),A22(NULL), xcomp(NULL),ycomp(NULL),zcomp(NULL) { ! CheckInitValueParamCount("mesh",1); ! const string& meshname = (*FindInitValue("mesh"))[0]; ! Oxs_Ext* tempobj = director->FindExtObject(meshname); ! if(tempobj==NULL) { ! string msg="Unable to identify Oxs_Mesh object with name " ! + meshname; ! throw Oxs_Ext::Error(msg.c_str()); ! } ! Oxs_RectangularMesh* mesh ! = dynamic_cast(tempobj); if(mesh==NULL) { ! string msg="Object " + meshname + " is not a rectangular mesh."; throw Oxs_Ext::Error(msg.c_str()); } - meshkey.Set(mesh); // Dependency lock is held until *this is deleted. - DeleteInitValue("mesh"); - - VerifyAllInitArgsUsed(); // Fill dimension variables xdim = mesh->DimX(); --- 41,78 ---- 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), A00(NULL),A01(NULL),A02(NULL),A11(NULL),A12(NULL),A22(NULL), xcomp(NULL),ycomp(NULL),zcomp(NULL) { + VerifyAllInitArgsUsed(); + } ! void Oxs_Demag::ReleaseMemory() ! { ! if(xcomp!=NULL) { delete[] xcomp; xcomp=NULL; } ! if(ycomp!=NULL) { delete[] ycomp; ycomp=NULL; } ! if(zcomp!=NULL) { delete[] zcomp; zcomp=NULL; } ! if(A00!=NULL) { delete[] A00; A00=NULL; } ! if(A01!=NULL) { delete[] A01; A01=NULL; } ! if(A02!=NULL) { delete[] A02; A02=NULL; } ! 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; ! } ! ! void Oxs_Demag::FillCoefficientArrays(const Oxs_Mesh* genmesh) const ! { // This routine is conceptually const. ! const Oxs_RectangularMesh* mesh ! = dynamic_cast(genmesh); if(mesh==NULL) { ! string msg=string("Object ") ! + string(genmesh->InstanceName()) ! + string(" is not a rectangular mesh."); throw Oxs_Ext::Error(msg.c_str()); } // Fill dimension variables xdim = mesh->DimX(); *************** *** 234,260 **** A12[aindex] = zcomp[pindex].real(); A22[aindex] = zcomp[pindex].imag(); } - - } - - void Oxs_Demag::ReleaseMemory() - { - if(xcomp!=NULL) { delete[] xcomp; xcomp=NULL; } - if(ycomp!=NULL) { delete[] ycomp; ycomp=NULL; } - if(zcomp!=NULL) { delete[] zcomp; zcomp=NULL; } - if(A00!=NULL) { delete[] A00; A00=NULL; } - if(A01!=NULL) { delete[] A01; A01=NULL; } - if(A02!=NULL) { delete[] A02; A02=NULL; } - 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; - } - - BOOL Oxs_Demag::Init() - { - return 1; } void Oxs_Demag::GetEnergyAndField --- 243,248 ---- *************** *** 263,275 **** Oxs_MeshValue& field ) const { ! // Check that the mesh hasn't changed. ! if(meshkey.KeyId() != state.mesh->Id()) { ! string msg="Input mesh to Oxs_Demag::GetEnergyAndField()" ! " routine of object " + string(InstanceName()) ! + " is different than the one used to initialize this object."; ! throw Oxs_Ext::Error(msg.c_str()); } const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); --- 251,263 ---- Oxs_MeshValue& field ) const { ! // (Re)-initialize mesh coefficient array if mesh has changed. ! if(mesh_id != state.mesh->Id()) { ! mesh_id = 0; // Safety ! FillCoefficientArrays(state.mesh); ! mesh_id = state.mesh->Id(); } + const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); diff -crN oommf-1.2a0/app/oxs/ext/demag.h oommf/app/oxs/ext/demag.h *** oommf-1.2a0/app/oxs/ext/demag.h Tue Oct 24 16:36:48 2000 --- oommf/app/oxs/ext/demag.h Tue Jan 16 01:09:15 2001 *************** *** 22,46 **** class Oxs_Demag:public Oxs_Energy { private: ! UINT4m xdim,ydim,zdim,totalsize; // Natural size ! UINT4m pxdim,pydim,pzdim,ptotalsize; // Padded size ! Oxs_Key meshkey; // 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. ! REAL8m *A00,*A01,*A02,*A11,*A12,*A22; ! MyComplex *xcomp,*ycomp,*zcomp; ! FFT3D fft; // All transforms are same size, so we need /// only one FFT3D object. UINT4m NextPowerOfTwo(UINT4m n) const; // Helper function void ReleaseMemory(); public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_Demag(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 22,47 ---- class Oxs_Demag:public Oxs_Energy { private: ! mutable UINT4m xdim,ydim,zdim,totalsize; // Natural size ! mutable UINT4m pxdim,pydim,pzdim,ptotalsize; // Padded size ! 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. + void FillCoefficientArrays(const Oxs_Mesh* mesh) const; + UINT4m NextPowerOfTwo(UINT4m n) const; // Helper function void ReleaseMemory(); public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. Oxs_Demag(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter diff -crN oommf-1.2a0/app/oxs/ext/eulerevolve.cc oommf/app/oxs/ext/eulerevolve.cc *** oommf-1.2a0/app/oxs/ext/eulerevolve.cc Thu Nov 2 19:04:25 2000 --- oommf/app/oxs/ext/eulerevolve.cc Mon Jan 22 04:11:36 2001 *************** *** 25,63 **** Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Evolver(name,newdtr,safe_interp,argstr) { // Process arguments ! const vector* vsptr; // Temp pointer ! gamma=2.21e5; // Default value ! vsptr = FindInitValue("gamma"); ! if(vsptr!=NULL) { ! CheckInitValueParamCount("gamma",1); ! gamma=Nb_Atof((*vsptr)[0].c_str()); ! DeleteInitValue("gamma"); ! } ! ! // alpha is required input ! CheckInitValueParamCount("alpha",1); ! alpha=Nb_Atof((*FindInitValue("alpha"))[0].c_str()); ! DeleteInitValue("alpha"); ! ! do_precess=1; // Default value ! vsptr = FindInitValue("do_precess"); ! if(vsptr!=NULL) { ! CheckInitValueParamCount("do_precess",1); ! do_precess=atoi((*vsptr)[0].c_str()); ! DeleteInitValue("do_precess"); ! } ! ! start_dm=0.01; // Default value ! vsptr = FindInitValue("start_dm"); ! if(vsptr!=NULL) { ! CheckInitValueParamCount("start_dm",1); ! start_dm=Nb_Atof((*vsptr)[0].c_str()); ! DeleteInitValue("start_dm"); ! } VerifyAllInitArgsUsed(); } --- 25,59 ---- Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Evolver(name,newdtr,safe_interp,argstr), ! energy_accum_count_limit(25), ! next_timestep(0.),state_id(0),max_dm_dt(0.),dE_dt(0.), ! total_energy(0.),total_energy_change(0.), ! max_dm_dt_output(this,InstanceName(),"Max dm/dt","deg/ns",0, ! &Oxs_EulerEvolve::UpdateDerivedOutputs,newdtr), ! dE_dt_output(this,InstanceName(),"dE/dt","J/s",0, ! &Oxs_EulerEvolve::UpdateDerivedOutputs,newdtr), ! total_energy_output(this,InstanceName(),"Total energy","J",0, ! &Oxs_EulerEvolve::UpdateDerivedOutputs,newdtr), ! dm_dt_output(this,InstanceName(),"dm/dt","rad/s",1, ! &Oxs_EulerEvolve::UpdateDerivedOutputs,newdtr), ! total_H_field_output(this,InstanceName(),"H","A/m",1, ! &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); ! ! gamma = GetRealInitValue("gamma",2.21e5); ! ! do_precess = GetIntInitValue("do_precess",1); ! ! start_dm = GetRealInitValue("start_dm",0.01); ! ! alpha = GetRealInitValue("alpha"); // alpha is required input VerifyAllInitArgsUsed(); } *************** *** 65,73 **** BOOL Oxs_EulerEvolve::Init() { next_timestep=0.0; ! state_id=0; max_dm_dt=-1; // Dummy value dE_dt=0; // Dummy value return 1; } --- 61,73 ---- BOOL Oxs_EulerEvolve::Init() { next_timestep=0.0; ! state_id=0; // Mark as invalid state max_dm_dt=-1; // Dummy value dE_dt=0; // Dummy value + total_energy=0.0; + total_energy_change=0.0; // Dummy value + energy_accum_count=energy_accum_count_limit; // Force cold count + /// on first pass return 1; } *************** *** 92,97 **** --- 92,98 ---- REAL8m max_dm_dt_sq=0.0; REAL8m dm_dt_sq; REAL8m dE_dt_sum=0.0; + dm_dt_.AdjustSize(&mesh_); for(UINT4m i=0;i current_state, Oxs_Key& next_state) { UINT4m size,i; // Mesh size and indexing variable const Oxs_SimState& cstate = current_state.GetReadReference(); ! Oxs_SimState& nstate = next_state.GetWriteReference(); ! nstate.valid_state=0; // Safety ! if(cstate.mesh->Id() != nstate.mesh->Id()) { throw Oxs_Ext::Error ("EulerEvolve::Step: Oxs_Mesh not fixed across steps."); } REAL8m stepsize = next_timestep; if( cstate.Id() != state_id || stepsize<=0.0) { ! energy.AdjustSize(cstate.mesh); ! mxH.AdjustSize(cstate.mesh); ! dm_dt.AdjustSize(cstate.mesh); ! director->GetTotalEnergyAndmxH(cstate,energy,mxH); Calculate_dm_dt(*(cstate.mesh),*(cstate.Ms), mxH,cstate.spin, dm_dt,max_dm_dt,dE_dt); --- 125,147 ---- Oxs_ConstKey current_state, Oxs_Key& next_state) { + const REAL8m max_step_increase = 1.25; + const REAL8m max_step_decrease = 0.5; + UINT4m size,i; // Mesh size and indexing variable const Oxs_SimState& cstate = current_state.GetReadReference(); ! Oxs_SimState& workstate = next_state.GetWriteReference(); ! if(cstate.mesh->Id() != workstate.mesh->Id()) { throw Oxs_Ext::Error ("EulerEvolve::Step: Oxs_Mesh not fixed across steps."); } REAL8m stepsize = next_timestep; if( cstate.Id() != state_id || stepsize<=0.0) { ! // Cached data out of data ! director->GetEnergyDensity(cstate,energy,&mxH,NULL); Calculate_dm_dt(*(cstate.mesh),*(cstate.Ms), mxH,cstate.spin, dm_dt,max_dm_dt,dE_dt); *************** *** 152,244 **** state_id = cstate.Id(); } ! if (!cstate.valid_state) { ! // cstate is invalid, but presumably it is valid after ! // this routine fills in what it knows. So copy cstate ! // to nstate, make what corrections we can, mark nstate ! // valid and return. ! nstate = cstate; ! nstate.last_timestep=0; ! nstate.iteration_count++; ! nstate.stage_iteration_count++; ! nstate.max_dm_dt = max_dm_dt; ! REAL8m total_energy=0.0; ! size = cstate.mesh->Size(); ! for(i=0;iVolume(i); ! } ! nstate.total_energy = total_energy; ! nstate.valid_state=1; ! next_state.GetReadReference(); // Release write lock ! state_id = nstate.Id(); ! next_timestep = stepsize; ! return 1; ! } ! ! // Negotiate with driver over size of next step ! nstate.last_timestep=stepsize; ! driver.FillStatePartB(nstate); BOOL forcestep=0; ! if(nstate.last_timestep>stepsize) { // driver wants to force this stepsize forcestep=1; } ! stepsize = nstate.last_timestep; ! nstate.elapsed_time = cstate.elapsed_time + stepsize; ! nstate.iteration_count = cstate.iteration_count + 1; ! nstate.stage_iteration_count = cstate.stage_iteration_count + 1; // Put new spin configuration in next_state ! size = nstate.spin.Size(); ThreeVector tempspin; for(i=0;iGetTotalEnergyAndmxH(nstate,new_energy,mxH); REAL8m dE=0.0; for(i=0;iVolume(i); } // Check step and adjust next_timestep ! if(!forcestep && dE>0.0) { ! nstate.valid_state=0; // Safety ! next_state.GetReadReference(); // Release write lock ! next_timestep=stepsize/2.0; return 0; // Reject step } - REAL8m expected_dE = dE_dt * stepsize; - // NOTE: Both dE and expected_dE are negative - if(dE > 0.5*expected_dE) next_timestep = 0.5*stepsize; - else { - next_timestep = stepsize * 1.2; - if(dE > expected_dE) next_timestep *= dE/expected_dE; - /// Because both dE's are <0, the ratio dE/expected_dE - /// in the previous line is <1, i.e., dE>expected_dE - /// means we got less of a drop than expected. - } ! // Otherwise, accept step ! Calculate_dm_dt(*(nstate.mesh), ! *(nstate.Ms), ! mxH,nstate.spin, ! dm_dt,max_dm_dt,dE_dt); ! nstate.max_dm_dt = max_dm_dt; ! nstate.total_energy = cstate.total_energy + dE; ! nstate.valid_state=1; ! next_state.GetReadReference(); // Release write lock energy.Swap(new_energy); state_id = nstate.Id(); return 1; // Good step } --- 153,383 ---- state_id = cstate.Id(); } ! // Negotiate with driver over size of next step ! workstate.last_timestep=stepsize; ! driver.FillStatePartB(workstate); BOOL forcestep=0; ! if(workstate.last_timestep>stepsize) { // driver wants to force this stepsize forcestep=1; } ! stepsize = workstate.last_timestep; ! ! if(stepsize*max_dm_dt* H_ptr = &new_H; ! 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) { ! total_H_field_output.cache.state_id = nstate.Id(); ! } ! REAL8m dE=0.0; for(i=0;iVolume(i); } + // 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 max_error=0; + for(i=0;imax_error) max_error = temp_error; + } + max_error = sqrt(max_error)/2.0; // Actual (local) error + /// estimate is max_error * stepsize + + + // Estimate ideal stepsize using quadratic fit to results. + // First calculate dE/dM|t1 * dm/dt|t0 (see NOTES II, p66, + // 13-Dec-2000): + REAL8m dE_dt_1 = 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; ! if(next_timestept_ideal) next_timestep = t_ideal; ! if(next_timestepVolume(i); ! } ! energy_accum_count=0; ! } ! total_energy_change = dE; energy.Swap(new_energy); state_id = nstate.Id(); return 1; // Good step } + + void Oxs_EulerEvolve::UpdateDerivedOutputs(const Oxs_SimState& state) + { // This routine fills all the Oxs_EulerEvolve Oxs_ScalarOutput's to + // the appropriate value based on the import "state". Also any of + // Oxs_VectorOutput's that have CacheRequest enabled are filled. + max_dm_dt_output.cache.state_id + = dE_dt_output.cache.state_id + = total_energy_output.cache.state_id = 0; + if(state.Id()==state_id) { + // Use previously calculated values + max_dm_dt_output.cache.value=max_dm_dt*(180e-9/PI); + /// Convert from radians/second to deg/ns + dE_dt_output.cache.value=dE_dt; + total_energy_output.cache.value=total_energy; + if(dm_dt_output.GetCacheRequestCount()>0) { + dm_dt_output.cache.value=dm_dt; + dm_dt_output.cache.state_id=state_id; + } + } else { + // Calculate from scratch + UINT4m size=state.mesh->Size(); + Oxs_MeshValue* H_ptr = NULL; + if(total_H_field_output.GetCacheRequestCount()>0 + && total_H_field_output.cache.state_id != state.Id()) { + H_ptr = &total_H_field_output.cache.value; + total_H_field_output.cache.state_id = 0; + } + director->GetEnergyDensity(state,new_energy,&mxH,H_ptr); + if(total_H_field_output.GetCacheRequestCount()>0 + && total_H_field_output.cache.state_id != state.Id()) { + total_H_field_output.cache.state_id = state.Id(); + } + REAL8m energy_sum=0.; + for(UINT4m i=0;iVolume(i); + } + total_energy_output.cache.value=energy_sum; + + Oxs_MeshValue* dm_dt_ptr = &dm_dt; + if(dm_dt_output.GetCacheRequestCount()>0 + && dm_dt_output.cache.state_id != state.Id()) { + dm_dt_ptr = &dm_dt_output.cache.value; + dm_dt_output.cache.state_id=0; + } + Calculate_dm_dt(*(state.mesh),*(state.Ms),mxH,state.spin, + *dm_dt_ptr,max_dm_dt_output.cache.value, + dE_dt_output.cache.value); + if(dm_dt_output.GetCacheRequestCount()>0 + && 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; + /// Convert from radians/second to deg/ns + } + max_dm_dt_output.cache.state_id + = dE_dt_output.cache.state_id + = total_energy_output.cache.state_id = state.Id(); + + if(total_H_field_output.GetCacheRequestCount()>0 + && total_H_field_output.cache.state_id != state.Id()) { + director->GetEnergyDensity(state,new_energy,NULL, + &total_H_field_output.cache.value); + total_H_field_output.cache.state_id = state.Id(); + } + } + + diff -crN oommf-1.2a0/app/oxs/ext/eulerevolve.h oommf/app/oxs/ext/eulerevolve.h *** oommf-1.2a0/app/oxs/ext/eulerevolve.h Thu Nov 2 19:04:25 2000 --- oommf/app/oxs/ext/eulerevolve.h Mon Jan 22 04:11:36 2001 *************** *** 15,20 **** --- 15,35 ---- class Oxs_EulerEvolve:public Oxs_Evolver { private: + // Step control parameters + REAL8m allowed_error; + REAL8m step_aggression; + + // The total energy field in Oxs_SimState is computed by accumulating + // the dE into the total energy from the previous state. It order to + // keep this value from becoming too inaccurate, we recalculate total + // energy directly from the energy densities after each + // energy_accum_count_limit passes. NB: The code here assumes that a + // single sequence of states is being fed to this routine. If this + // is not the case, then the accum count needs to be tied to the state + // id. + const UINT4m energy_accum_count_limit ; + UINT4m energy_accum_count; + // The following evolution constants are uniform for now. These // should be changed to arrays in the future. REAL8m gamma; // Landau-Lifschitz gyromagnetic ratio *************** *** 33,44 **** --- 48,71 ---- UINT4m state_id; REAL8m max_dm_dt; REAL8m dE_dt; + REAL8m total_energy; + REAL8m total_energy_change; Oxs_MeshValue dm_dt; Oxs_MeshValue energy; + // Outputs + void UpdateDerivedOutputs(const Oxs_SimState&); + Oxs_ScalarOutput max_dm_dt_output; + Oxs_ScalarOutput dE_dt_output; + Oxs_ScalarOutput total_energy_output; + Oxs_VectorFieldOutput dm_dt_output; + Oxs_VectorFieldOutput total_H_field_output; + // Scratch space Oxs_MeshValue new_energy; + Oxs_MeshValue new_dm_dt; Oxs_MeshValue mxH; + Oxs_MeshValue new_H; void Calculate_dm_dt (const Oxs_Mesh& mesh_, *************** *** 55,63 **** /// automatically generated by the OXS_EXT_REGISTER macro. virtual BOOL Init(); Oxs_EulerEvolve(const char* name, // Child instance id ! Oxs_Director* newdtr, // App director ! Tcl_Interp* safe_interp, // Safe interpreter ! const char* argstr); // MIF input block parameters virtual ~Oxs_EulerEvolve(); virtual BOOL --- 82,90 ---- /// automatically generated by the OXS_EXT_REGISTER macro. virtual BOOL Init(); Oxs_EulerEvolve(const char* name, // Child instance id ! Oxs_Director* newdtr, // App director ! Tcl_Interp* safe_interp, // Safe interpreter ! const char* argstr); // MIF input block parameters virtual ~Oxs_EulerEvolve(); virtual BOOL diff -crN oommf-1.2a0/app/oxs/ext/exchange6ngbr.cc oommf/app/oxs/ext/exchange6ngbr.cc *** oommf-1.2a0/app/oxs/ext/exchange6ngbr.cc Wed Sep 27 16:26:17 2000 --- oommf/app/oxs/ext/exchange6ngbr.cc Tue Jan 16 23:56:26 2001 *************** *** 5,10 **** --- 5,11 ---- * */ + #include "atlas.h" #include "nb.h" #include "key.h" #include "director.h" *************** *** 28,66 **** Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Energy(name,newdtr,safe_interp,argstr) { // Process arguments ! CheckInitValueParamCount("A",1); ! A=Nb_Atof((*FindInitValue("A"))[0].c_str()); ! DeleteInitValue("A"); ! ! CheckInitValueParamCount("mesh",1); ! const string& meshname = (*FindInitValue("mesh"))[0]; ! Oxs_Ext* tempobj = director->FindExtObject(meshname); if(tempobj==NULL) { ! string msg=string("Unable to identifu Oxs_Mesh object with name ") ! + meshname; throw Oxs_Ext::Error(msg.c_str()); } ! Oxs_RectangularMesh* mesh ! = dynamic_cast(tempobj); ! if(mesh==NULL) { ! string msg="Object " + meshname + " is not a rectangular mesh."; throw Oxs_Ext::Error(msg.c_str()); } ! meshkey.Set(mesh); // Dependency lock is held until *this is deleted. ! DeleteInitValue("mesh"); VerifyAllInitArgsUsed(); } Oxs_Exchange6Ngbr::~Oxs_Exchange6Ngbr() - {} - - BOOL Oxs_Exchange6Ngbr::Init() { ! return 1; } void Oxs_Exchange6Ngbr::GetEnergyAndField --- 29,138 ---- Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Energy(name,newdtr,safe_interp,argstr), ! A_size(0), A(NULL), mesh_id(0) { // Process arguments ! CheckInitValueParamCount("atlas",1); ! const string& atlasname = (*FindInitValue("atlas"))[0]; ! Oxs_Ext* tempobj = director->FindExtObject(atlasname); if(tempobj==NULL) { ! string msg=string("Unable to identify Oxs_Atlas object with name ") ! + atlasname; throw Oxs_Ext::Error(msg.c_str()); } ! Oxs_Atlas* atlas ! = dynamic_cast(tempobj); ! if(atlas==NULL) { ! string msg=string("Object ") ! + atlasname ! + string(" is not an Oxs_Atlas."); ! throw Oxs_Ext::Error(msg.c_str()); ! } ! atlaskey.Set(atlas); // Dependency lock is held until *this is deleted. ! DeleteInitValue("atlas"); ! ! // Check for optional default_A parameter; default is 0. ! REAL8m default_A=0.0; ! const vector* vsptr = FindInitValue("default_A"); ! if(vsptr!=NULL) { ! CheckInitValueParamCount("default_A",1); ! default_A ! = Nb_Atof((*FindInitValue("default_A"))[0].c_str()); ! DeleteInitValue("default_A"); ! } ! ! // Allocate A matrix. Because raw pointers are used, a memory ! // leak will occur if an exception is thrown inside this constructor. ! A_size = atlas->GetRegionCount(); ! if(A_size<1) { ! string msg=string("Oxs_Atlas object ") ! + atlasname ! + string(" must contain at least one region."); throw Oxs_Ext::Error(msg.c_str()); } ! A = new REAL8m*[A_size]; ! A[0] = new REAL8m[A_size*A_size]; ! UINT4m i; ! for(i=1;isize()<1) { ! string msg = "MIF input block for \"" ! + string(InstanceName()) ! + "\" missing specification for parameter \"A\""; ! throw Oxs_Ext::Error(msg.c_str()); ! } ! Oxs_SplitList pair_list; ! for(i=0;isize();i++) { ! pair_list.Split((*vsptr)[i].c_str()); ! if( pair_list.Count() != 3) { ! char buf[512]; ! Oc_Snprintf(buf,sizeof(buf), ! "Error in MIF input block for \"%s\";" ! " A[%d] sub-list must be a 3 element list," ! " { region-1 region-2 A-value }" ! " (actual sub-list size: %d)", ! InstanceName(),i,pair_list.Count()); ! throw Oxs_Ext::Error(buf); ! } ! INT4m i1 = atlas->GetRegionId(pair_list[0]); ! INT4m i2 = atlas->GetRegionId(pair_list[1]); ! REAL8m Apair = Nb_Atof(pair_list[2]); ! if(i1<0) { ! char buf[512]; ! Oc_Snprintf(buf,sizeof(buf), ! "Error in MIF input block for \"%s\";" ! " First entry in A[%d] sub-list, \"%s\"," ! " is not a known region in atlas \"%s\"", ! InstanceName(),i,pair_list[0],atlas->InstanceName()); ! throw Oxs_Ext::Error(buf); ! } ! if(i2<0) { ! char buf[512]; ! Oc_Snprintf(buf,sizeof(buf), ! "Error in MIF input block for \"%s\";" ! " Second entry in A[%d] sub-list, \"%s\"," ! " is not a known region in atlas \"%s\"", ! InstanceName(),i,pair_list[1],atlas->InstanceName()); ! throw Oxs_Ext::Error(buf); ! } ! A[i1][i2]=Apair; ! A[i2][i1]=Apair; // A should be symmetric ! } ! DeleteInitValue("A"); VerifyAllInitArgsUsed(); } Oxs_Exchange6Ngbr::~Oxs_Exchange6Ngbr() { ! if(A_size>0 && A!=NULL) { ! delete[] A[0]; ! delete[] A; ! } } void Oxs_Exchange6Ngbr::GetEnergyAndField *************** *** 69,93 **** Oxs_MeshValue& field ) const { ! // Check that the mesh hasn't changed. ! if(meshkey.KeyId() != state.mesh->Id()) { ! string msg="Input mesh to Oxs_Exchange6Ngbr::GetEnergyAndField()" ! " routine of object " + string(InstanceName()) ! + " is different than the one used to initialize this object."; ! throw Oxs_Ext::Error(msg.c_str()); } const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms_inverse = *(state.Ms_inverse); ! const Oxs_RectangularMesh* mesh = meshkey.GetPtr(); UINT4m xdim = mesh->DimX(); UINT4m ydim = mesh->DimY(); UINT4m zdim = mesh->DimZ(); UINT4m xydim = xdim*ydim; ! REAL8m wgtx = -A/(mesh->EdgeLengthX()*mesh->EdgeLengthX()); ! REAL8m wgty = -A/(mesh->EdgeLengthY()*mesh->EdgeLengthY()); ! REAL8m wgtz = -A/(mesh->EdgeLengthZ()*mesh->EdgeLengthZ()); REAL8m hcoef = -2/MU0; --- 141,186 ---- Oxs_MeshValue& field ) const { ! // See if mesh and/or atlas has changed. ! if(mesh_id != state.mesh->Id() || !atlaskey.SameState()) { ! // Setup region mapping ! mesh_id = 0; // Safety ! const Oxs_Atlas* atlas = atlaskey.GetPtr(); ! UINT4m size = state.mesh->Size(); ! region_id.AdjustSize(state.mesh); ! ThreeVector location; ! for(UINT4m i=0;iCenter(i,location); ! if((region_id[i] = atlas->GetRegionId(location))<0) { ! string msg="Import mesh to Oxs_Exchange6Ngbr::GetEnergyAndField()" ! " routine of object " + string(InstanceName()) ! + string(" has points outside atlas ") ! + string(atlas->InstanceName()); ! throw Oxs_Ext::Error(msg.c_str()); ! } ! } ! mesh_id = state.mesh->Id(); } const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms_inverse = *(state.Ms_inverse); ! const Oxs_RectangularMesh* mesh ! = dynamic_cast(state.mesh); ! if(mesh==NULL) { ! string msg="Import mesh to Oxs_Exchange6Ngbr::GetEnergyAndField()" ! " routine of object " + string(InstanceName()) ! + " is not an Oxs_RectangularMesh object."; ! throw Oxs_Ext::Error(msg.c_str()); ! } ! UINT4m xdim = mesh->DimX(); UINT4m ydim = mesh->DimY(); UINT4m zdim = mesh->DimZ(); UINT4m xydim = xdim*ydim; ! REAL8m wgtx = -1.0/(mesh->EdgeLengthX()*mesh->EdgeLengthX()); ! REAL8m wgty = -1.0/(mesh->EdgeLengthY()*mesh->EdgeLengthY()); ! REAL8m wgtz = -1.0/(mesh->EdgeLengthZ()*mesh->EdgeLengthZ()); REAL8m hcoef = -2/MU0; *************** *** 102,131 **** field[i].Set(0.,0.,0.); continue; } 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(x0) { UINT4m j = i-xydim; ! REAL8m Apair = Arow[region_id[j]]; ! if(Ms_inverse[j]!=0.0) sum += Apair*wgtz*(spin[j] - base); } if(y>0) { UINT4m j = i-xdim; ! REAL8m Apair = Arow[region_id[j]]; ! if(Ms_inverse[j]!=0.0) sum += Apair*wgty*(spin[j] - base); } if(x>0) { UINT4m j = i-1; ! REAL8m Apair = Arow[region_id[j]]; ! if(Ms_inverse[j]!=0.0) sum += Apair*wgtx*(spin[j] - base); } if(x meshkey; public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_Exchange6Ngbr(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 21,34 ---- class Oxs_Exchange6Ngbr:public Oxs_Energy { private: ! UINT4m A_size; ! REAL8m** A; ! Oxs_Key atlaskey; ! mutable UINT4m mesh_id; ! mutable Oxs_MeshValue region_id; public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. Oxs_Exchange6Ngbr(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter diff -crN oommf-1.2a0/app/oxs/ext/fixedzeeman.cc oommf/app/oxs/ext/fixedzeeman.cc *** oommf-1.2a0/app/oxs/ext/fixedzeeman.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/fixedzeeman.cc Tue Jan 16 18:19:54 2001 *************** *** 0 **** --- 1,70 ---- + /* FILE: fixedzeeman.cc -*-Mode: c++-*- + * + * Fixed (in time) Zeeman energy/field, derived from Oxs_Energy class. + * + */ + + #include // auto_ptr template + + #include "oc.h" + #include "nb.h" + #include "threevector.h" + #include "energy.h" + #include "simstate.h" + #include "mesh.h" + #include "meshvalue.h" + #include "vectorfieldinit.h" + #include "fixedzeeman.h" + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_FixedZeeman); + + /* End includes */ + + + // Constructor + Oxs_FixedZeeman::Oxs_FixedZeeman( + const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr) // MIF input block parameters + : Oxs_Energy(name,newdtr,safe_interp,argstr), mesh_id(0) + { + // Process arguments + // Note: Stroustrup specifies an auto_ptr .reset() member function, + // but that is apparently not supported by some common STL's. As + // a workaround, create a temporary auto_ptr, and use operator=(). + auto_ptr + bar(NewVectorFieldInit(safe_interp,"field")); + fixedfield_init = bar; + VerifyAllInitArgsUsed(); + } + + void Oxs_FixedZeeman::GetEnergyAndField + (const Oxs_SimState& state, + Oxs_MeshValue& energy, + Oxs_MeshValue& field + ) const + { + UINT4m size = state.mesh->Size(); + if(size<1) return; // Nothing to do + if(mesh_id != state.mesh->Id()) { + // This is either the first pass through, or else mesh + // has changed. + mesh_id = 0; + fixedfield_init->FillMeshValue(state.mesh,fixedfield); + mesh_id = state.mesh->Id(); + } + + const Oxs_MeshValue& spin = state.spin; + const Oxs_MeshValue& Ms = *(state.Ms); + UINT4m i=0; + do { + field[i] = fixedfield[i]; + energy[i] = -MU0*Ms[i]*(fixedfield[i]*spin[i]); + ++i; + } while(i // auto_ptr template + + #include "oc.h" + #include "director.h" + #include "threevector.h" + #include "energy.h" + #include "simstate.h" + #include "mesh.h" + #include "meshvalue.h" + #include "vectorfieldinit.h" + + /* End includes */ + + class Oxs_FixedZeeman:public Oxs_Energy { + private: + mutable UINT4m mesh_id; + auto_ptr fixedfield_init; + mutable Oxs_MeshValue fixedfield; + /// fixedfield is a cached value filled by + /// fixedfield_init when a change in mesh is + /// detected. + public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + Oxs_FixedZeeman(const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF input block parameters + + virtual ~Oxs_FixedZeeman() {} + + virtual void GetEnergyAndField(const Oxs_SimState& state, + Oxs_MeshValue& energy, + Oxs_MeshValue& field + ) const; + }; + + + #endif // _OXS_FIXEDZEEMAN diff -crN oommf-1.2a0/app/oxs/ext/planerandomvectorfieldinit.cc oommf/app/oxs/ext/planerandomvectorfieldinit.cc *** oommf-1.2a0/app/oxs/ext/planerandomvectorfieldinit.cc Thu Nov 2 19:04:46 2000 --- oommf/app/oxs/ext/planerandomvectorfieldinit.cc Fri Dec 8 01:19:51 2000 *************** *** 43,49 **** } BOOL Oxs_PlaneRandomVectorFieldInit::Init() ! { return 1; } void Oxs_PlaneRandomVectorFieldInit::FillMeshValue --- 43,51 ---- } BOOL Oxs_PlaneRandomVectorFieldInit::Init() ! { ! return 1; ! } void Oxs_PlaneRandomVectorFieldInit::FillMeshValue diff -crN oommf-1.2a0/app/oxs/ext/randomvectorfieldinit.cc oommf/app/oxs/ext/randomvectorfieldinit.cc *** oommf-1.2a0/app/oxs/ext/randomvectorfieldinit.cc Wed Nov 1 20:49:14 2000 --- oommf/app/oxs/ext/randomvectorfieldinit.cc Fri Dec 8 01:19:51 2000 *************** *** 30,40 **** // Process arguments. min_norm=GetRealInitValue("min_norm"); max_norm=GetRealInitValue("max_norm"); VerifyAllInitArgsUsed(); } BOOL Oxs_RandomVectorFieldInit::Init() ! { return 1; } void Oxs_RandomVectorFieldInit::FillMeshValue --- 30,43 ---- // Process arguments. min_norm=GetRealInitValue("min_norm"); max_norm=GetRealInitValue("max_norm"); + VerifyAllInitArgsUsed(); } BOOL Oxs_RandomVectorFieldInit::Init() ! { ! return 1; ! } void Oxs_RandomVectorFieldInit::FillMeshValue diff -crN oommf-1.2a0/app/oxs/ext/rectangularmesh.cc oommf/app/oxs/ext/rectangularmesh.cc *** oommf-1.2a0/app/oxs/ext/rectangularmesh.cc Fri Oct 6 18:33:56 2000 --- oommf/app/oxs/ext/rectangularmesh.cc Tue Jan 16 01:09:15 2001 *************** *** 5,15 **** */ #include "vf.h" #include "meshvalue.h" #include "rectangularmesh.h" #include "director.h" #include "nb.h" - #include "rectangularregion.h" #include "energy.h" // Needed to make MSVC++ 5 happy #include "util.h" --- 5,15 ---- */ #include "vf.h" + #include "atlas.h" #include "meshvalue.h" #include "rectangularmesh.h" #include "director.h" #include "nb.h" #include "energy.h" // Needed to make MSVC++ 5 happy #include "util.h" *************** *** 35,61 **** cellsize.z=Nb_Atof((*FindInitValue("cellsize"))[2].c_str()); DeleteInitValue("cellsize"); ! CheckInitValueParamCount("region",1); Oxs_Ext* tempobj ! = director->FindExtObject((*FindInitValue("region"))[0]); if(tempobj==NULL) { ! string msg=string("Oxs_RectangularRegion object (region) with name ") ! + (*FindInitValue("region"))[0] + string(" either not found, or name is not unique"); throw Oxs_Ext::Error(msg.c_str()); } ! const Oxs_RectangularRegion* region ! = dynamic_cast(tempobj); ! if(region==NULL) { ! string msg=string("Ext object (region) with name ") ! + (*FindInitValue("region"))[0] ! + string(" is not of Oxs_RectangularRegion type"); throw Oxs_Ext::Error(msg.c_str()); } ! DeleteInitValue("region"); ! if(cellsize.x<=0.0 || cellsize.y<=0.0 || cellsize.z<=0.0 ! || region==NULL) { string msg="Invalid MIF input block detected for object " + string(InstanceName()); throw Oxs_Ext::Error(msg.c_str()); --- 35,60 ---- cellsize.z=Nb_Atof((*FindInitValue("cellsize"))[2].c_str()); DeleteInitValue("cellsize"); ! CheckInitValueParamCount("atlas",1); Oxs_Ext* tempobj ! = director->FindExtObject((*FindInitValue("atlas"))[0]); if(tempobj==NULL) { ! string msg=string("Oxs_Atlas object with name ") ! + (*FindInitValue("atlas"))[0] + string(" either not found, or name is not unique"); throw Oxs_Ext::Error(msg.c_str()); } ! const Oxs_Atlas* atlas ! = dynamic_cast(tempobj); ! if(atlas==NULL) { ! string msg=string("Ext object (atlas) with name ") ! + (*FindInitValue("atlas"))[0] ! + string(" is not of Oxs_Atlas type"); throw Oxs_Ext::Error(msg.c_str()); } ! DeleteInitValue("atlas"); ! if(cellsize.x<=0.0 || cellsize.y<=0.0 || cellsize.z<=0.0) { string msg="Invalid MIF input block detected for object " + string(InstanceName()); throw Oxs_Ext::Error(msg.c_str()); *************** *** 65,71 **** cellvolume=cellsize.x*cellsize.y*cellsize.z; Oxs_Box box; ! region->GetExtents(box); REAL8m xrange = box.GetMaxX() - box.GetMinX(); REAL8m yrange = box.GetMaxY() - box.GetMinY(); REAL8m zrange = box.GetMaxZ() - box.GetMinZ(); --- 64,70 ---- cellvolume=cellsize.x*cellsize.y*cellsize.z; Oxs_Box box; ! atlas->GetWorldExtents(box); REAL8m xrange = box.GetMaxX() - box.GetMinX(); REAL8m yrange = box.GetMaxY() - box.GetMinY(); REAL8m zrange = box.GetMaxZ() - box.GetMinZ(); diff -crN oommf-1.2a0/app/oxs/ext/rectangularregion.cc oommf/app/oxs/ext/rectangularregion.cc *** oommf-1.2a0/app/oxs/ext/rectangularregion.cc Mon Aug 14 02:26:33 2000 --- oommf/app/oxs/ext/rectangularregion.cc Wed Dec 31 19:00:00 1969 *************** *** 1,55 **** - /* FILE: rectangularregion.cc -*-Mode: c++-*- - * - * Concrete region class, derived from Oxs_Region class. - * - */ - - #include "rectangularregion.h" - - // Oxs_Ext registration support - OXS_EXT_REGISTER(Oxs_RectangularRegion); - - /* End includes */ - - - // Constructor - Oxs_RectangularRegion::Oxs_RectangularRegion( - const char* name, // Child instance id - Oxs_Director* newdtr, // App director - Tcl_Interp* safe_interp, // Safe interpreter - const char* argstr) // MIF input block parameters - : Oxs_Region(name,newdtr,safe_interp,argstr) - { - // 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"); - - box.Set(xrange[0],xrange[1], - yrange[0],yrange[1], - zrange[0],zrange[1]); - - DeleteInitValue("xrange"); - DeleteInitValue("yrange"); - DeleteInitValue("zrange"); - VerifyAllInitArgsUsed(); - } - - - BOOL Oxs_RectangularRegion::Init() - { return 1; } - - void Oxs_RectangularRegion::GetExtents(Oxs_Box &mybox) const - { - mybox=box; - } - - Oxs_RectangularRegion::~Oxs_RectangularRegion() - {} - - --- 0 ---- diff -crN oommf-1.2a0/app/oxs/ext/rectangularregion.h oommf/app/oxs/ext/rectangularregion.h *** oommf-1.2a0/app/oxs/ext/rectangularregion.h Mon Aug 14 02:26:33 2000 --- oommf/app/oxs/ext/rectangularregion.h Wed Dec 31 19:00:00 1969 *************** *** 1,31 **** - /* FILE: rectangularregion.h -*-Mode: c++-*- - * - * Abstract region class, derived from OXS extension class. - * - */ - - #ifndef _OXS_RECTANGULARREGION - #define _OXS_RECTANGULARREGION - - #include "region.h" - #include "util.h" - /* End includes */ - - class Oxs_RectangularRegion:public Oxs_Region { - private: - Oxs_Box box; - public: - virtual const char* ClassName() const; // ClassName() is - /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); - Oxs_RectangularRegion - ( const char* name, // Child instance id - Oxs_Director* newdtr, // App director - Tcl_Interp* safe_interp, // Safe interpreter - const char* argstr); // MIF input block parameters - void GetExtents(Oxs_Box &mybox) const; - ~Oxs_RectangularRegion(); - }; - - - #endif // _OXS_RECTANGULARREGION --- 0 ---- diff -crN oommf-1.2a0/app/oxs/ext/rectangularsection.cc oommf/app/oxs/ext/rectangularsection.cc *** oommf-1.2a0/app/oxs/ext/rectangularsection.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/rectangularsection.cc Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,63 ---- + /* FILE: rectangularsection.cc -*-Mode: c++-*- + * + * Concrete section class, derived from Oxs_Section class. + * + */ + + #include "rectangularsection.h" + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_RectangularSection); + + /* End includes */ + + + // Constructor + Oxs_RectangularSection::Oxs_RectangularSection( + const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr) // MIF input block parameters + : Oxs_Section(name,newdtr,safe_interp,argstr) + { + // 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"); + + box.Set(xrange[0],xrange[1], + yrange[0],yrange[1], + zrange[0],zrange[1]); + + DeleteInitValue("xrange"); + DeleteInitValue("yrange"); + DeleteInitValue("zrange"); + VerifyAllInitArgsUsed(); + } + + + BOOL Oxs_RectangularSection::Init() + { return 1; } + + void Oxs_RectangularSection::GetExtents(Oxs_Box &mybox) const + { + mybox=box; + } + + BOOL Oxs_RectangularSection::IsIn(const ThreeVector& point) const + { // Returns 1 if point is inside section, 0 otherwise. + if(point.x=box.GetMaxX()) return 0; + if(point.y=box.GetMaxY()) return 0; + if(point.z=box.GetMaxZ()) return 0; + return 1; + } + + Oxs_RectangularSection::~Oxs_RectangularSection() + {} + + diff -crN oommf-1.2a0/app/oxs/ext/rectangularsection.h oommf/app/oxs/ext/rectangularsection.h *** oommf-1.2a0/app/oxs/ext/rectangularsection.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/rectangularsection.h Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,35 ---- + /* FILE: rectangularsection.h -*-Mode: c++-*- + * + * Abstract section class, derived from OXS extension class. + * + */ + + #ifndef _OXS_RECTANGULARSECTION + #define _OXS_RECTANGULARSECTION + + #include "section.h" + #include "util.h" + /* End includes */ + + class Oxs_RectangularSection:public Oxs_Section { + private: + Oxs_Box box; + public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + virtual BOOL Init(); + Oxs_RectangularSection + ( const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF input block parameters + virtual void GetExtents(Oxs_Box &mybox) const; + virtual BOOL IsIn(const ThreeVector& point) const; + /// Returns 1 if point is inside section, 0 otherwise. + /// The lower bound on each coordinate is considered + /// included in the section, the upper bound is excluded. + ~Oxs_RectangularSection(); + }; + + + #endif // _OXS_RECTANGULARSECTION diff -crN oommf-1.2a0/app/oxs/ext/scriptvectorfieldinit.cc oommf/app/oxs/ext/scriptvectorfieldinit.cc *** oommf-1.2a0/app/oxs/ext/scriptvectorfieldinit.cc Thu Sep 21 15:55:10 2000 --- oommf/app/oxs/ext/scriptvectorfieldinit.cc Fri Jan 19 22:34:30 2001 *************** *** 29,35 **** Tcl_Interp* safe_interp_, // Safe interpreter const char* argstr) // MIF input block parameters : Oxs_VectorFieldInit(name,newdtr,safe_interp_,argstr), ! safe_interp(safe_interp_),set_norm(0),norm(0) { // Process arguments. const vector* normlist = FindInitValue("norm"); --- 29,35 ---- Tcl_Interp* safe_interp_, // Safe interpreter const char* argstr) // MIF input block parameters : Oxs_VectorFieldInit(name,newdtr,safe_interp_,argstr), ! safe_interp(safe_interp_),set_norm(0),norm(0.) { // Process arguments. const vector* normlist = FindInitValue("norm"); diff -crN oommf-1.2a0/app/oxs/ext/sectionatlas.cc oommf/app/oxs/ext/sectionatlas.cc *** oommf-1.2a0/app/oxs/ext/sectionatlas.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/sectionatlas.cc Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,164 ---- + /* FILE: sectionatlas.cc -*-Mode: c++-*- + * + * Section atlas class, derived from OXS extension class. + * + */ + + #include "sectionatlas.h" + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_SectionAtlas); + + /* End includes */ + + + // Constructor + Oxs_SectionAtlas::Oxs_SectionAtlas + ( 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) + { + // Use Tcl_SplitList to break argstr into components + Oxs_SplitList arglist; + if(arglist.Split(argstr)!=TCL_OK) { + // Input string not a valid Tcl list; Throw exception + string msg= string("MIF input block for ") + + string(InstanceName()) + + string(" not a valid Tcl list: ") + + string(argstr); + throw Oxs_Ext::Error(msg.c_str()); + } + if(arglist.Count()%2 != 0) { + // Input string is not a list of pairs; Throw exception + string msg=string("MIF input block for ") + + string(InstanceName()) + + string(" does not have an even number of elements: ") + + string(argstr); + throw Oxs_Ext::Error(msg.c_str()); + } + + // Each pair is a name + section init string + Oxs_Box bbox,tbox; + BOOL expand_results = 0; + Oxs_SplitList params; + int i; + for(i=0;i+1(tempext); + if(tr==NULL) { + string msg=string("Oxs_Ext object ") + params[0] + + string(" associated with input block ") + + string(InstanceName()) + + string(", subblock ") + name + + string(", is not an Oxs_Section object"); + throw Oxs_Ext::Error(msg.c_str()); + } + + section_list.push_back(tr); + section_name_list.push_back(name); + + tr->GetExtents(tbox); + expand_results = bbox.Expand(tbox); + } + + // Check that last section bounding box contain all others, by + // comparing extent boxes. This doesn't find all containment + // errors, but will at least catch some of them. + if(arglist.Count()>2 && expand_results) { + string msg=string("Final section ") + + string(arglist[arglist.Count()-2]) + + string(" specified in input block ") + + string(InstanceName()) + + string(" does not contain all preceding sections."); + throw Oxs_Ext::Error(msg.c_str()); + } + } + + + // Destructor + Oxs_SectionAtlas::~Oxs_SectionAtlas() + { + UINT4m count = UINT4m(section_list.size()); + for(UINT4m i=0;iGetExtents(mybox); + } + + INT4m Oxs_SectionAtlas::GetRegionId(const ThreeVector& point) const + { // Returns the id number for the first section in + // "sections" list containing point. The return + // value is -1 if the point is not contained in + // the atlas. + UINT4m count = UINT4m(section_list.size()); + for(UINT4m i=0;iIsIn(point)) return i; + } + return -1; + } + + INT4m Oxs_SectionAtlas::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. + UINT4m count = UINT4m(section_list.size()); + for(UINT4m i=0;i=section_list.size()) return 1; + name = section_name_list[id]; + return 0; + } diff -crN oommf-1.2a0/app/oxs/ext/sectionatlas.h oommf/app/oxs/ext/sectionatlas.h *** oommf-1.2a0/app/oxs/ext/sectionatlas.h Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/sectionatlas.h Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,62 ---- + /* FILE: sectionatlas.h -*-Mode: c++-*- + * + * Section atlas class, derived from Oxs_Atlas class. + * + */ + + #ifndef _OXS_SECTIONATLAS + #define _OXS_SECTIONATLAS + + #include + #include + + #include "ext.h" + #include "section.h" + #include "threevector.h" + #include "util.h" + #include "atlas.h" + /* End includes */ + + class Oxs_SectionAtlas:public Oxs_Atlas { + private: + vector section_list; // Ordered list of sections + vector section_name_list; // Corresponding section names + public: + virtual const char* ClassName() const; // ClassName() is + /// automatically generated by the OXS_EXT_REGISTER macro. + virtual BOOL Init() { return 1; } + + Oxs_SectionAtlas(const char* name, + Oxs_Director* newdtr, + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr); // MIF block argument string + + ~Oxs_SectionAtlas(); + + void GetWorldExtents(Oxs_Box &mybox) const; + /// Fills mybox with bounding box for the atlas + + 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(section_list.size()); } + /// Valid RegionId numbers range from 0 to GetRegionCount -1, + /// inclusive. + + }; + + #endif // _OXS_SECTIONATLAS diff -crN oommf-1.2a0/app/oxs/ext/simpledemag.cc oommf/app/oxs/ext/simpledemag.cc *** oommf-1.2a0/app/oxs/ext/simpledemag.cc Tue Oct 17 11:09:48 2000 --- oommf/app/oxs/ext/simpledemag.cc Tue Jan 16 01:09:15 2001 *************** *** 43,71 **** 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), A00(NULL),A01(NULL),A02(NULL),A11(NULL),A12(NULL),A22(NULL), Mx(NULL),My(NULL),Mz(NULL),Hcomp(NULL) { ! CheckInitValueParamCount("mesh",1); ! const string& meshname = (*FindInitValue("mesh"))[0]; ! Oxs_Ext* tempobj = director->FindExtObject(meshname); ! if(tempobj==NULL) { ! string msg="Unable to identify Oxs_Mesh object with name " ! + meshname; ! throw Oxs_Ext::Error(msg.c_str()); ! } ! Oxs_RectangularMesh* mesh ! = dynamic_cast(tempobj); if(mesh==NULL) { ! string msg="Object " + meshname + " is not a rectangular mesh."; throw Oxs_Ext::Error(msg.c_str()); } - meshkey.Set(mesh); // Dependency lock is held until *this is deleted. - DeleteInitValue("mesh"); - - VerifyAllInitArgsUsed(); // Fill dimension variables xdim = mesh->DimX(); --- 43,80 ---- 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), A00(NULL),A01(NULL),A02(NULL),A11(NULL),A12(NULL),A22(NULL), Mx(NULL),My(NULL),Mz(NULL),Hcomp(NULL) { + VerifyAllInitArgsUsed(); + } ! void Oxs_SimpleDemag::ReleaseMemory() ! { ! if(Mx!=NULL) { delete[] Mx; Mx=NULL; } ! if(My!=NULL) { delete[] My; My=NULL; } ! if(Mz!=NULL) { delete[] Mz; Mz=NULL; } ! if(A00!=NULL) { delete[] A00; A00=NULL; } ! if(A01!=NULL) { delete[] A01; A01=NULL; } ! if(A02!=NULL) { delete[] A02; A02=NULL; } ! 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; ! } ! ! void Oxs_SimpleDemag::FillCoefficientArrays(const Oxs_Mesh* genmesh) const ! { // This routine is conceptually const. ! const Oxs_RectangularMesh* mesh ! = dynamic_cast(genmesh); if(mesh==NULL) { ! string msg=string("Object ") ! + string(genmesh->InstanceName()) ! + string(" is not a rectangular mesh."); throw Oxs_Ext::Error(msg.c_str()); } // Fill dimension variables xdim = mesh->DimX(); *************** *** 90,96 **** throw Oxs_Ext::Error(msg.c_str()); } - // Allocate memory for interaction matrices and magnetization components A00 = new MyComplex[ptotalsize]; A01 = new MyComplex[ptotalsize]; --- 99,104 ---- *************** *** 264,302 **** fft.Forward(pxdim,pydim,pzdim,A22); } - void Oxs_SimpleDemag::ReleaseMemory() - { - if(Mx!=NULL) { delete[] Mx; Mx=NULL; } - if(My!=NULL) { delete[] My; My=NULL; } - if(Mz!=NULL) { delete[] Mz; Mz=NULL; } - if(A00!=NULL) { delete[] A00; A00=NULL; } - if(A01!=NULL) { delete[] A01; A01=NULL; } - if(A02!=NULL) { delete[] A02; A02=NULL; } - 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; - } - - BOOL Oxs_SimpleDemag::Init() - { - return 1; - } - void Oxs_SimpleDemag::GetEnergyAndField (const Oxs_SimState& state, Oxs_MeshValue& energy, Oxs_MeshValue& field ) const { ! // Check that the mesh hasn't changed. ! if(meshkey.KeyId() != state.mesh->Id()) { ! string msg="Input mesh to Oxs_SimpleDemag::GetEnergyAndField()" ! " routine of object " + string(InstanceName()) ! + " is different than the one used to initialize this object."; ! throw Oxs_Ext::Error(msg.c_str()); } const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); --- 272,290 ---- fft.Forward(pxdim,pydim,pzdim,A22); } void Oxs_SimpleDemag::GetEnergyAndField (const Oxs_SimState& state, Oxs_MeshValue& energy, Oxs_MeshValue& field ) const { ! // (Re)-initialize mesh coefficient array if mesh has changed. ! if(mesh_id != state.mesh->Id()) { ! mesh_id = 0; // Safety ! FillCoefficientArrays(state.mesh); ! mesh_id = state.mesh->Id(); } + const Oxs_MeshValue& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); diff -crN oommf-1.2a0/app/oxs/ext/simpledemag.h oommf/app/oxs/ext/simpledemag.h *** oommf-1.2a0/app/oxs/ext/simpledemag.h Fri Sep 15 20:07:58 2000 --- oommf/app/oxs/ext/simpledemag.h Tue Jan 16 01:09:15 2001 *************** *** 24,47 **** class Oxs_SimpleDemag:public Oxs_Energy { private: ! UINT4m xdim,ydim,zdim,totalsize; // Natural size ! UINT4m pxdim,pydim,pzdim,ptotalsize; // Padded size ! Oxs_Key meshkey; // The A## arrays hold demag coefficients, transformed into // frequency domain. These are held long term. Mx, My, Mz // and Hcomp are used as temporary space to convert M into // H. ! MyComplex *A00,*A01,*A02,*A11,*A12,*A22; ! MyComplex *Mx,*My,*Mz,*Hcomp; ! FFT3D fft; // All transforms are same size, so we need /// only one FFT3D object. UINT4m NextPowerOfTwo(UINT4m n) const; // Helper function void ReleaseMemory(); public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_SimpleDemag(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 24,48 ---- class Oxs_SimpleDemag:public Oxs_Energy { private: ! mutable UINT4m xdim,ydim,zdim,totalsize; // Natural size ! mutable UINT4m pxdim,pydim,pzdim,ptotalsize; // Padded size ! mutable UINT4m mesh_id; // The A## arrays hold demag coefficients, transformed into // frequency domain. These are held long term. Mx, My, Mz // and Hcomp are used as temporary space to convert M into // H. ! mutable MyComplex *A00,*A01,*A02,*A11,*A12,*A22; ! mutable MyComplex *Mx,*My,*Mz,*Hcomp; ! mutable FFT3D fft; // All transforms are same size, so we need /// only one FFT3D object. + void FillCoefficientArrays(const Oxs_Mesh* mesh) const; + UINT4m NextPowerOfTwo(UINT4m n) const; // Helper function void ReleaseMemory(); public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. Oxs_SimpleDemag(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter diff -crN oommf-1.2a0/app/oxs/ext/standarddriver.cc oommf/app/oxs/ext/standarddriver.cc *** oommf-1.2a0/app/oxs/ext/standarddriver.cc Thu Nov 16 19:44:05 2000 --- oommf/app/oxs/ext/standarddriver.cc Fri Jan 19 22:34:30 2001 *************** *** 30,47 **** Oxs_StandardDriver::Oxs_StandardDriver( const char* name, // Child instance id Oxs_Director* newdtr, // App director ! Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Driver(name,newdtr,safe_interp,argstr), ! OSO_INIT(last_timestep,"Last time step","s"), ! OSO_INIT(elapsed_time,"Elapsed time","s"), ! OSO_INIT(max_dm_dt,"Max dm/dt","deg/ns"), ! OSO_INIT(total_energy,"Total energy","J"), OSO_INIT(iteration_count,"Iteration",""), OSO_INIT(stage_iteration_count,"Stage iteration",""), OSO_INIT(stage_number,"Stage",""), magnetization_output(this,InstanceName(),"Magnetization","A/m",1, &Oxs_StandardDriver::Fill__magnetization_output, newdtr) { // Process arguments --- 30,56 ---- Oxs_StandardDriver::Oxs_StandardDriver( const char* name, // Child instance id Oxs_Director* newdtr, // App director ! Tcl_Interp* safe_interp_, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Driver(name,newdtr,safe_interp_,argstr), ! safe_interp(safe_interp_), ! max_dm_dt_obj_ptr(NULL), OSO_INIT(iteration_count,"Iteration",""), OSO_INIT(stage_iteration_count,"Stage iteration",""), OSO_INIT(stage_number,"Stage",""), + OSO_INIT(last_timestep,"Last time step","s"), + OSO_INIT(simulation_time,"Simulation time","s"), magnetization_output(this,InstanceName(),"Magnetization","A/m",1, &Oxs_StandardDriver::Fill__magnetization_output, + newdtr), + aveMx_output(this,InstanceName(),"Mx","A/m",1, + &Oxs_StandardDriver::Fill__aveM_output, + newdtr), + aveMy_output(this,InstanceName(),"My","A/m",1, + &Oxs_StandardDriver::Fill__aveM_output, + newdtr), + aveMz_output(this,InstanceName(),"Mz","A/m",1, + &Oxs_StandardDriver::Fill__aveM_output, newdtr) { // Process arguments *************** *** 96,102 **** m0 = foo; /// Stroustrup specifies an auto_ptr .reset() member function, /// but that is apparently not supported by some common STL's. ! /// This above creation of a temporary (foo) is a workaround. VerifyAllInitArgsUsed(); --- 105,111 ---- m0 = foo; /// Stroustrup specifies an auto_ptr .reset() member function, /// but that is apparently not supported by some common STL's. ! /// The above creation of a temporary (foo) is a workaround. VerifyAllInitArgsUsed(); *************** *** 118,130 **** Oxs_Key initial_state; director->GetNewSimulationState(initial_state); Oxs_SimState& istate = initial_state.GetWriteReference(); ! istate.last_timestep = 0.0; ! istate.elapsed_time = 0.0; ! istate.max_dm_dt = -1.0; // Dummy value. ! istate.total_energy = 0.0; // Dummy value. ! istate.iteration_count = 0; istate.stage_iteration_count = 0; ! istate.stage_number = 0; istate.mesh = meshkey.GetPtr(); --- 127,137 ---- Oxs_Key initial_state; director->GetNewSimulationState(initial_state); Oxs_SimState& istate = initial_state.GetWriteReference(); ! istate.iteration_count = 0; istate.stage_iteration_count = 0; ! istate.stage_number = 0; ! istate.last_timestep = 0.0; ! istate.elapsed_time = 0.0; istate.mesh = meshkey.GetPtr(); *************** *** 132,139 **** istate.Ms_inverse = &Ms_inverse; m0->FillMeshValue(istate.mesh,istate.spin); ! istate.valid_state=0; // Technically, this is not a valid ! /// state because max_dm_dt and total_energy aren't set. return initial_state; } --- 139,152 ---- istate.Ms_inverse = &Ms_inverse; m0->FillMeshValue(istate.mesh,istate.spin); ! // Insure that all spins are unit vectors ! UINT4m size = istate.spin.Size(); ! for(UINT4m i=0;iFindOutputObject("Max dm/dt"); ! if(max_dm_dt_obj_ptr==NULL) { ! string msg=string("Error in ") + string(InstanceName()) ! + string(": Unable to identify unique Max dm/dt output object"); ! throw Oxs_Ext::Error(msg.c_str()); ! } ! return 1; } Oxs_StandardDriver::~Oxs_StandardDriver() *************** *** 149,166 **** BOOL Oxs_StandardDriver::StageDone(const Oxs_SimState& state, string& result) const ! { // Note: The iteration counts are effective 1-based, because ! // the original state in each stage is marked 'invalid_state,' ! // since max_dm_dt & energy aren't set. Thus, since state ! // iteration counts record the count for a completed state, ! // when the iteration count is the same as the limit, the limit ! // is reached. if( stage_iteration_limit>0 && state.stage_iteration_count >= stage_iteration_limit) goto done; if( total_iteration_limit>0 && state.iteration_count >= total_iteration_limit ) goto done; ! if( !state.valid_state ) return 0; ! if( state.max_dm_dt <= stopping_dm_dt ) goto done; return 0; done: result.append("Oc_EventHandler Generate Oxs Stage\n"); --- 171,190 ---- BOOL Oxs_StandardDriver::StageDone(const Oxs_SimState& state, string& result) const ! { ! REAL8m max_dm_dt=0.; if( stage_iteration_limit>0 && state.stage_iteration_count >= stage_iteration_limit) goto done; if( total_iteration_limit>0 && state.iteration_count >= total_iteration_limit ) goto done; ! if(max_dm_dt_obj_ptr->Output(&state,safe_interp,0,NULL) != TCL_OK) { ! string msg=string("Error in ") + string(InstanceName()) ! + string(": Unable to obtain Max dm/dt output: "); ! msg += string(Tcl_GetStringResult(safe_interp)); ! throw Oxs_Ext::Error(msg.c_str()); ! } ! max_dm_dt = Nb_Atof(Tcl_GetStringResult(safe_interp)); ! if(max_dm_dt <= stopping_dm_dt) goto done; return 0; done: result.append("Oc_EventHandler Generate Oxs Stage\n"); *************** *** 168,174 **** } BOOL Oxs_StandardDriver::Done(const Oxs_SimState& state, string& result) const ! { // Note: See note on iteration counts in StageDone() above. if( total_iteration_limit>0 && state.iteration_count >= total_iteration_limit ) goto done; if( number_of_stages >0 --- 192,198 ---- } BOOL Oxs_StandardDriver::Done(const Oxs_SimState& state, string& result) const ! { if( total_iteration_limit>0 && state.iteration_count >= total_iteration_limit ) goto done; if( number_of_stages >0 *************** *** 192,200 **** (const Oxs_SimState& old_state, Oxs_SimState& new_state) const { - new_state.valid_state = 0; new_state.stage_number = old_state.stage_number; new_state.Ms = old_state.Ms; new_state.mesh = old_state.mesh; new_state.spin.AdjustSize(new_state.mesh); } --- 216,224 ---- (const Oxs_SimState& old_state, Oxs_SimState& new_state) const { new_state.stage_number = old_state.stage_number; new_state.Ms = old_state.Ms; + new_state.Ms_inverse = old_state.Ms_inverse; new_state.mesh = old_state.mesh; new_state.spin.AdjustSize(new_state.mesh); } *************** *** 217,234 **** { NAME##_output.cache.state_id=state.Id(); \ NAME##_output.cache.value=state.NAME; } - OSO_FUNC(last_timestep) - OSO_FUNC(elapsed_time) - OSO_FUNC(total_energy) OSO_FUNC(iteration_count) OSO_FUNC(stage_iteration_count) OSO_FUNC(stage_number) ! ! void Oxs_StandardDriver::Fill__max_dm_dt_output(const Oxs_SimState& state) { ! max_dm_dt_output.cache.state_id=state.Id(); ! max_dm_dt_output.cache.value = state.max_dm_dt * 180e-9 / PI; ! /// Convert from radians/second to deg/ns } void --- 241,255 ---- { NAME##_output.cache.state_id=state.Id(); \ NAME##_output.cache.value=state.NAME; } OSO_FUNC(iteration_count) OSO_FUNC(stage_iteration_count) OSO_FUNC(stage_number) ! OSO_FUNC(last_timestep) ! void ! Oxs_StandardDriver::Fill__simulation_time_output(const Oxs_SimState& state) { ! simulation_time_output.cache.state_id = state.Id(); ! simulation_time_output.cache.value = state.elapsed_time; } void *************** *** 245,248 **** --- 266,354 ---- mag[i] *= Ms[i]; } magnetization_output.cache.state_id=state.Id(); + } + + void + Oxs_StandardDriver::Fill__aveM_output(const Oxs_SimState& state) + { + const Oxs_MeshValue& spin = state.spin; + const Oxs_MeshValue& Ms = *(state.Ms); + UINT4m size=state.mesh->Size(); + + if(aveMx_output.GetCacheRequestCount()>0 && + aveMy_output.GetCacheRequestCount()>0 && + aveMz_output.GetCacheRequestCount()>0) { + // Usual case: All three components desired + aveMx_output.cache.state_id=0; + aveMy_output.cache.state_id=0; + aveMz_output.cache.state_id=0; + REAL8m Mx=0.0; + REAL8m My=0.0; + REAL8m Mz=0.0; + if(size>0) { + UINT4m i=0; + do { + REAL8m sat_mag = Ms[i]; + Mx += sat_mag*(spin[i].x); + My += sat_mag*(spin[i].y); + Mz += sat_mag*(spin[i].z); + ++i; + } while(i0) { + aveMx_output.cache.state_id=0; + REAL8m Mx=0.0; + if(size>0) { + UINT4m i=0; + do { + Mx += Ms[i]*(spin[i].x); + ++i; + } while(i0) { + aveMy_output.cache.state_id=0; + REAL8m My=0.0; + if(size>0) { + UINT4m i=0; + do { + My += Ms[i]*(spin[i].y); + ++i; + } while(i0) { + aveMz_output.cache.state_id=0; + REAL8m Mz=0.0; + if(size>0) { + UINT4m i=0; + do { + Mz += Ms[i]*(spin[i].z); + ++i; + } while(i unlimited UINT4m stage_iteration_limit; // 0 => no limit UINT4m total_iteration_limit; // 0 => no limit // State-based outputs, maintained by the driver. These are // conceptually public, but are specified private to force // clients to use the output_map interface in Oxs_Director. #define OSO_DECL(name) \ void Fill__##name##_output(const Oxs_SimState&); \ Oxs_ScalarOutput name##_output - OSO_DECL(last_timestep); - OSO_DECL(elapsed_time); - OSO_DECL(max_dm_dt); - OSO_DECL(total_energy); OSO_DECL(iteration_count); OSO_DECL(stage_iteration_count); OSO_DECL(stage_number); Oxs_VectorFieldOutput magnetization_output; void Fill__magnetization_output(const Oxs_SimState&); public: Oxs_StandardDriver(const char* name, // Child instance id --- 27,61 ---- REAL8m min_timestep; // Seconds REAL8m max_timestep; // Seconds ! REAL8m stopping_dm_dt; // deg/ns UINT4m number_of_stages; // 0 => unlimited UINT4m stage_iteration_limit; // 0 => no limit UINT4m total_iteration_limit; // 0 => no limit + Tcl_Interp* const safe_interp; // For obtaining output object data + Oxs_Output* max_dm_dt_obj_ptr; // Pointer to object providing + /// max dm/dt data. + // State-based outputs, maintained by the driver. These are // conceptually public, but are specified private to force // clients to use the output_map interface in Oxs_Director. #define OSO_DECL(name) \ void Fill__##name##_output(const Oxs_SimState&); \ Oxs_ScalarOutput name##_output OSO_DECL(iteration_count); OSO_DECL(stage_iteration_count); OSO_DECL(stage_number); + OSO_DECL(last_timestep); + OSO_DECL(simulation_time); + ///// OSO_DECL(max_dm_dt); + ///// OSO_DECL(total_energy); + ///// OSO_DECL(total_energy_change); Oxs_VectorFieldOutput magnetization_output; void Fill__magnetization_output(const Oxs_SimState&); + Oxs_ScalarOutput aveMx_output; + Oxs_ScalarOutput aveMy_output; + Oxs_ScalarOutput aveMz_output; + void Fill__aveM_output(const Oxs_SimState&); public: Oxs_StandardDriver(const char* name, // Child instance id diff -crN oommf-1.2a0/app/oxs/ext/uniaxialanisotropy.cc oommf/app/oxs/ext/uniaxialanisotropy.cc *** oommf-1.2a0/app/oxs/ext/uniaxialanisotropy.cc Wed Nov 1 20:49:14 2000 --- oommf/app/oxs/ext/uniaxialanisotropy.cc Mon Dec 18 19:50:30 2000 *************** *** 43,51 **** VerifyAllInitArgsUsed(); } - BOOL Oxs_UniaxialAnisotropy::Init() - { return 1; } - void Oxs_UniaxialAnisotropy::GetEnergyAndField (const Oxs_SimState& state, Oxs_MeshValue& energy, --- 43,48 ---- diff -crN oommf-1.2a0/app/oxs/ext/uniaxialanisotropy.h oommf/app/oxs/ext/uniaxialanisotropy.h *** oommf-1.2a0/app/oxs/ext/uniaxialanisotropy.h Wed Nov 1 20:49:14 2000 --- oommf/app/oxs/ext/uniaxialanisotropy.h Mon Dec 18 19:50:30 2000 *************** *** 33,39 **** public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_UniaxialAnisotropy(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 33,38 ---- diff -crN oommf-1.2a0/app/oxs/ext/uniformexchange.cc oommf/app/oxs/ext/uniformexchange.cc *** oommf-1.2a0/app/oxs/ext/uniformexchange.cc Wed Dec 31 19:00:00 1969 --- oommf/app/oxs/ext/uniformexchange.cc Tue Jan 16 23:56:26 2001 *************** *** 0 **** --- 1,113 ---- + /* FILE: uniformexchange.cc -*-Mode: c++-*- + * + * Uniform 6 neighbor exchange energy on rectangular mesh, + * derived from Oxs_Energy class. + * + */ + + #include "nb.h" + #include "director.h" + #include "mesh.h" + #include "meshvalue.h" + #include "simstate.h" + #include "threevector.h" + #include "rectangularmesh.h" + #include "uniformexchange.h" + #include "energy.h" // Needed to make MSVC++ 5 happy + + // Oxs_Ext registration support + OXS_EXT_REGISTER(Oxs_UniformExchange); + + /* End includes */ + + + // Constructor + Oxs_UniformExchange::Oxs_UniformExchange( + const char* name, // Child instance id + Oxs_Director* newdtr, // App director + Tcl_Interp* safe_interp, // Safe interpreter + const char* argstr) // MIF input block parameters + : Oxs_Energy(name,newdtr,safe_interp,argstr) + { + // Process arguments + CheckInitValueParamCount("A",1); + A=Nb_Atof((*FindInitValue("A"))[0].c_str()); + DeleteInitValue("A"); + + VerifyAllInitArgsUsed(); + } + + Oxs_UniformExchange::~Oxs_UniformExchange() + {} + + void Oxs_UniformExchange::GetEnergyAndField + (const Oxs_SimState& state, + Oxs_MeshValue& energy, + Oxs_MeshValue& field + ) const + { + const Oxs_MeshValue& spin = state.spin; + const Oxs_MeshValue& Ms_inverse = *(state.Ms_inverse); + + const Oxs_RectangularMesh* mesh + = dynamic_cast(state.mesh); + if(mesh==NULL) { + string msg="Import mesh to Oxs_UniformExchange::GetEnergyAndField()" + " routine of object " + string(InstanceName()) + + " is not an Oxs_RectangularMesh object."; + throw Oxs_Ext::Error(msg.c_str()); + } + + UINT4m xdim = mesh->DimX(); + UINT4m ydim = mesh->DimY(); + UINT4m zdim = mesh->DimZ(); + UINT4m xydim = xdim*ydim; + + REAL8m wgtx = -A/(mesh->EdgeLengthX()*mesh->EdgeLengthX()); + REAL8m wgty = -A/(mesh->EdgeLengthY()*mesh->EdgeLengthY()); + REAL8m wgtz = -A/(mesh->EdgeLengthZ()*mesh->EdgeLengthZ()); + + 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 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(x& energy, + Oxs_MeshValue& field + ) const; + }; + + + #endif // _OXS_UNIFORMEXCHANGE diff -crN oommf-1.2a0/app/oxs/ext/uzeeman.cc oommf/app/oxs/ext/uzeeman.cc *** oommf-1.2a0/app/oxs/ext/uzeeman.cc Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/ext/uzeeman.cc Mon Dec 18 19:50:30 2000 *************** *** 8,14 **** #include #include "oc.h" #include "nb.h" - #include "threevector.h" #include "uzeeman.h" // Oxs_Ext registration support --- 8,13 ---- *************** *** 23,29 **** Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Energy(name,newdtr,safe_interp,argstr) { // Process arguments // Get scale factor for all Hrange input --- 22,40 ---- Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter const char* argstr) // MIF input block parameters ! : Oxs_Energy(name,newdtr,safe_interp,argstr), ! Bapp_output(this,InstanceName(),"B","mT",1, ! &Oxs_UZeeman::Fill__Bapp_output, ! newdtr), ! Bappx_output(this,InstanceName(),"Bx","mT",1, ! &Oxs_UZeeman::Fill__Bapp_output, ! newdtr), ! Bappy_output(this,InstanceName(),"By","mT",1, ! &Oxs_UZeeman::Fill__Bapp_output, ! newdtr), ! Bappz_output(this,InstanceName(),"Bz","mT",1, ! &Oxs_UZeeman::Fill__Bapp_output, ! newdtr) { // Process arguments // Get scale factor for all Hrange input *************** *** 84,91 **** Oxs_UZeeman::~Oxs_UZeeman() {} ! BOOL Oxs_UZeeman::Init() ! { return 1; } void Oxs_UZeeman::GetEnergyAndField (const Oxs_SimState& state, --- 95,111 ---- Oxs_UZeeman::~Oxs_UZeeman() {} ! ThreeVector Oxs_UZeeman::GetAppliedField(UINT4m stage_number) const ! { ! ThreeVector H(0,0,0); ! UINT4m field_count = static_cast(Happ.size()); ! if(field_count>0) { ! if(stage_number>=field_count) H=Happ[field_count-1]; ! else H=Happ[stage_number]; ! } ! ! return H; ! } void Oxs_UZeeman::GetEnergyAndField (const Oxs_SimState& state, *************** *** 94,121 **** ) const { UINT4m size = state.mesh->Size(); ! UINT4m stage_number = state.stage_number; ! UINT4m field_count = static_cast(Happ.size()); ! ! ThreeVector H(0,0,0); ! if(field_count>0) { ! if(stage_number>=field_count) H=Happ[field_count-1]; ! else H=Happ[stage_number]; ! } ! ! UINT4m i; ! for(i=0;i& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); ! for(i=0;iSize(); + if(size<1) return; ! ThreeVector H = GetAppliedField(state.stage_number); ! UINT4m i=0; ! do { field[i] = H; ! ++i; ! } while(i& spin = state.spin; const Oxs_MeshValue& Ms = *(state.Ms); ! i=0; ! do { energy[i] = Ms[i]*(vtemp*spin[i]); + ++i; + } while(i0) { + Bapp_output.cache.state_id=0; + Bapp_output.cache.value = sqrt(B.MagSq()); + Bapp_output.cache.state_id=state.Id(); + } + + if(Bappx_output.GetCacheRequestCount()>0) { + Bappx_output.cache.state_id=0; + Bappx_output.cache.value = B.x; + Bappx_output.cache.state_id=state.Id(); + } + + if(Bappy_output.GetCacheRequestCount()>0) { + Bappy_output.cache.state_id=0; + Bappy_output.cache.value = B.y; + Bappy_output.cache.state_id=state.Id(); + } + + if(Bappz_output.GetCacheRequestCount()>0) { + Bappz_output.cache.state_id=0; + Bappz_output.cache.value = B.z; + Bappz_output.cache.state_id=state.Id(); } } diff -crN oommf-1.2a0/app/oxs/ext/uzeeman.h oommf/app/oxs/ext/uzeeman.h *** oommf-1.2a0/app/oxs/ext/uzeeman.h Fri Sep 15 20:07:59 2000 --- oommf/app/oxs/ext/uzeeman.h Mon Dec 18 19:50:30 2000 *************** *** 8,25 **** #define _OXS_UZEEMAN #include - #include "energy.h" #include "threevector.h" /* End includes */ class Oxs_UZeeman:public Oxs_Energy { private: vector Happ; // Indexed off of state stage_number public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. - virtual BOOL Init(); Oxs_UZeeman(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter --- 8,36 ---- #define _OXS_UZEEMAN #include #include "threevector.h" + #include "output.h" + #include "energy.h" /* End includes */ class Oxs_UZeeman:public Oxs_Energy { private: vector Happ; // Indexed off of state stage_number + ThreeVector GetAppliedField(UINT4m stage_number) const; + /// Utility function. Indexes Happ off of stage_number with + /// proper range behavior. + + // Supplied outputs, in addition to those provided by Oxs_Energy. + Oxs_ScalarOutput Bapp_output; + Oxs_ScalarOutput Bappx_output; + Oxs_ScalarOutput Bappy_output; + Oxs_ScalarOutput Bappz_output; + void Fill__Bapp_output(const Oxs_SimState& state); + public: virtual const char* ClassName() const; // ClassName() is /// automatically generated by the OXS_EXT_REGISTER macro. Oxs_UZeeman(const char* name, // Child instance id Oxs_Director* newdtr, // App director Tcl_Interp* safe_interp, // Safe interpreter diff -crN oommf-1.2a0/app/oxs/makerules.tcl oommf/app/oxs/makerules.tcl *** oommf-1.2a0/app/oxs/makerules.tcl Sat Nov 18 16:56:28 2000 --- oommf/app/oxs/makerules.tcl Mon Jan 22 17:06:17 2001 *************** *** 24,29 **** --- 24,30 ---- # Standard source modules set objects { + atlas director driver energy *************** *** 34,41 **** output oxs oxscmds - region scalarfieldinit simstate threevector util --- 35,42 ---- output oxs oxscmds scalarfieldinit + section simstate threevector util *************** *** 89,95 **** puts $f " Oc_Application Define { -name [list $e] ! -version 1.2.0.0 -machine [list [Platform Name]] -file [list [file tail \ [Platform Executables [list $e]]]] --- 90,96 ---- puts $f " Oc_Application Define { -name [list $e] ! -version 1.2.0.1 -machine [list [Platform Name]] -file [list [file tail \ [Platform Executables [list $e]]]] *************** *** 216,222 **** MakeRule Define { -targets upgrade ! -script {} } MakeRule Define { --- 217,228 ---- MakeRule Define { -targets upgrade ! -script {DeleteFiles \ ! [file join ext rectangularregion.cc] \ ! [file join ext rectangularregion.h] \ ! [file join base region.cc] \ ! [file join base region.h] \ ! } } MakeRule Define { diff -crN oommf-1.2a0/app/oxs/mifconvert.tcl oommf/app/oxs/mifconvert.tcl *** oommf-1.2a0/app/oxs/mifconvert.tcl Thu Nov 9 01:27:21 2000 --- oommf/app/oxs/mifconvert.tcl Sun Jan 21 16:04:03 2001 *************** *** 2,8 **** # v--Edit here if necessary \ exec tclsh "$0" ${1+"$@"} ! set progvers "MIF Conversion utility 1.0" if {[llength $argv]!=2} { puts stderr "Usage: tclsh mifconvert.tcl " --- 2,8 ---- # v--Edit here if necessary \ exec tclsh "$0" ${1+"$@"} ! set progvers "MIF Conversion utility 1.2.0.1" if {[llength $argv]!=2} { puts stderr "Usage: tclsh mifconvert.tcl " *************** *** 120,134 **** set yspan [EatAllRecords inlist "partheight"] set zspan [EatAllRecords inlist "partthickness"] set cellsize [EatAllRecords inlist "cellsize"] ! puts $outfile "Specify Oxs_RectangularRegion:World { ! xrange {0 $xspan} ! yrange {0 $yspan} ! zrange {0 $zspan} } Specify Oxs_RectangularMesh:mesh { cellsize {$cellsize $cellsize $zspan} ! region Oxs_RectangularRegion:World }" ############################################################## --- 120,136 ---- set yspan [EatAllRecords inlist "partheight"] set zspan [EatAllRecords inlist "partthickness"] set cellsize [EatAllRecords inlist "cellsize"] ! puts $outfile "Specify Oxs_SectionAtlas:atlas { ! world { Oxs_RectangularSection { ! xrange {0 $xspan} ! yrange {0 $yspan} ! zrange {0 $zspan} ! } } } Specify Oxs_RectangularMesh:mesh { cellsize {$cellsize $cellsize $zspan} ! atlas Oxs_SectionAtlas:atlas }" ############################################################## *************** *** 194,202 **** # Write exchange info set A [EatAllRecords inlist "a"] puts $outfile " ! Specify Oxs_Exchange6Ngbr { A $A - mesh :mesh }" ############################################################## --- 196,203 ---- # Write exchange info set A [EatAllRecords inlist "a"] puts $outfile " ! Specify Oxs_UniformExchange { A $A }" ############################################################## *************** *** 214,222 **** not supported. Using constmag instead." } puts $outfile " ! Specify Oxs_Demag { ! mesh :mesh ! }" } --- 215,221 ---- not supported. Using constmag instead." } puts $outfile " ! Specify Oxs_Demag {}" } *************** *** 224,229 **** --- 223,238 ---- # Write applied field info. # Field Range line in MIF 1.1 has format # x0 y0 z0 x1 y1 z1 steps (+optional control point specs) + if {![catch {EatAllRecords inlist "fieldtype"} Htype]} { + if {![string match -nocase "uniform" $Htype]} { + puts stderr \ + "ERROR: Unsupported applied field type: $Htype" + puts stderr "ABORT" + puts $outfile "error {INCOMPLETE MIF FILE}" + exit 10 + } + } + set rangecount 0 set stagecount 1 set lastfield {0 0 0} *************** *** 301,311 **** } } set stopping_dm_dt [expr {$stop_mxh*$Ms*$gamma*sqrt(1+$alpha*$alpha)}] if {[catch {EatAllRecords inlist "maxtimestep"} max_timestep]} { set max_timestep 10e-9 } if {[catch {EatAllRecords inlist "mintimestep"} min_timestep]} { ! set min_timestep 0 } if {[catch {EatAllRecords inlist "partshape"} part_shape]} { set part_shape rectangle --- 310,321 ---- } } set stopping_dm_dt [expr {$stop_mxh*$Ms*$gamma*sqrt(1+$alpha*$alpha)}] + set stopping_dm_dt [expr {$stopping_dm_dt*180e-9/$PI}] ;# Convert to deg/ns if {[catch {EatAllRecords inlist "maxtimestep"} max_timestep]} { set max_timestep 10e-9 } if {[catch {EatAllRecords inlist "mintimestep"} min_timestep]} { ! set min_timestep 1e-18 } if {[catch {EatAllRecords inlist "partshape"} part_shape]} { set part_shape rectangle diff -crN oommf-1.2a0/app/oxs/oxsii.tcl oommf/app/oxs/oxsii.tcl *** oommf-1.2a0/app/oxs/oxsii.tcl Sat Nov 18 12:33:59 2000 --- oommf/app/oxs/oxsii.tcl Fri Jan 19 22:34:30 2001 *************** *** 12,19 **** # Application description boilerplate Oc_Main SetAppName Oxsii ! Oc_Main SetVersion 1.2.0.0 ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/11/18 17:33:59 $} _ date Oc_Main SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ --- 12,19 ---- # 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 SetDate [string trim $date] Oc_Main SetAuthor [Oc_Person Lookup dgp] Oc_Main SetHelpURL [Oc_Url FromFilename [file join [file dirname \ *************** *** 46,56 **** append gui "[list Oc_Main SetPid [pid]]\n" append gui { ! regexp \\\044Date:(.*)\\\044 {$Date: 2000/11/18 17:33:59 $} _ date Oc_Main SetDate [string trim $date] # This won't cross different OOMMF installations nicely ! Oc_Main SetAuthor [Oc_Person Lookup dgp] } # This might not cross nicely either --- 46,56 ---- append gui "[list Oc_Main SetPid [pid]]\n" append gui { ! regexp \\\044Date:(.*)\\\044 {$Date: 2001/01/20 03:34:30 $} _ date Oc_Main SetDate [string trim $date] # This won't cross different OOMMF installations nicely ! Oc_Main SetAuthor [Oc_Person Lookup donahue] } # This might not cross nicely either *************** *** 444,455 **** "vector field" vectorField DataTable DataTable } private common scalars {} const public variable handle const public variable name const private variable type const public variable units - const private variable basename ClassConstructor { trace variable index wu [subst { uplevel #0 { set opAssocList \[[list array get [$class GlobalName index]]] --- 444,463 ---- "vector field" vectorField DataTable DataTable } + + # We assume that all Oxs_Output objects existing at the same time + # are provided by the same loaded problem, i.e. the same MIF, + # so all scalars should be gathered into one DataTable, and one + # basename is shared in common by all Oxs_Output objects. + # If Oxs ever allows multiple problems to be loaded at once, + # re-think this. private common scalars {} + private common basename oxs + const public variable handle const public variable name const private variable type const public variable units ClassConstructor { trace variable index wu [subst { uplevel #0 { set opAssocList \[[list array get [$class GlobalName index]]] *************** *** 490,498 **** } # Get filename base from the Mif object. - set basename oxs if {[lsearch -exact [$mif GetMiscKeys] basename] >= 0} { ! append basename [$mif GetMiscValue basename] } # When the problem is released, our handle becomes invalid, --- 498,505 ---- } # Get filename base from the Mif object. if {[lsearch -exact [$mif GetMiscKeys] basename] >= 0} { ! set basename [$mif GetMiscValue basename] } # When the problem is released, our handle becomes invalid, *************** *** 512,518 **** return $directory($n) } private proc SendDataTable {thread} { ! set triples {} foreach on $scalars { set o $directory($on) set n [$o Cget -name] --- 519,525 ---- return $directory($n) } private proc SendDataTable {thread} { ! set triples [list [list @Filename:$basename.odt {} 0]] foreach on $scalars { set o $directory($on) set n [$o Cget -name] *************** *** 525,534 **** # the table gets closed when the problem ends. if {![info exists closers($thread)]} { Oc_EventHandler New closers($thread) Oxs Cleanup \ ! [list $thread Send DataTable [list [list "@Filename:" {} 0]]] \ ! -groups [list $thread] -oneshot 1 ! Oc_EventHandler New _ $closers($thread) Delete \ ! [list unset [$class GlobalName closers]($thread)] -oneshot 1 } return [$thread Send DataTable $triples] } --- 532,540 ---- # the table gets closed when the problem ends. if {![info exists closers($thread)]} { Oc_EventHandler New closers($thread) Oxs Cleanup \ ! "[list $thread Send DataTable [list [list @Filename: \ ! {} 0]]]; [list unset [$class GlobalName \ ! closers]($thread)]" -groups [list $thread] -oneshot 1 } return [$thread Send DataTable $triples] } *************** *** 563,570 **** vectorField { # Piece together a permanent file name set idx [lsearch -glob $scalars *Iteration] ! set iter [Oxs_OutputGet \ ! [$directory([lindex $scalars $idx]) Cget -handle]] switch -exact -- $units { T {set ext .obf ;# vector field in Tesla} A/m { --- 569,579 ---- vectorField { # Piece together a permanent file name set idx [lsearch -glob $scalars *Iteration] ! set iter [format %07d [Oxs_OutputGet \ ! [$directory([lindex $scalars $idx]) Cget -handle]]] ! set idx [lsearch -glob $scalars *Stage] ! set stage [format %02d [Oxs_OutputGet \ ! [$directory([lindex $scalars $idx]) Cget -handle]]] switch -exact -- $units { T {set ext .obf ;# vector field in Tesla} A/m { *************** *** 576,584 **** } default {set ext .ovf} } ! set filename $basename-$name-$iter$ext regsub -all {:+} $filename {-} filename ! regsub -all "\[ \r\n\t]" $filename {_} filename # Piece together a temporary file name Oc_TempFile New t -stem $basename -extension $ext --- 585,593 ---- } default {set ext .ovf} } ! set filename $basename-$name-$stage-$iter$ext regsub -all {:+} $filename {-} filename ! regsub -all "\[ \r\n\t]+" $filename {_} filename # Piece together a temporary file name Oc_TempFile New t -stem $basename -extension $ext diff -crN oommf-1.2a0/app/pimake/appindex.tcl oommf/app/pimake/appindex.tcl *** oommf-1.2a0/app/pimake/appindex.tcl Thu Apr 6 02:34:03 2000 --- oommf/app/pimake/appindex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,7 **** Oc_Application Define { -name pimake ! -version 1.2.0.0 -machine tclsh -file pimake.tcl -mode fg --- 1,7 ---- Oc_Application Define { -name pimake ! -version 1.2.0.1 -machine tclsh -file pimake.tcl -mode fg diff -crN oommf-1.2a0/app/pimake/pimake.tcl oommf/app/pimake/pimake.tcl *** oommf-1.2a0/app/pimake/pimake.tcl Fri Aug 25 13:01:23 2000 --- oommf/app/pimake/pimake.tcl Thu Jan 18 18:51:51 2001 *************** *** 138,144 **** wm withdraw . } Oc_Main SetAppName pimake ! Oc_Main SetVersion 1.2.0.0 # Disable the -console option; we don't enter an event loop Oc_CommandLine Option console {} {} --- 138,144 ---- wm withdraw . } Oc_Main SetAppName pimake ! Oc_Main SetVersion 1.2.0.1 # Disable the -console option; we don't enter an event loop Oc_CommandLine Option console {} {} diff -crN oommf-1.2a0/config/cache/sgi.tcl oommf/config/cache/sgi.tcl *** oommf-1.2a0/config/cache/sgi.tcl Fri Nov 17 22:41:05 2000 --- oommf/config/cache/sgi.tcl Tue Dec 12 22:29:54 2000 *************** *** 100,107 **** } if {[string match CC $ccbasename]} { # ...for SGI's compiler CC ! $config SetValue program_compiler_c++_option_opt {format "\"-O%s\""} ! # $config SetValue program_compiler_c++_option_opt {format "-Ofast"} ## If you specify -Ofast here, then you must also specify -IPA ## in the program_linker line below. Also, at least some versions ## of CC don't like the combination '-32 -Ofast', so you may have --- 100,108 ---- } if {[string match CC $ccbasename]} { # ...for SGI's compiler CC ! # $config SetValue program_compiler_c++_option_opt \ ! # {format "\"-O%s\" -OPT:Olimit=25000"} ! $config SetValue program_compiler_c++_option_opt {format "-Ofast"} ## If you specify -Ofast here, then you must also specify -IPA ## in the program_linker line below. Also, at least some versions ## of CC don't like the combination '-32 -Ofast', so you may have *************** *** 149,156 **** set linkcmdline [lindex [$config GetValue program_compiler_c++] 0] if {![string match {} $id32]} {lappend linkcmdline $id32} if {![string match {} $langopt]} {lappend linkcmdline $langopt} ! # Enable the next line if you specified -Ofast above ! lappend linkcmdline "-IPA" $config SetValue program_linker $linkcmdline unset linkcmdline } else { --- 150,166 ---- set linkcmdline [lindex [$config GetValue program_compiler_c++] 0] if {![string match {} $id32]} {lappend linkcmdline $id32} if {![string match {} $langopt]} {lappend linkcmdline $langopt} ! ! # Disable "Multiply defined" warnings from linker ! lappend linkcmdline "-Wl,-woff15" ! ! # Include -IPA if you specified -Ofast in the compile line above. ! # There is an optimization bug affecting routines taking a variable ! # number of args (C++ "..." specification; cf. stdargs.h); one fix ! # is to turn off "aggressive interprocedural constant propagation" ! # with the linker option '-IPA:aggr_cprop=OFF'. ! lappend linkcmdline "-IPA:aggr_cprop=OFF" ! $config SetValue program_linker $linkcmdline unset linkcmdline } else { diff -crN oommf-1.2a0/config/cache/winalp.tcl oommf/config/cache/winalp.tcl *** oommf-1.2a0/config/cache/winalp.tcl Mon Feb 28 20:18:53 2000 --- oommf/config/cache/winalp.tcl Wed Dec 20 16:53:49 2000 *************** *** 60,66 **** # # Microsoft Visual C++ # ! $config SetValue program_compiler_c++ {cl /nologo /c} ######################################################################## # OPTIONAL CONFIGURATION --- 60,69 ---- # # Microsoft Visual C++ # ! $config SetValue program_compiler_c++ {cl /nologo /GX /GR /c} ! # /GX enables exception handling. On x86, /GR enables RTTI. ! # For MVC++ 6.0 on the Alpha, /GR is not a documented option, ! # but the compiler does not complain if it is included. ######################################################################## # OPTIONAL CONFIGURATION *************** *** 89,94 **** --- 92,101 ---- # Widest natively support floating point type $config SetValue program_compiler_c++_typedef_realwide "double" + + # Deletion of an empty STL map<> is broken. + $config SetValue \ + program_compiler_c++_property_stl_map_broken_empty_delete 1 } # The program to run on this platform to link together object files and diff -crN oommf-1.2a0/config/cache/wintel.tcl oommf/config/cache/wintel.tcl *** oommf-1.2a0/config/cache/wintel.tcl Sun Sep 24 22:29:59 2000 --- oommf/config/cache/wintel.tcl Mon Jan 22 15:34:28 2001 *************** *** 105,111 **** --- 105,114 ---- set ccbasename [file tail [lindex [$config GetValue program_compiler_c++] 0]] if {[string match cl $ccbasename]} { # ... for Microsoft Visual C++ + # Default optimization $config SetValue program_compiler_c++_option_opt {} + # Maximum optimization + # $config SetValue program_compiler_c++_option_opt {format "/G5 /Ox"} $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\""} diff -crN oommf-1.2a0/config/notes/README oommf/config/notes/README *** oommf-1.2a0/config/notes/README Wed Dec 31 19:00:00 1969 --- oommf/config/notes/README Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,10 ---- + This directory includes scripts and sample C programs that can be + used to diagnose configuration problems on some platforms. They + are meant to be distributed so that when users report problems + configuring, building, or using OOMMF, we can make use of these + scripts and programs in our instructions on how to better diagnose + and correct the situation. + + See documentation at the beginning of each file to learn what it + does. + diff -crN oommf-1.2a0/config/notes/async.tcl oommf/config/notes/async.tcl *** oommf-1.2a0/config/notes/async.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/async.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,76 ---- + #!/bin/sh + # FILE: async + # Usage: async + # \ + # + # The file pkg/net/link.tcl tries to use [socket -async] to make + # network connections. Unfortunately, [socket -async] is broken + # in some releases of Tcl on some platforms. This script tests + # for a broken [socket -async]. To use it, run it twice. First + # provide a host and port that allow a connection. Then provide + # a host and port that refused a connection. If either run results + # in a "Tcl is broken" message, then pkg/net/link.tcl needs to be + # written so that [socket -async] is avoided for that combination + # of platform and Tcl release. + # + # See also + # http://sourceforge.net/bugs/?group_id=10894&func=detailbug&bug_id=118945 + # + exec tclsh "$0" ${1+"$@"} + + proc AsyncConnect {host port} { + puts "creating socket..." + set s [socket -async $host $port] + puts "socket created" + fileevent $s writable [list VerifyConnection $s $host $port] + } + + proc VerifyConnection {s host port} { + global connected + fileevent $s writable {} + + # If there's an error condition on the socket (failure to connect), + # then [fconfigure -error] should provide an error message + # + set msg [fconfigure $s -error] + if {![string match {} $msg]} { + puts "Connection to $host:$port failed: $msg" + set connected 0 + catch {close $s} + return + } + + # Connection reportedly successful. At this point we normally + # configure the socket for whatever communications we want and + # set up fileevent handlers to manage protocols over the socket. + # + # Here, as a simple check, print out the peername information + # as a check of a good connection. If we really are connected, + # we print information about the far end of the connection. If + # not, print an error message indicating that Tcl's fileevent, + # fconfigure, and socket are not working as advertised. + # + if {[catch {fconfigure $s -peername} peerInfo]} { + puts "Tcl is broken: $peerInfo" + } else { + puts "Connected: $peerInfo" + } + set connected 1 + close $s + } + + proc tick {} { + # Demonstrate event loop is active, and provide eventual timeout + global tick connected + incr tick + puts "tick $tick" + if {$tick >= 6000} {set connected 0; return} + after 10 tick + } + + set connected 0 + set tick 0 + tick + eval AsyncConnect $argv + vwait connected + # END FILE: async diff -crN oommf-1.2a0/config/notes/badstdargs.c oommf/config/notes/badstdargs.c *** oommf-1.2a0/config/notes/badstdargs.c Wed Dec 31 19:00:00 1969 --- oommf/config/notes/badstdargs.c Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,43 ---- + /**********************************************************************/ + /* FILE: badstdargs.c + * + * This program demonstrates a bug in the SGI C compiler, cc, + * MIPSpro Compilers: Version 7.3.1.1m, when built on R12000 + * hardware with + * + * cc -Ofast badstdargs.c + * + * In this case sample output looks like + * + * x = 1.06097e-314 (should be 43.21) + * + * There appear to be several linker switches that will defeat this + * problem. One is '-IPA:aggr_cprop=OFF'. + * + * To express the bug, the number and type of parameters to foo() + * is important. If n1 and n2 are changed to char*'s (so it has the + * same signature as the sprintf() function), then the error disappears. + */ + + #include + #include + #include + + void foo(int n1,int n2, ...) + { + double x; + va_list arg_ptr; + va_start(arg_ptr,n2); + x = va_arg(arg_ptr,double); + va_end(arg_ptr); + printf("x = %g",x); + } + + int main(int argc,char** argv) + { + double x=43.21; + foo(3,4,x); + printf(" (should be %g)\n",x); + return 0; + } + diff -crN oommf-1.2a0/config/notes/ctrl.tcl oommf/config/notes/ctrl.tcl *** oommf-1.2a0/config/notes/ctrl.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/ctrl.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,13 ---- + # FILE: ctrl.tcl + # Control client program + # + # This script is used with the scripts server.tcl and data.tcl to test + # proper functioning of Tcl's socket fileevents. See server.tcl. + # + set s [socket localhost 5000] + fconfigure $s -blocking 0 -buffering line -translation {auto crlf} + button .start -text Start -command {puts $s start} + button .stop -text Stop -command {puts $s stop} + button .quit -text Quit -command exit + pack .start .stop .quit + # END FILE: ctrl.tcl diff -crN oommf-1.2a0/config/notes/ctype.tcl oommf/config/notes/ctype.tcl *** oommf-1.2a0/config/notes/ctype.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/ctype.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,14 ---- + # FILE: ctype.tcl + # + # This script makes use of Tcl's http package to retrieve a URL and + # print a summary of its properties. Notably, one can discover the + # Content-Type of the resources identified by that URL. This can + # be useful in testing whether web servers are properly exporting + # special Content-Types associated with OOMMF's file formats. + # + package require http + set token [http::geturl [lindex $argv 0]] + http::wait $token + array set summary [array get $token] + set summary(body) [string range $summary(body) 0 100]... + parray summary diff -crN oommf-1.2a0/config/notes/data.tcl oommf/config/notes/data.tcl *** oommf-1.2a0/config/notes/data.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/data.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,19 ---- + # FILE: data.tcl + # Data client program + # + # This script is used with the scripts server.tcl and ctrl.tcl to test + # proper functioning of Tcl's socket fileevents. See server.tcl. + # + set s [socket localhost 7000] + fconfigure $s -blocking 0 -buffering line -translation {auto crlf} + fileevent $s readable [list Read $s] + proc Read {s} { + set ::value [gets $s] + if {![eof $s]} { + puts $s "Got: $::value" + } + } + label .l -textvariable value + button .quit -text Quit -command exit + pack .l .quit + # END FILE: data.tcl diff -crN oommf-1.2a0/config/notes/nettest.tcl oommf/config/notes/nettest.tcl *** oommf-1.2a0/config/notes/nettest.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/nettest.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,51 ---- + # FILE: nettest.tcl + # + # This script is used to debug OOMMF's Net package. It must be + # evaluated with OOMMF's omfsh shell. In OOMMF's root directory, type: + # + # tclsh oommf.tcl omfsh config/notes/nettest.tcl + # + # A long stream of messages will be written to stderr logging the + # operations of the Net package as it starts up the host directory + # and account directory servers. Capture that log information in + # a file, and include it with your message to the OOMMF developers + # when you ask for their help debugging netowrking problems with + # your OOMMF installation. + + package require Oc + + # Report all status messages to stdout + proc WriteToStdout {msg type src} { + puts "$src $type: $msg" + } + Oc_Log SetLogHandler WriteToStdout status + + package require Net + + proc Die {} { + global server + $server Stop + after 2000 exit 0 + } + + Net_Protocol New protocol -name "OOMMF NetworkTest protocol 0.0" + $protocol AddMessage start HasGui {} { + return [list start [list 0 0]] + } + $protocol AddMessage start die {} { + after 2000 Die + return [list close [list 0 Bye!]] + } + Net_Server New server -protocol $protocol -alias nettest + $server Start 0 + + set cmd [list Net_Thread New thread -hostname localhost -pid [pid]:0 \ + -accountname [Net_Account DefaultAccountName] -alias nettest] + + if {[package vcompare [package provide Oc] 1.1] < 0} { + lappend cmd -log [em_extension ApplicationLog] + } + eval $cmd + Oc_EventHandler New _ $thread Ready [list $thread Send die] + + vwait forever diff -crN oommf-1.2a0/config/notes/server.tcl oommf/config/notes/server.tcl *** oommf-1.2a0/config/notes/server.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/server.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,133 ---- + # FILE: server.tcl + # Computation engine/server program + # + # This script is used with the scripts ctrl.tcl and data.tcl to test + # proper functions of Tcl's socket fileevents. Running OOMMF on + # Windows 95 and Windows 98 with some releases of Tcl 8.0 and Tcl 8.1, + # we noticed that when we had mmSolve2D sending Data out to two or + # more display applicataions every iteration, mmSolve2D was sluggish + # in responding to control commands from its interface (usually a + # Pause request). This could mean many iterations would compute after + # the interactive user asked for a Pause in the computation. + # + # These three scripts are pared down versions of OOMMF applications. + # server.tcl represents mmSolve2D. data.tcl represents a data + # display application, like mmDataTable. ctrl.tcl represents + # mmSolve2D's interactive interface. Use wish to start a copy of + # server.tcl, a copy of ctrl.tcl, and two copies of data.tcl. + # Click Start. You should see the server and data windows display + # incrementing counters that are roughly in sync. Now click Stop. + # If the counters stop immediately, things are fine. If they continue + # for awhile before stopping, your Tcl is probably buggy. + # + # We believe the bug these scripts test for was fixed in Tcl 8.2. + # We believe this bug was only present in the version of Tcl for the + # Microsoft Windows OS. + # + ######################################################################## + # Utility proc for reading from non-blocking socket + proc Receive {datahdlr closehdlr s} { + if {[catch {gets $s line} readCount]} { + # socket error + $closehdlr $s + close $s + return + } + if {$readCount < 0} { + if {[fblocked $s]} { + return + } + if {[eof $s]} { + $closehdlr $s + close $s + return + } + } + $datahdlr $s $line + } + + ######################################################################## + # Server for Data clients. Send out iteration counts to them. + # Display their replies in Tk labels. + + set datasockets {} + + proc DataHdlr {s line} { + set ::msg($s) $line + } + + proc DataCloseHdlr {s} { + set idx [lsearch -exact $::datasockets $s] + set ::datasockets [lreplace $::datasockets $idx $idx] + destroy .l$s + unset ::msg($s) + } + + proc DataChannel {s h p} { + fconfigure $s -blocking 0 -buffering line -translation {auto crlf} + puts $s "Connected to Data" + lappend ::datasockets $s + pack [label .l$s -textvariable msg($s)] + fileevent $s readable [list Receive DataHdlr DataCloseHdlr $s] + } + + socket -server DataChannel 7000 + + proc StepReport {ct} { + foreach s $::datasockets { + puts $s $ct + } + } + + ######################################################################## + # Iterative computation engine. [Step] is one iteration. + # [ChangeState] starts and stops the computation. + + set afterId {} + set state 0 + + proc ChangeState {f} { + if {$::state == $f} { + return + } + after cancel $::afterId + if {$f} { + set ::afterId [after idle Step] + } else { + set ::afterId {} + } + set ::state $f + } + + set count 0 + + proc Step {} { + after 1000; # Simulate computation + StepReport [incr ::count] + set ::afterId [after 1 {set ::afterId [after idle Step]}] + } + + ######################################################################## + # Server for Control clients. Recieve "start" and "stop" commands from + # them to start and stop the computation engine. + + proc CtrlHdlr {s line} { + switch -exact $line { + start {ChangeState 1} + stop {ChangeState 0} + default {} + } + } + + proc CtrlCloseHdlr {s} {} + + proc CtrlChannel {s h p} { + fconfigure $s -blocking 0 -buffering line -translation {auto crlf} + puts $s "Connected to Control" + fileevent $s readable [list Receive CtrlHdlr CtrlCloseHdlr $s] + } + + socket -server CtrlChannel 5000 + + pack [button .quit -text Quit -command exit] + # END FILE: server.tcl diff -crN oommf-1.2a0/config/notes/setperm.tcl oommf/config/notes/setperm.tcl *** oommf-1.2a0/config/notes/setperm.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/setperm.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,36 ---- + #!/bin/sh + # FILE: setperm.tcl + # + # Script to reset some file permissions that get lost when transported + # across a DOS filesystem. This script *must* be run from the OOMMF + # home directory. + # + # Bootstrap trick \ + exec tclsh "$0" ${1+"$@"} + + array set patarr { + ./app/mmdisp/*/avftoovf 755 + ./app/mmdisp/*/avftovio 755 + ./app/mmdisp/*/mmdisp 755 + ./app/mmpe/filesource.tcl 755 + ./app/mmpe/mmpe.tcl 755 + ./app/mmsolve/*/mmsolve 755 + ./app/omfsh/*/omfsh 755 + ./app/oommf/oommf.tcl 755 + ./app/pimake/pimake.tcl 755 + ./dvl/setperm.tcl 755 + ./ext/oc/*/varinfo 755 + } + + puts "Setting file permissions" + puts " Mode File" + foreach pat [lsort [array names patarr]] { + set perm $patarr($pat) + foreach file [lsort [glob -nocomplain -- $pat]] { + if {![catch {exec chmod $perm $file} errmsg]} { + puts [format " %4s %s" $perm $file] + } else { + puts stderr "Error setting file $file mode to $perm: $errmsg" + } + } + } diff -crN oommf-1.2a0/config/notes/tclbugs.tcl oommf/config/notes/tclbugs.tcl *** oommf-1.2a0/config/notes/tclbugs.tcl Wed Dec 31 19:00:00 1969 --- oommf/config/notes/tclbugs.tcl Fri Dec 15 18:32:28 2000 *************** *** 0 **** --- 1,49 ---- + #!/bin/sh + # \ + exec wish "$0" ${1+"$@"} + # + # This script tests for the presence of bugs found in some releases + # of Tcl/Tk which break OOMMF. Evaluate this script with + # wish to see if your Tcl/TK installation has those bugs + # fixed. The output should be lines which look like: + # + # Test 1: Success + # + # If any test reports failure, or if the program crashes, your + # Tcl/TK installation is buggy, and cannot run OOMMF. + + proc fooGet {varName} { + upvar $varName v + set v 0 + } + + set foo(Get) fooGet + + proc snafu {class proc args} { + upvar #0 $class def + uplevel $def($proc) $args + } + + interp alias {} foo {} snafu foo + + proc bar {} { + set v bad + foo Get v + if {!$v} { + puts "Test 1: Success" + } + } + + if {[catch bar msg]} { + puts "Test 1: Fail: $msg" + } + + if {![catch {package require Tk}]} { + set t [text .t] + $t insert end \n + $t window create end -window [button $t.b] + $t index end-2c + puts "Test 2: Success" + } + + exit 0 Binary files oommf-1.2a0/doc/common/contents.gif and oommf/doc/common/contents.gif differ Binary files oommf-1.2a0/doc/common/contents_motif.gif and oommf/doc/common/contents_motif.gif differ diff -crN oommf-1.2a0/doc/progman/localmods.perl oommf/doc/progman/localmods.perl *** oommf-1.2a0/doc/progman/localmods.perl Thu Aug 24 18:41:13 2000 --- oommf/doc/progman/localmods.perl Mon Dec 11 19:55:57 2000 *************** *** 56,62 **** # "My" contents page local($contents_img) = ! "\"contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); --- 56,62 ---- # "My" contents page local($contents_img) = ! "\"contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); *************** *** 88,94 **** # "My" contents page local($border) = (length($NAV_BORDER) ? "BORDER=\"$NAV_BORDER\"" : ""); ! local($contents_img) = "\"Contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); --- 88,94 ---- # "My" contents page local($border) = (length($NAV_BORDER) ? "BORDER=\"$NAV_BORDER\"" : ""); ! local($contents_img) = "\"Contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); diff -crN oommf-1.2a0/doc/progman/makerules.tcl oommf/doc/progman/makerules.tcl *** oommf-1.2a0/doc/progman/makerules.tcl Fri Oct 6 18:04:04 2000 --- oommf/doc/progman/makerules.tcl Mon Dec 11 19:55:57 2000 *************** *** 23,29 **** -script { Oc_Exec Foreground latex2html \ -init_file latex2html-init progman.tex ! file copy -force ../common/contents_motif.gif progman file copy -force ../common/oommficon.gif progman } } --- 23,29 ---- -script { Oc_Exec Foreground latex2html \ -init_file latex2html-init progman.tex ! file copy -force ../common/contents.gif progman file copy -force ../common/oommficon.gif progman } } diff -crN oommf-1.2a0/doc/progman/oxs-body.tex oommf/doc/progman/oxs-body.tex *** oommf-1.2a0/doc/progman/oxs-body.tex Tue Nov 14 18:19:08 2000 --- oommf/doc/progman/oxs-body.tex Sun Jan 21 15:42:41 2001 *************** *** 65,71 **** This sections provides an extended dissection of a simple \cd{Oxs\_Energy} child class. The computational details are kept as simple as possible, so the discussion can focus on the \Cplusplus class ! structural details. Althought the calculation details will vary between energy terms, the class structure issues discussed here apply across the board to all energy terms. --- 65,71 ---- This sections provides an extended dissection of a simple \cd{Oxs\_Energy} child class. The computational details are kept as simple as possible, so the discussion can focus on the \Cplusplus class ! structural details. Although the calculation details will vary between energy terms, the class structure issues discussed here apply across the board to all energy terms. diff -crN oommf-1.2a0/doc/progman/progman.tex oommf/doc/progman/progman.tex *** oommf-1.2a0/doc/progman/progman.tex Mon Nov 13 16:33:38 2000 --- oommf/doc/progman/progman.tex Fri Jan 19 10:58:26 2001 *************** *** 1,7 **** \input{../common/oommfhead} %\HTMLset{toppage}{progman.html} ! %\htmladdtonavigation{\htmladdnormallink{\htmladdimg{../common/contents_motif.gif}}{progman.html}} \begin{document} --- 1,7 ---- \input{../common/oommfhead} %\HTMLset{toppage}{progman.html} ! %\htmladdtonavigation{\htmladdnormallink{\htmladdimg{../common/contents.gif}}{progman.html}} \begin{document} *************** *** 20,26 **** Programming Manual\\[2ex] {\today} {}\\[2ex] ! This manual documents release 1.2a0.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date.\\[1ex] WARNING: This document in under construction. --- 20,26 ---- Programming Manual\\[2ex] {\today} {}\\[2ex] ! This manual documents release 1.2a1.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date.\\[1ex] WARNING: This document in under construction. diff -crN oommf-1.2a0/doc/userguide/cmdutils-body.tex oommf/doc/userguide/cmdutils-body.tex *** oommf-1.2a0/doc/userguide/cmdutils-body.tex Fri Nov 3 19:56:17 2000 --- oommf/doc/userguide/cmdutils-body.tex Mon Jan 22 04:09:57 2001 *************** *** 1,13 **** \section{Command Line Utilities}\label{sec:cmdutils} This section documents a few utilities distributed with \OOMMF\ that are ! run from the command line (\Unix\ shell or \Windows\ \DOS prompt), which are typically used in pre- or post-processing of data associated with a micromagnetic simulation. \subsection{Making Bitmaps from Vector Fields: avf2ppm}\label{sec:avf2ppm}% ! \index{file!bitmap}\index{file!vector~field}\index{file!conversion} The \app{avf2ppm}\index{application!avf2ppm} utility converts a collection of vector field files (e.g., \fn{.omf}, \fn{.ohf}) into color --- 1,184 ---- \section{Command Line Utilities}\label{sec:cmdutils} This section documents a few utilities distributed with \OOMMF\ that are ! run from the command line (\Unix\ shell or \Windows\ \DOS\ prompt), which are typically used in pre- or post-processing of data associated with a micromagnetic simulation. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \subsection{Bitmap File Format Conversion: + any2ppm}\label{sec:any2ppm}% + \index{file!bitmap}\index{file!ppm}\index{file!bmp}\index{file!gif}% + \index{application!any2ppm}\index{file!conversion} + The \app{any2ppm} program converts bitmap files of various formats into + the Portable Pixmap (PPM) P3 (text) format. Supported input formats are + PPM, BMP, and GIF. (Note: \OOMMF\ support for BMP + requires Tk 8.0\index{requirement!Tk~8.0+} + or later.) + + \sssechead{Launching} + The \app{any2ppm} launch command is: + \begin{verbatim} + tclsh oommf.tcl any2ppm [standard options] [-noinfo] \ + [-o outfile] [infile ...] + \end{verbatim} + where + \begin{description} + \item[{\tt\bf -noinfo}] + Suppress writing of progress information to stderr. + \item[{\tt\bf -o outfile}] + Write output to {\tt outname}; use ``-'' to pipe output to + stdout. The default is to create a new file by stripping the + extension, if any, off of each input filename, and appending \fn{.ppm}. + If the generated filename already exists, a ``-000'' or ``-001'' + \ldots\ suffix is appended. + \item[{\tt\bf infile ...}] + List of input files to process. + \end{description} + + {\bf \Tk\ Requirement:}\index{requirement!Tk} \app{any2ppm} uses the + \Tk\ \cd{image} command in its processing. This requires that \Tk\ be + properly initialized, which in particular means that a valid display + 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} + virtual framebuffer can be used if desired. (Xvfb is an X server + distributed with X11R6 that requires no display hardware or physical + input devices.) + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \subsection{Making Data Tables from Vector Fields: + avf2odt}\label{sec:avf2odt}% + \index{file!vector~field}\index{file!data~table}\index{file!vio}% + \index{application!avf2odt}\index{file!conversion} + The \app{avf2odt} program converts rectangularly meshed vector field + files in any of the \latexhtml{recognized formats (\OVF, \VIO; see + Sec.~\ref{sec:vfformats})}{\htmlref{recognized formats}{sec:vfformats} + (\OVF, \VIO)} into the \hyperrefhtml{\ODT~1.0}{\ODT~1.0 + (Sec.~}{)}{sec:odtformat} data table format. + + \sssechead{Launching} + The \app{avf2odt} launch command is: + \begin{verbatim} + tclsh oommf.tcl avf2odt [standard options] \ + [-type ] [-axis ] \ + [-region ] \ + infile >outfile + \end{verbatim} + where + \begin{description} + \item[{\tt\bf -type $<$space\pipe plane\pipe line\pipe point$>$}] + Specify type of averaging. \cd{Space} outputs 1 data line + consisting of the average $v_x$, $v_y$ and $v_z$ field values in the + selected region (see \cd{-region} option below). (For magnetization + files, $v_x$, $v_y$ and $v_z$ correspond to $M_x$, $M_y$ and $M_z$.) + If \cd{plane} or \cd{line} is selected, then the output data table + consists of multiple lines with 4 or 5 columns respectively. The + last 3 columns in both cases are the $v_x$, $v_y$ and $v_z$ averaged + over the specified axes-parallel affine subspace (i.e., plane or + line). In the \cd{plane} case, the first column specifies the + averaging plane offset along the coordinate axis normal to the plane + (see \cd{-axis} option below). In the \cd{line} case, the first + 2 columns specify the offset of the averaging line in the coordinate + plane perpendicular to the line. If \cd{-type} is set to + \cd{point}, then no averaging is done, and the output consists of 6 + column data lines, one line for each point in the selected region, + where the first 3 columns are the point coordinates, and the last 3 + are the $v_x$, $v_y$ and $v_z$ values at the point. + + This parameter is optional. The default value is \cd{space}. + + \item[{\tt\bf -axis $<$x\pipe y\pipe z$>$}] + For the \cd{-type plane} and \cd{-type line} averaging types, + selects which subset of affine subspaces the averaging will be + performed over. In the \cd{plane} case, the \cd{-axis} represents + the normal direction to the planes, while for \cd{line} it is the + direction parallel to the lines. This parameter is ignored if + \cd{-type} is \cd{space} or \cd{point}. Optional; default is + \cd{x}. + + \item[{\tt\bf -region $<$xmin$>$ $<$ymin$>$ $<$zmin$>$ + $<$xmax$>$ $<$ymax$>$ $<$zmax$>$}] + Axes-parallel rectangular box denoting region in the vector field + file over which data is to be collected. The locations are in + problem units (typically meters). A single hyphen, ``-'', may be + specified for any of the box corner coordinates, in which case the + corresponding extremal value from the input file is used. Optional; + the default, \cd{-region - - - - - -}, selects the entire input file. + + \item[{\tt\bf infile}] + Name of input file to process. Must be one of the recognized formats, + \OVF\ 1.0 or \VIO, in a rectangular mesh subformat. Required. + \item[{\tt\bf $>$outfile}] + Avf2odt writes its output to stdout. Use the redirection operator + ``$>$'' to send the output to a file. For output format details, + see the \hyperrefhtml{\ODT\ file description}{\ODT\ file description + (Sec.~}{)}{sec:odtformat}. + \end{description} + + {\bf Note:} The $m_x$, $m_y$ and $m_z$ average magnetization values + reported by \hyperrefhtml{mmSolve2D}{mmSolve2D + (Sec.~}{)}{sec:mmsolve2d}\index{application!mmSolve2D} exclude points with 0 saturation + magnetization. Such points are {\em included} by \app{avf2odt}, + so the data table output from this program will probably not agree + with that directly output from \app{mmSolve2D} if there are any such regions. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \subsection{Vector Field File Format Conversion: + avf2ovf}\label{sec:avf2ovf}% + \index{file!vector~field}\index{file!vio}% + \index{application!avf2ovf}\index{file!conversion} + The \app{avf2ovf} program converts vector field files from any of the + \latexhtml{recognized formats (\OVF, \VIO; see + Sec.~\ref{sec:vfformats})}{\htmlref{recognized formats}{sec:vfformats} + (\OVF, \VIO)} into the \OVF\ 1.0 format. + + \sssechead{Launching} + The \app{avf2ovf} launch command is: + \begin{verbatim} + tclsh oommf.tcl avf2ovf [standard options] [-format ] \ + [-grid ] infile >outfile + \end{verbatim} + where + \begin{description} + \item[{\tt\bf -format $<$text\pipe b4\pipe b8$>$}] + Specify output data format. The default is ASCII \cd{text}; \cd{b4} selects + 4-byte binary, \cd{b8} selects 8-byte binary. (The OVF format has an + ASCII text header in all cases.) + \item[{\tt\bf -grid $<$reg\pipe irreg$>$}] + Specify output grid\index{grid} structure. The default is \cd{reg}, which + will output a regular (rectangular) grid if the input is recognized + as a regular grid. The option \cd{-grid irreg} forces irregular mesh style + output. + \item[{\tt\bf infile}] + Name of input file to process. Must be one of the recognized formats, + \OVF\ 0.0, \OVF\ 1.0, or \VIO. + \item[{\tt\bf $>$outfile}] + Avf2ovf writes its output to stdout. Use the redirection operator + ``$>$'' to send the output to a file. + \end{description} + + The \cd{-format text} and \cd{-grid irreg} options are useful for + preparing files for import + into non-\OOMMF\ applications, because all non-data lines are readily + identified by a leading ``\verb+#+,'' and each data line is a 6-tuple + consisting of the node location and vector value. Pay attention, + however, to the scaling of the vector value as specified by %%%%%%%%%% + ``\verb+# valueunit+'' and ``\verb+# valuemultiplier+'' header lines. + + For output format details, see the \hyperrefhtml{OVF file + description}{OVF file description (Sec.~}{)}{sec:ovfformat}. + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \subsection{Making Bitmaps from Vector Fields: avf2ppm}\label{sec:avf2ppm}% ! \index{file!bitmap}\index{file!vector~field}\index{file!conversion}% ! \index{animations} The \app{avf2ppm}\index{application!avf2ppm} utility converts a collection of vector field files (e.g., \fn{.omf}, \fn{.ohf}) into color *************** *** 264,384 **** the command line. These are processed from left to right, with the last value set for each entry taking precedence. ! \subsection{Bitmap File Format Conversion: ! any2ppm}\label{sec:any2ppm}% ! \index{file!bitmap}\index{file!ppm}\index{file!bmp}\index{file!gif}% ! \index{application!any2ppm}\index{file!conversion} ! The \app{any2ppm} program converts bitmap files of various formats into ! the Portable Pixmap (PPM) P3 (text) format. Supported input formats are ! PPM, BMP, and GIF. (Note: \OOMMF\ support for BMP ! requires Tk 8.0\index{requirement!Tk~8.0+} ! or later.) ! ! \sssechead{Launching} ! The \app{any2ppm} launch command is: ! \begin{verbatim} ! tclsh oommf.tcl any2ppm [standard options] [-noinfo] \ ! [-o outfile] [infile ...] ! \end{verbatim} ! where ! \begin{description} ! \item[{\tt\bf -noinfo}] ! Suppress writing of progress information to stderr. ! \item[{\tt\bf -o outfile}] ! Write output to {\tt outname}; use ``-'' to pipe output to ! stdout. The default is to create a new file by stripping the ! extension, if any, off of each input filename, and appending \fn{.ppm}. ! If the generated filename already exists, a ``-000'' or ``-001'' ! \ldots\ suffix is appended. ! \item[{\tt\bf infile ...}] ! List of input files to process. ! \end{description} ! ! {\bf \Tk\ Requirement:}\index{requirement!Tk} \app{any2ppm} uses the ! \Tk\ \cd{image} command in its processing. This requires that \Tk\ be ! properly initialized, which in particular means that a valid display ! 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} ! virtual framebuffer can be used if desired. (Xvfb is an X server ! distributed with X11R6 that requires no display hardware or physical ! input devices.) ! \subsection{Vector Field File Format Conversion: ! avf2ovf}\label{sec:avf2ovf}% \index{file!vector~field}\index{file!vector~field}\index{file!vio}% ! \index{application!avf2ovf}\index{file!conversion} ! The \app{avf2ovf} program converts vector field files from any of the ! \latexhtml{recognized formats (\OVF, \VIO; see Sec.~\ref{sec:vfformats})}{\htmlref{recognized formats}{sec:vfformats} ! (\OVF, \VIO)} into the \OVF\ 1.0 format. \sssechead{Launching} ! The \app{avf2ovf} launch command is: \begin{verbatim} ! tclsh oommf.tcl avf2ovf [standard options] [-format ] \ ! [-grid ] infile >outfile \end{verbatim} where \begin{description} ! \item[{\tt\bf -format $<$text\pipe b4\pipe b8$>$}] ! Specify output data format. The default is ASCII \cd{text}; \cd{b4} selects ! 4-byte binary, \cd{b8} selects 8-byte binary. (The OVF format has an ! ASCII text header in all cases.) ! \item[{\tt\bf -grid $<$reg\pipe irreg$>$}] ! Specify output grid\index{grid} structure. The default is \cd{reg}, which ! will output a regular (rectangular) grid if the input is recognized ! as a regular grid. The option \cd{-grid irreg} forces irregular mesh style ! output. ! \item[{\tt\bf infile}] ! Name of input file to process. Must be one of the recognized formats, ! \OVF\ 0.0, \OVF\ 1.0, or \VIO. ! \item[{\tt\bf $>$outfile}] ! Avf2ovf writes its output to stdout. Use the redirection operator ! ``$>$'' to send the output to a file. \end{description} ! The \cd{-format text} and \cd{-grid irreg} options are useful for ! preparing files for import ! into non-\OOMMF\ applications, because all non-data lines are readily ! identified by a leading ``\verb+#+,'' and each data line is a 6-tuple ! consisting of the node location and vector value. Pay attention, ! however, to the scaling of the vector value as specified by %%%%%%%%%% ! ``\verb+# valueunit+'' and ``\verb+# valuemultiplier+'' header lines. ! For output format details, see the \hyperrefhtml{OVF file description}{OVF file description (Sec.~}{)}{sec:ovfformat}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - \subsection{\MIF\ Format Conversion: mifconvert}\label{sec:mifconvert}% - \index{file!mif}\index{file!conversion} - - The \app{mifconvert}\index{application!mifconvert} utility converts a - \hyperrefhtml{\MIF~1.1}{\MIF~1.1, see Sec.~}{}{sec:mif1format} - micromagnetic problem specification file into the - \hyperrefhtml{\MIF~2.0}{\MIF~2.0, see Sec.~}{}{sec:mif2format} - format. Eventually, it should be possible to express any problem in - the \MIF~1.1 format using the \MIF\ 2.0 format, but currently that is - not the case. It is recommended that the user carefully inspect the - \MIF~2.0 files generated by this routine for correctness. - - \sssechead{Launching} - The \app{mifconvert} launch command is: - \begin{verbatim} - tclsh oommf.tcl mifconvert input_file output_file - \end{verbatim} - where - \begin{description} - \item[{\tt\bf input\_file}] - Import \MIF~1.1 micromagnetic problem specification file. Required. - \item[{\tt\bf output\_file}] - Export \MIF~2.0 micromagnetic problem specification file. Required. - \end{description} - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - \subsection{Calculating \vH\ Fields from Magnetization: mag2hfield}\label{sec:mag2hfield}% \index{file!magnetization}\index{file!vector~field}\index{file!conversion} --- 435,484 ---- the command line. These are processed from left to right, with the last value set for each entry taking precedence. ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ! \subsection{Vector Field File Difference: ! avfdiff}\label{sec:avfdiff}% \index{file!vector~field}\index{file!vector~field}\index{file!vio}% ! \index{application!avfdiff}\index{file!difference} ! The \app{avfdiff} program computes differences between vector field files ! in any of the \latexhtml{recognized formats (\OVF, \VIO; see Sec.~\ref{sec:vfformats})}{\htmlref{recognized formats}{sec:vfformats} ! (\OVF, \VIO)}. The input data must lie on rectangular meshes with ! identical dimensions. \sssechead{Launching} ! The \app{avfdiff} launch command is: \begin{verbatim} ! tclsh oommf.tcl avf2ovf [standard options] file-0 file-1 [... file-n] \end{verbatim} where \begin{description} ! \item[{\tt\bf file-0}] ! Name of input file to subtract from other files. Must be either ! an \OVF\ 1.0 file in the rectangular mesh subformat, or an \VIO\ ! file. Required. ! \item[{\tt\bf file-1}] ! Name of first input file from which \cd{file-0} is to be subtracted. ! Must also be either an \OVF\ 1.0 file in the rectangular mesh ! subformat, or an \VIO\ file, and must have the same dimensions as ! \cd{file-0}. Required. ! \item[{\tt\bf\ldots file-n}] ! Optional additional files from which \cd{file-0} is to be ! subtracted, with the same requirements as \cd{file-1}. \end{description} ! For each input file \cd{file-1} through \cd{file-n}, a separate output ! file is generated, in the \OVF\ 1.0 format. Each output file has a ! name based on the name of corresponding input file, with a \cd{-diff} ! suffix. If a file with the same name already exists, it will be ! overwritten. ! For output file format details, see the \hyperrefhtml{OVF file description}{OVF file description (Sec.~}{)}{sec:ovfformat}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Calculating \vH\ Fields from Magnetization: mag2hfield}\label{sec:mag2hfield}% \index{file!magnetization}\index{file!vector~field}\index{file!conversion} *************** *** 434,439 **** --- 534,568 ---- \fn{.omf} magnetization file name, stripped of any trailing \fn{.omf} or \fn{.ovf} extension. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + + \subsection{\MIF\ Format Conversion: mifconvert}\label{sec:mifconvert}% + \index{file!mif}\index{file!conversion} + + The \app{mifconvert}\index{application!mifconvert} utility converts a + \hyperrefhtml{\MIF~1.1}{\MIF~1.1, see Sec.~}{}{sec:mif1format} + micromagnetic problem specification file into the + \hyperrefhtml{\MIF~2.0}{\MIF~2.0, see Sec.~}{}{sec:mif2format} + format. Eventually, it should be possible to express any problem in + the \MIF~1.1 format using the \MIF\ 2.0 format, but currently that is + not the case. It is recommended that the user carefully inspect the + \MIF~2.0 files generated by this routine for correctness. + + \sssechead{Launching} + The \app{mifconvert} launch command is: + \begin{verbatim} + tclsh oommf.tcl mifconvert input_file output_file + \end{verbatim} + where + \begin{description} + \item[{\tt\bf input\_file}] + Import \MIF~1.1 micromagnetic problem specification file. Required. + \item[{\tt\bf output\_file}] + Export \MIF~2.0 micromagnetic problem specification file. Required. + \end{description} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + \subsection{Platform-Independent Make: pimake}\label{sec:pimake}% \index{application!pimake} *************** *** 482,488 **** \item[{\tt\bf upgrade}] Used immediately after unpacking a distribution, it removes any files which were part of a previous release, but are not ! part of the unpacked distrubtion. \item[{\tt\bf all}] Creates all files created by the \fn{configure} target (see below). Compiles and links all the executables and libraries. --- 611,617 ---- \item[{\tt\bf upgrade}] Used immediately after unpacking a distribution, it removes any files which were part of a previous release, but are not ! part of the unpacked distribution. \item[{\tt\bf all}] Creates all files created by the \fn{configure} target (see below). Compiles and links all the executables and libraries. *************** *** 513,516 **** --- 642,647 ---- \item[{\tt\bf help}] Print a summary of the standard targets. \end{description} + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff -crN oommf-1.2a0/doc/userguide/fileformats-body.tex oommf/doc/userguide/fileformats-body.tex *** oommf-1.2a0/doc/userguide/fileformats-body.tex Wed Nov 8 20:45:46 2000 --- oommf/doc/userguide/fileformats-body.tex Mon Jan 22 04:09:57 2001 *************** *** 11,25 **** (Sec.~}{)}{sec:batchsolve}\index{application!batchsolve}) and the \hyperrefhtml{\app{mmProbEd}}{\app{mmProbEd} (Sec.~}{)}{sec:mmprobed}\index{application!mmProbEd} problem editor. ! The new \MIF format, version 2.0, is used by the Oxs 3D solver (\hyperrefhtml{\app{Oxsii}}{\app{Oxsii} (Sec.~}{)}{sec:oxsii}\index{application!Oxsii}). In both cases all values are in \SI\ units. A command line utility \hyperrefhtml{\app{mifconvert}}{\app{mifconvert} (Sec.~}{)}{sec:mifconvert}\index{application!mifconvert} is provided to aid in converting \MIF~1.1 files to the \MIF~2.0 format. For both ! versions it is recommended that \MIF\ files be given names ending in the ! \fn{.mif} file extension. \subsubsection{\MIF~1.1}\label{sec:mif1format} --- 11,25 ---- (Sec.~}{)}{sec:batchsolve}\index{application!batchsolve}) and the \hyperrefhtml{\app{mmProbEd}}{\app{mmProbEd} (Sec.~}{)}{sec:mmprobed}\index{application!mmProbEd} problem editor. ! The new \MIF\ format, version 2.0, is used by the Oxs 3D solver (\hyperrefhtml{\app{Oxsii}}{\app{Oxsii} (Sec.~}{)}{sec:oxsii}\index{application!Oxsii}). In both cases all values are in \SI\ units. A command line utility \hyperrefhtml{\app{mifconvert}}{\app{mifconvert} (Sec.~}{)}{sec:mifconvert}\index{application!mifconvert} is provided to aid in converting \MIF~1.1 files to the \MIF~2.0 format. For both ! versions it is recommended that \MIF\ files be given names ending with ! the \fn{.mif} file extension. \subsubsection{\MIF~1.1}\label{sec:mif1format} *************** *** 601,617 **** \begin{verbatim} Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! region Oxs_RectangularRegion:World } \end{verbatim} \end{quote} Here the value associated with ``cellsize'' is a list of 3 elements (the sampling rate along each of the coordinate axes, in meters). Notice ! also that the ``region'' value refers to an earlier \cd{Oxs\_Ext} ! object, ``Oxs\_RectangularRegion:World''. A \cd{Specify} block may also include embedded \cd{Oxs\_Ext} objects. ! This is typically used to initialize a spatially varying quantity. For example, \begin{quote} \begin{verbatim} --- 601,617 ---- \begin{verbatim} Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! atlas Oxs_SectionAtlas:WorldAtlas } \end{verbatim} \end{quote} Here the value associated with ``cellsize'' is a list of 3 elements (the sampling rate along each of the coordinate axes, in meters). Notice ! also that the ``atlas'' value refers to an earlier \cd{Oxs\_Ext} ! object, ``Oxs\_SectionAtlas:WorldAtlas''. A \cd{Specify} block may also include embedded \cd{Oxs\_Ext} objects. ! This is frequently used to initialize a spatially varying quantity. For example, \begin{quote} \begin{verbatim} *************** *** 688,717 **** # Individual Oxs_Ext objects are loaded and initialized # via Specify command blocks. The following block defines # the extents (in meters) of the volume to be modeled. ! # The prefix 'Oxs_RectangularRegion' specifies the type ! # of Oxs_Ext object to create, and the suffix ':World' is # the name assigned to this particular instance. Each object # created by a Specify command must have a unique full name ! # (here 'Oxs_RectangularRegion:World'). If the suffix is # not explicitly given, then the default ':' is automatically # assigned. References may be made to either the full name, ! # or the shorter suffix instance name (here ':World') if the # latter is unique. See the Oxs_StandardDriver block for some # reference examples. ! Specify Oxs_RectangularRegion:World { ! xrange {1e-9 301e-9} ! yrange {0 200e-9} ! zrange {-1d-9 19e-9} } # The Oxs_RectangularMesh object is initialized with the # discretization cell size (in meters). Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! region Oxs_RectangularRegion:World } ! # Sample magnetocrystalline anisotropy block. # Oxs_UniformScalarFieldInit and Oxs_UniformVectorFieldInit # are examples of embedded Oxs_Ext objects used to provide # internal initialization of the Oxs_UniaxialAnisotropy --- 688,729 ---- # Individual Oxs_Ext objects are loaded and initialized # via Specify command blocks. The following block defines # the extents (in meters) of the volume to be modeled. ! # The prefix 'Oxs_SectionAtlas' specifies the type ! # of Oxs_Ext object to create, and the suffix ':WorldAtlas' is # the name assigned to this particular instance. Each object # created by a Specify command must have a unique full name ! # (here 'Oxs_SectionAtlas:WorldAtlas'). If the suffix is # not explicitly given, then the default ':' is automatically # assigned. References may be made to either the full name, ! # or the shorter suffix instance name (here ':WorldAtlas') if the # latter is unique. See the Oxs_StandardDriver block for some # reference examples. ! Specify Oxs_SectionAtlas:WorldAtlas { ! top { Oxs_RectangularSection { ! xrange {0 500e-9} ! yrange {0 250e-9} ! zrange {3e-9 9e-9} ! } } ! bottom { Oxs_RectangularSection { ! xrange {0 500e-9} ! yrange {0 250e-9} ! zrange {0 3e-9} ! } } ! world { Oxs_RectangularSection { ! xrange {0 500e-9} ! yrange {0 250e-9} ! zrange {0 9e-9} ! } } } # The Oxs_RectangularMesh object is initialized with the # discretization cell size (in meters). Specify Oxs_RectangularMesh:mesh { cellsize {10e-9 10e-9 10e-9} ! atlas :WorldAtlas } ! # Magnetocrystalline anisotropy block. # Oxs_UniformScalarFieldInit and Oxs_UniformVectorFieldInit # are examples of embedded Oxs_Ext objects used to provide # internal initialization of the Oxs_UniaxialAnisotropy *************** *** 725,733 **** } } ! Specify Oxs_Exchange6Ngbr:NiFe { ! A 13e-12 ! mesh :mesh } # Define a couple of constants for later use. --- 737,755 ---- } } ! # Exchange energy with spatially varying exchange ! # coefficient A. Inside the top layer (refer to ! # Oxs_SectionAtlas:WorldAtlas above) A = 13e-12 J/m, ! # in the bottom layer A = 30e-12 J/m (taken from the ! # default_A value), and the interlayer coupling is ! # A = 20e-12 J/m. ! Specify Oxs_Exchange6Ngbr { ! default_A 30e-12 ! atlas :WorldAtlas ! A { ! { top top 13e-12 } ! { top bottom 20e-12 } ! } } # Define a couple of constants for later use. *************** *** 749,758 **** } " ! Specify Oxs_Demag { ! mesh :mesh ! } Specify Oxs_EulerEvolve { alpha 0.5 start_dm 0.01 --- 771,781 ---- } " ! # Enable demagnetization (stray) field computation. ! # This block takes no parameters. ! Specify Oxs_Demag {} + # First order Euler ODE solver Specify Oxs_EulerEvolve { alpha 0.5 start_dm 0.01 *************** *** 774,780 **** evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 1 mesh :mesh number_of_stages 1 stage_iteration_limit 0 --- 797,803 ---- evolver Oxs_EulerEvolve min_timestep 1e-18 max_timestep 1e-9 ! stopping_dm_dt 0.01 mesh :mesh number_of_stages 1 stage_iteration_limit 0 diff -crN oommf-1.2a0/doc/userguide/install-body.tex oommf/doc/userguide/install-body.tex *** oommf-1.2a0/doc/userguide/install-body.tex Fri Nov 17 17:26:49 2000 --- oommf/doc/userguide/install-body.tex Fri Jan 19 22:32:21 2001 *************** *** 82,137 **** We do development and test builds on the following platforms, although porting to others should not be difficult: ! % The following conditional text is a kludge, based on the ! % implementation of \html{...}. However, it is also a workaround for a ! % bug in latex2html, that generates footnotes from inside ! % \newcommand{...}, and \settowidth{...}{...} where it shouldn't. So, ! % if the \html{...} implementation is changed so that the kludge below ! % breaks, perhaps the footnote generation bug will happen to be fixed ! % too? ! \begin{center} ! \html{\par\begin{makeimage}\htmlimage{no_transparent}} % Note: Don't use transparent images, because mmHelp % renders transparent them rather slowly. ! %begin{latexonly} ! \newcommand{\platformtable}{% ! %end{latexonly} ! \renewcommand{\thefootnote}{\fnsymbol{footnote}} ! \renewcommand{\thempfootnote}{\fnsymbol{mpfootnote}} ! \html{\setcounter{footnote}{0}} \begin{tabular}{|l|l|}\hline Platform & Compilers \\ \hline ! AIX & Gnu gcc \\ Alpha/Compaq Tru64 UNIX & Compaq C++, Gnu gcc \\ Alpha/Linux & Compaq C++, Gnu gcc \\ Alpha/Windows NT & ! Microsoft Visual C++\footnote{Version 5.0 or later required to build the ! OXS (3D) solver.\label{fn:mvcpp}} \\ ! HP-UX & ! HP C++ (cfront),\footnote{The older HP cfront compiler will not build the ! OXS (3D) solver.}\, aC++ \\ Intel/Linux & Gnu gcc \\ Intel/Windows NT, 95, 98 & ! % The following dance on the footnote is required to get pdftex ! % to set the link without dying. ! Microsoft Visual C++,% ! $^{\mbox{\scriptsize\ref{fn:mvcpp}}}$ ! \\ & Cygwin gcc, Borland C++ \\ MIPS/IRIX 6 (SGI) & MIPSpro C++, Gnu gcc \\ SPARC/Solaris & Sun Workshop C++, Gnu gcc \\ \hline ! \end{tabular}% ! %begin{latexonly} ! } ! \newlength{\platformtablewidth} ! \settowidth{\platformtablewidth}{\platformtable} ! \begin{minipage}{\platformtablewidth} ! \platformtable ! \end{minipage} ! %end{latexonly} ! \html{\end{makeimage}} \end{center} \subsection{Basic Installation} Follow the instructions in the following sections, in order, --- 82,120 ---- We do development and test builds on the following platforms, although porting to others should not be difficult: ! % Note: Don't use transparent images, because mmHelp % renders transparent them rather slowly. ! \begin{center} ! \begin{makeimage} ! \htmlimage{no_transparent} \begin{tabular}{|l|l|}\hline Platform & Compilers \\ \hline ! AIX & VisualAge C++ (xlC), Gnu gcc \\ Alpha/Compaq Tru64 UNIX & Compaq C++, Gnu gcc \\ Alpha/Linux & Compaq C++, Gnu gcc \\ Alpha/Windows NT & ! Microsoft Visual C++ \\ ! HP-UX & aC++ \\ Intel/Linux & Gnu gcc \\ Intel/Windows NT, 95, 98 & ! Microsoft Visual C++, \\ & Cygwin gcc, Borland C++ \\ MIPS/IRIX 6 (SGI) & MIPSpro C++, Gnu gcc \\ SPARC/Solaris & Sun Workshop C++, Gnu gcc \\ \hline ! \end{tabular} ! \end{makeimage} \end{center} + \par\noindent + \textbf{System Notes:} + \begin{description} + \item[Windows] Versions of the Microsoft Visual C++ compiler earlier + than 5.0 will not build the OXS (3D) solver. + \item[HP-UX] The older HP cfront compiler will not build the OXS (3D) + solver. + \end{description} + \subsection{Basic Installation} Follow the instructions in the following sections, in order, *************** *** 214,229 **** here is the typical output on a Linux/Alpha system: \begin{verbatim} $ tclsh oommf.tcl +platform ! <24537> oommf.tcl 1.2.0.0 info: ! OOMMF release 1.2.0.0 Platform Name: linalp C++ compiler: /usr/bin/g++ Tcl configuration file: /usr/local/lib/tclConfig.sh tclsh: /usr/local/bin/tclsh8.3 ! Tcl release: 8.3.1 (config) 8.3.1 (running) Tk configuration file: /usr/local/lib/tkConfig.sh wish: /usr/local/bin/wish8.3 ! Tk release: 8.3.1 (config) 8.3.1 (running) \end{verbatim} If \cd{oommf.tcl +platform} doesn't print a summary like that, it --- 197,213 ---- 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 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) Tk configuration file: /usr/local/lib/tkConfig.sh wish: /usr/local/bin/wish8.3 ! Tk release: 8.3.2 (config) 8.3.2 (running) \end{verbatim} If \cd{oommf.tcl +platform} doesn't print a summary like that, it *************** *** 257,270 **** release with pre-compiled binaries for your platform, you may ignore this line. Otherwise, if this line reports ``none selected'', or if it reports a compiler other than the one you wish to use, ! then you will need to tell \OOMMF\ what compiler to use. The ! compiler selection for the example above is recorded in the file ! \fn{config/cache/linalp.tcl}. To change the compiler selection, ! that file must be edited. Editing instructions are contained within ! the file. Of course, on other platforms the name \fn{linalp} ! in \fn{linalp.tcl} should be replaced with the platform name \OOMMF\ ! reports for your platform. For example, on a Windows machine using an ! x86 processor, the corresponding configuration file is \fn{wintel.tcl}. \index{installation!Tcl\Tk|(} The next three lines describe the \Tcl\ configuration \OOMMF\ finds --- 241,255 ---- release with pre-compiled binaries for your platform, you may ignore this line. Otherwise, if this line reports ``none selected'', or if it reports a compiler other than the one you wish to use, ! then you will need to tell \OOMMF\ what compiler to use. To do ! that, you must edit the appropriate configuration file for your ! platform. Continuing the example above, one would edit the file ! \fn{config/cache/linalp.tcl}. Editing instructions are contained within ! the file. On other platforms the name \fn{linalp} ! in \fn{config/cache/linalp.tcl} should be replaced with the ! platform name \OOMMF\ reports for your platform. For example, ! on a Windows machine using an x86 processor, ! the corresponding configuration file is \fn{config/cache/wintel.tcl}. \index{installation!Tcl\Tk|(} The next three lines describe the \Tcl\ configuration \OOMMF\ finds diff -crN oommf-1.2a0/doc/userguide/localmods.perl oommf/doc/userguide/localmods.perl *** oommf-1.2a0/doc/userguide/localmods.perl Thu Aug 24 18:41:13 2000 --- oommf/doc/userguide/localmods.perl Mon Dec 11 19:55:57 2000 *************** *** 56,62 **** # "My" contents page local($contents_img) = ! "\"contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); --- 56,62 ---- # "My" contents page local($contents_img) = ! "\"contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); *************** *** 88,94 **** # "My" contents page local($border) = (length($NAV_BORDER) ? "BORDER=\"$NAV_BORDER\"" : ""); ! local($contents_img) = "\"Contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); --- 88,94 ---- # "My" contents page local($border) = (length($NAV_BORDER) ? "BORDER=\"$NAV_BORDER\"" : ""); ! local($contents_img) = "\"Contents\""; local($contents_page) = &my_get_contents_page ; local($mycontents) = &add_special_link($contents_img,$contents_page,$file); diff -crN oommf-1.2a0/doc/userguide/makerules.tcl oommf/doc/userguide/makerules.tcl *** oommf-1.2a0/doc/userguide/makerules.tcl Sat Nov 18 17:48:35 2000 --- oommf/doc/userguide/makerules.tcl Mon Dec 11 19:55:57 2000 *************** *** 23,29 **** -script { Oc_Exec Foreground latex2html \ -init_file latex2html-init userguide.tex ! file copy -force ../common/contents_motif.gif userguide file copy -force ../common/oommficon.gif userguide } } --- 23,29 ---- -script { Oc_Exec Foreground latex2html \ -init_file latex2html-init userguide.tex ! file copy -force ../common/contents.gif userguide file copy -force ../common/oommficon.gif userguide } } diff -crN oommf-1.2a0/doc/userguide/mmdatatable-body.tex oommf/doc/userguide/mmdatatable-body.tex *** oommf-1.2a0/doc/userguide/mmdatatable-body.tex Thu Aug 24 18:41:13 2000 --- oommf/doc/userguide/mmdatatable-body.tex Mon Dec 18 18:44:34 2000 *************** *** 90,95 **** specifications of the selected entry. These specifications, with any revisions, may then be applied to all of the selected entries. ! The menu selection \btn{File\pipe Exit} terminates the ! {\bf mmDataTable} application. The menu \btn{Help} provides ! the usual help facilities. --- 90,97 ---- specifications of the selected entry. These specifications, with any revisions, may then be applied to all of the selected entries. ! The menu selection \btn{File\pipe Reset} reinitializes the ! \textbf{mmDataTable} application to its original state, clearing the ! display and the \btn{Data} menu. The menu selection ! \btn{File\pipe Exit} terminates the application. The menu \btn{Help} ! provides the usual help facilities. diff -crN oommf-1.2a0/doc/userguide/mmdisp-body.tex oommf/doc/userguide/mmdisp-body.tex *** oommf-1.2a0/doc/userguide/mmdisp-body.tex Thu Aug 24 18:41:13 2000 --- oommf/doc/userguide/mmdisp-body.tex Sun Jan 21 15:42:41 2001 *************** *** 481,483 **** --- 481,486 ---- \htmladdnormallink{http://www.ctcms.nist.gov/\%7Erdm/std1/vectorcompare.html}{http://www.ctcms.nist.gov/\%7Erdm/std1/vectorcompare.html}. \end{center} + \ssechead{Known Bugs} + The $z$-slice selection feature does not work properly with irregular + meshes. \ No newline at end of file diff -crN oommf-1.2a0/doc/userguide/mmhelp-body.tex oommf/doc/userguide/mmhelp-body.tex *** oommf-1.2a0/doc/userguide/mmhelp-body.tex Thu Nov 9 15:59:09 2000 --- oommf/doc/userguide/mmhelp-body.tex Fri Jan 19 10:58:26 2001 *************** *** 52,57 **** --- 52,60 ---- three buttons have corresponding entries in the \btn{Navigate} menu. + Use the menu selection \btn{File\pipe Open} to directly select + a file from the file system to be displayed by {\bf mmHelp}. + The menu selection \btn{File\pipe Refresh}, or the \btn{Refresh} button causes {\bf mmHelp} to reload and redisplay the current diff -crN oommf-1.2a0/doc/userguide/oxsii-body.tex oommf/doc/userguide/oxsii-body.tex *** oommf-1.2a0/doc/userguide/oxsii-body.tex Fri Nov 17 21:37:01 2000 --- oommf/doc/userguide/oxsii-body.tex Mon Jan 22 04:09:57 2001 *************** *** 66,75 **** --- 66,78 ---- button. \ssechead{Controls} + \centerline{\textbf{Awaiting Construction.}} \ssechead{Details} + \centerline{\textbf{Awaiting Construction.}} \ssechead{Known Bugs} + \centerline{\textbf{Awaiting Construction.}} \subsection{Standard Oxs\_Ext Child Classes}\label{sec:oxsext}% \newcommand{\bi}{\hspace*{2em}} *************** *** 77,104 **** \newcommand{\ccb}{\textrm{\}}} \index{Oxs\_Ext~child~classes} An \app{OXS} simulation is built as a collection of \cd{Oxs\_Ext} (OXS ! Extension) objects. These are specified via \cd{Specify} blocks in the input \hyperrefhtml{\MIF~2.0 file.}{\MIF~2.0 file ! (Sec.~}{).}{sec:mif2format} This section describes the \cd{Oxs\_Ext} ! classes available in the standard \OOMMF\ distribution, including ! documentation of their \cd{Specify} block initialization strings. ! Standard \cd{Oxs\_Ext} objects can be identified by the \cd{Oxs\_} ! prefix in their names. Additional \cd{Oxs\_Ext} objects may be ! available on your system. Check local documentation for details. ! The discussion below organizes \cd{Oxs\_Ext} objects into 6 categories: ! regions, meshes, energies, evolvers, drivers, and field initializers. \ssechead{Regions} ! Regions describe geometric volumes of space. The mesh class requires a ! specified region to define its meshing boundaries. Currently there is ! only one type of region supported, \cd{Oxs\_RectangularRegion}, which ! defines an axes parallel rectangular parallelepiped. The specify block ! has the form \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_RectangularRegion:{\it name} \ocb \\ \bi xrange \ocb {\it xmin xmax}\ccb\\ \bi yrange \ocb {\it ymin ymax}\ccb\\ \bi zrange \ocb {\it zmin zmax}\ccb\\ --- 80,114 ---- \newcommand{\ccb}{\textrm{\}}} \index{Oxs\_Ext~child~classes} An \app{OXS} simulation is built as a collection of \cd{Oxs\_Ext} (OXS ! Extension) objects. These are defined via \cd{Specify} blocks in the 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 ! presented below. ! ! This section describes the \cd{Oxs\_Ext} classes available in the ! standard \OOMMF\ distribution, including documentation of their ! \cd{Specify} block initialization strings. Standard \cd{Oxs\_Ext} ! objects can be identified by the \cd{Oxs\_} prefix in their names. ! Additional \cd{Oxs\_Ext} objects may be available on your system. Check ! local documentation for details. ! For presentation purposes, the \cd{Oxs\_Ext} classes are organized into ! 6 categories: regions, meshes, energies, evolvers, drivers, and field initializers. \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 ! present only one type of each is supported: ! \begin{description} ! \item[Oxs\_RectangularSection:] An axes parallel rectangular ! parallelepiped. The specify block has the form \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_RectangularSection:{\it name} \ocb\\ \bi xrange \ocb {\it xmin xmax}\ccb\\ \bi yrange \ocb {\it ymin ymax}\ccb\\ \bi zrange \ocb {\it zmin zmax}\ccb\\ *************** *** 106,120 **** \end{quote} \end{latexonly} \begin{rawhtml}
! Specify Oxs_RectangularRegion:name {
xrange { xmin xmax }
yrange { ymin ymax }
zrange { zmin zmax }
}

\end{rawhtml} ! where \textit{xmin, xmax, \ldots} are coordinates in meters. The ! \textit{name} entry is commonly set to ``World'' to denote the outer, ! all-encompassing region that is referenced by the mesh object. \ssechead{Meshes} Meshes define the discretization impressed on the simulation. There --- 116,170 ---- \end{quote} \end{latexonly} \begin{rawhtml}

! Specify Oxs_RectangularSection:name {
xrange { xmin xmax }
yrange { ymin ymax }
zrange { zmin zmax }
}

\end{rawhtml} ! where \textit{xmin, xmax, \ldots} are coordinates in meters. ! ! \item[Oxs\_SectionAtlas:] An ordered list of sections. The specify ! block has the form ! \begin{latexonly} ! \begin{quote}\tt ! Specify Oxs\_SectionAtlas:{\it name} \ocb\\ ! \bi {\it section-1-name} \ocb {\it section-type} \ocb\\ ! \bi \bi {\it section-initialize-block}\\ ! \bi \ccb \bi \ccb\\ ! \bi {\it section-2-name} \ocb {\it section-type} \ocb\\ ! \bi \bi {\it section-initialize-block}\\ ! \bi \ccb \bi \ccb\\ ! \bi\bi\ldots\\ ! \bi {\it final-section-name} \ocb {\it section-type} \ocb\\ ! \bi \bi {\it section-initialize-block}\\ ! \bi \ccb \bi \ccb\\ ! \ccb ! \end{quote} ! \end{latexonly} ! \begin{rawhtml}

! Specify Oxs_SectionAtlas:name { !
section-1-name { section-type {
!
section-initialize-block !
} } !
section-2-name { section-type {
!
section-initialize-block !
} } !
... !
final-section-name { section-type {
!
section-initialize-block !
} } !
}

! \end{rawhtml} ! At present there is only one section type, so all the {\it ! section-type} fields above will be \cd{Oxs\_RectangularSection}. ! ! Given a point, \cd{Oxs\_SectionAtlas} returns the name of the first ! section in its list that contains that point. The final section in ! the list must be sized so as to contain all the preceding sections. ! For this reason, it is common to set {\it final-section-name} to ! \cd{world}, though this is not required. ! \end{description} \ssechead{Meshes} Meshes define the discretization impressed on the simulation. There *************** *** 124,146 **** \begin{quote}\tt Specify Oxs\_RectangularMesh:{\it name} \ocb \\ \bi cellsize \ocb {\it xstep ystep zstep}\ccb\\ ! \bi region {\it region\_reference}\\ \ccb \end{quote} \end{latexonly} \begin{rawhtml}

Specify Oxs_RectangularMesh:name {
cellsize { xstep ystep zstep } !
region { region_reference }
}

\end{rawhtml} ! This defines an axes parallel rectangular mesh, with sample rates along ! each axis as specified by {\it xstep, ystep,} and {\it zstep.} The mesh ! is cell-based, with the center of the first cell one half step in from the ! (xmin,ymin,ymax) coordinate specified in the referenced region {\it ! region\_reference}. The {\it name} is commonly set to ``mesh'', so the ! mesh object can be referred to by other \cd{Oxs\_Ext} objects by the ! short name ``:mesh''. \ssechead{Energies} The following energy terms are available. There is no limitation on the --- 174,197 ---- \begin{quote}\tt Specify Oxs\_RectangularMesh:{\it name} \ocb \\ \bi cellsize \ocb {\it xstep ystep zstep}\ccb\\ ! \bi atlas {\it atlas\_reference}\\ \ccb \end{quote} \end{latexonly} \begin{rawhtml}

Specify Oxs_RectangularMesh:name {
cellsize { xstep ystep zstep } !
atlas { atlas_reference }
}

\end{rawhtml} ! This creates an axes parallel rectangular mesh across the entire space ! covered by {\it atlas\_reference} (i.e., the final or ``world'' section ! of the atlas). The mesh sample rates along each axis are specified by ! {\it xstep, ystep,} and {\it zstep.} The mesh is cell-based, with the ! center of the first cell one half step in from the minimal extremal ! point (xmin,ymin,ymax) specified by {\it atlas\_reference}. ! The {\it name} is commonly set to ``mesh'', so the mesh object can be ! referred to by other \cd{Oxs\_Ext} objects by the short name ``:mesh''. \ssechead{Energies} The following energy terms are available. There is no limitation on the *************** *** 172,203 **** \item[Oxs\_Exchange6Ngbr:] Standard 6-neighbor exchange energy. The exchange energy density contribution from cell $i$ is given by \begin{displaymath} ! E_i = A \sum_{j\in N_i} ! \frac{\vm_i\cdot\left(\vm_i - \vm_j\right)}{\Delta_{ij}} \end{displaymath} ! where $A$ is the exchange constant in J/m, $N_i$ is the set ! consisting of the 6 cells nearest to cell $i$, and $\Delta_{ij}$ is ! the discretization step size from cell $i$ to cell $j$ (in meters). ! The \cd{Specify} block for this term takes 2 parameters, exchange ! constant \textbf{A} in J/m, and a reference to a previously defined ! \cd{Oxs\_RectangularMesh} object. For example, ! \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_Exchange6Ngbr:NiFe \ocb \\ ! \bi A 13e-12\\ ! \bi mesh :mesh\\ \ccb \end{quote} \end{latexonly} \begin{rawhtml}

! Specify Oxs_Exchange6Ngbr:NiFe { !
A 13e-12 !
mesh :mesh
}

\end{rawhtml} ! Notice that this exchange energy term does \textit{not} support ! varying exchange constant A, so A is initialized with a simple ! constant (as opposed to an embedded Field Initializer object). \item[Oxs\_UZeeman:] Uniform (homogeneous) applied field energy. The specify block for this term takes an optional \textbf{Hscale} entry, and a required field range list \textbf{Hrange}. The field range --- 223,282 ---- \item[Oxs\_Exchange6Ngbr:] Standard 6-neighbor exchange energy. The exchange energy density contribution from cell $i$ is given by \begin{displaymath} ! E_i = \sum_{j\in N_i} A_{ij} ! \frac{\vm_i\cdot\left(\vm_i - \vm_j\right)}{\Delta_{ij}^2} \end{displaymath} ! where $N_i$ is the set consisting of the 6 cells nearest to cell $i$, ! $A_{ij}$ is the exchange coefficient between cells $i$ and $j$ in J/m, ! and $\Delta_{ij}$ is the discretization step size from cell $i$ to ! cell $j$ (in meters). ! ! The \cd{Specify} block for this term has the form ! \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_Exchange6Ngbr:{\it name} \ocb\\ ! \bi default\_A {\it value}\\ ! \bi atlas {\it atlas\_reference}\\ ! \bi A \ocb\\ ! \bi \bi \ocb {\it region-1 region-1 $A_{11}$} \ccb\\ ! \bi \bi \ocb {\it region-1 region-2 $A_{12}$} \ccb\\ ! \bi \bi \ldots\\ ! \bi \bi \ocb {\it region-m region-n $A_{mn}$} \ccb\\ ! \bi \ccb\\ \ccb \end{quote} \end{latexonly} \begin{rawhtml}

! Specify Oxs_Exchange6Ngbr:name { !
default_A value !
atlas atlas_reference !
A {
!
{ ! region-1 region-1 A11 } !
{ ! region-1 region-2 A12 } !
... !
{ ! region-m region-n Amn } !
}
}

\end{rawhtml} ! The \cd{A} block specifies $A_{ij}$ values on a region by region ! basis, where the regions are those declared by {\it atlas\_reference}. ! This allows for specification of $A$ both inside a given region ! (e.g., $A_{ii}$) and along interfaces between regions (e.g., ! $A_{ij}$). By symmetry, if $A_{ij}$ is specified, then the same ! value is automatically assigned to $A_{ji}$ as well. The ! \cd{default\_A} value is applied to any otherwise unassigned ! $A_{ij}$. ! ! \item[Oxs\_UniformExchange:] Similar to \cd{Oxs\_Exchange6Ngbr}, except ! the exchange constant $A$ is uniform across all space. The ! \cd{Specify} block is very simple, consisting of the label \cd{A} and ! the desired exchange coefficient value in J/m. Since \cd{A} is not ! spatially varying, it is initialized with a simple constant, as ! opposed to an embedded Field Initializer object. ! \item[Oxs\_UZeeman:] Uniform (homogeneous) applied field energy. The specify block for this term takes an optional \textbf{Hscale} entry, and a required field range list \textbf{Hrange}. The field range *************** *** 234,246 **** \end{rawhtml} The applied field steps between 0~mT, 5~mT, 10~mT and back to 0~mT. (Note that 795.77472=0.001/$\mu_0$.) \item[Oxs\_Demag:] Standard demagnetization energy term, which is built on the assumption that the magnetization is constant in each cell, and computes the average demagnetization field through the cell using formulae from \cite{aharoni98,newell93} and convolution via the Fast Fourier Transform. The \cd{Specify} initialization ! string takes one parameter, \textbf{mesh}, which must be a reference ! to an previously defined \cd{Oxs\_RectangularMesh} object. \item[Oxs\_SimpleDemag:] This is the same as the \cd{Oxs\_Demag} object, except that the implementation does not use any of the of the symmetries inherent in the demagnetization kernel, or special --- 313,342 ---- \end{rawhtml} The applied field steps between 0~mT, 5~mT, 10~mT and back to 0~mT. (Note that 795.77472=0.001/$\mu_0$.) + + \item[Oxs\_FixedZeeman:] Non-uniform, non-time varying applied field. + This can be used to simulate a biasing field. The specify block + holds one parameter, which defines the field: + \begin{latexonly} + \begin{quote}\tt + Specify Oxs\_FixedZeeman:{\it name} \ocb\\ + \bi field \ocb\ {\it vector\_field\_initializer} \ccb\\ + \ccb + \end{quote} + \end{latexonly} + \begin{rawhtml}

+ Specify Oxs_FixedZeeman:name { +
field { vector_field_initializer } +
}

+ \end{rawhtml} + \item[Oxs\_Demag:] Standard demagnetization energy term, which is built on the assumption that the magnetization is constant in each cell, and computes the average demagnetization field through the cell using formulae from \cite{aharoni98,newell93} and convolution via the Fast Fourier Transform. The \cd{Specify} initialization ! string should be an empty string, typically denoted by \ocb\ccb. ! \item[Oxs\_SimpleDemag:] This is the same as the \cd{Oxs\_Demag} object, except that the implementation does not use any of the of the symmetries inherent in the demagnetization kernel, or special *************** *** 283,289 **** form \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_StandardDriver \ocb\\ \bi evolver {\it evolver\_reference}\\ \bi mesh {\it mesh\_reference}\\ \bi min\_timestep {\it minimum\_time\_step}\\ --- 379,385 ---- form \begin{latexonly} \begin{quote}\tt ! Specify Oxs\_StandardDriver:{\it name} \ocb\\ \bi evolver {\it evolver\_reference}\\ \bi mesh {\it mesh\_reference}\\ \bi min\_timestep {\it minimum\_time\_step}\\ *************** *** 298,304 **** \end{quote} \end{latexonly} \begin{rawhtml}

! Specify Oxs_StandardDriver {
evolver evolver_reference
mesh mesh_reference
min_timestep minimum_time_step --- 394,400 ---- \end{quote} \end{latexonly} \begin{rawhtml}
! Specify Oxs_StandardDriver:name {
evolver evolver_reference
mesh mesh_reference
min_timestep minimum_time_step *************** *** 317,323 **** the minimum and maximum time step size allowed during Landau-Lifshitz ODE evolution, in seconds. A stage is considered complete when $|\dot{\vM}/\textrm{M}_{\rm s}|$ drops below \textbf{stopping\_dm\_dt} ! (in radians/second), or when the number of steps taken on the current problem reaches \textbf{stage\_iteration\_limit}. stage\_iteration\_limit is an optional integer parameter, with default value of 0, which is interpreted to mean no iteration limit. Similarly, --- 413,419 ---- the minimum and maximum time step size allowed during Landau-Lifshitz ODE evolution, in seconds. A stage is considered complete when $|\dot{\vM}/\textrm{M}_{\rm s}|$ drops below \textbf{stopping\_dm\_dt} ! (in degrees/nanosecond), or when the number of steps taken on the current problem reaches \textbf{stage\_iteration\_limit}. stage\_iteration\_limit is an optional integer parameter, with default value of 0, which is interpreted to mean no iteration limit. Similarly, *************** *** 343,348 **** --- 439,475 ---- \item[Oxs\_UniformScalarFieldInit:] Returns the same constant value regardless of the import position. The \cd{Specify} block takes one parameter, \textbf{value}, which is the returned constant value. + \item[Oxs\_AtlasScalarFieldInit:] Defines values that are constant + across individual regions of a previously defined \cd{Oxs\_Atlas}. + The \cd{Specify} block looks like + \begin{latexonly} + \begin{quote}\tt + Specify Oxs\_AtlasScalarFieldInit \ocb\\ + \bi atlas {\it atlas\_reference}\\ + \bi default\_value {\it value}\\ + \bi values \ocb\\ + \bi\bi\ocb {\it region1\_name value1} \ccb\\ + \bi\bi\ocb {\it region2\_name value2} \ccb\\ + \bi\bi \ldots\\ + \bi\ccb\\ + \ccb + \end{quote} + \end{latexonly} + \begin{rawhtml}
+ Specify Oxs_AtlasScalarFieldInit { +
atlas atlas_reference +
default_value value +
values {
+
{ region1_reference value1 } +
{ region2_reference value2 } +
... +
} +
}

+ \end{rawhtml} + The specified atlas is used to map cell locations to regions, and + the corresponding value from the \cd{values} subblock is + assigned to that cell. If a cell's region is not included in the + \cd{values} subblock, then the \cd{default\_value} is used. \item[Oxs\_ScriptScalarFieldInit:] Returns a value dependent on a \Tcl\ script, which should be defined elsewhere in the \MIF\ file. The one \cd{Specify} initialization string parameter is \textbf{script}, *************** *** 401,406 **** --- 528,566 ---- \end{rawhtml} This returns the unit vector $(a,a,a)$, where \latexhtml{$a=1/\sqrt 3$}{a=1/sqrt(3)}, regardless of the import position. + \item[Oxs\_AtlasVectorFieldInit:] Defines vector values that are + constant across individual regions of a previously defined + \cd{Oxs\_Atlas}. The \cd{Specify} block looks like + \begin{latexonly} + \begin{quote}\tt + Specify Oxs\_AtlasVectorFieldInit \ocb\\ + \bi atlas {\it atlas\_reference}\\ + \bi default\_value \ocb {\it $v_x$ $v_y$ $v_z$} \ccb\\ + \bi values \ocb\\ + \bi\bi\ocb {\it region1\_name $v1_x$ $v1_y$ $v1_z$} \ccb\\ + \bi\bi\ocb {\it region2\_name $v2_x$ $v2_y$ $v2_z$} \ccb\\ + \bi\bi \ldots\\ + \bi\ccb\\ + \ccb + \end{quote} + \end{latexonly} + \begin{rawhtml}

+ Specify Oxs_AtlasVectorFieldInit { +
atlas atlas_reference +
default_value { + vx vy vz } +
values {
+
{ region1_reference + v1x v1y v1z } +
{ region2_reference + v2x v2y v2z } +
... +
} +
}

+ \end{rawhtml} + Interpretation is analogous to the \cd{Oxs\_AtlasScalarFieldInit} + specify block, except here the values are 3 dimensional vectors + rather than scalars. \item[Oxs\_ScriptVectorFieldInit:] This is conceptually similar to the scalar field initializer object, \cd{Oxs\_ScriptScalarFieldInit}, except that the script should return a vector (as a 3 element list) diff -crN oommf-1.2a0/doc/userguide/trouble-body.tex oommf/doc/userguide/trouble-body.tex *** oommf-1.2a0/doc/userguide/trouble-body.tex Thu Aug 24 18:41:13 2000 --- oommf/doc/userguide/trouble-body.tex Mon Dec 11 19:55:57 2000 *************** *** 52,61 **** indicating that exceptions are not supported. Parts of \OOMMF\ are written in C++, and exceptions have been part ! of the C++ langauge for many years. If your compiler does not support them, it is time to upgrade to one that does. \OOMMF\ 1.2 requires a compiler capable of compiling source code which uses C++ exceptions. \item On Solaris, gcc reports many errors like \begin{quote} --- 52,72 ---- indicating that exceptions are not supported. Parts of \OOMMF\ are written in C++, and exceptions have been part ! of the C++ language for many years. If your compiler does not support them, it is time to upgrade to one that does. \OOMMF\ 1.2 requires a compiler capable of compiling source code which uses C++ exceptions. + + \item \hyperrefhtml{Compiling}{Compiling + (Sec.~}{)}{sec:install.compile} with gcc/egcs produces syntax errors + on lines involving \cd{auto\_ptr} templates. + + This is known to occur on RedHat 5.2 systems. The \cd{auto\_ptr} + definition in the system STL header file \cd{memory} (located on RedHat + 5.2 systems in the directory \cd{/usr/include/g++}) is disabled by two + \cd{\lb if} statements. One solution is to edit this file to turn off + the \cd{\lb if} checks. If you do this, you will also have to fix two + small typos in the definition of the \cd{release()} member function. \item On Solaris, gcc reports many errors like \begin{quote} diff -crN oommf-1.2a0/doc/userguide/userguide.tex oommf/doc/userguide/userguide.tex *** oommf-1.2a0/doc/userguide/userguide.tex Fri Nov 3 19:56:17 2000 --- oommf/doc/userguide/userguide.tex Sun Jan 21 15:42:41 2001 *************** *** 1,7 **** \input{../common/oommfhead} %\HTMLset{toppage}{userguide.html} ! %\htmladdtonavigation{\htmladdnormallink{\htmladdimg{../common/contents_motif.gif}}{userguide.html}} \begin{document} --- 1,7 ---- \input{../common/oommfhead} %\HTMLset{toppage}{userguide.html} ! %\htmladdtonavigation{\htmladdnormallink{\htmladdimg{../common/contents.gif}}{userguide.html}} \begin{document} *************** *** 21,27 **** User's Guide\\[2ex] {\today} {}\\[2ex] ! This manual documents release 1.2a0.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date. --- 21,27 ---- User's Guide\\[2ex] {\today} {}\\[2ex] ! This manual documents release 1.2a1.\\[1ex] WARNING: In this alpha release, the documentation may not be up to date. *************** *** 61,66 **** --- 61,67 ---- \index{Landau-Lifshitz|see{ODE,Landau-Lifshitz}} \index{mesh|see{grid}} \index{MIF|see{file,mif}} + \index{movies|see{animations}} \index{mxh|see{simulation,mxh}} \index{network~socket!bug|see{platform,Windows,network~socket~bug}} \index{OBS|see{application,OOMMF~Batch~System}} diff -crN oommf-1.2a0/oommf.tcl oommf/oommf.tcl *** oommf-1.2a0/oommf.tcl Fri Aug 25 13:01:22 2000 --- oommf/oommf.tcl Fri Jan 19 10:41:27 2001 *************** *** 123,129 **** wm withdraw . } Oc_Main SetAppName oommf.tcl ! Oc_Main SetVersion 1.2.0.0 Oc_CommandLine Switch + Oc_CommandLine Option fg {} {global bg; set bg 0} \ --- 123,129 ---- wm withdraw . } Oc_Main SetAppName oommf.tcl ! Oc_Main SetVersion 1.2.0.1 Oc_CommandLine Switch + Oc_CommandLine Option fg {} {global bg; set bg 0} \ *************** *** 141,155 **** } "Print platform summary and exit" Oc_CommandLine Option [Oc_CommandLine Switch] { ! {{appSpec optional} {} "Application to launch:\ \"appName \[-exact\] \[version-requirement\]\""} {{arg list} {} "Arguments to pass to the application"} } { if {[string length $appSpec] == 0} { set appSpec mmLaunch - } - if {![string match {[a-zA-Z]*} [lindex $appSpec 0]]} { - Oc_CommandLine Panic "Bad appSpec argument: $appSpec" } global argv; set argv [concat [list $appSpec] $arg] } "End of options; next argument is appSpec" --- 141,154 ---- } "Print platform summary and exit" Oc_CommandLine Option [Oc_CommandLine Switch] { ! {{appSpec optional} {expr {![string length $appSpec] ! || [string match {[a-zA-Z]*} [lindex $appSpec 0]]}} ! "Application to launch:\ \"appName \[-exact\] \[version-requirement\]\""} {{arg list} {} "Arguments to pass to the application"} } { if {[string length $appSpec] == 0} { set appSpec mmLaunch } global argv; set argv [concat [list $appSpec] $arg] } "End of options; next argument is appSpec" diff -crN oommf-1.2a0/pkg/if/version.h oommf/pkg/if/version.h *** oommf-1.2a0/pkg/if/version.h Fri Aug 25 13:01:25 2000 --- oommf/pkg/if/version.h Thu Jan 18 18:51:51 2001 *************** *** 4,11 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:25 $ ! * Last modified by: $Author: donahue $ */ #ifndef _IF_VERSION --- 4,11 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/18 23:51:51 $ ! * Last modified by: $Author: dgp $ */ #ifndef _IF_VERSION *************** *** 19,24 **** #define IF_MAJOR_VERSION 1 #define IF_MINOR_VERSION 2 #define IF_RELEASE_LEVEL 0 ! #define IF_RELEASE_SERIAL 0 #endif /* _IF_VERSION */ --- 19,24 ---- #define IF_MAJOR_VERSION 1 #define IF_MINOR_VERSION 2 #define IF_RELEASE_LEVEL 0 ! #define IF_RELEASE_SERIAL 1 #endif /* _IF_VERSION */ diff -crN oommf-1.2a0/pkg/nb/dlist.h oommf/pkg/nb/dlist.h *** oommf-1.2a0/pkg/nb/dlist.h Fri Aug 25 13:01:25 2000 --- oommf/pkg/nb/dlist.h Thu Jan 4 17:06:44 2001 *************** *** 185,190 **** --- 185,198 ---- /// If all ready at end of list, then return value is NULL, and key is /// set to point to last valid element (if any). + INT4m GetElt(const Nb_List_Index& key,T& elt) const; + /// Copies from position specified by key into elt. Returns 0 + /// on success, 1 if key is invalid or out-of-bounds + + INT4m ReplaceElt(const Nb_List_Index& key,const T &elt); + /// Copies elt into position specified by key. Returns 0 + /// on success, 1 if key is invalid or out-of-bounds + void Clear(void) { last_used_spine_index=-1; last_used_rib_index=rib_xtnd_size-1; *************** *** 336,341 **** --- 344,389 ---- if((arr[alloc_rib_count++]=new T[rib_xtnd_size])==0) FatalError(-1,STDDOC,ErrNoMem); #undef MEMBERNAME + } + + template INT4m + Nb_List::GetElt(const Nb_List_Index& key,T& elt) const + { // Copies from position specified by key into elt. Returns 0 + // on success, 1 if key is invalid or out-of-bounds + + if(key.spine<0 || key.rib<0 || key.rib>=rib_xtnd_size) { + return 1; // Invalid key + } + if(key.spine>last_used_spine_index + || (key.spine==last_used_spine_index + && key.rib>last_used_rib_index)) { + return 1; // Out-of-bounds + } + + // Valid element + elt=arr[key.spine][key.rib]; /// ASSUMES a valid class T operator=(). + + return 0; + } + + template INT4m + Nb_List::ReplaceElt(const Nb_List_Index& key,const T &elt) + { // Copies elt into position specified by key. Returns 0 + // on success, 1 if key is invalid or out-of-bounds + + if(key.spine<0 || key.rib<0 || key.rib>=rib_xtnd_size) { + return 1; // Invalid key + } + if(key.spine>last_used_spine_index + || (key.spine==last_used_spine_index + && key.rib>last_used_rib_index)) { + return 1; // Out-of-bounds + } + + // Valid element + arr[key.spine][key.rib]=elt; /// ASSUMES a valid class T operator=(). + + return 0; } template INT4m Nb_List::Append(const T &elt) diff -crN oommf-1.2a0/pkg/nb/dstring.cc oommf/pkg/nb/dstring.cc *** oommf-1.2a0/pkg/nb/dstring.cc Fri Aug 25 13:01:25 2000 --- oommf/pkg/nb/dstring.cc Sun Jan 14 16:37:47 2001 *************** *** 4,10 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:25 $ * Last modified by: $Author: donahue $ */ --- 4,10 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/14 21:37:47 $ * Last modified by: $Author: donahue $ */ *************** *** 372,374 **** --- 372,380 ---- return strspn(a.str,b); } + Nb_DString operator+(const Nb_DString& a,const Nb_DString& b) + { + Nb_DString result(a); + result.Append(b); + return result; + } diff -crN oommf-1.2a0/pkg/nb/dstring.h oommf/pkg/nb/dstring.h *** oommf-1.2a0/pkg/nb/dstring.h Fri Aug 25 13:01:25 2000 --- oommf/pkg/nb/dstring.h Sun Jan 14 16:37:47 2001 *************** *** 4,10 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:25 $ * Last modified by: $Author: donahue $ */ --- 4,10 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/14 21:37:47 $ * Last modified by: $Author: donahue $ */ *************** *** 26,31 **** --- 26,33 ---- const Nb_DString &); // Replicates strcmp friend size_t StringSpan(const Nb_DString &, const char *); // Replicates strspn + friend Nb_DString operator+(const Nb_DString& a, + const Nb_DString& b); private: static const ClassDoc class_doc; size_t bufsize; // Length of buffer pointed to by str. diff -crN oommf-1.2a0/pkg/nb/functions.cc oommf/pkg/nb/functions.cc *** oommf-1.2a0/pkg/nb/functions.cc Tue Oct 10 16:42:12 2000 --- oommf/pkg/nb/functions.cc Wed Dec 13 17:00:02 2000 *************** *** 4,16 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/10/10 20:42:12 $ ! * Last modified by: $Author: donahue $ */ #include #include #include #include "functions.h" --- 4,17 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/12/13 22:00:02 $ ! * Last modified by: $Author: dgp $ */ #include #include #include + #include #include "functions.h" diff -crN oommf-1.2a0/pkg/nb/version.h oommf/pkg/nb/version.h *** oommf-1.2a0/pkg/nb/version.h Fri Aug 25 13:01:25 2000 --- oommf/pkg/nb/version.h Thu Jan 18 18:51:51 2001 *************** *** 4,11 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:25 $ ! * Last modified by: $Author: donahue $ */ #ifndef _NB_VERSION --- 4,11 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/18 23:51:51 $ ! * Last modified by: $Author: dgp $ */ #ifndef _NB_VERSION *************** *** 19,24 **** #define NB_MAJOR_VERSION 1 #define NB_MINOR_VERSION 2 #define NB_RELEASE_LEVEL 0 ! #define NB_RELEASE_SERIAL 0 #endif /* _NB_VERSION */ --- 19,24 ---- #define NB_MAJOR_VERSION 1 #define NB_MINOR_VERSION 2 #define NB_RELEASE_LEVEL 0 ! #define NB_RELEASE_SERIAL 1 #endif /* _NB_VERSION */ diff -crN oommf-1.2a0/pkg/net/net.tcl oommf/pkg/net/net.tcl *** oommf-1.2a0/pkg/net/net.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/net/net.tcl Thu Jan 18 18:51:51 2001 *************** *** 5,12 **** # This extension provides a set of Oc_Classes which support networking # operations. # ! # Last modified on: $Date: 2000/08/25 17:01:25 $ ! # Last modified by: $Author: donahue $ # # When this version of the Net extension is selected by the 'package require' # command, this file is sourced. --- 5,12 ---- # This extension provides a set of Oc_Classes which support networking # operations. # ! # Last modified on: $Date: 2001/01/18 23:51:51 $ ! # Last modified by: $Author: dgp $ # # When this version of the Net extension is selected by the 'package require' # command, this file is sourced. *************** *** 20,26 **** Oc_CheckTclIndex Net # CVS ! package provide Net 1.2.0.0 # Set up for autoloading of Net extension commands set _net(library) [file dirname [info script]] --- 20,26 ---- Oc_CheckTclIndex Net # CVS ! package provide Net 1.2.0.1 # Set up for autoloading of Net extension commands set _net(library) [file dirname [info script]] diff -crN oommf-1.2a0/pkg/net/pkgIndex.tcl oommf/pkg/net/pkgIndex.tcl *** oommf-1.2a0/pkg/net/pkgIndex.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/net/pkgIndex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,3 **** # FILE: pkgIndex.tcl # ! package ifneeded Net 1.2.0.0 [list uplevel #0 [list source [file join $dir net.tcl]]] --- 1,3 ---- # FILE: pkgIndex.tcl # ! package ifneeded Net 1.2.0.1 [list uplevel #0 [list source [file join $dir net.tcl]]] diff -crN oommf-1.2a0/pkg/net/threadWish.tcl oommf/pkg/net/threadWish.tcl *** oommf-1.2a0/pkg/net/threadWish.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/net/threadWish.tcl Fri Jan 19 15:37:44 2001 *************** *** 60,66 **** package require Ow wm title . [Oc_Main GetInstanceName] wm iconname . [wm title .] ! wm protocol . WM_DELETE_WINDOW exit Ow_SetIcon . } } --- 60,75 ---- package require Ow wm title . [Oc_Main GetInstanceName] wm iconname . [wm title .] ! proc VerifyExit {} { ! set response [Ow_Dialog 1 "Exit [Oc_Main GetInstanceName]?" \ ! warning "Are you *sure* you want to exit \ ! [Oc_Main GetInstanceName]?" {} 1 Yes No] ! if {$response == 0} { ! appexit ! exit ! } ! } ! wm protocol . WM_DELETE_WINDOW VerifyExit Ow_SetIcon . } } diff -crN oommf-1.2a0/pkg/oc/bug81.tcl oommf/pkg/oc/bug81.tcl *** oommf-1.2a0/pkg/oc/bug81.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/oc/bug81.tcl Fri Dec 15 18:06:54 2000 *************** *** 2,16 **** # # Patches for Tcl 8.1 # ! # Last modified on: $Date: 2000/08/25 17:01:25 $ ! # Last modified by: $Author: donahue $ # # This file contains Tcl code which when sourced in a Tcl 8.1 interpreter # will patch bugs in Tcl 8.1 fixed in later versions of Tcl. It is not # meant to be complete. Bugs are patched here only as we discover the need # to do so in writing other OOMMF software. ! # Tcl 8.1 is the current stable version. No version-specific patches. ! # Continue on to the generic patches. ! source [file join [file dirname [info script]] bug.tcl] --- 2,15 ---- # # Patches for Tcl 8.1 # ! # Last modified on: $Date: 2000/12/15 23:06:54 $ ! # Last modified by: $Author: dgp $ # # This file contains Tcl code which when sourced in a Tcl 8.1 interpreter # will patch bugs in Tcl 8.1 fixed in later versions of Tcl. It is not # meant to be complete. Bugs are patched here only as we discover the need # to do so in writing other OOMMF software. ! # Continue with bug patches for the next Tcl version ! source [file join [file dirname [info script]] bug82.tcl] diff -crN oommf-1.2a0/pkg/oc/bug82.tcl oommf/pkg/oc/bug82.tcl *** oommf-1.2a0/pkg/oc/bug82.tcl Wed Dec 31 19:00:00 1969 --- oommf/pkg/oc/bug82.tcl Fri Dec 15 18:06:54 2000 *************** *** 0 **** --- 1,15 ---- + # FILE: bug82.tcl + # + # Patches for Tcl 8.2 + # + # Last modified on: $Date: 2000/12/15 23:06:54 $ + # Last modified by: $Author: dgp $ + # + # This file contains Tcl code which when sourced in a Tcl 8.2 interpreter + # will patch bugs in Tcl 8.2 fixed in later versions of Tcl. It is not + # meant to be complete. Bugs are patched here only as we discover the need + # to do so in writing other OOMMF software. + + # Continue with bug patches for the next Tcl version + source [file join [file dirname [info script]] bug83.tcl] + diff -crN oommf-1.2a0/pkg/oc/bug83.tcl oommf/pkg/oc/bug83.tcl *** oommf-1.2a0/pkg/oc/bug83.tcl Wed Dec 31 19:00:00 1969 --- oommf/pkg/oc/bug83.tcl Fri Dec 15 18:06:54 2000 *************** *** 0 **** --- 1,23 ---- + # FILE: bug83.tcl + # + # Patches for Tcl 8.3 + # + # Last modified on: $Date: 2000/12/15 23:06:54 $ + # Last modified by: $Author: dgp $ + # + # This file contains Tcl code which when sourced in a Tcl 8.3 interpreter + # will patch bugs in Tcl 8.3 fixed in later versions of Tcl. It is not + # meant to be complete. Bugs are patched here only as we discover the need + # to do so in writing other OOMMF software. + + # Before Tcl 8.4, [expr rand()] can return an out of range result + # the first time it is called on a 64-bit platform. Workaround that + # problem by always calling it and discarding the possibly bad result + # here before good results are expected. Use [catch] to cover Tcl 7 + # where rand() did not yet exist. + catch {expr {rand()}} + + # Tcl 8.3 is the current stable version. + # Continue on to the generic patches. + source [file join [file dirname [info script]] bug.tcl] + diff -crN oommf-1.2a0/pkg/oc/config.tcl oommf/pkg/oc/config.tcl *** oommf-1.2a0/pkg/oc/config.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/oc/config.tcl Tue Dec 19 16:32:54 2000 *************** *** 193,199 **** --- 193,202 ---- } method Summary {} { + global tcl_platform set ret "Platform Name:\t\t$name\n" + append ret "Tcl name for OS:\t" + append ret "$tcl_platform(os) $tcl_platform(osVersion)\n" append ret "C++ compiler:\t\t" if {![catch {$this GetValue program_compiler_c++} c]} { foreach wd [auto_execok [lindex $c 0]] { *************** *** 251,257 **** } append ret " (running)" - global tcl_platform if {[info exists tcl_platform(threaded)]} { append ret "\nWARNING: Your installation of Tcl appears to be\ thread-enabled.\nOOMMF does not support thread-enabled\ --- 254,259 ---- *************** *** 284,289 **** --- 286,305 ---- to re-install Tk, requesting a full\ninstallation\ this time, or install the developers package for Tk?" } + } + set code [catch {socket -server Oc_Nop 0} s] + catch {close $s} + if {$code} { + append ret "\nWARNING: It appears that your computer does\ + not have networking software enabled to support\ + Internet (TCP/IP) communications. Your computer\ + does not have to be connected to the Internet to\ + run OOMMF, but it does need basic networking\ + capabilities installed." + } + if {[string match *WARNING* $ret]} { + append ret "\n\nPlease see the Installation section of the\ + OOMMF User's Guide for more information." } return $ret } diff -crN oommf-1.2a0/pkg/oc/custom.tcl oommf/pkg/oc/custom.tcl *** oommf-1.2a0/pkg/oc/custom.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/oc/custom.tcl Fri Dec 15 18:06:54 2000 *************** *** 2,9 **** # # OOMMF core provided customizations to Tcl/Tk # ! # Last modified on: $Date: 2000/08/25 17:01:25 $ ! # Last modified by: $Author: donahue $ # # This file provides some customization/extensions to Tcl/Tk that # are common across the OOMMF project. --- 2,9 ---- # # OOMMF core provided customizations to Tcl/Tk # ! # Last modified on: $Date: 2000/12/15 23:06:54 $ ! # Last modified by: $Author: dgp $ # # This file provides some customization/extensions to Tcl/Tk that # are common across the OOMMF project. *************** *** 130,154 **** rename interp Tcl_interp proc interp {args} { set code [catch {uplevel Tcl_interp $args} result] ! if {!$code && [string match c* [lindex $args 0]] ! && ![Tcl_interp issafe $result]} { ! # [interp create] of trusted interp ! foreach pair [info loaded {}] { ! foreach {_ pkg} $pair {break} ! set ver [package provide $pkg] ! if {[catch {package vcompare $ver $ver}]} { ! set ver [package provide [string tolower $pkg]] if {[catch {package vcompare $ver $ver}]} { ! Oc_Log Log "Bad package $pkg: loaded, but not\ ! provided." warning ! continue } } ! $result eval [list package ifneeded $pkg $ver \ ! [list load {} $pkg]] } - global oc - $result eval [list lappend auto_path $oc(library)] } return -code $code $result } --- 130,160 ---- rename interp Tcl_interp proc interp {args} { set code [catch {uplevel Tcl_interp $args} result] ! if {!$code && [string match c* [lindex $args 0]]} { ! # [interp create] ! # Work around broken [expr rand()] in $result ! catch {expr {rand()}} ! if {![Tcl_interp issafe $result]} { ! # [interp create] of trusted interp ! foreach pair [info loaded {}] { ! foreach {_ pkg} $pair {break} ! set ver [package provide $pkg] if {[catch {package vcompare $ver $ver}]} { ! # Attempt to work around broken [info loaded] that ! # doesn't return proper package names ! set ver [package provide [string tolower $pkg]] ! if {[catch {package vcompare $ver $ver}]} { ! Oc_Log Log "Bad package $pkg: loaded, but not\ ! provided." warning ! continue ! } } + $result eval [list package ifneeded $pkg $ver \ + [list load {} $pkg]] } ! global oc ! $result eval [list lappend auto_path $oc(library)] } } return -code $code $result } diff -crN oommf-1.2a0/pkg/oc/oc.tcl oommf/pkg/oc/oc.tcl *** oommf-1.2a0/pkg/oc/oc.tcl Wed Nov 1 13:38:32 2000 --- oommf/pkg/oc/oc.tcl Thu Jan 18 18:51:51 2001 *************** *** 2,8 **** # # OOMMF core # ! # Last modified on: $Date: 2000/11/01 18:38:32 $ # Last modified by: $Author: dgp $ # # When this version of the Oc extension is selected by the 'package require' --- 2,8 ---- # # OOMMF core # ! # Last modified on: $Date: 2001/01/18 23:51:51 $ # Last modified by: $Author: dgp $ # # When this version of the Oc extension is selected by the 'package require' *************** *** 46,52 **** } # CVS ! package provide Oc 1.2.0.0 # Set up for autoloading of Oc extension commands set oc(library) [file dirname [info script]] --- 46,52 ---- } # CVS ! package provide Oc 1.2.0.1 # Set up for autoloading of Oc extension commands set oc(library) [file dirname [info script]] diff -crN oommf-1.2a0/pkg/oc/pkgIndex.tcl oommf/pkg/oc/pkgIndex.tcl *** oommf-1.2a0/pkg/oc/pkgIndex.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/oc/pkgIndex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,5 **** # FILE: pkgIndex.tcl # # Do not override an existing ifneeded script (from C, for example). ! if {![string match "" [package ifneeded Oc 1.2.0.0]]} {return} ! package ifneeded Oc 1.2.0.0 [list uplevel #0 [list source [file join $dir oc.tcl]]] --- 1,5 ---- # FILE: pkgIndex.tcl # # Do not override an existing ifneeded script (from C, for example). ! if {![string match "" [package ifneeded Oc 1.2.0.1]]} {return} ! package ifneeded Oc 1.2.0.1 [list uplevel #0 [list source [file join $dir oc.tcl]]] diff -crN oommf-1.2a0/pkg/oc/procs.tcl oommf/pkg/oc/procs.tcl *** oommf-1.2a0/pkg/oc/procs.tcl Wed Sep 20 16:59:56 2000 --- oommf/pkg/oc/procs.tcl Wed Dec 20 16:53:49 2000 *************** *** 373,378 **** --- 373,395 ---- } } + # Some STL implementations have broken map<*,*> containers that + # cannot properly destroy an empty map. Define a macro for those + # compilers so that dummy entries can be placed in a map<> before + # attempting map deletion to work around the problem. + if {![catch { + $config GetValue \ + program_compiler_c++_property_stl_map_broken_empty_delete + } _] && $_} { + append porth { + /* The STL implementation of map<> is broken. Empty map<>s cannot + * be deleted. Define a macro to surround insertion of a pair into + * a map<> before its deletion to work around the problem. + */ + #define OC_STL_MAP_BROKEN_EMPTY_DELETE + } + } + # Fill in missing function prototypes foreach func [$config Features program_compiler_c++_prototype_supply_*] { set proto [$config GetValue $func] diff -crN oommf-1.2a0/pkg/oc/version.h oommf/pkg/oc/version.h *** oommf-1.2a0/pkg/oc/version.h Fri Aug 25 13:01:25 2000 --- oommf/pkg/oc/version.h Thu Jan 18 18:51:51 2001 *************** *** 4,11 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:25 $ ! * Last modified by: $Author: donahue $ */ #ifndef _OC_VERSION --- 4,11 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/18 23:51:51 $ ! * Last modified by: $Author: dgp $ */ #ifndef _OC_VERSION *************** *** 21,26 **** #define OC_MAJOR_VERSION 1 #define OC_MINOR_VERSION 2 #define OC_RELEASE_LEVEL 0 ! #define OC_RELEASE_SERIAL 0 #endif /* _OC_VERSION */ --- 21,26 ---- #define OC_MAJOR_VERSION 1 #define OC_MINOR_VERSION 2 #define OC_RELEASE_LEVEL 0 ! #define OC_RELEASE_SERIAL 1 #endif /* _OC_VERSION */ diff -crN oommf-1.2a0/pkg/ow/ow.tcl oommf/pkg/ow/ow.tcl *** oommf-1.2a0/pkg/ow/ow.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/ow/ow.tcl Thu Jan 18 18:51:51 2001 *************** *** 2,9 **** # # OOMMF Widgets # ! # Last modified on: $Date: 2000/08/25 17:01:25 $ ! # Last modified by: $Author: donahue $ # # When this version of the ow extension is selected by the 'package require' # command, this file is sourced. --- 2,9 ---- # # OOMMF Widgets # ! # Last modified on: $Date: 2001/01/18 23:51:51 $ ! # Last modified by: $Author: dgp $ # # When this version of the ow extension is selected by the 'package require' # command, this file is sourced. *************** *** 21,27 **** Oc_CheckTclIndex Ow # CVS ! package provide Ow 1.2.0.0 # Provide Oc_Log dialogs for message reporting Oc_Log SetLogHandler Ow_Message panic Oc_Log --- 21,27 ---- Oc_CheckTclIndex Ow # CVS ! package provide Ow 1.2.0.1 # Provide Oc_Log dialogs for message reporting Oc_Log SetLogHandler Ow_Message panic Oc_Log diff -crN oommf-1.2a0/pkg/ow/pkgIndex.tcl oommf/pkg/ow/pkgIndex.tcl *** oommf-1.2a0/pkg/ow/pkgIndex.tcl Fri Aug 25 13:01:25 2000 --- oommf/pkg/ow/pkgIndex.tcl Thu Jan 18 18:51:51 2001 *************** *** 1,3 **** # FILE: pkgIndex.tcl # ! package ifneeded Ow 1.2.0.0 [list uplevel #0 [list source [file join $dir ow.tcl]]] --- 1,3 ---- # FILE: pkgIndex.tcl # ! package ifneeded Ow 1.2.0.1 [list uplevel #0 [list source [file join $dir ow.tcl]]] diff -crN oommf-1.2a0/pkg/vf/mesh.cc oommf/pkg/vf/mesh.cc *** oommf-1.2a0/pkg/vf/mesh.cc Wed Aug 30 16:40:44 2000 --- oommf/pkg/vf/mesh.cc Thu Jan 4 17:06:44 2001 *************** *** 108,113 **** --- 108,137 ---- return code; } + // Subtract values of one mesh from the other. + int Vf_Mesh::SubtractMesh(const Vf_Mesh& other) + { + if(GetSize() != other.GetSize()) + return 1; // Meshes aren't the same size + + Vf_Mesh_Index *key1,*key2; + Nb_LocatedVector vec1,vec2; + + if( GetFirstPt(key1,vec1) && other.GetFirstPt(key2,vec2) ) { + do { + vec1.value -= vec2.value; + SetNodeValue(key1,vec1.value); + } while( GetNextPt(key1,vec1) && other.GetNextPt(key2,vec2) ); + } + + delete key1; + delete key2; + + return 0; + } + + + ////////////////////////////////////////////////////////////////////////// // Regular 3D grid of Nb_Vec3's const ClassDoc Vf_GridVec3f::class_doc("Vf_GridVec3f", *************** *** 637,643 **** int Vf_GridVec3f::GetNextPt(Vf_Mesh_Index* &key_import, Nb_LocatedVector &lv) const { ! Vf_GridVec3f_Index *key=(Vf_GridVec3f_Index *)key_import; int isize,jsize,ksize; GetDimens(isize,jsize,ksize); int i=key->i,j=key->j,k=key->k; --- 661,667 ---- int Vf_GridVec3f::GetNextPt(Vf_Mesh_Index* &key_import, Nb_LocatedVector &lv) const { ! Vf_GridVec3f_Index *key = (Vf_GridVec3f_Index *)key_import; int isize,jsize,ksize; GetDimens(isize,jsize,ksize); int i=key->i,j=key->j,k=key->k; *************** *** 656,661 **** --- 680,713 ---- return 1; } + int Vf_GridVec3f::SetNodeValue(const Vf_Mesh_Index* key_import, + const Nb_Vec3& value) + { // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + + Vf_GridVec3f_Index *key = (Vf_GridVec3f_Index *)key_import; + /// This should be a dynamic cast, but we don't want to + /// require RTTI in this code. So we leave it up to the + /// programmer to insure that keys imported here were created + /// by the corresponding GetFirstPt or GetNextPt functions. + + // Check key validity + int isize,jsize,ksize; + GetDimens(isize,jsize,ksize); + int i=key->i,j=key->j,k=key->k; + if(i<0 || i>=isize || j<0 || j>=jsize || k<0 || k>=ksize) + return 1; // Invalid or out-of-bounds key + + // Set value + GridVec(i,j,k) = value; + + return 0; + } + + + ////////////////////////////////////////////////////////////////////////// // General (non-regular) 3D mesh of Nb_Vec3's const ClassDoc Vf_GeneralMesh3f::class_doc("Vf_GeneralMesh3f", *************** *** 1326,1328 **** --- 1378,1395 ---- } + int Vf_GeneralMesh3f::SetNodeValue(const Vf_Mesh_Index* key_import, + const Nb_Vec3& value) + { // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + + Vf_GeneralMesh3f_Index *index = (Vf_GeneralMesh3f_Index *)key_import; + /// This should be a dynamic cast, but we don't want to + /// require RTTI in this code. So we leave it up to the + /// programmer to insure that keys imported here were created + /// by the corresponding GetFirstPt or GetNextPt functions. + + return mesh.SetValue(index->key,value); + } diff -crN oommf-1.2a0/pkg/vf/mesh.h oommf/pkg/vf/mesh.h *** oommf-1.2a0/pkg/vf/mesh.h Thu Aug 31 21:43:21 2000 --- oommf/pkg/vf/mesh.h Thu Jan 4 17:06:44 2001 *************** *** 73,78 **** --- 73,85 ---- /// set to 0 length, and any larger than MaxMagHint is /// rescaled to have magnitude equal to MaxMagHint. REAL8m ValueMultiplier; // Default value scaling + + // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + virtual int SetNodeValue(const Vf_Mesh_Index* key, + const Nb_Vec3& value) = 0; public: const char* GetName() const; const char* GetTitle() const; *************** *** 247,261 **** // NOTE: Unlike some other generic Vf_Mesh functions, these return // REAL8 vectors. virtual int ! GetFirstPt(Vf_Mesh_Index* &key,Nb_LocatedVector &) const { ! key=new Vf_Mesh_Index; ! return 1; } virtual int GetNextPt(Vf_Mesh_Index* &,Nb_LocatedVector &) const { ! return 1; } }; ////////////////////////////////////////////////////////////////////////// --- 254,271 ---- // NOTE: Unlike some other generic Vf_Mesh functions, these return // REAL8 vectors. virtual int ! GetFirstPt(Vf_Mesh_Index* &,Nb_LocatedVector &) const { ! return 0; } virtual int GetNextPt(Vf_Mesh_Index* &,Nb_LocatedVector &) const { ! return 0; } + // Subtracts the values in specified mesh from *this. Returns 0 on + // success. Returns 1 if meshes aren't compatible. + virtual int SubtractMesh(const Vf_Mesh& other); + }; ////////////////////////////////////////////////////////////////////////// *************** *** 265,270 **** --- 275,291 ---- private: Nb_BoundingBox empty_range; Nb_List< Nb_Vec3 > empty_boundary_list; + + protected: + // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + virtual int SetNodeValue(const Vf_Mesh_Index*, + const Nb_Vec3&) { + return 1; // All indexes are out-of-bounds + } + public: Vf_EmptyMesh():Vf_Mesh("Vf_EmptyMesh","") {} INT4m GetPreciseRange(Nb_BoundingBox &range) const { *************** *** 358,363 **** --- 379,392 ---- // The following function is left undefined on purpose Vf_GridVec3f& operator=(Vf_GridVec3f& rhs); // Assignment op + protected: + // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + virtual int SetNodeValue(const Vf_Mesh_Index* key, + const Nb_Vec3& value); + public: virtual REAL8m GetMaxMag() const; *************** *** 490,495 **** --- 519,533 ---- // Provided for convience for mesh arrays. Vf_GeneralMesh3f(void):Vf_Mesh("Vf_GeneralMesh3f",NULL) {} + + protected: + // For use by generic Vf_Mesh code for manipulation of + // mesh node values (as opposed to node locations). + // Returns 0 on success, 1 if the index is invalid + // or out-of-bounds. + virtual int SetNodeValue(const Vf_Mesh_Index* key, + const Nb_Vec3& value); + public: ////////////// Generic Mesh functions /////////////////// Vf_GeneralMesh3f(const char* filename,const char* title=NULL, diff -crN oommf-1.2a0/pkg/vf/ptsearch.cc oommf/pkg/vf/ptsearch.cc *** oommf-1.2a0/pkg/vf/ptsearch.cc Tue Sep 5 16:55:41 2000 --- oommf/pkg/vf/ptsearch.cc Thu Jan 4 17:06:44 2001 *************** *** 583,588 **** --- 583,599 ---- return &(bep->lv); } + int + Vf_BoxList::SetValue(const Vf_BoxList_Index& index, + const Nb_Vec3& value) + { + Vf_BoxElt be; + if(wholelist->GetElt(index.key,be)!=0) return 1; // Error + be.lv.value = value; + return wholelist->ReplaceElt(index.key,be); + } + + INT4m Vf_BoxList::GetSpaceWaste() const { INT4m wasted_space=0; diff -crN oommf-1.2a0/pkg/vf/ptsearch.h oommf/pkg/vf/ptsearch.h *** oommf-1.2a0/pkg/vf/ptsearch.h Fri Aug 25 13:01:26 2000 --- oommf/pkg/vf/ptsearch.h Thu Jan 4 17:06:44 2001 *************** *** 221,226 **** --- 221,227 ---- // select count. const Nb_LocatedVector* GetFirst(Vf_BoxList_Index& key) const; const Nb_LocatedVector* GetNext(Vf_BoxList_Index& key) const; + int SetValue(const Vf_BoxList_Index& key,const Nb_Vec3& value); }; // USUAL Vf_BoxList USAGE: diff -crN oommf-1.2a0/pkg/vf/vecfile.cc oommf/pkg/vf/vecfile.cc *** oommf-1.2a0/pkg/vf/vecfile.cc Tue Oct 10 16:42:12 2000 --- oommf/pkg/vf/vecfile.cc Thu Jan 4 17:29:05 2001 *************** *** 318,324 **** #if (BYTEORDER == 4321) // Flip bytes from LSB to MSB on output Oc_SwapBuf(cptr,sizeof(REAL4),count); #endif ! if(Nb_WriteChannel(channel,cptr,sizeof(REAL4)*count) !=sizeof(REAL4)*count) return 1; return 0; } --- 318,324 ---- #if (BYTEORDER == 4321) // Flip bytes from LSB to MSB on output Oc_SwapBuf(cptr,sizeof(REAL4),count); #endif ! if(Nb_WriteChannel(channel,cptr,UINT4m(sizeof(REAL4))*count) !=sizeof(REAL4)*count) return 1; return 0; } *************** *** 330,336 **** #if (BYTEORDER == 4321) // Flip bytes from LSB to MSB on output Oc_SwapBuf(cptr,sizeof(REAL8),count); #endif ! if(Nb_WriteChannel(channel,cptr,sizeof(REAL8)*count) !=sizeof(REAL8)*count) return 1; return 0; } --- 330,336 ---- #if (BYTEORDER == 4321) // Flip bytes from LSB to MSB on output Oc_SwapBuf(cptr,sizeof(REAL8),count); #endif ! if(Nb_WriteChannel(channel,cptr,UINT4m(sizeof(REAL8))*count) !=sizeof(REAL8)*count) return 1; return 0; } diff -crN oommf-1.2a0/pkg/vf/version.h oommf/pkg/vf/version.h *** oommf-1.2a0/pkg/vf/version.h Fri Aug 25 13:01:26 2000 --- oommf/pkg/vf/version.h Thu Jan 18 18:51:51 2001 *************** *** 4,11 **** * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2000/08/25 17:01:26 $ ! * Last modified by: $Author: donahue $ */ #ifndef _VF_VERSION --- 4,11 ---- * * NOTICE: Please see the file ../../LICENSE * ! * Last modified on: $Date: 2001/01/18 23:51:51 $ ! * Last modified by: $Author: dgp $ */ #ifndef _VF_VERSION *************** *** 24,30 **** #define VF_MAJOR_VERSION 1 #define VF_MINOR_VERSION 2 #define VF_RELEASE_LEVEL 0 ! #define VF_RELEASE_SERIAL 0 #define VF_VERSION OC_MAKE_VERSION(VF) --- 24,30 ---- #define VF_MAJOR_VERSION 1 #define VF_MINOR_VERSION 2 #define VF_RELEASE_LEVEL 0 ! #define VF_RELEASE_SERIAL 1 #define VF_VERSION OC_MAKE_VERSION(VF) diff -crN oommf-1.2a0/pkg/vf/vf.tcl oommf/pkg/vf/vf.tcl *** oommf-1.2a0/pkg/vf/vf.tcl Fri Aug 25 13:01:26 2000 --- oommf/pkg/vf/vf.tcl Thu Jan 18 18:51:51 2001 *************** *** 2,9 **** # # Vector Field support # ! # Last modified on: $Date: 2000/08/25 17:01:26 $ ! # Last modified by: $Author: donahue $ # # When this version of the vf extension is selected by the 'package require' # command, this file is sourced. --- 2,9 ---- # # Vector Field support # ! # Last modified on: $Date: 2001/01/18 23:51:51 $ ! # Last modified by: $Author: dgp $ # # When this version of the vf extension is selected by the 'package require' # command, this file is sourced. *************** *** 12,18 **** # has been initialized # # NOTE: version number below must match that in ./vf.h ! package require -exact Vf 1.2.0.0 Oc_CheckTclIndex Vf --- 12,18 ---- # has been initialized # # NOTE: version number below must match that in ./vf.h ! package require -exact Vf 1.2.0.1 Oc_CheckTclIndex Vf