Innovation Intelligence ® 1 Chapter 6: Interfacing with HyperMesh Solver Templates.

Slides:



Advertisements
Similar presentations
Design Validation CSCI 5801: Software Engineering.
Advertisements

Assembly Language for x86 Processors 6th Edition Chapter 5: Procedures (c) Pearson Education, All rights reserved. You may modify and copy this slide.
CSCC69: Operating Systems
Test Case Management and Results Tracking System October 2008 D E L I V E R I N G Q U A L I T Y (Short Version)
Composition CMSC 202. Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.  CAD import  Geometry cleanup / repair  Prepare geometry.
Section 7 Mesh Control.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved.  CAD import  Geometry cleanup / repair  Prepare geometry.
C++ How to Program, 7/e © by Pearson Education, Inc. All Rights Reserved.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
SUNY Morrisville-Norwich Campus-Week 12 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
Innovation Intelligence ® 1 Chapter 3: HyperMesh Automation with HyperMesh Macros.
Chapter 8: I/O Streams and Data Files. In this chapter, you will learn about: – I/O file stream objects and functions – Reading and writing character-based.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
ASP.NET Programming with C# and SQL Server First Edition
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Test Automation: An Architected Approach Dan Young March 17th, 2005
Introducing JavaBeans Identify the features of a JavaBean Create and add a bean to an application Manipulate bean properties using accessor and mutator.
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
0 UMN 2011 ERP Terapan ABAP Introduction Session # 8.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
C++ How to Program, 8/e © by Pearson Education, Inc. All Rights Reserved. Note: C How to Program, Chapter 22 is a copy of C++ How to Program Chapter.
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
Software Engineering 2003 Jyrki Nummenmaa 1 CASE Tools CASE = Computer-Aided Software Engineering A set of tools to (optimally) assist in each.
Innovation Intelligence ® SimLab Automation Training Nirmal Subbaiah May, 2013.
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
Innovation Intelligence ® 1 Chapter 5: Retrieving Data from HyperMesh Entities.
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
JavaScript: Functions © by Pearson Education, Inc. All Rights Reserved.
Innovation Intelligence ® 1 Chapter 7: The MotionView Client.
Exploring an Open Source Automation Framework Implementation.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
Innovation Intelligence ® Section 6 Meshing in SimLab.
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Reformatted slides from the textbook, C++ How to Program, 6/e Pearson Education, Inc. All rights reserved Chapter 3. [Lecture 02] Introduction to.
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information CATIA import through CATScript.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
Innovation Intelligence ® 1 Chapter 6: The Plotting Client.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Templates.
1 PL\SQL Dev Templates. 2 TEMPLATE DEFINITION Whenever you create a new program unit, its initial contents are based upon a template which contains pre-defined.
Chapter 2: Introduction to HyperMesh Process Auomation
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Regeneration – Pro/Engineer.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. Simple FEM Process Process oriented and automated  Teaching.
ProgLan Python Session 4. Functions are a convenient way to divide your code into useful blocks, allowing us to: order our code, make it more readable,
Innovation Intelligence ® Section 15 Contact Modeling.
>> PHP: Insert Query & Form Processing. Insert Query Step 1: Define Form Variables Step 2: Make DB Connection Step 3: Error Handling Step 4: Define the.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Chapter 5 Introduction to Defining Classes
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session.
 2008 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
Innovation Intelligence ® Section 17 Material & Property Definition.
WS 9-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. February 27, 2009 Inventory # Workshop 9 Taylor Impact Test – “What if” Study.
Innovation Intelligence ® SIMLAB Updates: SimLab_13.3_Beta_WIN64_0529.
Innovation Intelligence ® 1 Chapter 4: The Animation Client.
Innovation Intelligence ® RBE3 Reduction Macro Dennis D. Schwerzler March 27, 2012.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
Chapter 5 Introduction to Defining Classes Fundamentals of Java.
Innovation Intelligence ® 1 Chapter 2: The HyperWorks Desktop Environment.
User-Written Functions
Introduction to Classes and Objects
Computer Science Projects Database Theory / Prototypes
Presentation transcript:

Innovation Intelligence ® 1 Chapter 6: Interfacing with HyperMesh Solver Templates

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 22 Interfacing with HyperMesh Solver Templates - Overview Topics Presented: Solver Attributes and Card Images Querying Solver Attributes Example: Automate Extracting Data in a Card Image Assigning data to solver attributes Creating a reusable and modular procedure Example: Automate Extracting Data in a Card Image Updating solver attributes Example: Automate Defining/Updating Multiple Materials

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 33 Solver feoutput Templates What are Solver Templates? Solver templates define every solver specific attribute including data names, attribute IDs, card image formats, and the format of the data upon export. Templates exist for each solver supported by HyperMesh and are located in subfolders under the /templates/feoutput directory. The *defineattribute command is used to define attribute data names and IDs in a template file. Types of Attributes defined in Solver Templates There are several different types of attributes including array, double, entity, integer and string. The difference is that each entity type uses an appropriate *attributeupdate command based on its type. There are also a number of hm_attribute commands to query entity attributes.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 44 Solver Attributes and Card Images A sample card image for an OptiStruct MAT1 material collector is shown below: For each field in the above card image there is, a corresponding attribute and data name in one the optistruct templates located in: /templates/feoutput/common_nas_os/attribs An excerpt is shown below for several of the card image fields: *defineattribute(E,1,real,none) *defineattribute(G,2,real,none) *defineattribute(Nu,3,real,none) *defineattribute(Rho,4,real,none)

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 55 Solver Attributes and Card Images Additionally, there are card image definitions that define how the card editor is generated inside of HyperMesh for each attribute. For optistruct, these card images are defined in: /templates/feoutput/optistruct An excerpt of the optistruct MAT1 card image is shown below: *menustring("MAT1 ") *menufield(ID,integer,id,8) *menufield(E,real,$E,8) *menudefaultvalue(" ") *menuinitialvalue( ) *menurestrictedvalue(>,0.0) The *menufield determines how a field is created in the card editor for a particular attribute. For example, the attribute and card image definitions for the Young’s Modulus for the MAT1 material are: * defineattribute(E,1,real,none) *menufield(E,real,$E,8) Knowing all of this information allows us to assign, update and query the data.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 66 Querying Solver Attributes Solver data names are accessed using hm_getentityvalue, hm_attributearrayvalue and hm_attributearray2dvalue These commands use a data_name_string to access a particular piece of data. Each attribute has both an ID and a data name. For example, from the MAT1 material card we have several attributes of interest: *defineattribute(E,1,real,none) *defineattribute(G,2,real,none) *defineattribute(Nu,3,real,none) *defineattribute(Rho,4,real,none) The first argument is the solver data name and the second is the attribute ID. So in order to extract the value of E from a material with ID 11: hm_getentityvalue mats 11 "\$E" 0

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 77 Example: Automate Extracting Data in a Card Image An OptiStruct MAT1 material of id 1 exists in the HyperMesh database. Extract from its card image its values for the parameters Young’s Modulus (E), Shear Modulus (G), Poisson’s ratio (Nu), and density (Rho). Display the values for the parameters. The following HyperMesh Tcl commands are used in this exercise hm_getentityvalue The following core Tcl commands are used in this exercise set return \ proc tk_messageBox

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 88 Assigning data to solver attributes When the MAT1 material collector shown before was initially created, the relevant commands to assign values to its attributes were written to the command.cmf file: *collectorcreate(materials,"steel","",11) *createmark(materials,2) "steel" *dictionaryload(materials,2,"C:/Altair/hw10.0/templates/feo utput/optistruct/optistruct","MAT1") *attributeupdateint(materials,1,3240,1,2,0,1) *attributeupdatedouble(materials,1,1,1,1,0,210000) *attributeupdatedouble(materials,1,2,1,0,0,0) *attributeupdatedouble(materials,1,3,1,1,0,0.3) *attributeupdatedouble(materials,1,4,1,1,0,7.85e-009) *attributeupdatedouble(materials,1,5,1,0,0,0) *attributeupdatedouble(materials,1,6,1,0,0,0) *attributeupdatedouble(materials,1,7,1,0,0,0) *attributeupdatedouble(materials,1,341,1,0,0,0) *attributeupdatedouble(materials,1,343,1,0,0,0) *attributeupdatedouble(materials,1,345,1,0,0,0) *attributeupdateint(materials,1,5237,1,2,0,0)

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 99 Assigning data to solver attributes Looking at one of the commands above we have: *attributeupdatedouble(materials,1,1,1,1,0,210000) Where: materials is the type of entity that owns the attribute 1 is the ID of the entity 1 is the identifier of the attribute 1 is the solver number of the attribute 1 is the status of the attribute 0 is the behavior of the attribute is the value of the attribute Looking at the optistruct attribs template, attribute 1 corresponds to the data name E, or Young’s Modulus.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 10 Creating a reusable and modular procedure Create a Tcl procedure that allows us to substitute variables for the name, color and data values. We can make the template file path modular across different platforms. Also we can make the material ID a variable that references the newly created material ID, so that the *attributeupdatedouble and *attributeupdateint commands work properly. The advantage of doing this is: Only need to pass the material name, color and the values for the material properties and the procedure will create the material accordingly. The variables are then used in the later commands to pass the appropriate arguments. This procedure also checks to see if a material with that name already exists, and if it does, a message is returned in the HyperMesh message bar. The hm_info command is used to find the appropriate template to load.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 11 Creating a reusable and modular procedure proc mat_create { name color E Nu Rho } { if {[hm_entityinfo exist mats $name -byname] == 1} { hm_errormessage "Material $name already exists" return; } else { *collectorcreate materials "$name" "" $color; *createmark materials 2 "$name"; #Retrieve material ID for use below; set mat_id [hm_getmark mats 2]; *dictionaryload materials 2 "[hm_info exporttemplate]“"MAT1"; *attributeupdateint materials $mat_id ; *attributeupdatedouble materials $mat_id $E; *attributeupdatedouble materials $mat_id $Nu; *attributeupdatedouble materials $mat_id $Rho; return; }

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 12 Example: Automate Defining a Card Image with Data Create an OptiStruct MAT1 material with the following parameter values. Assume the OptiStruct template is already loaded. Young’s Modulus (E) Shear Modulus (G) Poisson’s ratio (Nu) density (Rho) Upon automating the task, wrap the code into a Tcl procedure. The following HyperMesh commands are added and modified in this exercise: *dictionaryload()*attributeupdateint() *attributeupdatedouble() The following HyperMesh Tcl commands are used in this exercise: hm_markhm_info ·The following core Tcl commands are used in this exercise: set proc

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 13 Updating solver attributes It is also possible to update an existing card image. A procedure to do this is almost identical to the procedure to create a new card image, except that the material is not created and thus the procedure requires a material ID to be passed instead of a material name. proc mat_update { mat_id E Nu Rho } { if {[hm_entityinfo exist mats $mat_id -byid] == 0} { hm_errormessage "Material $mat_id does not exist" return; } else { *createmark materials 2 "by id" "$mat_id"; *dictionaryload materials 2 "[hm_info exporttemplate]" \ "MAT1"; *attributeupdatedouble materials $mat_id $E; *attributeupdatedouble materials $mat_id $Nu; *attributeupdatedouble materials $mat_id $Rho; return; }

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 14 Example: Automate Defining/Updating Multiple Materials NAME E G NU RHO aluminum altairium steel2.00E E E-09 This task is an extension to the previous example 6.2. Automate defining three OptiStruct MAT1 materials with values for the parameters Young’s Modulus (E), Shear Modulus (G), Poisson’s ratio (Nu), and density (Rho). If the materials exist in HyperMesh, simply update the values, otherwise create the material before setting the parameters. The three materials are:

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 15 Practical Exercises Exercise 6a Description: Generate a procedure to create a property collector with a PSHELL card image in the OptiStruct template. Ask the user to supply a thickness value. Try to incorporate checks into the procedure to avoid errors. For example, if a property with that name already exists, what happens? HyperMesh commands used hm_errormessage*createmark *collectorcreateonly*dictionaryload *attributeupdatedoublehm_getmark hm_getfloat TCL/TK commands used set if Hints Do the steps in HyperMesh and then extract the commands from the command.cmf file.