(************** 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[ 8802, 272]*) (*NotebookOutlinePosition[ 9472, 295]*) (* CellTagsIndexPosition[ 9428, 291]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["AnsysEmat", "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[{ "AnsysEmat is a Mathlink application to read Ansys binary EMAT file into ", StyleBox["Mathematica", FontSlant->"Italic"], "." }], "Text"], Cell["\<\ EMAT file contains element matrices. It is described in \"Guide to \ interfacing with Ansys\" and in file \ /usr/local/ansys61/ansys61/customize/include/fdemat.inc. One of the simplest \ ways to obtain it in Ansys is to run the next Ansys script.\ \>", "Text"], Cell["\<\ /solu allse psolve, elform finish \ \>", "Program"], Cell[TextData[{ "I have tried it for thermal problems only. In principle, it should work \ for any EMAT file, but it'd better to make special tests. Also, I have been \ working with symmetric matrices only. If you have/suspect problems, use ", StyleBox["AnsysRecords", FontWeight->"Bold"], " to check what is really written in your file." }], "Text"], Cell[BoxData[GridBox[{ { StyleBox[\(OpenAnsysFile[fileName]\), FontWeight->"Bold"], \(Opens\ the\ Ansys\ \(\(file\)\(.\)\)\)}, { StyleBox["CloseAnsysFile", FontWeight->"Bold"], \(Closes\ the\ \(\(file\)\(.\)\)\)}, { StyleBox[ TagBox[\(DoNotConvertAnsysMatrices[i]\), HoldForm], FontWeight-> "Bold"], \(Determines\ whether\ to\ convert\ a\ symmetric\ \ matrix\ from\ \[IndentingNewLine] a\ lower\ triangle\ \ to\ \ full\ \(\(form\)\(.\)\)\)}, { StyleBox["ReadAnsysHeader", FontWeight-> "Bold"], \(Read\ information\ before\ elements . \ \ \[IndentingNewLine]Must\ be\ executed\ before\ next\ \ \(\(functions\)\(.\)\)\)}, { StyleBox["ReadAnsysElement", FontWeight->"Bold"], \(Read\ a\ next\ \(\(element\)\(.\)\)\)}, { TagBox[ StyleBox[\(ReadAnsysElements[n]\), FontWeight->"Bold"], HoldForm], \(Read\ n\ next\ \(\(elements\)\(.\)\)\)} }, GridFrame->True]], "Text"], Cell[BoxData[ \(OpenAnsysFile["\"]\)], "Input"], Cell[TextData[{ "returns 'binset' return code. It must be 0 in the case of success. If not, \ check the file name and add the right path. Note that the application current \ directory is determined when the application starts and not when ", StyleBox["Mathematica", FontSlant->"Italic"], " connects to it. If you call ", StyleBox["OpenAnsysFile", FontWeight->"Bold"], " again, it calls ", StyleBox["CloseAnsysFile", FontWeight->"Bold"], " automatically, so actually you do not need ", StyleBox["CloseAnsysFile", FontWeight->"Bold"], " at all." }], "Text"], Cell[BoxData[ StyleBox[ TagBox[\(DoNotConvertAnsysMatrices[i]\), HoldForm], FontWeight->"Bold"]], "Input"], Cell[TextData[{ "In the EMAT file, symmetric element matrices are saved in lower triangular \ form. By default, they are converted to the full form. If you would like to \ leave element matrices as they are, issue ", StyleBox["DoNotConvertAnsysMatrices[1]", FontWeight->"Bold"], ". In this case, when the element matrix is in the lower triangular form, \ its dimension in the element header is negative.", StyleBox[" ", FontWeight->"Bold"] }], "Text"], Cell[BoxData[ StyleBox[ RowBox[{"R", StyleBox["eadAnsysHeader", FontWeight->"Bold"]}]]], "Input"], Cell["This command returns a list as follows", "Text"], Cell["\<\ { \t{number of elements, number of dofs per node, total DOFs of model, number \ of nodes, maximum node number, actual number of nodes referenced}, \t{Nodal equivalence table. This table equates the number used for storage to \ the actual node number.}, \t{Element equivalence table. The ANSYS program stores all element data in \ the numerical order that the SOLUTION processor solves the elements. This \ table equates the order number used to the actual element number.} }\ \>", "Program"], Cell[TextData[{ "The command ", StyleBox["ReadAnsysHeader", FontWeight->"Bold"], " must be executed once before reading elements." }], "Text"], Cell[BoxData[ StyleBox[ RowBox[{"R", StyleBox["eadAnsysElement", FontWeight->"Bold"]}]]], "Input"], Cell["\<\ returns the next element from the current file as a list as follows\ \ \>", "Text"], Cell["\<\ { \t{stiffness matrix key, mass matrix key, damping matrix key, stress \ stiffening matrix key, applied load vector key, numbers rows/columns in \ matrices}, \t{DOF index table.}, \t... matrices that are present, one list for each matrix. \t{Element force vector.} }\ \>", "Program"], Cell["\<\ If a matrix key is 1 then the matrix is available, if 0 then not \ available. According to the documentation: \"DOF index table. This record \ specifies the DOF locations of this element matrix in relation to the global \ matrix. The index is calculated as (N-1)*NUMDOF+DOF, where N is the position \ number of the node in the nodal equivalence table and DOF is the DOF \ reference number given above\" and \"Element force vector. The ANSYS program \ always writes this record\". As a result, the load vector is present even if \ it is equal to zero. In the latter case, the application returns an empty \ list in order to reduce assembling time.\ \>", "Text"], Cell[BoxData[ RowBox[{ StyleBox[ RowBox[{"R", StyleBox["eadAnsysElements", FontWeight->"Bold"]}]], StyleBox["[", FontWeight->"Bold"], StyleBox["n", FontWeight->"Bold"], StyleBox["]", FontWeight->"Bold"]}]], "Input"], Cell["returns a list of n next elements from the current file.", "Text"], Cell[TextData[{ "Mathlink has communication overhead. Each call is expensive, especially \ over network. As a result, ", StyleBox["ReadAnsysElements", FontWeight->"Bold"], " is much more efficient than ", StyleBox["R", FontWeight->"Bold"], StyleBox["eadAnsysElement", FontWeight->"Bold"], ". The total number of elements is available from ", StyleBox["ReadAnsysHeader", FontWeight->"Bold"], "." }], "Text"], Cell["\<\ In order to use a Mathlink application, you have to 1) compile it, \ 2) install it or connect to it. The source code is included however it may \ not be easy to make a binary as it requires linking with the ANSYS bin \ library. A binary for Sun is available at BinaryLocation along with an \ example and documentation how to run it. Yet, the binary requires the ANSYS \ bin shared library, so it may work within IMTEK only.\ \>", "Text"], Cell["\<\ In the source code, the length of the temporary array is fixed to \ 100000 integers or 50000 doubles. You may change it if you need to work with \ big ANSYS models.\ \>", "Text"] }, Open ]] }, FrontEndVersion->"4.2 for Macintosh", ScreenRectangle->{{0, 1024}, {0, 705}}, WindowSize->{772, 643}, WindowMargins->{{16, Automatic}, {Automatic, 0}}, StyleDefinitions -> "Default.nb" ] (******************************************************************* 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->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 62, 1, 70, "Section"], Cell[1841, 56, 135, 3, 36, "Text"], Cell[1979, 61, 163, 5, 36, "Text"], Cell[2145, 68, 270, 5, 74, "Text"], Cell[2418, 75, 67, 5, 99, "Program"], Cell[2488, 82, 360, 7, 74, "Text"], Cell[2851, 91, 1172, 32, 185, "Text"], Cell[4026, 125, 63, 1, 33, "Input"], Cell[4092, 128, 589, 16, 93, "Text"], Cell[4684, 146, 130, 4, 33, "Input"], Cell[4817, 152, 467, 10, 93, "Text"], Cell[5287, 164, 126, 4, 33, "Input"], Cell[5416, 170, 54, 0, 36, "Text"], Cell[5473, 172, 502, 10, 184, "Program"], Cell[5978, 184, 152, 5, 36, "Text"], Cell[6133, 191, 127, 4, 33, "Input"], Cell[6263, 197, 93, 3, 36, "Text"], Cell[6359, 202, 293, 9, 167, "Program"], Cell[6655, 213, 670, 10, 131, "Text"], Cell[7328, 225, 301, 11, 33, "Input"], Cell[7632, 238, 72, 0, 36, "Text"], Cell[7707, 240, 438, 14, 74, "Text"], Cell[8148, 256, 447, 7, 93, "Text"], Cell[8598, 265, 188, 4, 55, "Text"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)