patran学习pcl二次开发chp_第1页
patran学习pcl二次开发chp_第2页
patran学习pcl二次开发chp_第3页
patran学习pcl二次开发chp_第4页
patran学习pcl二次开发chp_第5页
已阅读5页,还剩29页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Lecture 3MSC.Patran Architecture and Session FilesMSC.Patran ArchitectureA Specification or API (Application Procedural Interface) partially documented in Part 9: PCL and Customization and PCL Reference Manual built in functions.Designates functional areas of the productIsolates areas of concernStru

2、cture to build upon which is efficient for developmentEnhances performance and functionalityMSC.Patran Architecture: ControlUser/operator Drives UIMS (User Interface Management System)UIMS drives ApplicationApplication drives databaseDatabase drives graphicsAll other connections are weak (Very few r

3、everse links)History windows echo the internal command from UIMS.MSC.Patran Architecture MapThe Four Functional AreasUIMSUser Interface ( Forms and Widgets - Graphical INPUT/OUTPUT Objects)Applications Convert user input into format for database storageDatabase Data persistence, Embedded SQL, Data i

4、ntegrity, Simultaneous access, UndoGraphics Display database contents in viewport Allow picking Give feedback to userThe Four Functional Areas (cont.)UIMS Allows user to input informationApplications Converts user input to analysis/database operations (i.e. Meshing, Load/BC Creation, etc.)Database -

5、 Store data and allows queryGraphics Displays results so user can begin new cycle (variation on design)Event ManagerPoliceman for event-driven systemFirst-In First-OutControls heartbeatHeartbeat turns red if not contacted for a few millisecondsCoordinates the four functional areasMSC.Patran Architec

6、ture: The DatabaseSample Database PCL Built-indb_get_nodes_for_elems (num_elems, max_connect, elem_ids, connectivity)Input:num_elemsintegerThe number of elements input to this function.max_connectintegerThe maximum number of nodes associated with any one of the input elements.elem_idsinteger arrayTh

7、e IDs of the elements input to this function.Output:connectivityinteger arrayA x array containing the IDs of all the nodes associated with each of the input element. The nodes are listed in standard PATRAN element connectivity ordering and each row is blank filled. For example, if there were two ele

8、ments (a two noded bar and a four noded plate) then the connectivity array would be: BarNodeI, BarNodeJ, 0, 0, PlateNodeI, PlateNodeJ, PlateNodeK, PlateNodeL.integerStatus return value. The value will be 0 if the routine is successful.Undo BasicsAllows applications to reverse the effect of the comma

9、nd mit(string) sets a fence (or marker)Intermediate processing is volatile (lost if unexpected interruption).uil_db_undo() undoes all volatile database and graphics operations uil_db_undo() only called by the eraser button Executes mit prior to calling the applicationDoes not execute mit prior to ca

10、lling the application (volatile operation)Template DatabaseThe database used when opening a new databaseTypically called template.dbContains definitional data such as the table definitions and Analysis preferencesCan be modified to store company/project specific preference settings and model data A

11、Base database (base.db) is supplied which does not contain any preferences Reduces the size of the database and improves the performance at start-upTemplate Database (cont.)PCL libraries are provided to load specific preferences into the Base databaseAnything can be stored by the template database i

12、ncluding models (geometry, FEM, Materials, etc.)Searched through the PCL pathUsed at sites to customize preferences for internal analysis capabilitiesDemonstration 6:Setting the AnalysisPreference in Base.dbDB PortUtility which facilitates database transfer between patible workstations (V8.0 and up)

13、(SUN, SGI, HP, IBM) (DEC, NT)(DEC) (NT)Located in /bin on every workstation with a proper MSC.Patran installation (ex: /msc/patran2000/bin)DB Port should work automatically when moving between different platforms. It can however be run outside of PATRAN (V8.0 and up)dbport filename.dbSUN, SGI, HP, I

14、BM all have compatible structures (no DBport required)Element TopologyDetermines the shape, dimension and node, edge and face numberingEach element has a specific internal integer codeUse the following function to get the proper topology codes:fem_get_patran25_etop()Element Topology (cont.)Shape = W

15、edgeDimensionality = 3Wedge6Built-ins for Exercise #4 - #7, put_element_in_groupdb_count_elems (num_elems)Output:num_elemsintegerThe number of elements in the database.Return ValueintegerStatus return value. The value will be 0 if the routine is successful.Built-ins for Exercise #4 - #7, put_element

16、_in_group (cont.)db_get_elem_ids (num_elems, elem_ids)Function:This function extracts the IDs for all the elements in the database.Input:integerThe total number of elements in the database.Output:integer arrayThe IDs of all the elements in the egerStatus return value. The value will be 0

17、 if the routine is successful.Built-ins for Exercise #4 - #7, put_element_in_group (cont.)fem_get_patran25_etop (shape_code, num_of_nodes, topo_code)In order to determine the topologies of a list of elements (such as all the elements in the database or all the elements in a given group) or the topol

