Introduction To Application Builder

2y ago
23 Views
2 Downloads
3.96 MB
220 Pages
Last View : 2m ago
Last Download : 2m ago
Upload by : Mya Leung
Transcription

COMSOL MultiphysicsApplication Programming Guide

Application Programming Guide 1998–2019 COMSOLProtected by patents listed on www.comsol.com/patents, and U.S. Patents 7,519,518; 7,596,474; 7,623,991; 8,457,932;8,954,302; 9,098,106; 9,146,652; 9,323,503; 9,372,673; 9,454,625; and 10,019,544. Patents pending.This Documentation and the Programs described herein are furnished under the COMSOL Software LicenseAgreement (www.comsol.com/comsol-license-agreement) and may be used or copied only under the terms of thelicense agreement.COMSOL, the COMSOL logo, COMSOL Multiphysics, COMSOL Desktop, COMSOL Compiler, COMSOL Server,and LiveLink are either registered trademarks or trademarks of COMSOL AB. All other trademarks are the propertyof their respective owners, and COMSOL AB and its subsidiaries and products are not affiliated with, endorsed by,sponsored by, or supported by those trademark owners. For a list of such trademark owners, see www.comsol.com/trademarks.Version: COMSOL 5.5Contact InformationVisit the Contact COMSOL page at www.comsol.com/contact to submit general inquiries, contactTechnical Support, or search for an address and phone number. You can also visit the WorldwideSales Offices page at www.comsol.com/contact/offices for address and contact information.If you need to contact Support, an online request form is located at the COMSOL Access page atwww.comsol.com/support/case. Other useful links include: Support Center: www.comsol.com/support Product Download: www.comsol.com/product-download Product Updates: www.comsol.com/support/updates COMSOL Blog: www.comsol.com/blogs Discussion Forum: www.comsol.com/community Events: www.comsol.com/events COMSOL Video Gallery: www.comsol.com/video Support Knowledge Base: www.comsol.com/support/knowledgebasePart number: CM020012

ContentsIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Syntax Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Declarations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14Built-in Elementary Math Functions. . . . . . . . . . . . . . . . . . . . . 15Control Flow Statements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Important Programming Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Ctrl Space for Code Completion . . . . . . . . . . . . . . . . . . . . . 18Recording Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Methods Called from the Model Builder . . . . . . . . . . . . . . . . 23Global Methods, Form Methods, and Local Methods . . . . . 23Method Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Introduction to the Model Object . . . . . . . . . . . . . . . . . . . . . . . . 25Model Object Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Creating a Model Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Creating Model Components and Model Object Nodes . . 28Get and Set Methods for Accessing Properties . . . . . . . . . . 29Parameters and Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Unary and Binary Operators in the Model Object . . . . . . . . 36Geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40Material. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Study. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3

Multiphysics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Working with Model Objects . . . . . . . . . . . . . . . . . . . . . . . . . 51The Model Object Class Structure. . . . . . . . . . . . . . . . . . . . . 53The Application Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55Accessing the Application Object. . . . . . . . . . . . . . . . . . . . . . 57The Name of User Interface Components . . . . . . . . . . . . . . 57Important Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57Get and Set Methods for the Color of a Form Object . . . . 58General Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59The Main Application Methods. . . . . . . . . . . . . . . . . . . . . . . . 60Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62Form Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83Data Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84Method Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89Form, Form Object, and Item List Methods . . . . . . . . . . . . . 89The Built-in Method Library for the Application Builder. . . . . . 91Model Utility Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91License Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93File Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96Operating System Methods. . . . . . . . . . . . . . . . . . . . . . . . . . 103Email Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107Email Class Methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107GUI-Related Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111GUI Command Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122Debug Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1234

Methods for External C Libraries . . . . . . . . . . . . . . . . . . . . . 123Progress Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125Date and Time Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . .131Conversion Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134Array Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136String Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Collection Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Model Builder Methods for Use in Add-ins . . . . . . . . . . . . . 148Programming Examples. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150Running the Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150Visualization Without Solution Data: Grid Data Sets . . . . . 150Visualization of Points, Curves, and Surfaces . . . . . . . . . . . .152Reading and Writing Data to File . . . . . . . . . . . . . . . . . . . . . 162Converting Interpolation Curve Data. . . . . . . . . . . . . . . . . . 186Plotting Points on a Parametric Surface . . . . . . . . . . . . . . . . 188Using Selections for Editing Geometry Objects . . . . . . . . .189Recursion and Recursively Defined Geometry Objects. . . 194Mesh Information and Statistics. . . . . . . . . . . . . . . . . . . . . . . 198Accessing Higher-Order Finite Element Nodes . . . . . . . . .199Accessing System Matrices and Vectors. . . . . . . . . . . . . . . . 201Using Built-In Methods from an External Java Library. . . . . 205Measuring the Java Heap Space Memory. . . . . . . . . . . . . . .206Time-Limited and Hardware-Locked Applications . . . . . . . 206 5

6

IntroductionThis book is a guide to writing code for COMSOL models and applicationsusing the Method editor. The Method editor is an important part of theApplication Builder and is available in the COMSOL Desktop environment inthe Windows version of COMSOL Multiphysics. For an introduction to usingthe Application Builder and its Form editor and Method editor, see the bookIntroduction to Application Builder.Writing a method is needed when an action is not already available in the standardrun commands associated with functionality in the model tree nodes of the ModelBuilder. A method may, for example, contain loops, process inputs and outputs,and send messages and alerts to the user of the application.In the Model Builder, the model tree is a graphical representation of the datastructure that represents a model. This data structure is called the model objectand stores the state of the underlying COMSOL Multiphysics model that isembedded in an application.The contents of the application tree in the Application Builder is accessed throughthe application object, which is an important part of the model object. You canwrite code using the Method editor to directly access and change the user interfaceof a running application, for example, to update button text, icons, colors, andfonts.In the COMSOL Multiphysics environment, you use the Java programminglanguage to write methods, which means that you can utilize the extensivecollection of Java libraries. In addition to the Java libraries, the ApplicationBuilder includes a built-in library for building applications and modifying themodel object. A number of tools and resources are available to help youautomatically create code for methods. For more information on autogenerationof code, see the book Introduction to Application Builder.This book assumes no prior knowledge of the Java programming language.However, some familiarity with a programming language is helpful. 7

Syntax PrimerIf you are not familiar with the Java programming language, read this section toquickly get up to speed with its syntax. When creating applications, it is useful toknow the basics of Java such as how to use the if, for, and while controlstatements. The more advanced aspects of Java will not be covered in this book.For more detail, see any dedicated book on Java programming or one of the manyonline resources. You can also learn a lot by reviewing the methods in the exampleapplications available in the Application Libraries.Data TypesP RIMITIVE D ATA T YPESJava contains eight primitive data types, listed in the table below.DATA TYPEDESCRIPTIONNUMBER OF BYTESEXAMPLEbyteInteger between -127 and 1281byte b 33;charUnicode character; integer between0 and 65535 (0 and 216-1)2char c ’a’;char c 97;shortInteger between -32768 and 32767(-215-1 and 215-1)2short s -1025;intInteger between -231 and 231-14int i 15;8long l 15;6363longInteger between -2float32-bit floating point number4float f 4.67f;double64-bit floating point number8double d 4.67;booleanBoolean with values false or trueN/Aboolean b true;and 2 -1Other data types such as strings are classes, which are also referred to as compositedata types.In methods, you can use any5 of the primitive or composite data types available inJava and the Java libraries. Many of the Application Builder built-in methods makeuse of primitive or composite data types. For example, the timeStamp() methodprovides a long integer as its output.A SSIGNMENTSANDL ITERALSA few examples of using literals in assignments are:8

int i 5; // initialize i and assign the value 5double d 5.0; // initialize d and assign the value 5.0boolean b true; // initialize b and assign the value trueThe constants 5, 5.0, and true are literals. Java distinguishes between the literals5 and 5.0, where 5 is an integer and 5.0 is a double (or float).U NARYANDB INARY O PERATORSINM ETHODS (J AVA S YNTAX )You can perform calculations and operations using primitive data types just likewith many other programming languages. The table below describes some of themost common unary and binary operators used in Java code.PRECEDENCE LEVELSYMBOLDESCRIPTION1 --unary: postfix addition and subtraction2 -- - !unary: addition, subtraction, positive sign,negative sign, logical not3* / %binary: multiplication, division, modulus4 -binary: addition, subtraction5!Logical NOT6 comparisons: less than, less than or equal,greater than, greater than or equal7 ! comparisons: equal, not equal8&&binary: logical AND9 binary: logical OR10?:conditional ternary11 - * / % & assignments12,element separator in listsT YPE C ONVERSIONSANDT YPE C ASTINGWhen programming in Java, conversion between data types is automatic in manycases. For example, the following lines convert from an integer to a double:int i; // initialize idouble d; //initialize di 41;d i; // the integer i is assigned to the double d and d is 41.0However, the opposite will not work automatically (you will get a compilationerror). Instead you can use explicit type casting as follows: 9

int i; // initialize idouble d; //initialize dd 41.0;i (int) d; // the double d is assigned to the integer i and i is 41You can convert between integers and doubles within arithmetic statements invarious ways, however you will need to keep track of when the automatic typeconversions are made. For example:int i; // initialize idouble d; //initialize di 41;d 14/i; // d is 0In the last line, 14 is seen as an integer literal and the automatic conversion to adouble is happening after the integer division 14/41, which results in 0.Compare with:int i; // initialize idouble d; //initialize di 41;d 14.0/i; // d is 0.3414.In the last line, 14.0 is seen as a double literal and the automatic conversion to adouble is happening before the division and is equivalent to 14.0/41.0.You can take charge over the type conversions with explicit casting by using thesyntax (int) or (double):int i; // initialize idouble d,e; //initialize d and ei 41;d ((int) 14.0)/i; // d is 0e 14/((double) i); // e is 0.3414.S TRINGSAND J AVAO BJECTSThe String data type is a Java object. This is an example of how to declare a stringvariable:String a "string A";When declaring a string variable, the first letter of the data type is capitalized. Thisis a convention for composite data types (or object-oriented classes).After you have declared a string variable, a number of methods are automaticallymade available that can operate on the string in various ways. Two such methodsare concat and equals as described below, but there are many more methodsavailable in the String class. See the online Java documentation for moreinformation.Concatenating StringsTo concatenate strings, you can use the method concat as follows:10

String a "string A";String b " and string B";a.concat(b);The resulting string a is "string A and string B". From an object-orientedperspective, the variable a is an instance of an object of the class String. Themethod concat is defined in the String class and available using the a.concat()syntax.Alternatively, you can use the operator as follows:a a b;which is equivalent to:a "string A" " and string B";and equivalent to:a "string A" " " "and string B";where the middle string is a string with a single whitespace character.Comparing StringsComparing string values in Java is done with the equals method and not with the operator. This is due to the fact that the operator compares whether thestrings are the same when viewed as class objects and does not consider theirvalues. The code below demonstrates string comparisons:boolean streq false;String a "string A";String b "string B";streq a.equals(b);// In this case streq falsestreq (a b);// In this case streq falseb "string A";streq a.equals(b);// In this case streq trueSpecial CharactersIf you would like to store, for example, a double quotation mark or a new linecharacter in a string you need to use special character syntax preceded by abackslash (\). The table below summarizes some of the most important specialcharacters.SPECIAL CHARACTERDESCRIPTION\'Single quotation mark\"Double quotation mark 11

SPECIAL arriage return\fFormfeed\nNewlineNote that in Windows the new line character is the composite \r\n whereas inLinux and macOS \n is used.The example below shows how to create a string in Windows that you later onintend to write to file and that consists of several lines.String contents "# Created by me\r\n" "# Version 1.0 of this file format \r\n" "# Body follows\r\n" "0 1 \r\n" "2 3\r\n" "4 5\r\n";The string is here broken up into several lines in the code for readability. However,the above is equivalent to the following:String contents "# Created by me\r\n# Version 1.0 of this file format \r\n#Body follows\r\n0 1 \r\n2 3\r\n4 5\r\n";which is clearly less readable.A RRAYSIn the application tree, the Declarations node directly supports 1D and 2D arraysof type string (String), integer (int), Boolean (boolean), or double (double). A1D array may be referred to as a vector and a 2D array referred to as a matrix,provided that the array is rectangular. A non-rectangular array is called jagged orragged. In methods, you can define higher-dimensional arrays as well as arrays ofdata types other than string, integer, Boolean, or double.1D ArraysIf you choose not to use the Declarations node to declare an array, then you canuse the following syntax in a method:double dv[] new double[12];This declares a double array of length 12.The previous line is equivalent to the following two lines:double dv[];dv new double[12];12

When a double vector has been declared in this way, the value of each element inthe array will be zero.To access elements in an array you use the following syntax:double e;e dv[3]; // e is 0.0Arrays are indexed starting from 0. This means that dv[0] is the first element ofthe array in the examples above, and dv[11] is the last element.You can simultaneously declare and initialize the values of an array by using curlybraces:double dv[] {4.1, 3.2, 2.93, 1.3, 1.52};In a similar way you can create an array of strings as follows:String sv[] {"Alice", "Bob", "Charles", "David", "Emma"};2D Arrays2D rectangular arrays can be declared as follows:double dm[][] new double[2][3];This corresponds to a matrix of doubles with 2 rows and 3 columns. The rowindex comes first.You can simultaneously declare and initialize a 2D array as follows:double dm[][] {{1.32, 2.11, 3.43},{4.14, 5.16, 6.12}};where the value of, for example, dm[1][0] is 4.14. This array is a matrix since it isrectangular (it has same number of columns for each row). You can declare aragged array as follows:double dm[][] {{1.32, 2.11}, {4.14, 5.16, 6.12, 3.43}};where the value of, for example, dm[1][3] is 3.43.Copying ArraysFor copying arrays, the following code:for(int i1 0;i1 11;i1 ) {for(int i2 0;i2 2;i2 ) {input array[i1][i2] init input array[i1][i2];}}is not equivalent to the line:input array init input array;since the last line will only copy by reference.Instead, you can use the copy method as follows:input table copy(init input table);which allocates a new array and then copies the values. 13

D e c l a r a ti o n sVariables defined in the Declarations node in the application tree are directlyavailable as global variables in a method and need no further declarations.Variables declared in methods will have local scope unless you specify otherwise.The Declarations node directly supports integers (int), doubles (double), andBooleans (boolean). In addition, strings are supported (see “Strings and JavaObjects” on page 10). In the Declarations node, variables can be scalars, 1D arrays,and 2D arrays.To simplify referencing form objects as well as menu, ribbon, and toolbar items byname, you can create shortcuts with a custom name. These names are available inthe Declarations node under Shortcuts. They are directly available in methods alongwith the other global variables defined under Declarations. For more informationon shortcuts, see “Shortcuts” on page 55.F ORM D ECLARATIONSVariables can also be defined as Form Declarations under each respective form nodein the application tree.14

Form declarations can be of the types Scalar, Array 1D, Array 2D and Choice List.Global declarations are exposed to all components of the application whereas formdeclarations are only exposed to the form that they are defined in and the formobjects within that form. Form declarations are used to limit the scope of variablesand thereby logically separate the different parts of an application.Built-in Elementary Math FunctionsElementary math function for use in methods are available in the Java math library.Some edoubledoubleabcdefghk Math.PI;// the mathematical constant piMath.sin(3*a); // trigonometric sine functionMath.cos(4*a); // trigonometric cosine functionMath.random(); // random number uniformly distributed in [0,1)Math.exp(2*a); // exponential functionMath.log(1 e); // natural base e logarithmMath.pow(10,3) // power functionMath.log10(2.5); // base 10 logarithmMath.sqrt(81.0); // square rootThere are several more math functions available in the Java math library. Foradditional information, see any Java book or online resource.Control Flow StatementsJava supports the usual control flow statements if-else, for, and while. Thefollowing examples illustrate some of the most common uses of control flowstatements.T HE IF-ELSE S TATEMENTThis is an example of a general if-else statement:if(a b) {alert("Value too small.");} else {alert("Value is just right.");}Between curly braces {} you can include multiple lines of code, each terminatedwith a semicolon. If you only need one line of code, such as in the example above,this shortened syntax is available:if(a b)alert("Value too small."); 15

