Transcription of COMSOL Multiphysics Programming Reference Manual
1 COMSOL Multiphysics Programming Reference ManualContact InformationVisit the Contact COMSOL page at to submit general inquiries, contact Technical Support, or search for an address and phone number. You can also visit the Worldwide Sales Offices page at for address and contact you need to contact Support, an online request form is located at the COMSOL Access page at Other useful links include: Support Center: Product Download: Product Updates: COMSOL Blog: Discussion Forum: Events: COMSOL Video Gallery: Support Knowledge Base: number: CM020007 COMSOL Multiphysics Programming Reference Manual 1998 2018 COMSOLP rotected by patents listed on , and 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.
2 9,372,673; and 9,454,625. Patents Documentation and the Programs described herein are furnished under the COMSOL Software License Agreement ( ) and may be used or copied only under the terms of the license , the COMSOL logo, COMSOL Multiphysics , COMSOL Desktop, COMSOL Server, and LiveLink are either registered trademarks or trademarks of COMSOL AB. All other trademarks are the property of 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 : COMSOL | 3 Contents Chapter 1: IntroductionAbout the COMSOL API 16 Where Do I Find More Information?
3 16 Getting Started 18 The Model Object .. 18 Compiling a Model File for Java .. 18 The Model File for Java .. 19 Running a Compiled Model File for Java from the Desktop .. 20 Running a Compiled Model File as a Batch Job from the Desktop .. 20 Running a Compiled Model File with the COMSOL Batch Command .. 20 Getting the COMSOL Installation Path from the Windows Registry .. 20 Setting up Eclipse for Compiling and Running a Java File .. 20 Chapter 2: General CommandsAbout General Commands 24 Overview of General-Purpose Commands .. 24get* and Selection Access Methods.
4 25set() .. 27setEntry().. 28setIndex() .. 28 Methods Associated to Set, SetIndex, and the Various Get Methods .. 29 Selections .. 30 Selection Color Themes .. 32 The loadFile and saveFile Methods .. 32 Inserting Features from Other Models .. 33 ModelUtil.. 34model .. () .. (<tag>) .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. ().. () .. () .. ().. 894 | () .. () .. () .. () .. () .. () .. () .. () .. ().. () .. () .. () .. ().
5 128 Least-Squares Objective Functions .. () .. () and ().param() .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. () .. 176 Plotting and Exporting Images 177 Errors and Warnings 180 Introduction.. 180 Retrieving Problem Information .. 180 Chapter 3: GeometryAbout Geometry Commands 184 Features for Creating Geometric Primitives.. 184 Features for Geometric Operations.. 185 Selection Features .. 186 Features for Virtual Operations .. 187 Features for Mesh Control.
6 187 Geometry Object Information Methods .. 188 Working with a Geometry Sequence 190 Adding a Model Component (Geometry).. 190 Adding a Geometry Feature.. 190 Editing a Geometry Feature .. 191 Building Geometry Features.. 192 CONTENTS | 5 Feature Status .. 192 Accessing Geometry Object Names .. 193 Deleting and Disabling Geometry Features .. 193 Deleting Geometry Objects .. 194 Moving and Scaling Geometry Objects .. 194 Plotting a Geometry Sequence .. 194 Geometry Settings 195 Length Unit .. 195 Angular Unit .. 195 Scale Values When Changing Unit.
7 195 Geometry Representation in 3D .. 196 Default Repair Tolerances .. 196 Automatic Rebuild .. 197 Work Planes 198 Selections of Geometric Entities 199 Named Selections .. 199 Using Selection Features .. 199 Cumulative Selections .. 200 Virtual Operations 201 About Virtual Operations .. 201 Mesh Control Entities .. 201 Geometry Object Information 202 General Information .. 202 Geometric Entity Counters .. 203 Adjacency .. 203 Evaluation on an Edge .. 204 Evaluation on a Face.. 204 Geometry Representation Arrays .. 205 Measurements 207 Measuring Geometric Entities in Objects.
8 207 Measuring Objects .. 207 Inserting Geometry Sequences from File 208 Example of Importing Geometry Sequences.. 208 Exporting Geometry to File 209 Exporting to an ACIS File.. 209 Exporting to a Parasolid File.. 209 Exporting to an STL File .. 210 Compatibility for mphbin/mphtxt in 2D and 3D .. 210 Using Geometry Parts 211 Geometry Commands 213 AdjacentSelection .. 214 Array .. 215 BallSelection, BoxSelection, CylinderSelection, Disk Selection .. 217 BezierPolygon .. 2206 | CONTENTSB lock .. 222 Chamfer .. 224 Circle .. 225 CollapseEdges.
9 227 CollapseFaces .. 227 CollapseFaceRegions .. 228 Compose, Union, Intersection, Difference .. 229 CompositeDomains .. 230 CompositeEdges .. 231 CompositeFaces .. 232 Cone .. 233 ConvertToSolid, ConvertToSurface, ConvertToCurve, ConvertToPoint.. 235 CrossSection .. 236 Cylinder .. 238 Delete .. 240 ECone .. 242 EditObject .. 244 Ellipse .. 246 Ellipsoid .. 247 ExplicitSelection .. 249 Extrude .. 250 Fillet.. 252 Finalize.. 253 FromMesh .. 254 Helix .. 255 Hexahedron.. 256If, ElseIf, Else, EndIf.
10 258 IgnoreEdges .. 259 IgnoreFaces .. 260 IgnoreVertices .. 261 Import DXF .. 262 Import Geometry Sequence.. 263 Import Mesh Part or Meshing Sequence .. 265 Import mphbin/mphtxt.. 266 Interpolation Curve .. 268 Interval .. 269 LineSegment .. 271 MergeEdges .. 272 MergeVertices .. 273 MeshControlDomains .. 274 MeshControlEdges .. 274 MeshControlFaces .. 275 MeshControlVertices .. 275 Mirror .. 276 Move, Copy .. 277 ParameterCheck .. 279 ParametricCurve .. 279 ParametricSurface .. 281 PartInstance .. 283 Partition.