18、ogy of just a single element, use the function above:Input:integerThe PATRAN 2.5 shape code for this type of element:1 = Point Element2 = Bar Element3 = Triangular Element4 = Quadrilateral Element5 = Tet Element7 = Pentahedral Element8 = Hexahedral Elementinteger Output:integer The MSC.Patran elemen

19、t topology code to be used in referencing an element of this egerThis function returns a value of 0 when executed successfully and a non zero value to indicate a change in status or an error.Notes:The C call is FemGetPatran25E FemGetPatran25Etop (shape_code, num_of_nodes, topo_code)in

20、tshape_codeintnum_of_nodesint*topo_codeBuilt-ins for Exercise #4 - #7, put_element_in_group (cont.)db_get_elem_etop (num_elems, elem_ids, topo_codes)In order to determine the appropriate element topology code for a given shape code and maximum number of nodes.Input:integerThe number of element input

21、 to the eger arrayThe IDs of the elements input to this function.Output:integer arrayThe MSC/PATRAN topology codes for all the input egerStatus return value. The value will be 0 if the routine is successful.More data about these topology codes, like PATRAN shape code and maxi

22、mum number of nodes per element, can be extracted by using the functions described in MSC.PATRAN Element Topology Codes.Built-ins for Exercise #4 - #7, put_element_in_group (cont.)db_get_elem_topology_data (num_codes, topo_codes, shape_codes, nodes_per_elem) Input:integerThe number of MSC.PATRAN top

23、ology codes input to this function. integer arrayThe topology codes being input to this function. Output:integer arrayThe shape codes corresponding to the input topology codes. Their meaning is as follows: 1 = Point Element 2 = Bar Element 3 = Triangular Element 4 = Quadrilateral Element 5 = Wedge E

24、lement 7 = Pentahedral Element 8 = Hexahedral Element integer arrayA array containing the maximum number of nodes which make up the connectivity of the element type specified by the corresponding input MSC/PATRAN topology code. integer Status return value. The value will be 0 if the routine is succe

25、ssful. Built-ins for Exercise #4 - #7, put_element_in_group (cont.)ga_group_create (name)Function:Creates an empty group in the database with default parameters;Example: Render Style defaults to WireframeInput:nameSTRING32Unique name of the group to be createdOutputINTEGERStatus return value. The va

26、lue will be 0 if the routine is successful.Notes:The group must be explicitly posted to a viewport before viewing any added contents.Built-ins for Exercise #4 - #7, put_element_in_group (cont.)ga_group_entity_add (name, entities)Function:Adds a list of entities as members to a group.Input:nameSTRING

27、32Name of the group to which the entities are to be addedentitiesSTRINGList of entities to be added in List Processor syntaxExample: point1:# C 1 hp3 surface 2Output:INTEGERStatus return value. The value will be 0 if the routine is successful.Notes:Entities can belong as members to any number of gro

28、ups.Built-ins for Exercise #4 - #7, put_element_in_group (cont.)msg_to_form (msgcode, msgtype, appcode, ints, reals, chars)Function:Display a message in either a user interface form or in the history window. This routine is mostly for internal use but may be of interest to advanced users.Input:Msgco

29、deINTEGERMessage code to look up in message file.msgtypeINTEGERMessage type value, INFO=1, WARNING=2, ACKNOWLEDGE=3, FATAL=4.appcodeINTEGERApplication code reporting error. Use zero for sINTEGER()Integer data for message formatting. For user calls will normally be zero.realsREAL*()Real da

30、ta for message formatting. For user calls will normally be 0.0.charsSTRING()String data for message formatting. For user calls will normally be .Output:INTEGER1=Yes, 2=No, other values as well.ExercisesPerform Exercise #4, lug_create()Perform Exercise #5, lug_mesh()Perform Exercise #6, lug_load()Per

31、form Exercise #7, put_element_in_group(element_type,group_name)PATRAN Sessions and PCL FunctionsThe Session File as Built-in SourceIdeal source for application built-insInteractively simulate the PCL functionUse the session file as the templateOne can use embedded global variables variable_name in t

32、he argument list as an option.Excerpt from sample session file (using embedded global variable):elementprops_create( eighth_in_steel_plate, 57, 25, 19, 1, 1, 20, 13,20,36,4037, 5,9,1,1, m:steel,thickness, lug_geometry )$Use of radius in the databox (creating session with embedded global variable):Ex

33、ample of Session File UsageWrite a PCL program to create and display 10 grids wherey = x2First, create a single point through the PATRAN interface. This will generate a session file with the commands necessary for creating one point.Now build the function that will create the desired points.Finally execute the function.Step 1: Create a single GridStep 2: Edit Session File$# Session file patran.ses.01 started recording at 16-Jan-00 $# 12:58:14$# Recorded by: MSC.Patran Version 9.0$# FLEXlm initialization complete. Acquiring license(s). $# MSC.Patran 9.0 has obtain

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论