Msc. Patran pcl handbook In a Nutshell 7



Download 1.08 Mb.
Page2/25
Date05.08.2017
Size1.08 Mb.
#26706
1   2   3   4   5   6   7   8   9   ...   25

In a Nutshell

What 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 use

In a Nutshell

What 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 procedures

In a Nutshell

How 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

  • F

    PCL


    C, C++


    Fortran


    Other


    MSC.Patran


    You





    ORTRAN and C functions can be “linked” with MSC.Patran through PCL

In a Nutshell

All 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 the database, 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.

Programming Task

Documentation

Comments

Basic programming

PCL & Customization, chapters 2 & 3

Math functions, string functions, file access functions, compiling, library management, etc.

Graphical user interface

PCL & Customization, chapter 5

Functions for creating forms

List processor

PCL & Customization, chapter 5.5

Functions for parsing a string or picklist, i.e., “Elm 1:9:2”

Applications, session file, result utilities

PCL Reference Guide

All functions written to the session file

Graphics

PCL & Customization, chapter 3.2

Functions for drawing graphic primitives such as lines, arrows, text, etc.

Database functions

PCL & Customization, chapter 8

Functions to access data in the database (i.e., node coordinates, element connectivity, element properties, etc.)

Architecture

PCL & Customization, chapters 6 & 7

Functions for creating analysis preferences

PCL for Everyone

Entering Equations


  • U


    se of PCL when creating spatial fields:

    ‘X + ‘X**2 – sinr(‘X)

    The PCL interpreter interprets anything immediately following a ‘ symbol as a field variable as opposed to a PCL function, such as, sinr().


PCL for Everyone

Entering Data


  • U

    se 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 ]


PCL for Everyone

Session Files


  • Session 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 2001

STRING 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 1

STRING 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:52


PCL for Everyone


Rebuilding Models


  • The 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.


A.

$# Session file patran.ses.01 started recording at 16-Aug-01 14:33:54

$# Recorded by: MSC.Patran 2001

STRING asm_create_patch_xy_created_ids[VIRTUAL]

asm_const_patch_xyz( "1", "<10 10 0>", "[0 0 0]", "Coord 0", @

a
B.


sm_create_patch_xy_created_ids )

$# 1 Patch created: Patch 1

STRING 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:52


  1. Create/Surface/XYZ

  2. Edit/Surface/Add Hole

PCL for Everyone



  • In 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 2001

STRING 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 1

STRING 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:52

PCL for Everyone



  • S


    If “Single Step” is selected, each command in the session file is written to the MSC.Patran command line. You must hit the enter key to execute the command. If it is not selected, then all of the PCL commands in the session file are executed automatically.
    If “Commit Commands” is selected, then each command in the session file being executed is also written to the session file which is currently being recorded. Otherwise, only the sf_play(…) command is written to the session file being recorded.
    ession files can be executed or “played” by selecting File/Session/Play … from the top menu.


Download 1.08 Mb.

Share with your friends:
1   2   3   4   5   6   7   8   9   ...   25




The database is protected by copyright ©ininet.org 2024
send message

    Main page