elsealert("Value is just right.");T HE F OR S TATEMENTJava supports several different types of for statements. This example uses theperhaps most conventional syntax:// Iterate i from 1 to N:int N 10;for (int i 1; i N; i ) {// Do something}An alternative syntax is shown in the example on page 64 where the loop is overall form objects in a list of form objects:for (FormObject formObject : app.form("form1").formObject()) {if ("Button".equals(formObject.getType())) {formObject.set("enabled", false);}}where the local iteration variable looped over is formObject of the type, or class,FormObject. The collection of objects, in this caseapp.form("form1").formObject(), can be an array or other types of lists ofobjects. Using this syntax, the iteration variable loops over all entries in thecollection, from start to finish. Another example can be found on page 90.T HE W HILE S TATEMENTThis example shows a while statement.double t 0,h 0.1,tend 10;while(t tend) {//do something with tt t h;}For a more advanced example of a while statement, see “Creating and RemovingModel Tree Nodes” on page 41.Note that Java also supports do-while statements.T HE W ITH S TATEMENTWhen writing methods in the Method editor, in addition to the standard Javacontrol flow statement, there is also a with statement that is used to makeApplication Builder code more compact and easier to read. A simple example isshown below:// Set the global parameter L to a fixed valuewith(model.param());16

set("L", "10[cm]");endwith();The code above is equivalent to:model.param().set("L", "10[cm]");In this case using the with statement has limited value since just one parameter isassigned but for multiple assignments readability increases. See “Parameters andVariables” on page 34 for an example with multiple assignments.Note that the with statement is only available when writing code in the Methodeditor. It is not available when using the COMSOL API for use with Java . Youcan turn off the use of with statements in the section for Methods in Preferences.The method descr returns the variable description for the last parameter orvariable in a with statement:with(model.param());set("L", "10[cm]");String ds descr("L");endwith();Assuming that the parameter description of the parameter L is Length. The stringds will have the value Length.E XCEPTION H ANDLINGAn exception is an error that occurs at run time. The Java programming languagehas a sophisticated machinery for handling exceptions and each exceptiongenerates an object of an exception class. The most common way to handleexceptions is by using try and catch, as in the example below.double d[][] new double[2][15];try {d readMatrixFromFile("common:///my file.txt");} catch (Exception e) {error("Cannot find the file my file.txt.");}where an error dialog box is shown in case the file my file.txt is not found inthe application file folder common. See the Java documentation for moreinformation about using try and catch. 17

Important Programming ToolsThe Application Builder includes several tools for automatically generating code.These tools include code completion, Record Method, Record Code, Convert to NewMethod, Editor Tools, Language Elements, and Copy as Code to Clipboard, and aredescribed in the book Introduction to Application Builder. These utilities allowyou to quickly get up and running with programming tasks even if you are notfamiliar with the syntax.The following sections describes two of the most important tools: codecompletion using Ctrl Space and Record Code. Using these tools will make youmore productive, for example, by allowing you to copy-paste or auto-generateblocks of code.Ct r l Sp ac e fo r C o d e C o m p l e t i o nWhile typing code in the Method editor, the Application Builder can providesuggestions for code completions. The list of possible completions are shown in aseparate completion list that opens while typing. In some situations, detailedinformation appears in a separate window when an entry is selected in the list.Code completion can always be requested with the keyboard shortcut Ctrl Space.Alternatively Ctrl / can be used to request code completion, which is useful ifCtrl Space is in use by the Windows operating system such as for certainlanguages. When accessing parts of the model object, you will get a list of possiblecompletions, as shown in the figure below:Select a completion by using the arrow keys to choose an entry in the list anddouble-click, or press the Tab or Enter key, to confirm the selection.If the list is long, you can filter by typing the first few characters of the completionyou are looking for.18

For example, if you enter the first few characters of a variable or method name,and press Ctrl Space, the possible completions are shown:In the example above, only variables that match the string iv are shown. Thisexample shows that variables local to the method also appear in the completionsuggestions.You can also use Ctrl Space to learn about the syntax for the built-in methods thatare not directly related to the model object. Type the name of the command anduse Ctrl Space to open a window with information on the various callingsignatures available.Additional information is also available in the form of tool tips that are displayedwhen hovering over the different parts of the code.The Method editor also supports code completion for properties, including listingthe properties that are available for a given model object feature node, andproviding a list of allowed values that are available for a given property.The figure below shows an example of code completion for the mesh element sizeproperty, where a list of the allowed values for the predefined element sizes ispresented. 19

