Msc. Patran pcl handbook In a Nutshell 7



Download 1.08 Mb.
Page24/25
Date05.08.2017
Size1.08 Mb.
#26706
1   ...   17   18   19   20   21   22   23   24   25

Appendix E

MSC.Patran Architecture

MSC.Patran is architected into 5 major areas:



  • UIMS – User interface

  • Applications – Converts user input into suitable format for database storage

  • Database – Includes functionality for data persistence, embedded SQL, data integrity, simultaneous access, undo

  • Graphics – Provides functions to display database contents in the viewport, picking, graphical user feedback

  • Event Manager – Coordinates the other 4 areas


Appendix F

Shareware Compiling Functions

The MSC.Patran Utilities or Shareware library contains several useful functions for compiling PCL that augment the basic !!COMPILE functionality. In addition to compiling the function into a PCL library, these functions first pass the function to be compiled through the C-preprocessor. Thus, these functions are useful in the event that it is impossible or inconvenient to use make and a Makefile.



The functions are contained in the bv_pcl class and can be executed at the MSC.Patran command line. The compile(…) function compiles a single PCL file into a PCL library while the compile_all(…) function compiles all files in the current directory/folder with a “.pcl” extension into a PCL library. Complete function descriptions and argument lists are given below.
bv_pcl.compile(file_name, plb_name)

DESCRIPTION

Same as “!!COMPILE file_name plb_name” except that the file_name is passed through the C-preprocessor (cpp) prior to compiling. Thus, by using this function you do not need to use “make” and a “makefile” prior to compiling. Note that if the PCL library does not exist, it is created.

INPUT







file_name

String[]

File containing PCL to be compiled

plb_name

String[]

Name of PCL library file.

OUTPUT















EXAMPLE

bv_pcl.compile(“My_very_own_pcl.pcl”, “My_pcl_library.plb”)
bv_pcl.compile_all(plb_name)

DESCRIPTION

Same as bv_pcl.compile(…) except that all files with a “.pcl” extension in the current directory/folder are compiled. Note that “special” MSC.Patran files such as settings.pcl or p3epilog.pcl are not compiled.

INPUT







plb_name

String[]

Name of PCL library file.

OUTPUT















EXAMPLE

bv_pcl.compile_all(“My_pcl_library.plb”)
The following function makes use of the bv_pcl class as well.
au_make_all()

DESCRIPTION

Same as bv_pcl.compile_all(…) except the PCL library filename is specified via a file called “au_makefile.dat” instead of as a function argument. The “au_makefile.dat” file contains a single line which is the name of the PCL library file, i.e., NT_break_elms.plb”

INPUT















OUTPUT















EXAMPLE

au_make_all()

Appendix G

Parametric Patran







  • A goal of MSC.Patran Parametric Modeling is to make it possible for the user to use names and default values for variables (parameters) in every entry point on every form that can be accessed for modeling purposes

  • Provides an automated method of parametric analysis in support of complex models/processes

  • Allows users to parametrically investigate and assess a number of different designs via batch submittal of a number of different design studies

  • Permits the use of named variables to replace the usual fixed numerical values of modeling parameters

  • The values of these parameters are provided by an external configuration file



  • Parametric parameters incude:

  • Variables

  • Macros

  • Outputs

  • Variable definition

  • Variable name

  • Optional description

  • Datatypes include: Integer, Real, String, Integer array, Real array, or String array (note that strings do not require quotation marks)

  • Current value

  • Macro definition

  • Combination of variables and/or other macros, i.e.,
    mesh_size = ~length~*~width~

  • Variable names are enclosed
    by ~ symbols



  • Output definition

  • An analysis response or result



  • Notes

  • Parametric parameters are saved with the database

  • A configuration file can be used to supply new parameter values. This allows automation, i.e., a driving program could execute MSC.Patran batch jobs with different configuration files to generate several model variations automatically

  • Configuration file can be selected via:

  • An environment variable:
    PARAMETRIC_MODELING_CONFIG_FILE

    This must be set prior to the MSC.Patran session.



  • A PCL function:
    parametric_modeling_util.define_user_config_file(“config_file”)

  • Sample session file with parameters:



parametric_modeling_util.create_variable( "length", "Real", "", "", "12", "" )

Real length = 12; em_sf_comment_previous_line()

$# Real length = 12; em_sf_comment_previous_line()

parametric_modeling_util.reset_variable( "length" )

parametric_modeling_util.create_variable( "height", "Real", "", "", "5", "" )

Real height = 5; em_sf_comment_previous_line()

$# Real height = 5; em_sf_comment_previous_line()

parametric_modeling_util.reset_variable( "height" )

parametric_modeling_util.create_macro( "mesh_density", @

"mth_min(~height~,~length~)*~mesh_factor~", "" )

FUNCTION mesh_density(); GLOBAL Real length; GLOBAL Real height; GLOBAL Real @

mesh_factor; RETURN( mth_min(height,length)*mesh_factor );END FUNCTION

$# Compiling: mesh_density

$# Compiled: mesh_density

  • The configuration file is simply a listing of the variable names and corresponding values. An exclamation mark (!) denotes a comment, i.e.,

    variable_name= value ! comment

  • A sample configuration file:

length = 40

height = 10

hole_dia = 5

x_hole = 30

y_hole = 4

elastic_modulus = 30e6

applied_load = 120

thickness = .5



  • Another sample configuration file

maximum = 1000 ! this is an integer

three = 1, 2, 3 ! this is a 3 word integer array

data = 37.655 ! this is a real

moredata = 1.0, 2.0, 3.0, 4.0 ! this is a 4 word real array

name = mat1 ! this is a string variable, note no quotes

names = one, two, three ! this is a string array, again no quotes


1   ...   17   18   19   20   21   22   23   24   25




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

    Main page