New Features in Opera - Version 2020

Page created by Jimmie Owens
 
CONTINUE READING
New Features in Opera - Version 2020
Version 2020

New Features in
    Opera
              Version 2020

         Dassault Systèmes UK Ltd
      Network House, Langford Locks
   Kidlington, Oxfordshire, OX5 1LH, UK
             December 2019
New Features in Opera - Version 2020
2                                                                                    : Legal Notices

Legal Notices

SIMULIA Opera 2020 is © 1984-2019 Dassault Systèmes UK Limited
This page specifies the patents, trademarks, copyrights, and restricted rights for SIMULIA Opera
2020:

Trademarks
Opera, 3DEXPERIENCE, the Compass icon, the 3DS logo, CATIA, SOLIDWORKS, ENOVIA, DELMIA,
SIMULIA, GEOVIA, EXALEAD, 3D VIA, BIOVIA, NETVIBES, IFWE and 3DEXCITE are commercial
trademarks or registered trademarks of Dassault Systèmes, a French “société européenne” (Ver-
sailles Commercial Register # B 322 306 440), or its subsidiaries in the United States and/or other
countries. All other trademarks are owned by their respective owners. Use of any Das-
sault Systèmes or its subsidiaries trademarks is subject to their express written approval.
DS Offerings and services names may be trademarks or service marks of Dassault Systèmes or its
subsidiaries.

Third-Party Copyrights Notices
Certain portions of SIMULIA Opera contain elements subject to copyright owned by the following
entities:

       © Intel Corporation
       Copyright © Mark J. Kilgard, 1994, 1995, 1996, 1998, 2000, 2006, 2010
       © Magnequench Neo Powders, PTE. Ltd.
       © Sumitomo Electric Industries, Ltd,
       Some procedures are based on routines in Numerical Recipes: The Art of Scientific
       Computing, published by Cambridge University Press, and are used by permission."
       and
       First Edition FORTRAN :"Copyright(C)1986 Numerical Recipes Software"
       First Edition C :"Copyright(c)1987,1988 Numerical Recipes Software"
       Second Ed.FORTRAN :"Copyright(c)1986,1992 Numerical Recipes Software"
       Second Ed.C :"Copyright(c)1987-1992 Numerical Recipes Software"
       Intel Python Distribution is copyright © 2018 Intel Corporation, and provided under the
       following terms:

              Use and Redistribution. You may use and redistribute the software (the
              "Software"), without modification, provided the following conditions are
              met:

New Features in Opera                                                 Version 2020, December 2019
New Features in Opera - Version 2020
: Legal Notices                                                                                     3

             * Redistributions must reproduce the above copyright notice and the fol-
             lowing terms of use in the Software and in the documentation and/or
             other materials provided with the distribution.
             * Neither the name of Intel nor the names of its suppliers may be used to
             endorse or promote products derived from this Software without specific
             prior written permission.
             * No reverse engineering, decompilation, or disassembly of this Soft-
             ware is permitted.
             Limited patent license. Intel grants you a world-wide, royalty-free, non-
             exclusive license under patents it now or hereafter owns or controls to
             make, have made, use, import, offer to sell and sell ("Utilize") this Soft-
             ware, but solely to the extent that any such patent is necessary to Utilize
             the Software alone. The patent license shall not apply to any com-
             binations which include this software. No hardware per se is licensed
             hereunder.
             Third party and other Intel programs. "Third Party Programs" are the
             files listed in the "third-party-programs.txt" text file that is included with
             the Software and may include Intel programs under separate license
             terms. Third Party Programs, even if included with the distribution of the
             Materials, are governed by separate license terms and those license
             terms solely govern your use of those programs.
             DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY
             EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
             TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
             A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
             DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN
             SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE
             MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT
             YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES,
             EXPENSES, AND ATTORNEYS. FEES ARISING OUT OF ANY SUCH USE,
             EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT
             REGARDING THE DESIGN OR MANUFACTURE OF THE MATERIALS.
             LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR
             ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
             CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
             PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
             DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
             CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
             CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
             OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
             SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH

Version 2020, December 2019                                                       New Features in Opera
4                                                                                         : Legal Notices

             DAMAGE. YOU AGREE TO INDEMNIFY AND HOLD INTEL HARMLESS
             AGAINST ANY CLAIMS AND EXPENSES RESULTING FROM YOUR USE
             OR UNAUTHORIZED USE OF THE SOFTWARE.
             No support. Intel may make changes to the Software, at any time
             without notice, and is not obligated to support, update or provide training
             for the Software.
             Termination. Intel may terminate your right to use the Software in the
             event of your breach of this Agreement and you fail to cure the breach
             within a reasonable period of time.
             Feedback. Should you provide Intel with comments, modifications, cor-
             rections, enhancements or other input ("Feedback") related to the Soft-
             ware Intel will be free to use, disclose, reproduce, license or otherwise
             distribute or exploit the Feedback in its sole discretion without any oblig-
             ations or restrictions of any kind, including without limitation, intellectual
             property rights or licensing obligations.
             Compliance with laws. You agree to comply with all relevant laws and
             regulations governing your use, transfer, import or export (or pro-
             hibition thereof) of the Software.
             Governing law. All disputes will be governed by the laws of the United
             States of America and the State of Delaware without reference to conflict
             of law principles and subject to the exclusive jurisdiction of the state or
             federal courts sitting in the State of Delaware, and each party agrees
             that it submits to the personal jurisdiction and venue of those courts and
             waives any objections. The United Nations Convention on Contracts for
             the International Sale of Goods (1980) is specifically excluded and will
             not apply to the Software.
             *Other names and brands may be claimed as the property of others.

SIMULIA Opera may include open source software components. Source code for these components
is available upon request. The original licensors of said open source software components provide
them on an “as is” basis and without any liability whatsoever to customer (or licensee).

IP Asset Name        IP Asset Version      Copyright Notice
Under Other License Terms
Libbzip2             1.0.6                 Copyright © 1996-2007 Julian R Seward. All rights
                                           reserved.
OpenGLUT             0.6.3                 Copyright © 2004 The OpenGLUT Contributors. All Rights
                                           Reserved.

New Features in Opera                                                    Version 2020, December 2019
: Legal Notices                                                                                 5

IP Asset Name      IP Asset Version    Copyright Notice
QUADPACK           None                Copyright © 1987 R. Piessens, Elise de Doncker

                                            l   the names of the Copyright holders or contributors
                                                may not be used to endorse or promote any
                                                derived Software without prior permission;
                                            l   the Quadpack Software is provided "as is", without
                                                warranties;
                                            l   and we deny any liability for situations resulting
                                                from the use of this Software
Under Boost Software License 1.0 (BSL-1.0) https://opensource.org/licenses/BSL-1.0:
Boost              1.68.0              Copyright © 2018 Boost Community
Boost              1.71.0              Copyright © 2019 Boost Community
Under 2-clause BSD License (BSD-2-Clause) https://opensource.org/licenses/BSD-2-Clause:
Pygments           2.2.0               Copyright © 2006-2017 by the Pygments team
Sphinx             2.2.1               Copyright © 2007-2019 by the Sphinx team.
                                       All rights reserved.
Under 3-clause BSD License (BSD-3-Clause) https://opensource.org/licenses/BSD-3-Clause:
ARPACK             1996                Copyright (c) 1996-2008 Rice University.
                                       Developed by D.C. Sorensen, R.B. Lehoucq, C. Yang, and
                                       K. Maschhoff. All rights reserved.
conda-pack         0.4.0               Copyright © 2017, Jim Crist and contributors

Version 2020, December 2019                                                 New Features in Opera
6                                                                                 : Legal Notices

IP Asset Name      IP Asset Version   Copyright Notice
hwloc              1.11.6             Copyright © 2004-2006 The Trustees of Indiana
                                      University and Indiana University Research and
                                      Technology Corporation. All rights reserved.
                                      Copyright © 2004-2005 The University of Tennessee and
                                      The University of Tennessee Research Foundation. All
                                      rights reserved.
                                      Copyright © 2004-2005 High Performance Computing
                                      Center Stuttgart, University of Stuttgart. All rights
                                      reserved.
                                      Copyright © 2004-2005 The Regents of the University of
                                      California. All rights reserved.
                                      Copyright © 2009 CNRS
                                      Copyright © 2009-2016 Inria. All rights reserved.
                                      Copyright © 2009-2015 Université Bordeaux
                                      Copyright © 2009-2015 Cisco Systems, Inc. All rights
                                      reserved.
                                      Copyright © 2009-2012 Oracle and/or its affiliates. All
                                      rights reserved.
                                      Copyright © 2010 IBM
                                      Copyright © 2010 Jirka Hladky
                                      Copyright © 2012 Aleksej Saushev, The NetBSD
                                      Foundation
                                      Copyright © 2012 Blue Brain Project, EPFL. All rights
                                      reserved.
                                      Copyright © 2015 Research Organization for Information
                                      Science and Technology (RIST). All rights reserved.
                                      Copyright © 2015-2016 Intel, Inc. All rights reserved.
QtSolutions        N/A                Copyright © 2013 Digia Plc and/or its subsidiary(-ies).
Under HDF5 (Hierarchical Data Format 5) License
https://support.hdfgroup.org/ftp/HDF5/releases/COPYING:
HDF5               1.8.18             HDF5 (Hierarchical Data Format 5) Software Library and
                                      Utilities
                                      Copyright 2006-2016 by The HDF Group.

                                      NCSA HDF5 (Hierarchical Data Format 5) Software
                                      Library and Utilities
                                      Copyright 1998-2006 by the Board of Trustees of the
                                      University of Illinois.
                                      All rights reserved.
Under ICU License https://github.com/unicode-org/icu/blob/master/icu4c/LICENSE:

New Features in Opera                                             Version 2020, December 2019
: Legal Notices                                                                                     7

IP Asset Name         IP Asset Version    Copyright Notice
ICU                   56.1                Copyright © 1995-2015 International Business Machines
                                          Corporation and others
                                          All rights reserved.
Under MIT License https://opensource.org/licenses/MIT:
dxfgrabber            1.0.0               Copyright © 2012, Manfred Moitzi
Ezdxf                 0.10.2              Copyright © 2011-2018, Manfred Moitzi
JSON for Modern       3.6.1               Copyright © 2013-2019 Niels Lohmann
C++
Pytest                5.0.1               Copyright © 2004-2019 Holger Krekel and others
Under OpenSSL License https://www.openssl.org/source/license.html:
openSSL               1.0.2m              Copyright © 1998-2017 The OpenSSL Project. All rights
                                          reserved.
                                          Copyright © 1995-1998 Eric Young (eay@cryptsoft.com).
                                          All rights reserved.
openSSL               1.1.1a              Copyright © 1998-2018 The OpenSSL Project. All rights
                                          reserved.
                                          Copyright © 1995-1998 Eric Young (eay@cryptsoft.com).
                                          All rights reserved.

The following components are distributed and licensed under the terms of their original licenses:

Under GNU Lesser General Public License version 2.1 (LGPL-2.1) https://open-
source.org/licenses/LGPL-2.1:
Numerical diag- 12-Mar-12      Copyright Joachim Kopp Numerical diagonalization of hermitian 3x3
onalization of                 matrices arXiv.org preprint: physics/0610206 Int. J. Mod. Phys. C19
3x3 matrices                   (2008) 523-548
nose              1.3.7        Copyright © 2015 Jason Pellerin

 Version 2020, December 2019                                                   New Features in Opera
8                                                                                      : Legal Notices

Qwt               6.1.4        Copyright © 1997 Josef Wilgen
                               Copyright © 2002 Uwe Rathmann
                               The Qwt library and included programs are provided under the terms
                               of the GNU LESSER GENERAL PUBLIC LICENSE (LGPL) with the fol-
                               lowing exceptions:

                                   1. Widgets that are subclassed from Qwt widgets do not con-
                                      stitute a derivative work.
                                   2. Static linking of applications and widgets to the Qwt library
                                      does not constitute a derivative work and does not require the
                                      author to provide source code for the application or widget,
                                      use the shared Qwt libraries, or link their applications or wid-
                                      gets against a user-supplied version of Qwt. If you link the
                                      application or widget to a modified version of Qwt, then the
                                      changes to Qwt must be provided under the terms of the
                                      LGPL in sections 1, 2, and 4.
                                   3. You do not have to provide a copy of the Qwt license with pro-
                                      grams that are linked to the Qwt library, nor do you have to
                                      identify the Qwt license in your program or documentation as
                                      required by section 6 of the LGPL.

                                      However, programs must still identify their use of Qwt.
Under GNU Lesser General Public License version 3 (LGPL-3.0) https://open-
source.org/licenses/LGPL-3.0:
Lime Report       1.4.7        Copyright © 2015 by Alexander Arin (arin_a@bk.ru)
Qt                5.12.4       Copyright © 2019 The Qt Company

Other license terms:

      libbzip2:

              This program, "bzip2", the associated library "libbzip2", and all doc-
              umentation, are Copyright (C) 1996-2007 Julian R Seward. All rights
              reserved.
              Redistribution and use in source and binary forms, with or without modi-
              fication, are permitted provided that the following conditions are met:
              1. Redistributions of source code must retain the above Copyright notice,
              this list of conditions and the following disclaimer.
              2. The origin of this Software must not be misrepresented; you must not
              Claim that you wrote the original Software. If you use this Software in a
              product, an acknowledgment in the product documentation would be
              appreciated but is not required.

New Features in Opera                                                  Version 2020, December 2019
: Legal Notices                                                                                  9

             3. Altered source versions must be plainly marked as such, and must not
             be misrepresented as being the original Software.
             4. The name of the author may not be used to endorse or promote
             products derived from this Software without specific prior written
             permission.
             THIS SOFTWARE IS PROVIDED BY THE AUTHOR ""AS IS'' AND ANY
             EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
             TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
             FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
             THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
             SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
             BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
             SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
             INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
             LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
             (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
             OUT OF THE USE OF THIS
             SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
             DAMAGE.

      OpenGLUT:

             Copyright (c) 2004 The OpenGLUT Contributors. All Rights Reserved.
             Permission is hereby granted, free of charge, to any person obtaining a
             copy of this software and associated documentation files (the "Soft-
             ware"), to deal in the Software without restriction, including without lim-
             itation the rights to use, copy, modify, merge, publish, distribute,
             sublicense, and/or sell copies or substantial portions of the Software.
             The above copyright notice and this permission notice shall be included
             in all copies or substantial portions of the Software.
             THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
             KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
             PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
             OPENGLUT CONTRIBUTORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
             OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
             OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
             SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
             Except as contained in this notice, the name of The OpenGLUT Con-
             tributors shall not be used in advertising or otherwise to promote the
             sale, use or other dealings in this Software without prior written author-
             ization from The OpenGLUT Contributors.

Version 2020, December 2019                                                    New Features in Opera
10                                                                                      : Legal Notices

Restricted Rights
This clause applies to all acquisitions of Dassault Systèmes Offerings by or for the United States gov-
ernment, or by any prime contractor or subcontractor (at any tier) under any contract, grant, cooper-
ative agreement or other activity with the United States government. The software, documentation
and any other technical data provided hereunder is commercial in nature and developed solely at
private expense. The Software is delivered as “Commercial Computer Software” as defined in DFARS
252.227-7014 or as a “Commercial Item” as defined in FAR 2.101(a) and as such is provided with
only such rights as are provided in Dassault Systèmes standard commercial end user license agree-
ment. Technical data is provided with limited rights only as provided in DFAR 252.227-7015 or FAR
52.227-14, whichever is applicable. The terms and conditions of the Dassault Systèmes standard
commercial end user license agreement shall pertain to the United States government's use and dis-
closure of this software, and shall supersede any conflicting contractual terms and conditions. If the
DS standard commercial license fails to meet the United States government's needs or is inconsistent
in any respect with United States Federal law, the United States government agrees to return this
software, unused, to DS. The following additional statement applies only to acquisitions governed by
DFARS Subpart 227.4: "Restricted Rights - use, duplication and disclosure by the Government is sub-
ject to restrictions as set forth in subparagraph (c)(l)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 252-227-7013.
SIMULIA Opera © 1984-2019 Dassault Systèmes UK Limited.

New Features in Opera                                                   Version 2020, December 2019
Contents

    Legal Notices                                                   2
    Contents                                                       11

  Chapter 1 Introduction                                          14
    Opera 2020                                                     14
      Opera-3d/Pre-Processor - End of Life                         14
    About this Document                                            15

  Chapter 2 Opera 2020 Major Features                             16
    New Opera-2d                                                   16
      Old Model and Solution Files                                 16
      COMI commands                                                17
      Upcoming Features                                            18

  Chapter 3 Opera-2d Graphical User Interface                     19
    Overview                                                       19
    Opera-2d Tabbed Menu Interface                                 22
    Canvas                                                         23
      Building Geometry                                            23
      Modifying Geometry                                           24
      Dimensions                                                   27
      Post-Processing                                              28
    Right Hand Side (RHS) Panel                                    30
    Left Hand Side (LHS) Panel                                     31
      Overview                                                     31
      Selection Options                                            31
      View Options                                                 32
      Select Items Using                                           33
      Modify Items                                                 33
    View Settings Menu                                             34
    Keyboard Actions Menu                                          35
    Python Console / Message Pane                                  36

Version 2020, December 2019                     New Features in Opera
12

        Python Console                                                                36
        Message Pane                                                                  37

     Chapter 4 Python and Opera-2d                                                   38
      Introduction                                                                    38
      Python Functionality Provided with Opera-2d                                     38
      Export to Python                                                                40
      Writing Python Scripts                                                          41
         Integrated Development Environment (IDE)                                     41
      Opera Python Example Scripts                                                    43
         Accessing Model Components                                                   43
         Build a Rectangle and Assign Material Property                               44
         Perform Boolean Operation                                                    45
         Assign Material Properties                                                   45
         Change Analysis Properties                                                   45
         Post-Processing Methods - Retrieve Field at Point                            46
         Post-Processing - Plot Line on Graph                                         46
         Canvas - View Commands                                                       47

     Chapter 5 Opera 2020 Minor Features                                             48
      Opera Manager                                                                   48
         SIMULIA CST Licensing                                                        48
         POWER'BY                                                                     48
      Command Language                                                                49
         FACT function                                                                49
      Intel Python                                                                    50
      ACIS 2019 (R29)                                                                 51
         Interoperability                                                             51
         Mesh Generator                                                               51
      Opera-3d/Modeller                                                               52
         CAD Import and Export, including Linux                                       52
         Shortcuts                                                                    52
         SAVE Command                                                                 52
      Opera-3d/Post-Processor                                                         53
         AXESVIEW command                                                             53

     Chapter 6 3d Pre-Processor: End of Life                                         54
      Opera-3d/Pre-Processor                                                          54

     Chapter 7 System Notes                                                          55

New Features in Opera                                        Version 2020, December 2019
13

   Supported Operating Systems for Opera 2020                         55
   Third Party Libraries                                              57
      Intel Python distribution                                       57
   Licensing                                                          58
      Opera License Management Suite (using LM-X)                     58
      SIMULIA CST License Wizard (using FlexNet)                      58

Version 2020, December 2019                         New Features in Opera
Chapter 1
   Introduction

Opera 2020

Opera 2020 is a major release which introduces significant new features into Opera, including:

    l   A complete replacement of the Opera-2d modelling and analysis modules.
    l   New licensing options to allow Opera to be run from new license bundles.

Other minor changes have been made throughout the software to enhance its functionality and reli-
ability. Some of these are also included in this document.

                 Opera-3d/Pre-Processor - End of Life
Opera 2020 will be the last version that is supplied with the Opera-3d/Pre-Processor, see "3d Pre-Pro-
cessor: End of Life" on page 54

Version 2020, December 2019                                                  New Features in Opera
15                                                       Chapter 1 Introduction: About this Document

About this Document

This New Features document high-lights the new facilities that are available in the Opera software at
version 20.

     l   "Opera 2020 Major Features" on page 16 describes the New Opera-2d.
     l   "Opera 2020 Minor Features" on page 48 describes other changes to the User Interface,
         Opera Manager and Opera-3d.
     l   "System Notes" on page 55 specifies the supported operating systems and the version num-
         bers of 3rd-party libraries used to build Opera as well as changes to the licensing system.

Please read the corresponding sections in the Reference Manuals and see the examples in the
User Guides for more information on these new features.

New Features in Opera                                                  Version 2020, December 2019
Chapter 2
   Opera 2020 Major Features

New Opera-2d

The Opera-2d/Pre & Post-Processor has been replaced in Opera 2020 with a new GUI that improves
the modelling and analysis process, while maintaining the accuracy and speed of the existing solvers.
In addition, Opera-2d now has full access from the Python language to make scripting far simpler.
Full details of the new application are included in the updated Opera-2d Reference Manual and
in the following chapters.

                         Old Model and Solution Files

Import
Opera-2d model files (.op2) and solution files (.st ,.ac,.tr,.rm,.lm,.dm,.sp,.sa,.th ,.thtr,.vl) can
be imported into new Opera-2d. These must be Opera-2d version 19/2019 files. Earlier version files
can be read into Opera-2d version 19/2019 and written out in order to bring them up to the correct
version to be imported into new Opera-2d.
When importing solution files, the solution and any solution tables will not be included in the import.
Solutions rely on the mesh nodes and elements, as the solution data is a list of solution potentials etc
on the nodes/elements. During the import of an old model the regions are re-created as new regions
which do not necessarily have the same edge order and mesh element number, which means that
when the imported model is re-meshed the mesh is likely to be slightly different from that which was
created in the model previously and so the previous solution data cannot be mapped directly onto the
new mesh.

Export
Models created in Opera-2d 2020 can be exported into the old model format (.op2) so that they can
be loaded into Opera-2d version 19/2019 and imported into the Opera-3d Modeller, as part of geo-
metry creation.

Version 2020, December 2019                                                    New Features in Opera
17                                                            Chapter 2 Opera 2020 Major Features:

The new geometric capabilities of Opera-2d 2020 does mean that there are some new features
which can not be supported by the older model format. This includes models which contain "holes".
Previously a hole in the geometry would have to be constructed with a wrapped around regions
where two edges are overlapped to form a join between the inside and outside of the hole. In new
Opera-2d a hole can be created using a boolean subtraction operation which does not create a com-
patible region topology.
When exporting a model to the old model format, warning messages will be issued if the model topo-
logy cannot be supported by the previous format.
As new features are added to Opera-2d, the older model format will not be updated and it is advis-
able to convert old models that are still required to the new format.

                                   COMI commands
Support for the parsing of COMI command scripts has been included in new Opera-2d to allow users
to run existing COMI files in new Opera-2d. This has been done for commands where it has been feas-
ible to do so. However, where a command was only relevant for the old display structure or com-
mand structure or where there is a newer method that deprecates a function, the commands will not
be converted. The following is a list of the commands that have not been included in the parser in this
release.

                 Command                Reason for not being supported
               ANIMATION         Deprecated functionality
               APPEND            Deprecated functionality
               CHECK             Deprecated functionality
               COMOUTPUT         Deprecated functionality - replaced by Python output
               DIMENSION         UI only functionality
               DUMP              Deprecated functionality
               GRAPH             Deprecated functionality
               GUIOPTIONS        Only relevant to previous interface
               HEATTRANSFER UI only functionality
               HELP              UI only functionality
               LIST              UI only functionality
               PAN               UI only functionality
               PLOT              Deprecated functionality
               PRINT             UI only functionality
               RESIZE            UI only functionality
               SECTION           UI only functionality

New Features in Opera                                                  Version 2020, December 2019
Chapter 2 Opera 2020 Major Features:                                                                  18

                SPLIT              UI only functionality
                TEST               Deprecated functionality
                TITLE              Deprecated functionality
                UNDO               UI only functionality
                WINDING            UI only functionality
                ZOOM               UI only functionality

Additionally some command parameters have not been included where they are deprecated or can
not be included in the parser system.
A new Opera-2d COMI Reference Manual is included in this release and is available from the
Opera Manager Help menu. This covers the list of commands which are included in the Python
parser. In order that compatibility with existing command scripts can be maintained as much as pos-
sible, command parameters have been retained in the same order. The parameters which are not
supported by the Python parser are marked as "Ignored".
The majority of COMI commands and command script structures have been included in the parser, in
order that existing scripts can be used with new Opera-2d with the minimum of updating. However
new features in Opera-2d are not available from COMI and so it is advisable to switch to using the
Python API to new Opera-2d.

                                  Upcoming Features
There are a number of features that are in the process of being implemented for the new version of
Opera-2d. These will be added in upcoming feature releases as they are developed. As they move
from the upcoming list to the implemented list they will be mentioned in the list of new features for
new Opera-2d and removed from this list.
The list of upcoming features includes:

    l   Charged Particle Analysis:
             l  Graphs of intersections of tracks with lines either defined in the post-processing stage
                or as geometry edges
    l   Partial Tables of solution values
    l   Solution restarts
    l   Incremental permeability restarts
    l   Machines Environment

 Version 2020, December 2019                                                     New Features in Opera
Chapter 3
   Opera-2d Graphical User
   Interface

Overview

Opera-2d is an interactive program for preparing data and processing results from the Opera-2d ana-
lysis programs.
The pre-processing commands are used to create and edit two dimensional finite element models,
define material characteristics for nonlinear magnetic, dielectric, thermal or stress components, dis-
play pictures of the models and the mesh and output data files in the formats accepted by the ana-
lysis programs.
The post-processing commands allow many field components, or expressions of field components to
be viewed at points, along lines or over the cross-section of the model. Components can be integ-
rated in one or two dimensions and particle trajectories can be calculated in three dimensions.
The Graphical User Interface consists of a number of different components as shown in the
images below. The description of each of these components is presented in the following sections.

Version 2020, December 2019                                                    New Features in Opera
20                                                Chapter 3 Opera-2d Graphical User Interface:

                    Figure 3.1 Components of the Graphical User Interface

New Features in Opera                                            Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface:                                                   21

                 Figure 3.2 Components of the Graphical User Interface - continued
The View Settings menu and the Right Hand Side panel are collapsible and they can be opened
and closed using the arrow icons.
The Graphical User Interface provides two different color schemes:

    l   light mode
    l   dark mode

The color scheme can be changed from the context menu available by right clicking in the Toolbar.

          Figure 3.3 Light color scheme                    Figure 3.4 Dark color scheme

The font size of the text in the Graphical User Interface can be adjusted with CTRL + and
CTRL - keys.

 Version 2020, December 2019                                                New Features in Opera
22                    Chapter 3 Opera-2d Graphical User Interface: Opera-2d Tabbed Menu Interface

Opera-2d Tabbed Menu Interface

The Opera-2d Tabbed Menu Interface has 4 tabs of commands:
• Work: contains commands for file reading and writing, global options and units.
• Modelling: contains commands for defining and manipulating bodies.
• Analysis: contains commands to generate the mesh and define analysis specific data.
• Post-Processing: contains commands for visualizing the solution and calculating further res-
  ults.

                             Figure 3.5 Tabbed menu interface - Work tab
In addition to these, there is a second row of tabs that switch between different views:

     l   Canvas 2d: drawing interface for model building and definition
     l   Circuits: interface for defining circuits connected to the Finite Element model (only available
         for certain types of solutions)
     l   BH Editor: interface for defining and visualizing material characteristics
     l   Winding Tool: interface for defining and visualizing winding layouts for electrical machines
     l   Graphing: interface for 2d plotting of results

The toolbuttons in the first row of tabs are only relevant for the Canvas 2d view.

              Figure 3.6 Tabbed menu interface - Modelling tab and second layer of tabs

New Features in Opera                                                    Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Canvas                                                   23

Canvas

The Canvas provides facilities for building and modifying geometry, as well as for selecting geo-
metric items.

                                  Building Geometry
A number of different controllers are available, which allow the definition of geometrical entities.
Each of the controllers is defined by a series of points and some allow various options in the way in
which the geometric shape is defined.

 Controller          Definition
                     A polyline is defined by a series of vertices that are connected with straight
                     lines or arcs.

     Polyline        On creating a new polyline, the default type of line is straight.
                     Switching between straight lines and arcs is done using the keyboard, as indic-
                     ated in the "Keyboard Actions Menu" on page 35 (A for arcs and L for straight
                     lines).
                     Arcs can be defined in one of 2 different ways:

                         a. using a center point and an angle span
                         b. using a radius and an angle span

                     The angle to the previous edge can be modified.
                     The arc can be tangential or perpendicular to the previous edge.
                     The direction of the arc can be toggled.
                     Polylines can be closed by snapping to the first corner or using the automated
                     option to close an open polyline.
                     A rectangle can be defined in 2 different ways:

                         a. by two opposite vertices
    Rectangle            b. by two consecutive vertices and a width
                     A circle is defined in one of 2 different ways:

                         a. by a center vertex and radius
       Circle            b. by a center vertex and diameter

 Version 2020, December 2019                                                     New Features in Opera
24                                               Chapter 3 Opera-2d Graphical User Interface: Canvas

 Controller           Definition
                      A circular sector is defined by:

                           l   center vertex
 Circular Sector           l   first vertex on the radius
                           l   second vertex on the radius
                      An annular sector is defined by:

                           l   center vertex
 Annular Sector            l   vertex on the first radius
                           l   vertex on the second radius
                      A regular polygon is defined by:

                           l   center vertex
  Regular Poly-            l   vertex at one of the polygon corners
      gon

Note: "Keyboard Actions Menu" on page 35 shows context-sensitive options for changing the defin-
ition mode.
Once a controller is activated, the definition of the individual vertices can be done by left clicking on
the canvas, or by entering the numerical coordinates.
To enter the numerical coordinates for a vertex, use the TAB key to enter the coordinate for the first
axis (X or R) and then using the TAB or RETURN keys move to define the coordinates for the
second axis (Y or Z). To finalize the definition of the vertex, use the RETURN key.
Once the definition of the geometric entity is finished, the user can exit the controller for the geo-
metry definition using the ESCAPE key.
Note: After entering one of the coordinates, the user can ‘lock’ the coordinate that has just been
defined using the TAB key. This operation does not create the entity. Only the RETURN key creates
the entity. The user can ‘unlock’ any of the coordinates using the BACKSPACE key.

Structure of Geometric Entities
From the point of view of a model structure, bodies contain regions, regions are made up of edges
and edges are defined by vertices. Primitives always contain one single region at the point when they
are created. After performing boolean operations, one body can contain multiple regions.

                                  Modifying Geometry
A number of different operations are allowed to modify bodies that have already been created. The
operation type must be selected first. Then a body or several bodies can be selected to apply a modi-
fication.

New Features in Opera                                                     Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Canvas                                               25

Boolean Operations
Boolean operations are performed on two or more bodies. The order in which bodies are selected for
a Boolean operation is important. The steps for defining a Boolean operation are:

    l   Enter the Boolean definition mode, by clicking the Boolean toolbutton
    l   Using the keys listed in the Keyboard Actions menu, select the type of Boolean operation:
            l   R – toggle between regular and non-regular union
            l   S – subtraction
            l   T – trim
            l   C – cutaway
            l   I – intersection
    l   Select the first body from the LHS panel or from the canvas
    l   Confirm the selection of the first body using the RETURN key
    l   Select the other bodies from the LHS panel or from the canvas

Note: In order to return to the definition of the first body selected in the Boolean operation, use
the BACKSPACE key
    l   Perform the Boolean operation using the RETURN key
    l   Exit the Boolean definition mode using the ESCAPE key

The outcome of a Boolean operation is:

    l   Regular Union -> one single body is created with the name and properties of the first body.
        The single body contains one single region.
    l   Non-regular Union -> one single body with the name of the first body and multiple
        regions, each maintaining their original properties.
    l   Subtraction -> the first selected body is kept but its geometry is modified by removing the
        intersections with the other bodies. The other bodies are removed.
    l   Trim -> same as Subtraction, but the other bodies are not removed.
    l   Cutaway -> the geometry of the first selected body is removed from all the other bodies
        (opposite to Trim). The first body remains unchanged.
    l   Intersection -> one single body is created with the name and properties of the first body
        and the geometry given by the intersection between all of the selected bodies.

Chamfer and Blend
The Chamfer or Blend operation adds a straight or curved edge, respectively, at the intersection
of two body edges.

The operation works by selecting the Chamfer or Blend toolbutton           , followed by clicking on
the node which sits at the intersection of two edges.
The mode of operation can be toggled between chamfering or blending by using the key displayed in
the Keyboard Actions menu.

 Version 2020, December 2019                                                  New Features in Opera
26                                              Chapter 3 Opera-2d Graphical User Interface: Canvas

For both modes, the user needs to provide the length along both edges that will be removed. By
providing these as independent values, chamfers and blends at any angle can be achieved.
To apply the chamfer or blend, left-click or press the RETURN key.
Note: Nodes that are being shared between multiple bodies cannot be used for chamfering or blend-
ing.

Copy and Replicate
The Copy functionality allows one or multiple bodies to be copied. Only bodies can be copied and the
new entities that are being created by the copy operation are independent from the original body or
bodies. The different ways in which bodies can be copied can be selected using the keys specified in
the Keyboard Actions menu.
The available options are:

     l   copy along the X-axis with a spacing and a number of copies
     l   copy along the Y-axis with a spacing and a number of copies
     l   mirror copy against an edge
         Note: The edge used for mirror needs to go through the origin or otherwise be a construction
         line
     l   mirror copy around an angle; the value for the angle can be defined using the TAB key
     l   rotated copies around a center, with a number of copies and angular span between copies

Note: Multiple types of copy can be combined at the same time, for example copy along the X-axis
and the Y-axis or copy around the origin and mirror against an angle.
The Replicate functionality allows one or multiple bodies to be replicated. The newly created entit-
ies are linked to the original body / bodies and their regions share the same properties.
All of the options that are available for the Copy command are also available for the Replicate com-
mand. The only restriction is for rotated replications: in this case, the center of rotation can only be
the origin (0, 0).

Transform
The transform operation allows the modification of existing bodies. The options available for trans-
formation can be toggled using the keys specified in the Keyboard Actions menu. The available
options are:

     l   Scale a body / bodies in both axes using a scaling factor
     l   Move the body / bodies in the plane
         Note: The move can be specified as a set of absolute coordinates or as a translation
     l   Rotate the body / bodies around a center with a specific angle
     l   Flip the body / bodies in the X or Y axis
     l   Mirror the body / bodies in an edge
         Note: The edge used for mirror needs to go through the origin or otherwise be a construction
         line

New Features in Opera                                                  Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Canvas                                                   27

Note: The origin of these transformations can be changed using the O key (as specified in the Key-
board Actions menu)

Region Ordering
Before creating the finite element mesh, all of the regions that define the model space will auto-
matically be 'flattened'. As part of this process, regions that occupy parts of the same canvas space
will need to be prioritised, so that at every point in the model space only one set of region properties
is retained.
Therefore, the ordering of regions that overlap or overlay each other is important. By default, the
ordering of these regions follows the order in which the regions (and the bodies to which they belong)
are created. Hence, the latest region that has been created will have the highest ordering level.
The layering order of a body can be modified by the user, by right clicking on the body and selecting
one of the options:

    l   Bring forward
    l   Send backward
    l   Bring to front
    l   Send to back

The order of the regions on the canvas is visible through the shading, colour and outline of regions.
When a body lies completely underneath another body, the software will issue a warning message at
the point of flattening and meshing, reporting that one or more regions have been omitted from the
meshed model. This can be avoided by bringing forward the body that contains the smaller region, so
that it lies above the larger body.
   [Warning] MeshCreation Hidden regions have been omitted from mesh

Groups
Bodies can be grouped in order to facilitate operations on multiple bodies. A group behaves like any
other body and can be transformed, copied and replicated. Groups can also be used in Boolean oper-
ations.
A group can be destroyed using the Ungroup option and the component bodies are made inde-
pendent.

                                         Dimensions

The Dimensions Tool            can be used to retrieve the position of geometric entities, as well as
measuring distances, arcs and angles.
Users can select Vertices and Edges and the following output will be provided based on the selec-
tion:

 Version 2020, December 2019                                                     New Features in Opera
28                                              Chapter 3 Opera-2d Graphical User Interface: Canvas

     l   1 vertex selected
             l   coordinates in XY and Rθ
     l   2 vertices selected
             l   coordinates of the two vertices in XY and Rθ
             l   angle between vertices at origin
             l   dimensions of equivalent edge in dXdY and Rθ
     l   3 non-collinear vertices selected
             l   coordinates of the three vertices in XY and Rθ
             l   center of calculated circle XY and Rθ
             l   equivalent arc dX, dY, radius, span, length
     l   1 vertex and 1 edge selected
             l   coordinates of vertex in XY and Rθ
             l   start and end coordinates of the edge
             l   edge lengths
             l   angle between edges
             l   distance between vertex and edge
     l   2 edges selected
             l   start and end coordinates for the two edges
             l   edge length
             l   intersection point between the edges or distance between edges, if they are parallel
     l   1 region selected
             l   number of vertices
             l   number of edges
             l   area

                                      Post-Processing
The Post-Processing interface provides capabilities for presenting calculated results from the finite
element solution and for performing further calculations using the existing solution fields.

Post-processing items
In order to facilitate the post-processing of results, new geometric entities, called post-processing
bodies, can be created once a solution exists. These bodies will not change the solution already cal-
culated and they are differentiated from other bodies by their colour.

New Features in Opera                                                   Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Canvas                               29

                               Figure 3.7 Post-processing body

Version 2020, December 2019                                      New Features in Opera
30                        Chapter 3 Opera-2d Graphical User Interface: Right Hand Side (RHS) Panel

Right Hand Side (RHS) Panel

The Right Hand Side (RHS) panel is used to define the properties of selected model components.
It also allows the definition of model-wide settings and of the analysis setup.
The panel contains three different tabs:

     l   Selection: is a context-sensitive tab and contains the properties for one or more entities
         selected from the Left Hand Side (LHS) panel or from the canvas
     l   Model: contains model-dependent properties, including the type of model space (cartesian or
         axisymmetric), information regarding the symmetry and global mesh, as well as the list of
         user variables and functions
     l   Analysis: contains the analysis definition parameters for the currently loaded model

                            Figure 3.8 Right Hand Side Panel - Analysis tab

New Features in Opera                                                 Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Left Hand Side (LHS) Panel                            31

Left Hand Side (LHS) Panel

                                          Overview
The Left Hand Side (LHS) panel provides the list of model entities that exist in the currently
loaded model:

    l   Bodies: geometric entities that are used to define the model
    l   Construction Helpers: straight lines and arc that can be used to help with building the geo-
        metry
    l   Region Tags: labels used to group together model regions that have common attributes
        (e.g. conductors belonging to the same phase)
    l   Materials: labels for defining material properties, which are applied to model region
    l   Volume Properties: labels used to define region properties, such as current density and
        material orientation
    l   Boundary Conditions: labels which contain the boundary conditions applied to model
        edges
    l   Conductors: labels that are used to link regions in the model with conductor sets in the Cir-
        cuit Editor (only available for transient and steady-state analyses)
    l   Machine Components: labels for the different components of an electrical machine (this
        section is only shown if a machine airgap is defined)
    l   Emitters: labels for the emitters defined (only available if the Charged Particle solver is
        selected)
    l   Post-Processing items: entities used for displaying and post-processing results (this sec-
        tion is only shown if a valid solution is loaded)

Note: Some of these sections are only available when certain solver types are selected or when a
solution is loaded.
From the LHS panel, users can create, delete, select and edit model components, as well as change
the visibility of these components in the canvas.

                                   Selection Options
The Selection Options dialog allows selecting bodies in the canvas:

    l   Select All: select all existing bodies
    l   Clear Selection: clear the currently selected bodies
    l   Unstructured Meshing: select bodies which have unstructured mesh assigned to their
        regions
    l   Structured Meshing: select bodies which have structured mesh assigned to their regions
    l   Mesh Size: select bodies which have a certain mesh size assigned to their regions (the drop-
        down menu provides a list of existing mesh sizes)
    l   Errors: select bodies which contain errors

Individual bodies can be selected from the LHS panel by left-clicking on their name.

 Version 2020, December 2019                                                  New Features in Opera
32                        Chapter 3 Opera-2d Graphical User Interface: Left Hand Side (LHS) Panel

                                 Figure 3.9 Selection Options menu

                                      View Options
The View Options dialog allows modifying the visibility of entities in the canvas:

     l   Hide All: hide all bodies
     l   Show All: show all bodies
     l   Hide Construction Helpers: hide all construction lines
     l   Show Construction Helpers: show all construction lines
     l   Hide Selection: hide the selected bodies
     l   Show Selection: show selected bodies

Individual bodies can be shown or hidden using the toggle button     /      next to each body name.

                                  Figure 3.10 View Options menu

New Features in Opera                                                    Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Left Hand Side (LHS) Panel                            33

                                  Select Items Using
Regions can be selected in the canvas based on their links to labels defined in the LHS panel, such as
material labels, volume property labels, conductor labels or region tags. The operation works by first
selecting the label(s) from the LHS panel and then clicking on the Select Items Using toolbutton
   .

                                       Modify Items
New items can be created using the Add new item toolbutton , which is available for all types
of items in the LHS panel, with the exception of bodies (which can only be created using the geo-
metry controllers).

Existing items can be edited using the Edit item toolbutton    .
Existing items can also be duplicated (along with the properties that have already been assigned to
them) using the Duplicate item toolbutton       .
Items from the LHS panel (including bodies) can be deleted from the model using the Delete item
toolbutton    . Items that are already in use (for example a material label that has been assigned to
a region) cannot be deleted.

 Version 2020, December 2019                                                   New Features in Opera
34                                 Chapter 3 Opera-2d Graphical User Interface: View Settings Menu

View Settings Menu

The View Settings Menu is used to define options related to the visibility of the model geometry
and the canvas.
The following options can be defined:

     l   X (R), Y (Z), Zoom Size: view center point and zoom
     l   Model Rotation Symmetry: display the geometry of the full model (for models with rota-
         tional symmetry)
     l   Show Grid: display the grid
     l   Show Axes: display the axes
     l   Show Outlines: display of the outlines of bodies
     l   Show Mesh: display of mesh (available after the mesh has been generated)
     l   Axisymmetry RZ / ZR: swap position of the axes for axisymmetric models
     l   Show Deformed Mesh: display of deformed mesh (only for solved mechanical models)

There is also a toolbutton that offers the option to Zoom to Fit, so that the entire model is included
in the view. This toolbutton is available both when the dialog is open and closed.

                       Figure 3.11 View Settings Menu - Axisymmetric model

New Features in Opera                                                  Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Keyboard Actions Menu                             35

Keyboard Actions Menu

The Keyboard Actions menu is a context sensitive and ‘read-only’ section of the LHS panel which
displays the possible actions and the related keyboard shortcuts. It is shown at the bottom of the
LHS panel and is automatically populated when a canvas operation is selected.

                                                   Figure 3.13 Keyboard Actions menu - boolean
 Figure 3.12 Keyboard Actions menu - geometry                       operation
                  controller

 Version 2020, December 2019                                                New Features in Opera
36                    Chapter 3 Opera-2d Graphical User Interface: Python Console / Message Pane

Python Console / Message Pane

At the bottom of the Graphical User Interface, a pane can be opened. In this pane, either a Python
Console can be activated or a Message Pane can be shown.

                                    Python Console
The Python console allows the user to run Python commands directly from the interface and interact
with the model.
The Python console provides auto-complete suggestions to help facilitate writing Python commands.
The auto-complete suggestion can be triggered using the TAB key, once a section of the desired com-
mand has been typed.
Additional help on the use of Python commands and their syntax can be obtained using the help
method:
 In : help(model.boolean_trim)
 Help on method boolean_trim:
 boolean_trim(...) method of _opera2d.ModelInterface instance

        boolean_trim( (ModelInterface)arg1, (Opera2dBodyItem)first_
        body, (object)other_bodies [, (object)name='']) -> Oper-
        a2dBodyItem :

        The intersection of first_body and other_bodies is removed
        from the first_body.

        Args:
        first_body (Opera2dBodyItem): The body to trim parts from.
        other_bodies (list(Opera2dBodyItem)): The bodies to remain
        intact, the intersections of these
        bodies with first_body will be removed from first_body.
        name (str, optional): The name of the result of the boolean
        operation.

        Returns:

New Features in Opera                                                 Version 2020, December 2019
Chapter 3 Opera-2d Graphical User Interface: Python Console / Message Pane                         37

         Opera2dBodyItem: The resulting body of the boolean oper-
         ation.

         Raises:
         ValueError: If the first_body has no region.
         If none of the other_bodies have regions.
         If any of the bodies provided are Post-Processing bodies.
         If the boolean command failed to run in some other way.

For more details on the use of Python as the scripting language in Opera, please see the section
"Python and Opera-2d" on page 38.

                                      Message Pane
The Message Pane displays messages that are reported by the software to the user. These mes-
sages can be one of three different types:

    l   Errors: printed in red color. These report errors that the software returns. They usually mean
        that an action that the user has requested is invalid.
    l   Warnings: printed in yellow color. These are intended to inform the user of potential issues.
    l   Information: printed in blue color. These pass relevant information to the user. They are used
        to return Python errors.

 Version 2020, December 2019                                                   New Features in Opera
Chapter 4
   Python and Opera-2d

Introduction

The scripting language for Opera-2d is Python. Below is a short Python nomenclature for some of the
terms used most frequently in the following sections.

 Name               Definition
 Package            A folder containing Python modules; a set of Python modules
 Module             A file containing related Python classes, functions and variables
 Method             Python function

Python Functionality Provided with Opera-2d

The Opera 2020 distribution includes the Intel Distribution for Python 2019 Update 5 which uses the
Conda package management system and includes Python 3.6.9.
A Python package is provided as part of the Opera installation. This includes all of the capabilities
needed for interacting with Opera-2d from the Python interface. The name of this package is oper-
apy.
The full list of Opera Python commands and their syntax can be found in the form of an HTML file in
the Opera Manager Help menu, Reference Manuals (html) / Opera-2d Python Reference Manual.
The scripting functionalities are grouped in two modules:

    l   canvas – contains methods related to the canvas (e.g. zoom level, canvas size)
    l   opera2d– contains methods used for interacting with the model (e.g. model building, setup,
        post-processing and graphing).

Both modules are automatically imported on startup of Opera-2d, so they can be accessed directly,
without the need for a manual import command. This can be seen in the Python console:
Pre Imported Modules: ['operapy', 'operapy.canvas', 'operapy.opera2d']

Version 2020, December 2019                                                   New Features in Opera
39                                                                    Chapter 4 Python and Opera-2d:

The opera2d module contains a number of interfaces, which group the commands that interact with
the software at different stages of the FE analysis process. The full list of provided interfaces is
shown in the table below.
The most important of these interfaces is the one that provides access to the model. This is also auto-
matically loaded on startup and the model object is available for use. The model contains data for
the currently loaded model and methods that allow interaction with this data.
The other interfaces all work on an existing model; hence, as part of their initialization, the current
model needs to be provided as an argument.

 Interface                  Method Name                 Description
 Model             get_model_interface()                Allows interaction with the model. Through
                                                        these methods, the geometry can be built,
                                                        modified and cleared.
 Post-Processing get_post_processing_                   Contains the commands for post-processing
                 interface(model)                       results, including creating maps, calculating
                                                        integrals and exporting tables. Requires a
                                                        model with a solution to be loaded.
 Circuit           get_circuit_interface                Provides access to the Circuit Editor. Circuits
                   (model)                              can be created, modified and imported /
                                                        exported. Requires a model to be loaded.
 Graphing          get_graphing_interface               Provides access to the graph tab. Data can be
                   (model)                              loaded from buffers, lines and graphs can be
                                                        created and modified. Requires a model to be
                                                        loaded.
 Winding Tool      get_winding_tool_                    Provides access to the Winding Tool and
                   interface(model)                     stored winding sets generated by the winding
                                                        tool. Requires a model to be loaded.

Alternatively, the name of the available interfaces can be found using the help functionality available
in Python, or by using the auto-complete feature, as explained in "Python Console / Message Pane"
on page 36.
The section "Opera Python Example Scripts" on page 43 includes a number of examples showing the
use of these interfaces and some of the methods they contain, including how to build geometry, setup
the analysis and post-process a model.

New Features in Opera                                                   Version 2020, December 2019
Chapter 4 Python and Opera-2d: Export to Python                                                 40

Export to Python

The current model can be exported to a Python file at any point using the Export to Python
toolbutton ,located in the Work tab.
The Python file that is generated contains the Python commands that correspond to the current status
of the model.

 Version 2020, December 2019                                                 New Features in Opera
41                                            Chapter 4 Python and Opera-2d: Writing Python Scripts

Writing Python Scripts

The Python Environment must be activated to run the standalone Python interpreter and Conda pack-
age management tools.
To run the Python interpreter from a Command Prompt on Windows, open the Command Prompt and
enter the command: /code/bin/Scripts/activate.bat . The python and conda
commands can now be used.
To run the Python interpreter from a bash shell on Linux, enter the command:
source /python/bin/activate

           Integrated Development Environment (IDE)
An Integrated Development Environment (IDE) is an application that provides facilities for
writing software code. There are numerous, freely available IDEs that support the Python language
and any one of these can be used to write and test code written for Opera-2d.

IDLE
A simple Python Shell and IDE is provided as part of the Opera installation. The name of the IDE is
IDLE .
On Windows IDLE can be accessed from a command prompt where Python is activated (see previous
section) by typing idle.
On Linux IDLE can be accessed from a bash shell where Python is activated (see previous section) by
typing idle3 or idle3.6.

Other IDEs
Other IDEs are available for download and install separately and they can be configured to work with
the Opera Python modules. These IDEs can offer more functionality, including code introspection,
auto-complete and code debugging.
The chosen IDE needs to be configured to use the Python distribution that has been provided with
Opera. This ensures that the Opera Python packages are recognized by the IDE and functionality like
auto-complete and debugging is available. The configuration typically involves specifying the path to
the Python executable to use.
The Python executable can be found under /code/bin/python.exe on Win-
dows and /python/bin/python on Linux.
Most IDEs can be configured to work with the Conda package management system but may need to
be told where the location of the conda command:

New Features in Opera                                                  Version 2020, December 2019
Chapter 4 Python and Opera-2d: Writing Python Scripts                                               42

    l   /code/bin/Scripts/conda.exe on Windows
    l   /python/bin/conda on Linux
Opera 2020 will only work with the root environment of the included Conda distribution (bin on Win-
dows, python on Linux)
It is possible to install additional Python packages using conda install but some packages may
be incompatible and stop Opera from working.
If you intend to add additional Python packages on Windows you should install Opera in a location
where users have write access and avoid using spaces in the path (e.g.
c:/ws/OperaFEA/Opera_2020).

 Version 2020, December 2019                                                  New Features in Opera
You can also read