COMSOL Multiphysics and its add-on modules contain thousands of physicsfeatures that you can learn about by using, for example, Record Code, Saveas Model File for Java, and code completion. The figure below shows codecompletion for a particular feature in the Ray Optics Module.Recording CodeClick the Record Code button in the Code section of the Method editor ribbon torecord a sequence of operations that you perform using the model tree, as shownin the figure below.Certain operations in the application tree can also be recorded, for example, codethat changes the color of a text label in a running application may be generated.To record a new method, click the Record Method button in the Main section ofthe Method editor ribbon.20

While recording code, the COMSOL Desktop windows are surrounded by a redframe: 21

To stop recording code, click one of the Stop Recording buttons in the ribbon ofeither the Model Builder or the Application Builder.By using Data Access, you can set the values of the Heat transfer coefficient and theExternal temperature properties of the busbar tutorial model used in the booksIntroduction to COMSOL Multiphysics and Introduction to ApplicationBuilder.To generate similar code using Record Code (Data Access is not used whenrecording code), follow these steps: Create a simple application based on the busbar model (MPH file). In the Model Builder window, in the Developer tab, click Record Method, orwith the Method editor open, click Record Code. Change the value of the Heat transfer coefficient to 5. Change the value of the External temperature to 300[K]. Click Stop Recording. If it is not already open, open the method with the recorded code.The resulting code is listed ("h", "5");set("Text", "300[K]");endwith();22

In this case, the autogenerated code contains a with() statement in order to makethe code more compact. For more information on the use of with(), see “TheWith Statement” on page 16.To generate code corresponding to changes to the application object, use RecordCode or Record Method, then go to the Form editor and, for example, change theap

Alternatively, you can use the operator as follows: a a b; which is equivalent to: a "string A" " and string B"; and equivalent to: a "string A" " " "and string B"; where the middle string is a string with a single whitespace character. Comparing Strings Comparing string values in

Related Documents:

Body Builder Harness Body Builder Harness with Auxiliary Switch Overlay (Dash), VN W3035627 1 Dual power take off (PTO), Switch 2 Body Builder Module (BBM) Electronic Control Unit (ECU) 3 Splice Pack (5K141B) 4 Main Cab (OPT5) 5 Main Cab (OPT1587) 6 Main Cab (MCBB) 7 Body Builder Connector # 4 (203D.A) 8 Body Builder Connector # 3 (203C.A)

The system administrator wants to use Application Builder to create an application. Which two statements about Application Builder are true? (Choose two.) A. Application Builder is a GUI. B. Application Builder can be run on the Avaya CallPilot Server. C. Application Builder can only be started from Avaya CallPilot Manager.

Builder 100, 200 and 300 are available as 6" or 9". Builder 400 is available as 5" and 9". Builder 500 is available as 3", 5", 9" and 5" Arctic. The angle accuracy is represented by the last digit of the instrument name. For example, Builder 505 is the 5" variant of the 500 series. Model Description Builder 100 Electronic theodolite.

Skill Builder One 51 Skill Builder Two 57 Skill Builder Three 65 Elementary Algebra Skill Builder Four 71 Skill Builder Five 77 Skill Builder Six 84 . classified in the Mathematics Test (see chart, page v). The 60 test questions reflect an appropriate balance of content and skills (low, middle, and high difficulty) and range of performance.

Creating new Lightning Page using Lighting App Builder Salesforce Lightning pages can be created using Lightning App Builder. To create, navigate to Build Lightning Bolt Lightning App Builder New. Lightning App Builder - App page. In this step, select App page and click on next button as shown below. Lightning App Builder

Getting Started with Memories Builder DVD 2.1 3 How to Use Memories Builder DVD Version 2.1 Getting Started This section of the User’s Guide contains instructions for installing Memories Builder DVD 2.1. To begin reading about the program, see Memories Builder DVD – Core Concepts on p. 6.

Molanis Technical Indicator Builder for MT4 is a stand‐alone product that complements Molanis Strategy Builder. Create custom indicators with Molanis Technical indicator Builder (files type *.moi) and use them when creating expert advisors with Molanis Strategy Builder (files type *.mol)

discover the Leica Builder for your task. Discover the Leica Builder for your task. Connect Leica DX10 fi eld controller Load your preferred Software tool and keep working as usual. The unique Builder setup method boosts your daily workfl ow. 1 Follow the Setup Wizard to level the Builder 2 Defi ne your Control Line