📄 gui_xmldoc.html.svn-base
字号:
/** \page GUI_XMLDoc Using the (beta) GUI/XML InterfaceThe following sections contain instructions for using the GUI/XMLinterface to OPT++. This includes starting the GUI, the code you willhave to write, and the form of the XML files. The GUI/XML interfaceprovides the major functionality of OPT++ but does not yet provide allof the detailed functionality allowed when setting up a problem asdescribed in \ref SetUp. We will gradually add this functionality aswe figure out the best way to do so. Please note that the GUI and XMLcode has only been confirmed to work on Linux machines using GNUtools. We expect other ports to be available in the future. Thefollowing topics are covered on this page.<ul> <li> \ref before <br> <li> \ref start <br> <li> \ref problem <br> <li> \ref algorithm <br> <li> \ref code <br> <ul> <li> <a href="#subroutine"> Subroutine Interface</a> <br> <li> <a href="#application"> Application Interface</a> <br> </ul> <li> \ref xml <br></ul>\section before Before You StartIn order to use the GUI/XML interface, you must first build OPT++ touse it. In particular, you should specify --with-xml at configuretime. See the <a href="InstallDoc.html#gui"> Configuring for use withthe new (beta) GUI/XML Interface</a> section of the<a href="InstallDoc.html"> Installation Documentation</a> for moredetails. In addition, you need Java 1.4 on your system. If it is notalready installed, you can download a version for Linux at the<a href="http://www.blackdown.org"> Blackdown web site</a>.Once Java is installed and OPT++ has been built appropriately, you nowneed to set a couple of environment variables. The first is theMAUI_HOME variable, and the second is the PATH variable. They shouldbe set as follows: \verbatim for csh or tcsh, setenv MAUI_HOME {path to OPT++}/Maui set path=($path {path to OPT++}/Maui/Java/bin {path to OPT++}/bin) \endverbatim OR \verbatim for bash, set MAUI_HOME={path to OPT++}/Maui set path=($path {path to OPT++}/Maui/Java/bin {path to OPT++}/bin) export path \endverbatimIf you would like to have these environment variables automaticallyset for you each time you log in and/or start a new shell, place thesecommands in your $HOME/.cshrc file or your $HOME/.bashrc file,respectively.The rest of this page describes how to set up an XML input file (bothwith and without the GUI) and how to set up any code you need toprovide. Once you have completed those tasks, you need only type: \verbatim opt++.e {name of XML file} \endverbatim OR \verbatim mpirun -np {number of procs} opt++.e {name of XML file}, <br> if you are using MPI. \endverbatimIf everything has been set up correctly, this command will execute theoptimization algorithm you chose on the problem you set up.\section start Starting the GUIOnce your environment is properly set up, as described in the<a href="#before"> Before You Start</a> section, starting up the GUIshould be straightforward. Simply execute the following command: \verbatim Maui.e {path to OPT++}/Opt.xml \endverbatimYou will get the following window: <br><IMG src="../images/maui_startup.png" ALIGN=center><BR>The first thing you may want to do is configure the appearance of theGUI. You can do this by clicking on the "Configure Maui" button. Youwill be given the opportunity to set a number of features, as shownbelow. Note that you can save the configuration for future use byclicking the "Save Config" button. <br><IMG src="../images/maui_config.png" ALIGN=center><BR>After you have configured the appearance to your liking, click the"Start New Session" button in order to bring up the OPT++ interface.The first time you do this, you will see the following error:<IMG src="../images/maui_noaction.png" ALIGN=center><BR>In order to correct this, click the "Browse" button. You will get afile menu which you should follow to {path to OPT++}/lib. Then selectthe file optMaui.jar, as show below. Once you've selected this file,you will be asked if you want to save it to your classpath. Click the"Yes" button to avoid the above error in the future.<IMG src="../images/maui_classpath.png" ALIGN=center><BR>Once you have complete these steps, you should now see the OPT++Welcome Panel, as shown below. You are now ready to set up youoptimization problem.<IMG src="../images/maui_opt++.png" ALIGN=center><BR>Before we move on, we first make some general comments regardingthings you will see on the GUI. The first is that some if the entriesare in blue font while others are in black font. Those in blue arerequired fields. Those in black will have default values set if youchoose to leave them blank. All of the field labels have Tool Tipsassociated with them. These tips are intended to tell you what typeof entry should go in that field and what range of values isappropriate. In addition, at the end of each field, you will see Helpbuttons. These are intended to provide you with some additionalguidance on the meaning of the field and on how it should be set.Finally, there is a "Load File" and a "Save Input for OPT++" button atthe top of the GUI. These allow you to load existing XML files and tosave XML files, respectively. The Load action currently cannot loadany files not generated by the GUI, though this will change in thefuture. The Save action generates error messages if any of the GUIinput is incorrect, but you will be allowed to save the file anyway atyour own risk.\section problem Setting up the ProblemTo set up your optimization problem, click on the "Problem Setup"tab. The default problem interface is the subroutine interface. Inorder to use this interface, you must provide the name of aninitialization subroutine, the name of a function evaluation routine,and the name of the library that contains these subroutines. You mustalso specify whether or not you will be providing code for derivativeevaluations. The initialization subroutine should include code forany one-time tasks to be done before the optimization process starts.The function evaluation routine should compute the value of thefunction given the current iterate. If you have specified that youwill be providing derivative information, the function evaluationsubroutine must also provide the code that performs the derivativecomputations. Finally, the library that contains these subroutinesmust be one that is dynamically linked. For more details on the codeyou must provide and how to compile it, please see the <a href="#subroutine"> Subroutine Interface Code</a> section. The"Problem Setup" panel with example entries for a subroutine-basedproblem is shown below.<IMG src="../images/maui_subroutine.png" ALIGN=center><BR>The other type of problem interface is the application interface. Forthis interface, you must provide the name of the executable that willbe called for the function evaluation. This may be a compiled binaryexecutable or a script that executes a sequence of steps that may alsoinclude such things as pre- and post-processing. The final resultmust a file named "fvalue.out" (or "convalue.out" for a nonlinearconstraint evaluation), which contains the function value, printed towhatever degree of precision you desire. (Note: Do not assume thatthe default precision for printf, fout, etc. is sufficient. You mightbe surprised!) In addition to the name of the executable, you mustalso provide the name, including the full path, of the directory thatcontains all of your application or model information. This includesnot only the executable named above, but any input files such as meshfiles. The final piece of information required is the name of theprimary input deck for your application. A templated form of thisfile must reside in a "makecopies" subdirectory of the applicationdirectory named above. Templated implies that the file has a ".Tmplt"extension, and the quantities you want to vary have been replaced byunique keywords. For more details on how to set up the files anddirectories required, please see the <a href="#application">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -