patran官方教程--Ws19_GlobalLocal_disp
2019年在Patran界面中建立Dytran模型及后处理的操作过程实例6

6.7 圆柱形钣金件冲压成形分析
有关工艺数据如下:
板料半径 板料厚度 凸模半径 凸模倒角半径 凹模内径 凹模倒角半径 冲压行程 冲压速度 压边圈内径 压边力 摩擦系数
100mm 0.7mm 50.0mm 13.0mm 51.25mm 5mm 40mm 4000mm/s 56.25mm 8.E8kN 0.18
数据文件产生后,用文本编辑器加以修改,将PATRAN界面中不支 持的卡片包含进来。
.
.
.
$
$ -------- Contact : master-slave-surface
$
$CONTACT
17 SURF SURF
1
2
+A012850
$+A012850
V4 BOTH
+A012851
$+A012851
[37 0 0]/Apply Point Coordinate List=
[50 13 0]/Apply Point Coordinate List=
[50 50 0]/Apply
Geometry/Create/Curve/Point/2Point/Starting Point List=Point 1/Ending Point List=Point 2/Apply /2D Arc2Point/Radius/Construction Plane List=Coord0.3/Arc Radius=13/Starting Point List=Point 2/Ending Point List=Point 3/Apply /Starting Point List=Point 3/Ending Point List=Point 4/Apply
patran使用技巧

分享patran使用中的一些技巧patran技巧[分享]为何我的FEM选单中不会出现Hybrid Mesh<Patran> 为何我的FEM选单中不会出现Hybrid Mesh?-->请在系统的环境变数中增加以下变数:PATRAN_USE_HYBRID_SURFACE_MESHER值设定为TRUE ,这样在surface mesh处, 除了Iso Mesh跟Paver Mesh外,就会看到另外一个Hybrid Mesh的选项[分享]MSC多解析任务批处理的方法如果仅有一台机器可以进行解析运算,有时候任务比较多的时候会时间来不及.提交模型让机器计算之后只能在旁边傻看着,什么也做不了. 其实有一种比较好一点的方法.可以用批处理文件让机器连续自动处理,下班时运行披处理文件,第二天早上来看结果.方法如下:比如有3个模型,S1.MOD,S2.MOD,S3.MOD1. 分别将上诉3个模型导出为DAT文件2.建立批处理c:\mscvn4w2002\solver\bin\nastran S1.datc:\mscvn4w2002\solver\bin\nastran S2.datc:\mscvn4w2002\solver\bin\nastran S3.dat3. 双击4. 下班5. 上班6. 导入解析结果.[转帖]PATRAN的一些小技巧1、在Patran里如何Move 一组Points 的位置, 而不改变这组Points 的ID 编号? Group/Transform/Translate的功能,这样不但编号不会变, 连property跟边界条件都会保留2、Patran如何执行多次Undo?所有Patran的操作步骤, 都记录在最新的一个patran.ses.xx中,如果需要多次undo, 可以刪除最后不需要的步骤指令行,再利用File -> Session -> Play 的方式, 执行改过的patran.ses.xx ,这样可以无限制的undo。
patran软件安装说明

软件安装说明By Zuo2009-12-3本说明主要针对水工专业常用的几种数值模拟软件,对他们的安装方法进行了详细的介绍与说明。
推荐按照下文中出现的先后顺序安装各种软件。
Patran:软件版本:Patran 2007 r2。
(不建议使用Patran 2005 r2,该版本属内部测试版本,与其他程序不兼容)安装文件:光盘镜像文件“m-patrr2.iso”。
安装方法:1、首先了解本计算机名,在“我的电脑——属性——计算机名”中的“完整的计算机名称”查找,为了后面安装的方便,在这里可以点击更改计算机名,建议取个简单的名字,例如myhost或xndss。
(注:更改后一定要重启。
)2、载入镜像文件,光盘自动弹出欢迎界面,点击Patran 2007 r2。
3、点选“next”N次。
注意:在选择安装目录的时候,最好就用它的默认目录,装在C盘较好。
4、装好后,在选择默认文件夹时直接点next就可以。
5、接着程序提示输入license文件。
我们先进入光盘,拷贝光盘下的MAGNiTUDE文件夹到C:\ MSC.Software 里面(默认),并将文件夹更名为license,打开该文件夹,用记事本程序打开license.dat 文件,其第一行应为:SERVER thishost 007330757468 1700将里面的”thishost”更改成本计算机名。
6、运行文件夹中的lmtools程序,点击Config Services选项卡,将里面的Service Name改为MSC,Path to the Imgrd.exe file 一项中浏览选择当前文件夹下的Imgrd.exe。
Path to the license file 一项中浏览中选择license.dat(文件类型选择.txt)。
Path to the debug log file 一项中浏览,并在文件名一栏中手动填入license.log。
7、勾选Use Services,并勾选Start Server at Power Up。
精典材料Patran的PCL用户手册V20

MSC.Patran PCL HandbookIn a Nutshell (7)What is PCL? (7)What can PCL be used for? (8)How does PCL work? (9)All you really need to know is on this page! (10)Documentation (10)PCL for Everyone (11)Entering Equations (11)Entering Data (12)Session Files (13)Rebuilding Models (14)PCL for the More Adventurous (17)Parametric Modeling (17)Adding a Graphical User Interface, GUI (21)Exercise 1: Session Files (22)PCL Programming Basics (24)Overview (24)PCL Expressions (26)Expressions, Comments, Syntax Tips (26)Identifiers (28)Naming Conventions (28)Variable / Function Scope (29)Structure of a PCL Function (30)Function Basics (30)Simple PCL function Example (31)Exercise 2: Hello World! (33)Exercise 3: Effective PCL (34)PCL Operators (35)String comparisons (35)PCL Variables and Constants (36)Datatypes (36)Variable Scope (37)Directly Allocated Arrays (38)Virtual arrays (39)Virtual strings (41)Loop Control Statements (42)For Loop (42)While Loop (42)Repeat Loop (43)BREAK (44)CONTINUE (45)Exercise 4: Writing Files (46)Exercise 5: Reading Files (48)Conditional Control Statements (49)IF Statement (49)SWITCH Statement (50)Structure of a PCL Function (51)Compiling and Linking PCL Functions (54)Primary PCL Directives (55)Compiling PCL outside of MSC.Patran (59)Linking Compiled Libraries (60)Other PCL Directives (61)Start Up Files (62)Exercise 6: p3epilog.pcl (63)Debugging (64)Debugging Compile Errors (64)Debugging Runtime Errors (65)Accessing PCL Functions (67)From The Command Line (67)From Any MSC.Patran Form (68)PCL Functions with Field Variables (69)MSC.Patran Built-In Functions (70)Naming Conventions for Applications (71)Naming Conventions for Other Operations (72)Exercise 7: Group Elements By Shape (74)Graphical User Interface (75)The PCL Class Statement (76)PCL Widgets (77)Required Functions for Building/Displaying a Form (78)The init() Function (78)The display() Function (79)Widget Callbacks (82)What Are They? (82)What Are They Used For? (83)Callback Arguments (Widget Function Data) (83)Widget Placement (85)Widget Variables (87)Modifying Widgets (88)Getting Data from Widgets (89)Putting it all Together (Example) (90)Exercise 8: Simple Form (92)The C-Preprocessor and Include Files (93)Make Files (94)Exercise 9: Callbacks (96)Handling Errors and Messaging (98)Errors from Built-In Functions (98)Custom Error Messages (99)Using User Messages Database (99)Without a Messages Database (100)Taking Advantage of the UNDO Feature (102)Select Mechanism (103)Select Mechanism GUI Mechanics (103)Select Databoxes, Select Frames, and Select Menus (103)GUI PCL Example (105)List Processor (106)List Processor Mechanics (106)All You Really Need to Know (107)Exercise 10: Form to Group Elms By Shape (110)Executing Programs Outside of MSC.Patran (112)Spawning Remote Processes (112)Locking a database (114)Using C and Fortran executables to access a MSC.Patran database directly. (115)External Access of an MSC.Patran Database (116)Special Widgets (118)File Widget (118)Spreadsheet Widget (121)Exercise 11: File Widget (122)Adding Help/Description to your PCL (123)Percent Complete (124)Functions (124)Example (124)Event Manager (125)General (125)Functions (126)Example (126)Primitive Graphics (127)Graphic Objects (127)Graphic Segments (128)Example (129)Another Example (130)Exercise 12: Primitive Graphics (131)MSC.Patran Customization (132)Adding Utility Programs to the Main Menu (132)Example (133)Example: p3_user_menu.my_menu.def (134)Customizing the MSC.Patran Toolbar (135)Exercise 13: Pulldown Menu (138)Exercise 14: Toolbar (139)Some Final Thoughts (141)Appendix A (144)Built-in Function Examples (144)Documentation for a typical MSC.Patran built-in function. (145)To get all the nodes and their global coordinates (146)To get the topology of every element (147)To get the shape of every element (148)To get all the element connectivity for all elements (149)To get the elements associated to a particular element property set (150)To get an element property value (shell thickness) for a specific element (151)To get a material property value (153)To get a list of all groups (154)To get the nodes and elements associated to the current group (154)To get result values for specified elements (155)Appendix B (164)Strings & String Functions (164)Declaration (165)Initialization (165)String Comparisons (165)Functions (166)Appendix C (174)Noteworthy Functions (174)sys_mov e_raw(...) (175)mth_array_search(...). (176)mth_sort(...) . (177)mth_sort_row(...).. (178)mth_sort_column(...) . (178)fem_geom_edge_length(...) .. (179)fem_geom_face_area(...). (179)fem_geom_elem_volume(...). (179)fem_geom_elem_location(...) .. (180)Appendix D (181)Form Spacing Parameters (appforms.p) (181)* SPACING (182)Appendix E (205)MSC.Patran Architecture (205)Appendix F (207)Shareware Compiling Functions (207)Appendix G (210)Parametric Patran (210)Appendix H (216)Additional List Processor Notes (216)List Processor Mechanics (217)List Processor Functions (217)List Processor Sublist Functions (219)List Processor Attribute Functions (220)Miscellaneous List Processor Functions (220)List Processor Examples (222)Easy to Use List Processor Functions (226)Appendix I (227)Key Mapping (227)Appendix J (230)Widget Classification (230)Appendix K (233)User Defined AOM (233)In a NutshellWhat is PCL?❑PCL stands for Patran Command Language❑Comprehensive, fully functional computer programming language❑Specifically and uniquely suited for MCAE applications ❑Delivered as a part of MSC.Patran❑Versatile and easy to useWhat can PCL be used for?❑Integrate application or site-specific programs with the MSC.Patran user interface and database❑Generate parametric/variational models for design/optimization ❑Integrate commercial and/or in-house analysis codes with MSC.Patran❑Display custom graphics❑Access the MSC.Patran database❑Create new and/or enhanced MSC.Patran functionality❑Database management for analysis files❑Eliminate tedious, repetitive proceduresHow does PCL work?❑All MSC.Patran commands are first interpreted by the PCL command interpreter❑PCL expressions are interpreted by a C program❑PCL functions can be compiled into libraries (more efficient binary representation) and “linked” with a MSC.Patran session❑“Built-in” PCL functions are written in C or FORTRAN❑MSC.Patran forms and menus can be created via PCL calls to Xlib, the X-window function library❑FORTRAN and C functions can be “linked” with MSC.Patran through PCLAll you really need to know is on this page! Documentation❑PCL and Customization - General programming guide for PCL.How to build forms, compile, manage libraries, access thedatabase, read/write files, etc.❑PCL Reference – Description of functions written to the session file.❑Develop: The MSC.Patran Toolkit – Documentation of additional functions for database access, etc.PCL for Everyone Entering EquationsUse of PCL when creating spatial fields:‘X + ‘X**2 –sinr(‘X)The PCL interpreter interprets anythingimmediately following a ‘ symbo l as afield variable as opposed to a PCLfunction, such as, sinr().Entering DataUse of PCL when entering geometric coordinates: [ `5./16.` 0 0 ]The PCL interpreter “evaluates” expressions enclosed in back tics, “`”.Other examples:[ `radius/length` 0 0 ]< `cosr(theta)` 1 1 >[ `MyFunction(radius)` 0 1 ]Session FilesSession and journal files are comprised entirely of PCL commands. Model changes (dimensions, mesh density, etc.) can be made quickly by editing and then replaying the session or journal files.$# Session file patran.ses.01 started recording at 16-Aug-01 14:33:54$# Recorded by: MSC.Patran 2001STRING asm_create_patch_xy_created_ids[VIRTUAL]asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", @asm_create_patch_xy_created_ids )$# 1 Patch created: Patch 1STRING sgm_edit_surface_add_h_edit_ids[VIRTUAL]sgm_edit_surface_add_hole( 1, 1., TRUE, "", "[5 5 0]", "", "Surface 1", @sgm_edit_surface_add_h_edit_ids )$# 1 Surface Edited: Surface 1$# Session file patran.ses.01 stopped recording at 16-Aug-01 14:34:52Rebuilding ModelsThe following session file creates a trimmed surface, 10” x10”with a 1” diameter hole at the center. Note that the parameter that controls the diameter of the hole is indicated below.$# Session file patran.ses.01 started recording at 16-Aug-01 14:33:54$# Recorded by: MSC.Patran 2001STRING asm_create_patch_xy_created_ids[VIRTUAL]asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", @asm_create_patch_xy_created_ids )$# 1 Patch created: Patch 1STRING sgm_edit_surface_add_h_edit_ids[VIRTUAL]sgm_edit_surface_add_hole( 1, 1., TRUE, "", "[5 5 0]", "", "Surface 1", @ sgm_edit_surface_add_h_edit_ids )$# 1 Surface Edited: Surface 1$# Session file patran.ses.01 stopped recording at 16-Aug-01 14:34:52In the session file below, the previous session file is edited to change the hole diameter from 1” to 4”$# Session file patran.ses.01 started recording at 16-Aug-01 14:33:54$# Recorded by: MSC.Patran 2001STRING asm_create_patch_xy_created_ids[VIRTUAL]asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", @asm_create_patch_xy_created_ids )$# 1 Patch created: Patch 1STRING sgm_edit_surface_add_h_edit_ids[VIRTUAL]sgm_edit_surface_add_hole( 1, 4., TRUE, "", "[5 5 0]", "", "Surface 1", @ sgm_edit_surface_add_h_edit_ids )$# 1 Surface Edited: Surface 1$# Session file patran.ses.01 stopped recording at 16-Aug-01 14:34:52Session files can be executed or “played” by selecting File/Session/Play … from the top menu.PCL for the More Adventurous Parametric Modeling❑Session files can be parameterized by defining and using variables during the MSC.Patran session❑First, variables are declared and initialized via the MSC.Patran command lineSecond, the variables are used as input into the appropriate MSC.Patran forms (note the use of ` `, back tics)Upon application, the PCL interpreter evaluates `radius` (i.e., sets it equal to 1.0 in this example) and creates the curve. Note that the variable is passed to the session file in its unevaluatedBy using variables as parameters during MSC.Patran input, it is very easy to edit and change dimensions, mesh parameters, etc. in the session file.PCL for the more Adventurous Adding a Graphical User Interface, GUIThe next step might be to create a user interface to run the plate session file!Exercise 1: Session FilesUse MSC.Patran to create a parameterized session file that createsa rectangular surface with an arbitrarily located hole.1) Create variables for the dimensions shown below.2) Steps:a) Create variables using MSC.Patran’s command lineb) Create/Surface/XYZ (use variables length and width)c) Edit/Surface/Add Hole (use x_center, y_center, and diameter) Extra credit: Include error checking, i.e., it doesn’t make sensefor the hole to be outside the surface boundary.IF (x_center + diameter/2.0 > length) THEN RETURNExtra credit: Include meshing, boundary conditions, elementproperties, etc.Extra credit: Use ui_read_real(prompt) to enter the variablevalues interactivelyExtra credit: Turn your session file into a PCL FUNCTION.Exercise 1 Below is an image showing an MSC.Patran form allowing the interactive creation of the model for this exercise.NB – See Appendix G for notes about Parametric Patran.1) Variables and macros are defined interactively via a GUI2) Variables and macros are persistent3) Plus, more. See Appendix G for the detailsPCL Programming Basics Overview❑PCL is a full-featured programming language.❑Operators for arithmetic, relational, and string expressions.Examples include:❑Variables with type, scope, and dimension attributes INTEGER i, j, status, NodeIds(1000)LOGICAL flagREAL xyz(1000, 3), pressure(100), timeGLOBAL STRING my_group[32], all_groups[32](100)❑Dynamically allocated virtual strings and arraysINTEGER node_ids(VIRTUAL)STRING groups[32](VIRTUAL), MyString[VIRTUAL]❑Intrinsic functions for math, string manipulation, etc.sinr(angle)cosd(angle)mth_abs(MyVal)mth_sort(MyArray, CompactDuplicates, NumLeft)mth_array_search(MyArray, Look4, Sorted)str_length(MyString)str_substr(MyString, Position, SubStringLength)str_index(StringToSearchIn, StringToSearchFor)str_token(MyString, Delimiter, TokenNumber, [Compress])PCL Programming Basics ❑Loop control features, such as, WHILE, FOR, REPEAT, and LIST❑Conditional control structure, such as, IF-THEN-ELSE and SWITCH-CASE❑Subroutine (procedure) and function (command) calls❑Class grouping of related functions❑Read/write access to external ASCII and/or binary filestext_open(FileName, Options, 0, 0, FileId)text_read_string(FileId, InString, InStringLength)text_write_string(FileId, OutString)text_read(FileId, Format, MyIntegers, MyReals, MyChar)text_write(FileId, Format, MyIntegers, MyReals, MyChar)text_close(FileId, Options)file_exists(FileSpec, Options)file_delete(FileSpec)❑Access to MSC.Patran “built-in” functions that allow for direct access to the MSC.Patran database, geometry creation,drawing graphic primitives,db_count_nodes(NumNodes)db_get_node_ids(NumNodes, NodeIds)asm_const_grid_xyz(output_ids, coordinates_list, coord_frame, @created_ids)PCL Expressions Expressions, Comments, Syntax Tips❑Sample PCL expressions include:theta = 360.0 – MTH_ASIND(MyAngle)IF (radius >= 20.0) THEN radius = 20.0length = str_length(MyString)build_gear_geometry(30., 56., 3)❑PCL comments begin with a “/*” and end with a “*/”/*This is a comment.Look Ma, I’m making comments in PCL!Has anyone seen or heard from Elvis lately?*/a = 2 /* set mysterious factor equal to 2 */❑Alternatively, single line comments may begin with “$”$ Don’t you just hate to comment your programs?❑More than one PCL expression can co-exist on a line using a semi-colon, “;”alpha = 30.0; beta = 120.0❑PCL expressions can be continued on subsequent lines by using the “@” symbolui_wid_set(main_form, @“HEIGHT”, @NewHeight)ui_wid_set( /* widget_id */ main_form, @/* parameter */ “HEIGHT”, @/* value */ NewHeight)PCL Expressions ❑Don’t break expressions in the middle of a keyword, constant, or identifier❑Multiple blanks are the same as a single blank space❑Lines beginning with “!” (bang operator) are echoed to the xterm (UNIX) or command window (NT), but are not executedIn MSC.Patran type: !`i` nodes createdIn the xterm you see: %27 nodes created❑PCL expressions beginning with “>” are echoed to the session file❑PCL expressions can be typed directly into MSC.Patran at the command line❑PCL expressions may also be created with an editor in a text file and directed into MSC.Patran as a session file or by using the PCL directive !!INPUTIdentifiersNaming Conventions❑Function names and/or variable names are called identifiers ❑Can be up to 32 characters long❑Must begin with a non-digit❑Case insensitive (as is all of PCL)❑Cannot be a reserved keyword, i.e., FOR, IF, etc.❑Valid identifierscurrent_groupCurrentGroupMyString❑Invalid identifiersa_very_very_very_very_very_very_very_very_long_name 95abclistIdentifiers Variable / Function Scope❑Global variable names and functions share the same name space❑When two function names or two variable names conflict, the most recent addition supercedes the previous❑When function names and variable names conflict, the variable name takes precedence❑When compiling functions, PCL will indicate if a function name is superceded by writing “Cleared memory function” to thehistory window❑Hint: Use a unique prefix to keep function definitions separate,i.e au_do_this_and_that.pclStructure of a PCL Function Function Basics❑PCL functions begin with a FUNCTION statement and end with an END FUNCTION statement.❑The FUNCTION statement may contain an argument list to be passed in or out of the function.❑An optional RETURN statement can be used to return a calculated value from the function to the calling statement.❑Processing of the function terminates at either the END FUNCTION statement or a RETURN statement.❑There may be multiple RETURN statements within a single function.Simple PCL function Exampleanother_simple_function(29)$#My favorite number is 29$#My least favorite number is 13Sample output. The ui_write functions writetext to the history window, the session file(patran.ses.##), and the journal file(model.db.jou)Exercise 2: Hello World!Write and execute a PCL function that accepts a single real number argument and echoesHello World, my favorite number is ….to the MSC.Patran session file and history window.Your function will use either the ui_write(…),ui_writef(…), or ui_writec(…) functions.If you use the ui_writef(…) and ui_writec(…) functions, refer to the documentation for the correct format specifiers.Extra credit: How would this function change if you wanted to echo your favorite 10 numbers to the session file? Extra credit: How would this function change if you wanted to echo your favorite color to the session file?Exercise 3: Effective PCLWrite an essay on how the effective use of PCL could:a) Help create a lasting world peaceb) Eliminate world hungerc) Conquer the common coldd) Stop global warmingExtra credit: How could PCL be used to find Elvis?PCL OperatorsExamplesDist = mth_sqrt((x2-x1)**2 + (y2-y1)**2 + (z2-z1)**2) MyString3 = MyString2//”hijk”IF (a == b) THEN c = dIF (a == b && a == c) THEN ui_write(“Equilibrium”)x += 1 (this is equivalent to x = x +1)String comparisons❑The string comparison operators are special in that they ignore trailing blanks and uppercase and lowercase. Therefore, all of the following expressions are TRUE“ABC” == “ABC ““ABC” == “abc”❑Leading blanks are compared, i.e., “TEST” != “ TEST”❑To perform case sensitive comparisons use the str_equal() function, i.e.,IF (str_equal(GroupName1, GroupName2)) THEN RETURN 0PCL Variables and Constants Datatypes❑LOGICAL Boolean value: TRUE or FALSELOGICAL done, created31-1)❑INTEGER Value between +/- (2INTEGER i, num_nodes, node_id❑REAL Single precision floating value between 1.0E-30 and1.0E+30 (positive or negative)REAL x, y, z, force, pressure❑STRING Character string surrounded by double quotes, “Have you seen Elvis?”. Size or string length is defined with brackets, [ ]STRING FileName[80], GroupName[32]❑WIDGET Value is assigned by calls toUI_WIDGET_NAME_CREATE(…), used to create andmanipulate forms, etc.WIDGET main_form, MyButton, group_lboxVariable Scope❑GLOBAL Available to all functions during the MSC.Patransession❑LOCAL Default, only visible within the defining function ❑STATIC Same as LOCAL, but retains its value betweencalls❑CLASSWIDE Available to all functions in the CLASS andretains its value during the MSC.Patran sessionDirectly Allocated Arrays❑Directly allocated arrays can have any number of subscripts (dimensions), defined within parentheses ()❑Assigned upper and lower bounds, ArrayName(Lower:Upper)INTEGER MyArray(2:10)❑ Default lower bound is 1 (not 0) ❑ Available for all datatypes❑Row major (unlike Fortran which is column major)INTEGER MyArray(2, 3) = 1, 2, 3, 4, 5, 6❑Array dimensions are inherited from the argument list, i.e., PCL passes by reference❑Declaration ExamplesREAL displacements(6, 200) STRING group_names[32](20) INTEGER ids(0:2, 0:4, 0:10) LOGICAL exists(12)Virtual arrays❑Any variable can be defined as a VIRTUAL array instead of a directly allocated array. Virtual arrays do not have storagelocations assigned to them at program initialization. The size and amount of storage is allocated as requested and can bereused for other virtual arrays.❑To declare a virtual array, use the keyword VIRTUAL in place of the subscripts for the declaration, i.e.,REAL MyVals(VIRTUAL)INTEGER NodeIds(VIRTUAL)❑Storage is allocated using the function, sys_allocate_array(), or sys_allocate_array(MyVals, 1, 300)sys_allocate_array(MyVals, 1, 300, 1, 3)sys_allocate_array(MyVals, 1, 300, 1, 3, 0, 5)etc.❑Storage may be reallocated using the function,sys_reallocate_array(),sys_reallocate_array(MyVals, 1, 300, 1, 3)❑Storage may be freed using the function, sys_free_array(), sys_free_array(MyVals)Virtual array examplePCL Variables and Constants Virtual strings❑Any string variable can be defined as a VIRTUAL length string instead of a fixed length string. Virtual length strings do nothave storage locations assigned to them at programinitialization. The string length is allocated as requested and can be reused.❑To declare a virtual length string, use the keyword in place of the subscripts for the declaration, i.e.,STRING picklist[VIRTUAL]❑The string length is allocated using the sys_allocate_string() functionsys_allocate_string(picklist, 1000)❑The string length may be modified using thesys_reallocate_string() functionsys_reallocate_string(picklist, 2000)❑The string storage may be freed using the sys_free_string() functionsys_free_string(picklist)❑ A virtual length string can also be a virtual array, i.e., STRING picklists[VIRTUAL](VIRTUAL)Loop Control StatementsFor Loop❑SyntaxFOR (var=numeric_expr TO numeric_exprnumeric_expr label statements … END FOR❑ExampleAvgTemp = 0.0FOR (i = 1 TO NumNodes) AvgTemp += NodalTemp(i) END FORAvgTemp = AvgTemp/NumNodesWhile Loop❑SyntaxWHILE (logical_expression ) [label ] statements … END WHILE❑ExampleAvgTemp = 0.0 i = 1WHILE (i <= NumNodes)AvgTemp += NodalTemp(i) i += 1 END WHILEAvgTemp = AvgTemp/NumNodesRepeat LoopThis is similar to a WHILE Loop except that it will always be executed at least once. Only use REPEAT loops if you want to ALWAYS execute the loop at least once, otherwise us a WHILE loop.❑SyntaxREPEAT [label]statements …UNTIL (logical_expression)❑ExampleAvgTemp = 0.0i = 1REPEATAvgTemp += NodalTemp(i)i += 1UNTIL (i > NumNodes)AvgTemp = AvgTemp/NumNodesBREAKThe BREAK statement is used to exit a loop prior to its normal termination. It can be used in any of the loop statements.BREAK [❑END WHILE…❑Example 2 (nested loops, using labels)WHILE (i <= NumNodes) MainLoopWHILE (j <= 100) AnotherLoopWHILE (k <= 200) InnerLoopIF (status != 0) THEN BREAK MainLoopIF (status != 0) THEN BREAK AnotherLoopIF (status != 0) THEN BREAKIF (status != 0) THEN BREAK InnerLoopEND WHILEEND WHILEEND WHILECONTINUEThe CONTINUE statement is used to skip to the end of the loop ❑SyntaxCONTINUE [label]❑Example 1 (reading a text file)INTEGER file_id, lengthSTRING read_str[80]/* read grid information */WHILE (text_read_string(file_id, read_str, length) == 0)END WHILE❑Example 2 (nested loop, using labels)WHILE (i <= NumNodes) MainLoopREPEAT InnerLoopCONTINUE MainLoopBREAK InnerLoopCONTINUECONTINUE InnerLoopUNTIL (j > 1000)END WHILEstatements …Exercise 4: Writing FilesCreate a PCL function to write nodal data to a user-defined file. 1) The function should have a single argument, the filename to becreated, i.e., FUNCTION write_nodes_to_file(FileName)2) The data should be written to the file as a table, i.e.,Node Id x-coordinate y-coordinate z-coordinate3) Use virtual arrays4) Use the following built-in functions:db_count_nodes(NumNodes)db_get_node_ids(NumNodes, NodeIds)db_get_nodes(NumNodes, NodeIds, rcids, acids, NodeXYZ)text_open(FileName, Options, idum, idum, FileId)text_close(FileId, Options)text_write(FileId, Format, Ints, Reals, Chars)text_write_string(FileId, OutString)5) Use the documentation if you have questions about thearguments to the built-in functions.6) Think about your choice for the format argument in thetext_write(…) function. Will your file be comma or spacedelimited? Will it be fixed or free format?7) Sample code outline:a) Declare variablesb) Count nodes in the databasec) Allocate arraysd) Get node Idse) Get node coordinatesf) Open fileg) Write data to the file with a looph) Close filei) Be sure to include a message that the file output is completeWriting Files Extra credit: Include a header line at the top of the file thatincludes the filename and the total number of nodeswritten to the file.Exercise 5: Reading FilesWrite a function to read the file created in Exercise 4.1) The function should accept a single argument, i.e., the filenameto be read.FUNCTION ReadFile(FileName)2) Use the data in the file to create nodes with the following built-in function from the PCL Reference Manual:fem_create_nodes_1(RefCIDList, AnalysisCIDList, GeomFlag, @NodeIDList, XYZList, NodesCreatedList)3) Use the following built-in functions:text_open(FileName, Options, idum, idum, FileId)text_close(FileId, Options)text_read(FileId, Format, Ints, Reals, Chars)4) Sample code outline:a) Declare variablesb) Open the filec) Read the file within a loopd) Create new nodes as the file is read within the loope) Close the fileExtra credit: What if a node ID to be created already exists in the database?Extra credit: What if the file to be read doesn’t exist? Whatfunction can be used to determine if a file exists? Extra credit: Searching the documentation reveals anotherfunction that can be used to create nodes, i.e.,db_create_nodes(num_nodes, rcids, acids, xyz, group_id,node_ids, node_exists). Why might you use thisfunction versus fem_create_nodes_1(…)?Conditional Control Statements IF Statement❑SyntaxIF (logical_expression) THENstatements …ELSE IF (logical_expression) THENstatements …ELSEstatements …END IF❑ExampleIF (MyKeyWord == “CBAR” || MyKeyWord == “CBEAM”) THEN statements …ELSE IF (MyKeyWord == “CTRIA” || MyKeyWord == “CQUAD”) THEN statements …ELSE IF (MyKeyWord == “GRID”) THENstatements …ELSEstatements …END IF。
PATRAN NASTRAN R 傻瓜式图文安装过程全解

64位win7旗舰版操作系统下PATRAN2011+NASTRAN2011傻瓜式图文安装过程全解教程以64位Windows7旗舰版操作系统为例,给出PATRAN2011和NASTRAN2011的傻瓜式操作教程。
作者绝对不信还有比这个更详细的安装教程了……欢迎上传本教程到网络,帮助更多新手顺利安装PATRAN2011+NASTRAN2011……0 下载安装文件............................................................................................................................. - 2 -1 加载PATRAN CD2 ...................................................................................................................... -3 -2 生成PATRAN license文件......................................................................................................... - 4 -3 安装PATRAN license许可管理.................................................................................................... - 5 -4 确认license 是否可用 ............................................................................................................. - 10 -5 安装PATRAN 主程序................................................................................................................ - 12 -6 卸载PATRAN许可管理器.......................................................................................................... - 20 -7 生成NASTRAN licence文件....................................................................................................... - 22 -8 安装NASTRAN licence许可管理器........................................................................................... - 23 -9 安装NASTRAN主程序............................................................................................................... - 27 -10 设置NASTRAN域PATRAN的关联 .......................................................................................... - 34 -11 其他 .......................................................................................................................................... - 40 -0下载安装文件/topics/2916178//topics/2916179/注:下载的PATRAN2011 有三个文件夹,CD1 为32 位安装包,CD2 为64 系统安装程序,CD3 是帮助文档安装程序。
patran使用技巧

分享patran使用中的一些技巧patran技巧[分享]为何我的FEM选单中不会出现Hybrid Mesh<Patran> 为何我的FEM选单中不会出现Hybrid Mesh?-->请在系统的环境变数中增加以下变数:PATRAN_USE_HYBRID_SURFACE_MESHER值设定为TRUE ,这样在surface mesh处, 除了Iso Mesh跟Paver Mesh外,就会看到另外一个Hybrid Mesh的选项[分享]MSC多解析任务批处理的方法如果仅有一台机器可以进行解析运算,有时候任务比较多的时候会时间来不及.提交模型让机器计算之后只能在旁边傻看着,什么也做不了. 其实有一种比较好一点的方法.可以用批处理文件让机器连续自动处理,下班时运行披处理文件,第二天早上来看结果.方法如下:比如有3个模型,S1.MOD,S2.MOD,S3.MOD1. 分别将上诉3个模型导出为DAT文件2.建立批处理c:\mscvn4w2002\solver\bin\nastran S1.datc:\mscvn4w2002\solver\bin\nastran S2.datc:\mscvn4w2002\solver\bin\nastran S3.dat3. 双击4. 下班5. 上班6. 导入解析结果.[转帖]PATRAN的一些小技巧1、在Patran里如何Move 一组Points 的位置, 而不改变这组Points 的ID 编号? Group/Transform/Translate的功能,这样不但编号不会变, 连property跟边界条件都会保留2、Patran如何执行多次Undo?所有Patran的操作步骤, 都记录在最新的一个patran.ses.xx中,如果需要多次undo, 可以刪除最后不需要的步骤指令行,再利用File -> Session -> Play 的方式, 执行改过的patran.ses.xx ,这样可以无限制的undo。
patran学习-推荐下载

Introduction这篇文章我本人在学习patran/natran 过程中遇到的问题,及后来找到的解决方法,这篇文章也在逐步更新中,希望这篇文档能给那些学习用patran/nastran 的一点帮助。
Yuanchongxin Delft2011/10/3111. THE SOLUTION FOR THE RESIDUAL STRUCTURE AND THE APPLIED LOADS FOR THE CURRENT SUBCASE ARE ZERO.后来将边界条件由123456改为123,即将位移约束变成simplified supported,就没有此问题了。
2. USER WARNING MESSAGE 4124 (IFS3P)THE SPCADD OR MPCADD UNION CONSISTS OF A SINGLE SET 在图中用了RB3 的MPC,其中dependent node (ux,uy,uz), independent(ux,uy,uz,rx,ry,rz),有可能是这里的问题。
不过这个倒不影响计算结果。
3. 建立夹层结构的有限元网络对于meshing, sweep can produce the solid element on the basis of the shell element. 另外sweep 下的loft,可以在两个shell mesh 之间,创建solid element. 对于夹层结构的modeling, shell and solid element should share common node. 否则算出来的结果,solid stress 为零。
至于如何共用节点,则需用到element 下的sweep 命令。
4. No PARAM values were set in the Control File不管失败还是成功的f06 文件中,都会出现这句话。
PATRAN&NASTRAN(R2011)傻瓜式图文安装过程全解

64位win7旗舰版操作系统下PATRAN2011+NASTRAN2011傻瓜式图文安装过程全解教程以64位Windows7旗舰版操作系统为例,给出PATRAN2011和NASTRAN2011的傻瓜式操作教程。
作者绝对不信还有比这个更详细的安装教程了……欢迎上传本教程到网络,帮助更多新手顺利安装PATRAN2011+NASTRAN2011……0 下载安装文件............................................................................................................................. - 2 -1 加载PATRAN CD2 ...................................................................................................................... -3 -2 生成PATRAN license文件......................................................................................................... - 4 -3 安装PATRAN license许可管理.................................................................................................... - 5 -4 确认license 是否可用 ............................................................................................................. - 10 -5 安装PATRAN 主程序................................................................................................................ - 12 -6 卸载PATRAN许可管理器.......................................................................................................... - 20 -7 生成NASTRAN licence文件....................................................................................................... - 22 -8 安装NASTRAN licence许可管理器........................................................................................... - 23 -9 安装NASTRAN主程序............................................................................................................... - 27 -10 设置NASTRAN域PATRAN的关联 .......................................................................................... - 34 -11 其他 .......................................................................................................................................... - 40 -0下载安装文件/topics/2916178//topics/2916179/注:下载的PATRAN2011 有三个文件夹,CD1 为32 位安装包,CD2 为64 系统安装程序,CD3 是帮助文档安装程序。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
e b c g f
PAT302, Workshop 19, June 2003
WS19-6
Step 2. Create a Group for Global Model
a
Create a group and make it current for the global model as follows. a. Group : Create… b. Enter global_loads_model for New Group Name. c. Select the Make Current and Unpost All Other Groups icons. d. Click on Apply. e. Click on Cancel.
PAT302, Workshop 19, June 2003
WS19-5
Step 1. Create a New Database
a
d
Open database. a. File : New. b. Enter quarter_plate for File Name. c. Click OK. d. Under New Model Preferences, select Based on Model Tolerance. e. Select MSC.NASTRAN for Analysis Code. f. Select Structural for Analysis Type. g. Click on OK.
b e f
g d c h
PAT302, Workshop 19, June 2003
WS19-11
Step 6. Use Analysis to Read Model for Local
Select the input file to read into the input deck. a. Click on Select Input File.. b. Select panel.bdf for Select File. c. Click on OK. d. Click on Apply. e. Click OK for the Nastran input file summary.
PAT302, Workshop 19, June 2003
WS19-4
Suggested Exercise Steps (continued)
15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25.
Create a Loads/BCs for the local model. Post and make current the group for the local model. Create a uniform pressure for the local model. Create a MSC.Nastran input file for analysis of local model. Run MSC.Nastran. Access results. Post process results. Create a viewport so have one for each model. Post both global and local model. View the results for each model simultaneously. Quit MSC.Patran.
Note that the viewport is cleared
b c
d
e
WS19-10
PAT302, Workshop 19, June 2003
Step 6. Use Analysis to Read Model for Local
a
Under, Analysis, read in a MSC.NASTRAN input deck that represents the detailed panel stress model. a. Analysis : Read Input File / Model Data / Translate. b. Click on Entity Selection… c. Click on Define Offsets… d. Enter 1000 for Input Offset Value in the Nodes row and press the Enter key. e. Enter 1000 for Input Offset Value for the Elements row and press the Enter key. f. Click on OK. g. Click on OK.
WORKSHOP 19 GLOBAL/LOCAL MODELING USING FEM FIELDS
PAT302, Workshop 19, June 2003
WS19-1
PAT302, Workshop 19, June 2003
WS19-2
Problem Description
This exercise is used to demonstrate how to map displacement results from the analysis of a global(overall) model onto the perimeter of a local(detail/ component of overall) model. The local model is used for an analysis to obtain results for the detail/component. The global model and its results are read into an MSC.Patran database. The results are used in the creation of a vector FEM field. The FEM field is used to map the global model displacement results onto the local model perimeter. Also, a pressure load is applied to the local model. An analysis of the local model is performed. The displacement results for both global and local models are compared.
PAT302, Workshop 19, June 2003
WS19-3
Suggested Exercise Steps
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
12. 13. 14.
Open a new database. Create a group for the global model. Use analysis form to read model and results for global model. Turn off all labels and reset the view to an isometric view. Create a group for the local model. Use analysis form to read local model. Post only the group for the global model for displaying its results. Display the deflections and stresses of the global model. Set the displacements to true scale 1.0. Create a vector plot of displacements for the global model. With the vector plot displayed, create a continuous, spatial, Vector FEM field using the global displacements. Post only the detailed local panel model. Create a group to be used for creating LBCs for the local model. Create a load case for the local model LBCs.
b c
d
PAT302, Workshop 19, June 2003 WS19-7
e
Step 3. Use Analysis to Read Model/Results for Global
a
Use Analysis to read in both the model and results of the Global Loads Model. a. Analysis : Read Output2 / Both / Translate. b. Click Select Results File… c. Select multi_cell_box.op2 for Select File. d. Click on OK. e. Click on Apply.
PAT302, Workshop 19, June 2003
WS19-9
Step 5. Create a Group for Local Model
a
Create another group, making it current, called panel_model. a. Group : Create… b. Enter panel_model for New Group Name. c. Select the Make Current and Unpost All Other Groups toggles. d. Click on Apply. e. Click on Cancel.