Innovation Intelligence ® 1 Chapter 5: Retrieving Data from HyperMesh Entities.

Slides:



Advertisements
Similar presentations
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. Introduction in Altair ® HyperMesh ® The Fastest, Solver Neutral.
Advertisements

Section 7 Mesh Control.
 2005 Pearson Education, Inc. All rights reserved Introduction.
COSC 120 Computer Programming
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Introduction to MATLAB Northeastern University: College of Computer and Information Science Co-op Preparation University (CPU) 10/22/2003.
11.3 Function Prototypes A Function Prototype contains the function’s return type, name and parameter list Writing the function prototype is “declaring”
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
Innovation Intelligence ® 1 Chapter 3: HyperMesh Automation with HyperMesh Macros.
Innovation Intelligence ® 1 Chapter 6: Interfacing with HyperMesh Solver Templates.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to scripting
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Innovation Intelligence ® 1 Chapter 1: Introduction to TCL.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Looping Exercises Deciding Which Loop to Use At this.
Innovation Intelligence ® SimLab Automation Training Nirmal Subbaiah May, 2013.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 11 - JavaScript: Arrays Outline 11.1 Introduction 11.2 Arrays 11.3 Declaring and Allocating Arrays.
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Section 13 Loads and Boundary Conditions.
ANSYS Fundamentals This document contains no technical data subject to the EAR or the ITAR.
Chapter 2 Overview of C Part I J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National Taipei University.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Innovation Intelligence ® 1 Chapter 7: The MotionView Client.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
Linux+ Guide to Linux Certification, Third Edition
Section 11 Finite Element Modeling. Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Overview.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Introduction to MATLAB 7 for Engineers William J. Palm.
APDL Basics Module 12. Training Manual January 30, 2001 Inventory # APDL Basics Overview APDL is an acronym for ANSYS Parametric Design Language,
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Copyright ©2005  Department of Computer & Information Science Introducing Dialogue Windows.
Innovation Intelligence ® 1 Chapter 6: The Plotting Client.
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
Chapter 2: Introduction to HyperMesh Process Auomation
ENG College of Engineering Engineering Education Innovation Center 1 More Script Files in MATLAB Script File I/O : Chapter 4 1.Global Variables.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 19 Domain Name System (DNS)
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
1 Chapter 6: Using Prompts in Tasks and Queries 6.1 Prompting in Projects 6.2 Creating and Using Prompts in Tasks 6.3 Creating and Using Prompts in Queries.
Copyright © 2010 Altair Engineering, Inc. All rights reserved.Altair Proprietary and Confidential Information Section 20 Flux and Convection.
Copyright © 2009 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. Simple FEM Process Process oriented and automated  Teaching.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Innovation Intelligence ® Section 15 Contact Modeling.
Exploring Microsoft Access Chapter 7 Building Applications: The Switchboard, Macros, and Prototyping.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Chapter 14 Formatting Readable Output. Chapter Objectives  Add a column heading with a line break to a report  Format the appearance of numeric data.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Innovation Intelligence ® 1 Chapter 4: Using TCL to Control the HyperMesh Session.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
1 Lecture 4 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
WS2-1 ADM , Workshop 2, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 2 EXPRESSIONS: OVERVIEW.
Innovation Intelligence ® SIMLAB Updates: SimLab_13.3_Beta_WIN64_0529.
Innovation Intelligence ® 1 Chapter 4: The Animation Client.
Innovation Intelligence ® Section 20 Flux and Convection.
Innovation Intelligence ® RBE3 Reduction Macro Dennis D. Schwerzler March 27, 2012.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
Innovation Intelligence ® 1 Chapter 2: The HyperWorks Desktop Environment.
SQL and SQL*Plus Interaction
© 2016 Pearson Education, Ltd. All rights reserved.
Scripts & Functions Scripts and functions are contained in .m-files
JavaScript: Functions.
funCTIONs and Data Import/Export
Introduction to MATLAB
Using SQL*Plus.
Using Script Files and Managing Data
Presentation transcript:

Innovation Intelligence ® 1 Chapter 5: Retrieving Data from HyperMesh Entities

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 22 Retrieving Data from HyperMesh Entities - Overview Topics Presented: HyperMesh Entities and Their Data Names Using the hm_getentityvalue command Pointers and Flags Process for Creating a HyperMesh Tcl Script to Retrieve Data on HyperMesh Entities Example: Automate Computing the Vector Sum of Forces

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 3 HyperMesh Entities and Their Data Names What are Data Names? Generic references to the information that physically defines an entity in the HyperMesh environment Example: The x, y, and z coordinates that define a node’s location in three- dimensional space. This information is part of the entity’s definition and is consistent for all solvers. Data Names can change from one HyperMesh version to the next. For this reason, please refer to the online help. Information on the data names can be found in the following location: HyperMesh > Reference Guide > Scripts > Creating Scripts > Tcl > Using Data Names

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 4 HyperMesh Entities and Their Data Names nodewhen a load is applied to a node, this serves as a pointer to the node comp1x component of the vector comp2y component of the vector comp3z component of the vector magnitudemagnitude of the load vector collectorcollector that owns the load (load collector pointer) How to access Data Names? hm_getentityvalue command accesses data names and template info associated with an entity Returns a string or floating point value hm_getentityvalue entity_type name_or_id data_name_string flag Example: Set the x component of a force with ID 12 to the variable force_x: set force_x [hm_getentityvalue loads 12 "comp1" 0] Several Data Names available for force loads:

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 5 HyperMesh Entities and Their Data Names idThe ID of the node (integer). inputsystemPointer to the node input system (pointer). outputsystemPointer to the node output system (pointer). x The x coordinate of the node in its local system (real). y The y coordinate of the node in its local system (real). z The z coordinate of the node in its local system (real). Example: Tcl script which prompts the user to select several nodes and then displays their x, y, and z coordinates hm_markclear nodes 1 *createmarkpanel nodes 1 set nodes [hm_getmark nodes 1] if { ! [ Null nodes ] } { foreach node $nodes { set xVal [hm_getentityvalue nodes $node "x" 0] set yVal [hm_getentityvalue nodes $node "y" 0] set zVal [hm_getentityvalue nodes $node "z" 0] tk_messageBox -message "Node $node = $xVal $yVal $zVal" } Several Data Names available for nodes:

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 6 Pointers and Flags Several of the data names in the two tables are defined as pointers. A pointer is used to directly access another data name. For example, the collector and node data names for force loads are pointers. This means they “point” to data names available for either collectors or nodes. In order to retrieve any data from a pointer, the data name requested for the particular pointer must also be supplied. The additional data names are separated by a period or dot (.).

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 7 Pointers and Flags The following are a few examples on how a pointer is used. To retrieve the node id that load 12 is applied to : set node_id [hm_getentityvalue loads 12 "node.id" 0] To retrieve the y coordinate of the node that load 12 is applied to: set node_id [hm_getentityvalue loads 12 "node.y" 0] To retrieve the load collector name that contains load 12: set ld_col [hm_getentityvalue loads 12 "collector.name" 1] For the collector name, notice the flag value is set to 1 as the expected return value is a string value as opposed to a numeric value. In the node example above, the flag value is set to 0, indicating that a floating point number is to be returned.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 8 Pointers and Flags Another example is with component collectors. There is no data name associated with a component collector to get the material name, only the material ID. The following set of commands is used to get the material ID: set matID [hm_getentityvalue comps 12 "materialid" 0] A second set of commands would then be required to get the name of the material with that ID: set matName [hm_getentityvalue mats $matID "name" 1] Alternatively, the component collector has a material pointer data name. From this pointer, any valid material data name can be substituted by separating the pointer and the new data name with a period (.). From the example above the following line can replace the previous two lines: set matName [hm_getentityvalue comps 12 "material.name" 1]

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 9 Process for Creating a HyperMesh Tcl Script to Retrieve Data on HyperMesh Entities 1.Define the task to be automated. 2.Write the commands to a user-created *.tcl text file Skip doing the task in HyperMesh as there are likely no commands to capture to the command.cmf file; the task is to retrieve information, not to perform a HyperMesh action. Use HyperMesh Tcl commands to extract data on HyperMesh entities. Use core Tcl commands to store extracted data in variables, retrieve, manipulate, and display it. 3.Test the script from the Command Window. 4.Define the Utility menu button for the macro in userpage.mac file. 5.In the current HyperMesh session, reload the hm.mac file (this also reloads userpage.mac ). 6.Run the script from the Utility menu.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 10 Example: Automate Computing the Vector Sum of Forces 1.Request the user to select forces. 2.If the user does not select loads, display a message stating this. 3.Retrieve the X, Y, and Z component information from the user-selected forces. 4.Sum the X, Y, and Z components. 5.Display the resulting X, Y, and Z components. The following HyperMesh commands are modified in this exercise. *clearmark()*createmarkpanel() The following HyperMesh Tcl commands are used in this exercise. hm_getentityvaluehm_getmark hm_usermessagehm_errormessage The following core Tcl commands are used in this exercise. brackets [ ]expr foreachif setreturn llength

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 11 Practical Exercises Exercise 5a Description: Create a HyperMesh Tcl script to automate the following task: Request the user to select a component to be translated. Request the user to select a HyperMesh defined vector along which the component is to be translated. Get the Xcomp Ycomp and Zcomp of the selected vector from the HyperMesh database. Request the user to enter in a translation distance. Use all of the above information to translate the given component. HyperMesh commands used *createmarkpanelhm_getfloat hm_getmarkhm_getentityvalue *createvector*translatemark *clearmark TCL/TK commands used set Hints Use the provided c_channel-tcl_vector.hm file as it has a vector defined in it.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 12 Practical Exercises Exercise 5b Description Create a HyperMesh Tcl script to automate the following task: Request the user to select elements on which to create system. Calculate the centroidal coordinates of each element. Create a node at each of these centroidal locations. Create systems with these nodes as an orientation node. HyperMesh commands used *createmarkpanel*createnode *clearmark*hm_nodelist hm_getmark*systemcreate hm_entityinfo TCL/TK commands used setfor foreacheval lindexllength Hints The majority of this assignment will be discovering where to find information about commands and how to apply the information you find. Be patient and use the resources available to you, including the HyperWorks online help.

Copyright © 2012 Altair Engineering, Inc. Proprietary and Confidential. All rights reserved. 13 Practical Exercises Exercise 5c: Description Starting with the results of Exercise 4b: Create a node at the centroid of the element. Translate the node in the positive direction of the element normal by an amount equal to the shortest diagonal of a quad element and the shortest side of a tria element. Create either a tetra element or a pyramid element using the original element node list and the new node created by the script. HyperMesh commands used *createmark*createvector*translatemark *createnode*createelement*collectorcreate *currentcollectorhm_getmarkhm_nodelist hm_entityinfohm_getentityvalue TCL/TK commands used forforeach setif elseifelse Hints This assignment will require you to think more, but the process is still the same. Pay careful attention to vector directions and look closely at the data you have generated. What are some ways to make this cleaner in the user environment? What are some problems that you might encounter?