(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 7321, 285]*) (*NotebookOutlinePosition[ 8752, 337]*) (* CellTagsIndexPosition[ 8518, 325]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["How to use AnsysRecords", "Section", CellDingbat->"\[FilledSquare]"], Cell["\<\ Evgenii Rudnyi, 2003, \[Copyright]. Use it at your own risk. It may \ damage your data, computer and property. \ \>", "Text"], Cell[TextData[{ "First, it is necessary to install the application from within ", StyleBox["Mathematica", FontSlant->"Italic"], ". You need to know the binary location on a Sun. Please change path in the \ examples below to the correct one." }], "Text"], Cell["\<\ There are two ways to proceed. If you are working on a Sun, then:\ \ \>", "Text"], Cell[BoxData[ StyleBox[\(lnk\ = Install["\"]\), "Input"]], "Input"], Cell["\<\ Another option is to run the application on a Sun and to connect to \ it from another system via the network. It is a bit slower but it is much \ more convinient. This is what I am doing by myself from my Powerbook. Note \ that the Ansys file should be located on the Sun filesystem in any case. \ \ \>", "Text"], Cell["\<\ The binary requires the ANSYS bin shared library, so it may not \ work outside of IMTEK.\ \>", "Text"], Cell["\<\ In the last case, the installation is a two-step procedure. 1) Run \ application by itself. There is a script runServer in the AnsysRecords \ directory. Connect to any Sun (remeber its name) and choose a port number \ (for example 5555). Then\ \>", "Text"], Cell["\<\ cd path ./runServer 5555\ \>", "Program"], Cell["2) Connect to the application from another computer", "Text"], Cell[BoxData[ \(lnk = Install["\", LinkMode \[Rule] Connect]\)], "Input"], Cell["To check that the installation is working run", "Text"], Cell[BoxData[ \(LinkPatterns[lnk]\)], "Input"], Cell["and make sure that the output is", "Text"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[\(OpenAnsysFile[str_String]\), HoldForm], ",", TagBox["CloseAnsysFile", HoldForm], ",", TagBox["ReadAnsysRecord", HoldForm], ",", TagBox[\(ReadAnsysRecords[n_Integer]\), HoldForm]}], "}"}]], "Output"], Cell["At the end of your work, uninstall the application.", "Text"], Cell[BoxData[ \(Uninstall[lnk]\)], "Input"], Cell["Note that this also closes the Sun process.", "Text"], Cell["\<\ In the directory ansys, there are two files you can play with. \ 1600.emat and 16000.emat contain 1600 and 16000 element matrices accordingly. \ The number of records is about five times more than the number of matrices.\ \ \>", "Text"], Cell["\<\ In the current version, the length of the array in the application \ is fixed to 100000 integers or 50000 doubles. If in your case, an Ansys \ records has a bigger length, you will probably get a crash.\ \>", "Text"], Cell[TextData[{ " An example below compares timing of using ", StyleBox["ReadAnsysRecord", FontWeight->"Bold"], " and ", StyleBox["ReadAnsysRecords", FontWeight->"Bold"], ". An assumpition is that the application is already started at computer \ stevenson, it listens on port 5555 and its current directory is path. \ Otherwise, make necessary modifications." }], "Text"], Cell[BoxData[ \(\(<< Imtek`Utilities`ExtendedTiming`;\)\)], "Input", CellTags->"In[8]:="], Cell[CellGroupData[{ Cell[BoxData[ \(lnk2 = Install["\<5555@stevenson\>", LinkMode \[Rule] Connect]\)], "Input", CellTags->"In[24]:="], Cell[BoxData[ \(LinkObject["5555@stevenson", 11, 3]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(LinkPatterns[lnk2]\)], "Input"], Cell[BoxData[ RowBox[{"{", RowBox[{ TagBox[\(OpenAnsysFile[str_String]\), HoldForm], ",", TagBox["CloseAnsysFile", HoldForm], ",", TagBox["ReadAnsysRecord", HoldForm], ",", TagBox[\(ReadAnsysRecords[n_Integer]\), HoldForm]}], "}"}]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(OpenAnsysFile["\<../ansys/1600.emat\>"]\)], "Input", CellTags->"In[36]:="], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ExtendedTiming[ l1 = {}; \[IndentingNewLine]Do[ AppendTo[l1, ReadAnsysRecord], \ {20}]]\)], "Input", CellTags->"In[37]:="], Cell[BoxData[ \({3.`, Null}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(OpenAnsysFile["\<../ansys/1600.emat\>"]\)], "Input", CellTags->"In[38]:="], Cell[BoxData[ \(0\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(ExtendedTiming[\(l2 = ReadAnsysRecords[20];\)]\)], "Input", CellTags->"In[39]:="], Cell[BoxData[ \({0.`, Null}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Uninstall[lnk2]\)], "Input", CellTags->"In[40]:="], Cell[BoxData[ \("5555@stevenson"\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[l1]\)], "Input"], Cell[BoxData[ \(20\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[l2]\)], "Input"], Cell[BoxData[ \(20\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(l1\ \[Equal] \ l2\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(l1[\([2]\)]\)], "Input"], Cell[BoxData[ \({2, 1600, 1, 1681, 1681, 1681, 0, 0, 1681, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 189, 193, 1877, 3480, 5164, 0, 10051, 6848, 0, 146051}\)], "Output"] }, Open ]] }, Open ]] }, FrontEndVersion->"4.2 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 705}}, WindowSize->{702, 569}, WindowMargins->{{Automatic, 47}, {Automatic, 0}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{ "In[8]:="->{ Cell[4961, 161, 95, 2, 33, "Input", CellTags->"In[8]:="]}, "In[24]:="->{ Cell[5081, 167, 126, 3, 33, "Input", CellTags->"In[24]:="]}, "In[36]:="->{ Cell[5736, 196, 96, 2, 33, "Input", CellTags->"In[36]:="]}, "In[37]:="->{ Cell[5907, 206, 158, 4, 52, "Input", CellTags->"In[37]:="]}, "In[38]:="->{ Cell[6150, 218, 96, 2, 33, "Input", CellTags->"In[38]:="]}, "In[39]:="->{ Cell[6321, 228, 103, 2, 33, "Input", CellTags->"In[39]:="]}, "In[40]:="->{ Cell[6509, 238, 72, 2, 33, "Input", CellTags->"In[40]:="]} } *) (*CellTagsIndex CellTagsIndex->{ {"In[8]:=", 7905, 300}, {"In[24]:=", 7990, 303}, {"In[36]:=", 8077, 306}, {"In[37]:=", 8163, 309}, {"In[38]:=", 8250, 312}, {"In[39]:=", 8336, 315}, {"In[40]:=", 8423, 318} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 76, 1, 70, "Section"], Cell[1855, 56, 135, 3, 36, "Text"], Cell[1993, 61, 263, 6, 55, "Text"], Cell[2259, 69, 91, 3, 36, "Text"], Cell[2353, 74, 98, 2, 33, "Input"], Cell[2454, 78, 322, 6, 74, "Text"], Cell[2779, 86, 112, 3, 36, "Text"], Cell[2894, 91, 266, 5, 74, "Text"], Cell[3163, 98, 51, 3, 65, "Program"], Cell[3217, 103, 67, 0, 36, "Text"], Cell[3287, 105, 119, 3, 33, "Input"], Cell[3409, 110, 61, 0, 36, "Text"], Cell[3473, 112, 50, 1, 33, "Input"], Cell[3526, 115, 48, 0, 36, "Text"], Cell[3577, 117, 329, 10, 52, "Output"], Cell[3909, 129, 67, 0, 36, "Text"], Cell[3979, 131, 47, 1, 33, "Input"], Cell[4029, 134, 59, 0, 36, "Text"], Cell[4091, 136, 246, 5, 74, "Text"], Cell[4340, 143, 226, 4, 55, "Text"], Cell[4569, 149, 389, 10, 74, "Text"], Cell[4961, 161, 95, 2, 33, "Input", CellTags->"In[8]:="], Cell[CellGroupData[{ Cell[5081, 167, 126, 3, 33, "Input", CellTags->"In[24]:="], Cell[5210, 172, 69, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5316, 178, 51, 1, 33, "Input"], Cell[5370, 181, 329, 10, 52, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5736, 196, 96, 2, 33, "Input", CellTags->"In[36]:="], Cell[5835, 200, 35, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5907, 206, 158, 4, 52, "Input", CellTags->"In[37]:="], Cell[6068, 212, 45, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6150, 218, 96, 2, 33, "Input", CellTags->"In[38]:="], Cell[6249, 222, 35, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6321, 228, 103, 2, 33, "Input", CellTags->"In[39]:="], Cell[6427, 232, 45, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6509, 238, 72, 2, 33, "Input", CellTags->"In[40]:="], Cell[6584, 242, 50, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6671, 248, 43, 1, 33, "Input"], Cell[6717, 251, 36, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6790, 257, 43, 1, 33, "Input"], Cell[6836, 260, 36, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6909, 266, 51, 1, 33, "Input"], Cell[6963, 269, 38, 1, 33, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7038, 275, 44, 1, 33, "Input"], Cell[7085, 278, 208, 3, 71, "Output"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)